/* ─── Primitives ──────────────────────────────────────────── */
:root {
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;

  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;

  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;

  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  --pink-500: #ec4899;
  --pink-600: #db2777;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;

  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
}

/* ─── Semantic tokens — Light ─────────────────────────────── */
:root {
  color-scheme: light;

  --color-bg:            var(--gray-50);
  --color-surface:       #ffffff;
  --color-surface-alt:   var(--gray-100);

  --color-text:          var(--gray-900);
  --color-text-muted:    var(--gray-500);
  --color-text-subtle:   var(--gray-400);

  --color-border:        var(--gray-200);
  --color-border-strong: var(--gray-300);

  --color-accent:        var(--emerald-600);
  --color-accent-deep:   var(--emerald-700);
  --color-accent-light:  color-mix(in srgb, var(--color-accent) 10%, transparent);
  --color-hover:         color-mix(in srgb, var(--color-text) 8%, transparent);
  --color-hover-active:  color-mix(in srgb, var(--color-text) 12%, transparent);
  --color-danger:        var(--red-600);

  --font-sans:  'DM Sans', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --maxw: 1080px;
}

/* ─── Semantic tokens — Dark ──────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg:            var(--gray-950);
    --color-surface:       var(--gray-900);
    --color-surface-alt:   var(--gray-800);
    --color-text:          var(--gray-100);
    --color-text-muted:    var(--gray-400);
    --color-text-subtle:   var(--gray-500);
    --color-border:        var(--gray-800);
    --color-border-strong: var(--gray-700);
    --color-accent:        var(--emerald-500);
    --color-accent-deep:   var(--emerald-600);
    --color-danger:        var(--red-400);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg:            var(--gray-950);
  --color-surface:       var(--gray-900);
  --color-surface-alt:   var(--gray-800);
  --color-text:          var(--gray-100);
  --color-text-muted:    var(--gray-400);
  --color-text-subtle:   var(--gray-500);
  --color-border:        var(--gray-800);
  --color-border-strong: var(--gray-700);
  --color-accent:        var(--emerald-500);
  --color-accent-deep:   var(--emerald-600);
  --color-danger:        var(--red-400);
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-deep); }

/* ─── Nav ─────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-weight: 600; font-size: 1.15rem; color: var(--color-text); }
.brand .brand-muted { color: var(--color-text-muted); }
.brand img, .brand svg { width: 32px; height: auto; flex: 0 0 auto; }
.logo-light { display: block; }
.logo-dark  { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark  { display: block; }
.nav-links { display: none; gap: 28px; align-items: center; }
.nav-links a { font-size: .95rem; color: var(--color-text-muted); }
.nav-links a:hover { color: var(--color-accent); }
.nav-cta {
  font-size: .9rem;
  background: var(--color-accent); color: #fff !important;
  padding: 9px 18px; border-radius: 999px; font-weight: 500;
}
.nav-cta:hover { background: var(--color-accent-deep); color: #fff !important; }
@media (min-width: 760px) { .nav-links { display: flex; } }

/* ─── Buttons — Radix Themes solid/outline (size 3) ──────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em;
  height: 40px; padding: 0 16px;
  border-radius: 6px; cursor: pointer; border: 0;
  user-select: none; vertical-align: top; flex-shrink: 0;
  transition: background-color .15s ease, filter .15s ease;
  text-decoration: none;
}
.btn-primary {
  background-color: var(--emerald-600);
  color: #fff;
}
@media (hover: hover) {
  .btn-primary:hover { background-color: var(--emerald-700); color: #fff; }
}
.btn-primary:active { background-color: var(--emerald-700); filter: brightness(0.92) saturate(1.1); }
.btn-primary:focus-visible { outline: 2px solid var(--emerald-600); outline-offset: 2px; }

/* ─── Icon button (theme toggle, etc.) ───────────────────── */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border-radius: 6px; cursor: pointer; border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text-muted);
  transition: background-color .15s ease, color .15s ease;
  flex-shrink: 0;
}
@media (hover: hover) {
  .btn-icon:hover { background-color: var(--color-accent-light); color: var(--color-accent); }
}
.btn-icon:active { background-color: var(--color-accent-light); filter: brightness(0.95); }
.btn-icon:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* light: show moon (click → go dark); dark: show sun (click → go light) */
:root[data-theme="light"] .btn-icon .icon-sun  { display: none; }
:root[data-theme="light"] .btn-icon .icon-moon { display: block; }
:root[data-theme="dark"]  .btn-icon .icon-moon { display: none; }
:root[data-theme="dark"]  .btn-icon .icon-sun  { display: block; }
.btn-outline {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text-muted);
}
@media (hover: hover) {
  .btn-outline:hover { background-color: var(--color-accent-light); color: var(--color-accent); }
}
.btn-outline:active { background-color: var(--color-accent-light); filter: brightness(0.95); }
.btn-outline:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ─── Hero ────────────────────────────────────────────────── */
.hero { padding: 80px 0 72px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: stretch; }
.eyebrow {
  font-size: .82rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-accent); font-weight: 500; margin-bottom: 18px;
  display: inline-block;
}
.hero h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 22px;
}
.hero h1 em { font-style: italic; color: var(--color-accent); font-weight: 600; }
.hero .lede { font-size: 1rem; color: var(--color-text-muted); max-width: 34ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.tiny-note { font-size: .9rem; color: var(--color-text-muted); font-style: italic; }

/* Hero canvas — constrained to right grid column */
.sid-wrap {
  position: relative;
  min-height: 380px;
  border-radius: 16px;
}
#hero-box {
  position: absolute;
  z-index: 4;
  pointer-events: none !important;
  border-radius: 18px;
  border: none;
  background: color-mix(in srgb, #00BC7C 16%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 700;
  color: #065f46;
  white-space: nowrap;
  line-height: 1;
  padding: 5px 14px;
}
:root[data-theme="dark"] #hero-box { color: #ffffff; }
.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.hero-canvas-wrap canvas { pointer-events: all; z-index: 3; }
.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.hero-blob-1 {
  width: 70%; height: 65%;
  top: -5%; right: -5%;
  background: color-mix(in srgb, var(--emerald-500) 20%, transparent);
  filter: blur(60px);
}
.hero-blob-2 {
  width: 55%; height: 50%;
  bottom: 5%; left: 5%;
  background: color-mix(in srgb, var(--emerald-700) 14%, transparent);
  filter: blur(48px);
}
.hero-blob-3 {
  width: 90%; height: 28%;
  bottom: 2%; left: 5%;
  background: color-mix(in srgb, var(--emerald-600) 22%, transparent);
  filter: blur(40px);
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

/* Hero book illustration */
.hero-book {
  position: absolute;
  bottom: 13%; left: 0; right: 0;
  width: 100%;
  z-index: 2;
  display: block;
  pointer-events: none;
}
.hero-book-light { display: none; }
:root[data-theme="dark"] .hero-book-dark  { display: none; }
:root[data-theme="dark"] .hero-book-light { display: block; }

@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1fr 1fr; align-items: center; }
  .hero .lede { font-size: 1rem; }
  .sid-wrap { min-height: 500px; }
}

