/* ---------- Tokens ---------- */
:root {
  --bg: #f7f6f2;
  --bg-alt: #efede7;
  --surface: #ffffff;
  --border: #e2dfd7;
  --text: #15181d;
  --text-muted: #5d6470;
  --accent: #0f7a6d;
  --accent-strong: #0a5c52;
  --accent-soft: rgba(15, 122, 109, 0.10);
  --shadow: 0 1px 2px rgba(20, 24, 30, 0.04), 0 8px 24px -12px rgba(20, 24, 30, 0.12);
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f14;
    --bg-alt: #0f151c;
    --surface: #131a22;
    --border: #212b36;
    --text: #e8ecf1;
    --text-muted: #96a1ae;
    --accent: #3ec9b3;
    --accent-strong: #62dcc8;
    --accent-soft: rgba(62, 201, 179, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-alt: #0f151c;
  --surface: #131a22;
  --border: #212b36;
  --text: #e8ecf1;
  --text-muted: #96a1ae;
  --accent: #3ec9b3;
  --accent-strong: #62dcc8;
  --accent-soft: rgba(62, 201, 179, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.muted { color: var(--text-muted); }

.skip {
  position: absolute; left: 16px; top: -100px;
  background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 12px; z-index: 100; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transform: rotate(45deg);
}
.brand-name { font-size: 15.5px; }
nav[aria-label="Primary"] { display: flex; align-items: center; gap: 4px; }
nav[aria-label="Primary"] a {
  color: var(--text-muted); font-size: 14.5px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px;
}
nav[aria-label="Primary"] a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
nav[aria-label="Primary"] .nav-cta { color: var(--accent); }
@media (max-width: 520px) {
  nav[aria-label="Primary"] a:not(.nav-cta) { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 420px;
  background:
    radial-gradient(600px 240px at 20% 40%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 220px at 80% 20%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  color: var(--text-muted); margin-bottom: 22px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 700;
  max-width: 17ch;
  letter-spacing: -0.03em;
}
.lede {
  margin-top: 22px; max-width: 60ch;
  font-size: clamp(17px, 2.1vw, 20px); color: var(--text-muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 600; font-size: 15px; line-height: 1;
  border: 1px solid transparent; transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.facts {
  list-style: none; padding: 0; margin: 48px 0 0;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.facts li {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.facts strong { font-size: 18px; letter-spacing: -0.01em; }
.facts span { color: var(--text-muted); font-size: 14px; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; }
.section-head p { margin-top: 12px; color: var(--text-muted); font-size: 17px; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid.cards { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card h3 { font-size: 20px; font-weight: 600; }
.card p { color: var(--text-muted); font-size: 15.5px; }

.tags {
  list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tags li {
  font-family: var(--mono); font-size: 12px; line-height: 1;
  padding: 6px 9px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.tags-lg li { font-size: 13px; padding: 8px 11px; }

/* ---------- Work ---------- */
.work-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.work-item {
  display: grid; grid-template-columns: 1fr; gap: 10px 32px;
  padding: 28px 0; border-top: 1px solid var(--border);
}
.work-item:last-child { border-bottom: 1px solid var(--border); }
@media (min-width: 720px) { .work-item { grid-template-columns: 180px 1fr; } }
.work-meta { display: flex; flex-direction: column; gap: 2px; }
.work-meta .org { font-weight: 600; font-size: 15px; }
.work-meta .years { font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); }
.work-body { display: flex; flex-direction: column; gap: 10px; }
.work-body h3 { font-size: 21px; font-weight: 600; }
.work-body h3 a { color: var(--text); }
.work-body h3 a:hover { color: var(--accent); }
.work-body p { color: var(--text-muted); font-size: 16px; max-width: 70ch; }

/* ---------- About ---------- */
.about { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .about { grid-template-columns: 220px 1fr; gap: 48px; } .about .section-head { margin-bottom: 0; } }
.about-body { display: flex; flex-direction: column; gap: 18px; max-width: 66ch; }
.about-body > p { font-size: 17.5px; }
.stack, .how { margin-top: 10px; }
.stack h3, .how h3 {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.how-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.how-list li { padding-left: 18px; position: relative; color: var(--text-muted); font-size: 16px; }
.how-list li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg);
}
.how-list strong { color: var(--text); }

/* ---------- Contact ---------- */
.section-contact { padding-top: 24px; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 44px 28px; text-align: center; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.contact-card::after {
  content: ""; position: absolute; inset: auto -20% -60% -20%; height: 200px;
  background: radial-gradient(500px 160px at 50% 100%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.contact-card > * { position: relative; }
.contact-card h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; max-width: 22ch; margin: 0 auto; }
.contact-card p { margin-top: 12px; color: var(--text-muted); }
.contact-card .actions { justify-content: center; margin-top: 28px; }
@media (min-width: 720px) { .contact-card { padding: 56px 48px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 14px; color: var(--text-muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- Engagement terms ---------- */
.terms {
  margin: 0; display: grid; gap: 16px; grid-template-columns: 1fr;
}
@media (min-width: 720px) { .terms { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 960px) { .terms { grid-template-columns: repeat(3, 1fr); } }
.term {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 24px; box-shadow: var(--shadow);
}
.term dt {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-strong); margin-bottom: 10px;
}
.term dd { margin: 0; color: var(--text-muted); font-size: 15.5px; }
.lead-name { font-size: 18px; }
abbr[title] { text-decoration: none; }

/* ---------- Badge & legal footer ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.hero .eyebrow { margin-bottom: 20px; display: block; }
.contact-card .badge { margin-bottom: 20px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.legal { font-size: 13px; line-height: 1.6; }
.legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
