/* ============================================================
   SERENDIB — Design Tokens & Base
   Dark botanical / cinematic, executed with editorial restraint.
   Palette rooted in the subject: night-estate ink, warm bone
   paper, turmeric-brass metal, botanical fern. Accent is BRASS
   (turmeric/gold trade), deliberately NOT the acid-green default.
   ============================================================ */

:root {
  /* --- Canvas: deep night-estate ink (green-black, never pure #000) --- */
  --ink:        #0E120D;   /* primary cinematic canvas            */
  --ink-1:      #141A11;   /* raised panel                        */
  --ink-2:      #1C2317;   /* card / surface on dark              */
  --ink-3:      #26301F;   /* hover / elevated                    */

  /* --- Paper: warm bone (rest sections, à la Aesop body) --- */
  --bone:       #ECE6D6;   /* primary text on ink / paper bg      */
  --paper:      #F3EFE3;   /* light "paper" section surface       */
  --paper-2:    #E7E1D1;   /* paper card / inset                  */

  /* --- Ink text tones --- */
  --bone-dim:   #ADA791;   /* secondary text on dark              */
  --bone-mute:  rgba(236,230,214,0.55);
  --ink-text:   #1A1E15;   /* body text on paper                  */
  --ink-dim:    #5B604F;   /* secondary text on paper             */

  /* --- Metal & botanical accents --- */
  --brass:      #C79A3F;   /* turmeric-gold — the signature       */
  --brass-hi:   #E4C475;   /* highlight / gradient stop           */
  --brass-deep: #9A742A;   /* pressed / deep                      */
  --fern:       #74855C;   /* botanical secondary (sparse)        */
  --cinnamon:   #A44B2A;   /* warm tertiary pop (labels only)     */

  /* --- Hairlines --- */
  --line:        rgba(236,230,214,0.14);
  --line-strong: rgba(236,230,214,0.28);
  --line-paper:  rgba(26,30,21,0.14);

  /* --- Type --- */
  --f-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --f-body:    'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* --- Fluid type scale (clamp: min, vw, max) --- */
  --t-eyebrow: 0.72rem;
  --t-body:    clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --t-lead:    clamp(1.18rem, 1.05rem + 0.6vw, 1.5rem);
  --t-h4:      clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --t-h3:      clamp(1.6rem, 1.3rem + 1.4vw, 2.5rem);
  --t-h2:      clamp(2.1rem, 1.5rem + 3vw, 4rem);
  --t-h1:      clamp(2.9rem, 1.9rem + 5.2vw, 6.5rem);
  --t-mega:    clamp(4rem, 2rem + 9vw, 11rem);

  /* --- Spacing rhythm --- */
  --space-section: clamp(4.5rem, 3rem + 7vw, 10rem);
  --gutter:        clamp(1.25rem, 0.8rem + 2.4vw, 3rem);
  --maxw:          1320px;
  --maxw-read:     680px;

  /* --- Misc --- */
  --r:      2px;        /* editorial: near-sharp corners        */
  --r-lg:   4px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:    0.6s;
  --shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
}

/* ---------------------- Reset ---------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }

/* ---------------------- Base type ---------------------- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  /* Fraunces character: a touch of softness + wonk */
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 90;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p  { max-width: 62ch; }

/* Eyebrow / kicker — mono, letterspaced, the "trade ledger" voice */
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 1.8em; height: 1px;
  background: var(--brass);
  opacity: 0.7;
}
.eyebrow--plain::before { display: none; }

/* Focus — visible, always */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Selection */
::selection { background: var(--brass); color: var(--ink); }

/* ---------------------- Layout helpers ---------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space-section); }
.paper { background: var(--paper); color: var(--ink-text); }
.paper .eyebrow { color: var(--cinnamon); }
.paper .eyebrow::before { background: var(--cinnamon); }
.paper h1, .paper h2, .paper h3, .paper h4 { color: var(--ink-text); }

/* Display serif italic accent */
.serif-italic { font-family: var(--f-display); font-style: italic; font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 40; }

/* Mono data label */
.mono { font-family: var(--f-mono); letter-spacing: 0.04em; }

/* Reveal-on-scroll base — gated on .js so no-JS shows everything */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }
