/* ============================================================
   Spill The Cha — Design Tokens
   Editorial studio register, adapted from a warm-canvas /
   serif-display / single-accent system. Accent swapped to a
   tea-amber to match the brand's own name ("cha" = tea).
   ============================================================ */

:root {
  /* Colors — canvas & surfaces */
  --color-parchment: #fdfbf6;   /* page canvas, warm tea-stained paper */
  --color-paper: #ffffff;       /* elevated cards, section fills */
  --color-linen: #f8f4ec;       /* inputs, subtle wash */

  /* Colors — text */
  --color-ink: #1c1815;         /* strongest contrast text */
  --color-graphite: #2b241d;    /* headlines */
  --color-charcoal: #4a4137;    /* body copy, button text */
  --color-ash: #6b6155;         /* muted / helper text */
  --color-fog: #b8ac9a;         /* tertiary, disabled */

  /* Colors — borders */
  --color-mist: #e6dccb;        /* hairline card / section borders, warm-tinted */
  --color-twilight: #2b2420;    /* nav border, outlined secondary action */
  --color-dusk: #211c17;        /* sole filled button surface */

  /* Colors — accent (the one splash of color) */
  --color-cha: #b9793a;         /* tea-amber — outlined CTA, links, emphasis */
  --color-cha-deep: #8a5a26;    /* pressed/hover state for accent */
  --color-steam: #5b6b6b;       /* cool grey-green, illustration atmosphere only */

  /* Typography */
  --font-serif: 'Fraunces', 'GT Sectra', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-caption: 13px;
  --text-body-sm: 15px;
  --text-subheading: 18px;
  --text-heading-sm: 27px;
  --text-heading: 40px;
  --text-heading-lg: 48px;
  --text-display: 56px;

  /* Spacing */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;

  /* Radius */
  --radius-btn: 8px;
  --radius-card: 12px;
  --radius-card-lg: 16px;
  --radius-surface: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-nav: rgba(0, 0, 0, 0.14) 0px 2px 6px 0px;
  --shadow-card: rgba(0, 0, 0, 0.07) 0px 1px 1px 0px, rgba(0, 0, 0, 0.06) 0px 4px 8px 0px;
  --shadow-diagram: rgba(0, 0, 0, 0.05) 0px 1px 8px 0px;

  --page-max-width: 1200px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-parchment);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-size: var(--text-subheading);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--color-cha);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-graphite);
  margin: 0;
  line-height: 1.1;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 1;
}
h1 { font-size: var(--text-display); letter-spacing: -0.02em; }
h2 { font-size: var(--text-heading-lg); letter-spacing: -0.02em; }
h3 { font-size: var(--text-heading-sm); letter-spacing: -0.01em; line-height: 1.3; }

p { margin: 0; }
.lede { font-size: var(--text-subheading); line-height: 1.5; color: var(--color-ash); max-width: 62ch; }
.caption {
  font-size: var(--text-caption);
  color: var(--color-ash);
  letter-spacing: 0.01em;
}

/* ---------- Page hero (plain, editorial) ---------- */
.page-hero { padding: 180px 0 var(--space-64); }
@media (max-width: 720px) {
  .page-hero { padding: 140px 0 var(--space-48); }
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--space-24);
}
section { position: relative; }
.section-pad { padding: var(--space-96) 0; }

@media (max-width: 720px) {
  .section-pad { padding: var(--space-64) 0; }
  h1 { font-size: 38px; }
  h2 { font-size: 32px; }
}

/* ---------- Nav ---------- */
.nav-shell {
  position: fixed;
  top: var(--space-20);
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 var(--space-16);
}
.nav-pill {
  display: flex;
  align-items: center;
  gap: var(--space-32);
  padding: 7px 7px 7px var(--space-16);
  background: rgba(253, 251, 246, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--shadow-nav);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-variation-settings: "WONK" 1;
  color: var(--color-graphite);
  white-space: nowrap;
}
.nav-mark { width: 18px; height: 18px; flex-shrink: 0; }
.nav-links {
  display: flex;
  gap: var(--space-24);
}
.nav-links a {
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--color-charcoal);
  letter-spacing: -0.01em;
}
.nav-links a:hover { color: var(--color-cha); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: block;
    background: none;
    border: none;
    padding: var(--space-8);
    color: var(--color-graphite);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-btn);
  padding: 9px 16px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: transparent;
  border-color: var(--color-cha);
  color: var(--color-cha-deep);
}
.btn-primary:hover { background: rgba(185, 121, 58, 0.08); }

.btn-secondary {
  background: transparent;
  border-color: var(--color-twilight);
  color: var(--color-twilight);
}
.btn-secondary:hover { background: rgba(43, 36, 32, 0.05); }

.btn-filled {
  background: var(--color-dusk);
  border-color: var(--color-twilight);
  color: #fdfbf6;
  padding: 11px 20px;
}
.btn-filled:hover { background: #171310; }

.btn-arrow {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-paper);
  border: 1px solid var(--color-mist);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-16);
}

.diagram-card {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-diagram);
  padding: var(--space-12);
}

.atmo-card {
  border-radius: var(--radius-surface);
  padding: var(--space-64) var(--space-48);
  color: #fdfbf6;
}

/* ---------- Footer ---------- */
footer {
  background: var(--color-paper);
  border-top: 1px solid var(--color-mist);
  padding: var(--space-80) 0 var(--space-40);
}
footer .statement {
  font-family: var(--font-serif);
  font-size: var(--text-heading);
  color: var(--color-graphite);
  max-width: 14ch;
  line-height: 1.15;
}
footer .foot-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-32);
  flex-wrap: wrap;
}
footer .foot-links {
  display: flex;
  gap: var(--space-24);
}
footer .foot-links a { font-size: var(--text-body-sm); color: var(--color-ash); }
footer .foot-links a:hover { color: var(--color-cha); }
footer .foot-meta {
  margin-top: var(--space-64);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-8);
  color: var(--color-fog);
  font-size: var(--text-caption);
  border-top: 1px solid var(--color-mist);
  padding-top: var(--space-24);
}

/* ---------- Ghost link ---------- */
.ghost-link {
  color: var(--color-charcoal);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}
.ghost-link:hover { color: var(--color-cha-deep); }
