/* Light theme. Accent green #157a3c gives 5.4:1 on white (WCAG AA for all text). */
:root {
  --bg: #ffffff;
  --fg: #141414;
  --muted: #3f3f3f;
  --accent: #157a3c;
  --rule: #e2e2e2;
  --pill-border: #dcdcdc;
  --pill-hover: #f4f7f5;
  --logo-ink: #ffffff;
  color-scheme: light;
}

/* Dark theme: follows the OS unless the visitor picks one with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f2421;
    --fg: #f1f3f1;
    --muted: #c4c9c5;
    --accent: #4fd17f; /* 8.1:1 on --bg */
    --rule: #4a524c;
    --pill-border: #5b655e;
    --pill-hover: #2a312c;
    --logo-ink: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1f2421;
  --fg: #f1f3f1;
  --muted: #c4c9c5;
  --accent: #4fd17f;
  --rule: #4a524c;
  --pill-border: #5b655e;
  --pill-hover: #2a312c;
  --logo-ink: #000000;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.125rem/1.65 "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

.wrap {
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.logo { display: inline-flex; color: var(--accent); border-radius: 50%; }
.logo-m { stroke: var(--logo-ink); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.icon-btn:hover { background: var(--pill-hover); }

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

main { flex: 1; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 0 3.5rem;
}

.headshot {
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 1.75rem;
  margin-bottom: 2.25rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0 0 2.5rem;
  font-size: 1.375rem;
  color: var(--muted);
  text-wrap: balance;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1.125rem;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.pill:hover { background: var(--pill-hover); border-color: var(--accent); }

/* Dividers and About */
hr {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.about {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.about-body p { margin: 0 0 1.1rem; font-size: 1rem; line-height: 1.7; text-wrap: pretty; }
.about-body p:last-child { margin-bottom: 0; }

footer {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}
footer p { margin: 0; }

/* Focus and accessibility helpers */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