/* ─── Sections ────────────────────────────────────────────── */
section { padding: 64px 0; }
section[id] { scroll-margin-top: 80px; }
.section-tag {
  font-size: .82rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-accent); font-weight: 600; margin-bottom: 14px;
}
h2 {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.1;
  letter-spacing: -.02em; margin-bottom: 18px;
}
.section-intro { font-size: 1rem; color: var(--color-text-muted); max-width: 56ch; margin-bottom: 8px; }

.serpent-divider { display: block; margin: 0 auto; width: 140px; height: 24px; opacity: .4; }

/* problem strip */
.problem { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.problem .quote {
  font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.2rem); line-height: 1.25; max-width: 24ch;
}
.problem p { font-size: 1rem; color: var(--color-text-muted); max-width: 50ch; margin-top: 20px; }

/* steps */
.steps { display: grid; gap: 28px; margin-top: 40px; }
.step { position: relative; padding-left: 0; }
.step .num {
  font-size: 2.4rem; color: var(--color-accent);
  line-height: 1; font-weight: 700;
}
.step h3 { font-weight: 600; font-size: 1.35rem; margin: 14px 0 8px; }
.step p { color: var(--color-text-muted); font-size: 1rem; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 36px; } }

/* difference cards */
.cards { display: grid; gap: 24px; margin-top: 40px; }
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 16px; padding: 32px 30px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--color-accent) 35%, transparent); border-color: var(--color-accent); }
.card .icon { width: 44px; height: 44px; margin-bottom: 18px; color: var(--color-accent); }
.card h3 { font-weight: 600; font-size: 1.4rem; margin-bottom: 10px; }
.card p { color: var(--color-text-muted); font-size: 1rem; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }

