:root {
  --page: #fbfdfb;
  --text: #263226;
  --heading: #203b25;
  --muted: #6c7c6d;

  --green-dark: #395d3d;
  --green: #65936a;
  --green-light: #b9cdb8;
  --green-pale: #edf4ed;
  --line: #d8e3d7;
  --white: #ffffff;

  color-scheme: light;
}

html[data-theme="dark"] {
  --page: #121812;
  --text: #e2ebe2;
  --heading: #f0f6ef;
  --muted: #aabbaa;

  --green-dark: #b8d8b8;
  --green: #78a879;
  --green-light: #49654c;
  --green-pale: #1e2b20;
  --line: #374838;
  --white: #263328;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

/* Prevent animations during the first render */
html.theme-loading *,
html.theme-loading *::before,
html.theme-loading *::after {
  transition: none !important;
  animation: none !important;
}
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

/* ------------------------------
   Navigation
------------------------------ */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;

  width: 100%;
  max-width: 100%;
  min-height: 48px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 8px 14px;

  background: var(--green-pale);
  border-bottom: 1px solid var(--green-light);
  box-shadow: 0 2px 8px rgba(48, 79, 51, 0.08);

  overflow: visible;
}

.nav-links {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
  flex-wrap: wrap;
}

/* This was missing from your CSS */
.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 32px;
  padding: 4px 15px;

  border: 1px solid var(--green-dark);
  border-radius: 999px;

  background: var(--green-dark);
  color: white;

  font-size: 0.78rem;
  font-weight: bold;
  text-decoration: none;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--white);
  color: var(--green-dark);
  transform: translateY(-1px);
}

.nav-controls {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  padding-right: 2px;
}

.nav-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dots span {
  display: block;
  width: 12px;
  height: 12px;

  border: 1px solid var(--green-dark);
  border-radius: 50%;

  background: var(--green);
}

.dot-light {
  background: var(--white) !important;
}

.dot-medium {
  background: var(--green-light) !important;
}

.dot-dark {
  background: var(--green-dark) !important;
}

@keyframes twitch {
  0% { transform: translate(0, 0) skewX(0deg); }
  20% { transform: translate(-1px, 1px) skewX(-1deg); }
  40% { transform: translate(1px, -1px) skewX(1deg); }
  60% { transform: translate(-1px, -1px) skewX(0deg); }
  80% { transform: translate(1px, 1px) skewX(0deg); }
  100% { transform: translate(0, 0) skewX(0deg); }
}

.theme-toggle {
  width: 34px;
  height: 34px;

  flex: 0 0 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--green-dark);
  border-radius: 50%;

  background: var(--white);
  color: var(--green-dark);

  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--green-dark);
  color: white;
  transform: rotate(15deg);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--green-light);
  outline-offset: 3px;
}
/* ------------------------------
   Main content
------------------------------ */
.site {
  width: min(780px, calc(100% - 20px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  max-width: 650px;
  padding: 40px 0 60px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  color: var(--heading);
}

h1 {
  margin: 12px 0 4px;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.95;
}

h2 {
  margin-top: 55px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

h3 {
  margin-bottom: 5px;
}

.tagline {
  color: var(--green-dark);
  font-size: 1.1rem;
}

.intro {
  max-width: 600px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.button {
  display: inline-block;

  padding: 12px 18px;
  border-radius: 999px;

  background: var(--green);
  color: white;

  text-decoration: none;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

section {
  scroll-margin-top: 90px;
}

.work-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.work-item p {
  color: var(--muted);
}

.email-link {
  color: var(--green-dark);
  font-weight: bold;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 80px;

  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}
/* ------------------------------
   Mobile layout
------------------------------ */

@media (max-width: 700px) {
  .top-nav {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 8px 12px;
  }

  .nav-links {
    flex: 1 1 calc(100% - 50px);
    min-width: 0;
    gap: 5px;
  }

  .nav-links a {
    min-height: 30px;
    padding: 3px 10px;
    font-size: 0.72rem;
  }

  .nav-controls {
    margin-left: auto;
    padding-right: 0;
  }

  .nav-dots {
    display: none;
  }
}
/* Add this class to your CSS file */
.twitch-effect {
  animation: twitch 0.15s infinite;
}

@media (max-width: 600px) {
  .site {
    width: calc(100% - 20px);
    padding-top: 24px;
  }

  .hero {
    padding-top: 24px;
  }
}