/* languages */
.languages { background: var(--color-accent); color: #fff; }
.languages .section-tag { color: var(--emerald-200); }
.languages h2 { color: #fff; }
.languages .section-intro { color: rgba(255,255,255,.8); }
.lang-tags { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 22px; }
.lang-tags span {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  padding: 10px 18px; border-radius: 999px; font-size: 1rem;
}
.lang-tags span.more { background: var(--amber-500); color: #fff; border-color: var(--amber-500); font-style: italic; }
.languages .pairs { color: rgba(255,255,255,.8); font-size: 1rem; max-width: 54ch; }
.languages .pairs strong { color: #fff; font-weight: 600; }

/* about */
.about-grid { display: grid; gap: 32px; align-items: start; }
.about p { font-size: 1rem; color: var(--color-text); margin-bottom: 18px; max-width: 60ch; }
.about p.sig { font-style: italic; color: var(--color-accent); font-size: 1.15rem; }
@media (min-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* support */
.support { background: var(--color-surface); border-top: 1px solid var(--color-border); text-align: center; }
.support .inner { max-width: 60ch; margin: 0 auto; }
.support h2 { margin-bottom: 16px; }
.support p { color: var(--color-text-muted); font-size: 1rem; margin-bottom: 30px; }.contact-row { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center; margin-top: 26px; font-size: 1rem; }
.contact-row a { font-weight: 500; }
.contact-row .label { color: var(--color-text-muted); font-style: italic; }

/* notify form — Radix TextField surface variant (size 3) */
.notify { max-width: 480px; margin: 34px auto 0; text-align: left; }
.notify label { display: block; font-size: .92rem; color: var(--color-text-muted); margin-bottom: 8px; }
.notify-row { display: flex; gap: 10px; flex-wrap: wrap; }
.notify input[type=email] {
  flex: 1; min-width: 200px;
  height: 40px; padding: 0 12px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 400;
  border: none; border-radius: 6px;
  background-color: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text);
  outline: none;
}
.notify input[type=email]::placeholder { color: var(--color-text-subtle); }
.notify input[type=email]:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
}
.notify input[type=email].is-invalid {
  box-shadow: inset 0 0 0 1px var(--color-danger);
}
.notify input[type=email].is-invalid:focus {
  outline-color: var(--color-danger);
}
.notify-msg { margin-top: 12px; font-size: .92rem; min-height: 1.2em; }
.notify-msg.is-error   { color: var(--color-danger); }
.notify-msg.is-success { color: var(--color-accent); }

/* FAQ */
.faq-list { margin-top: 34px; border-top: 1px solid var(--color-border); }
details { border-bottom: 1px solid var(--color-border); padding: 4px 0; }
summary {
  cursor: pointer; list-style: none; padding: 20px 0;
  font-weight: 600; font-size: 1.18rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary .plus { color: var(--color-accent); font-size: 1.5rem; transition: transform .2s ease; flex: 0 0 auto; }
details[open] summary .plus { transform: rotate(45deg); }
details p { color: var(--color-text-muted); padding: 0 0 22px; font-size: 1rem; max-width: 62ch; }

/* footer */
footer.site { background: var(--gray-900); color: var(--gray-400); padding: 48px 0 40px; }
footer .f-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
footer .brand { color: var(--gray-50); }
footer a { color: var(--gray-300); }
footer a:hover { color: #fff; }
footer .f-links { display: flex; gap: 24px; flex-wrap: wrap; font-size: .95rem; }
footer .copy { width: 100%; font-size: .85rem; color: var(--gray-500); margin-top: 26px; font-style: italic; }

/* ─── Entrance animation ──────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .18s; } .d3 { animation-delay: .31s; } .d4 { animation-delay: .44s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }
