/* ============================================================
   DAIDRA FOUNDATION — the quality floor every build starts from
   v1.0 · 2026-08-06 · sources: live-verified extractions in
   knowledge/websites-enterprise.md (Stripe et al.) + DESIGN.md

   HOW TO USE (per project):
   1. Copy this file into the project as the base of site.css.
   2. Skin ONLY the "BRAND SLOTS" block — fonts, hues, radius,
      heading weight. Everything below the slots is the standard;
      it should survive the skin untouched.
   3. The specimen page (index.html beside this file) shows every
      token and primitive in every state — rebuild it mentally
      against your skin before building pages.

   Rules encoded here (don't fight them):
   - Spacing lives on an 8px grid. Type lives on the clamp() scale.
   - Two easings, four durations. Nothing animates off-system.
   - Never `transition: all`. Hover moves ≥2 properties.
   - :focus-visible is a designed brand element, not a default.
   - Content never touches the viewport edge (--px gutter).
   - .section uses LONG-HAND padding (shorthand resets .wrap).
   - prefers-reduced-motion gets designed static states, not
     frozen half-animations.
   ============================================================ */

/* ----------------------------------------------------------
   1. BRAND SLOTS — skinned for TIFFANY PLUSNICK
   Lane: WIRED "Women" issue (Sept 2026), measured in rsmi.md.
   Display + text are ONE family (Newsreader) at two optical
   roles, the way the reference splits WIRED Display / Breve Text.
   Mono is the rubric voice. Magenta is reserved for HER NAME.
   ---------------------------------------------------------- */
:root {
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* Editorial display wants weight. The reference sets its display
     face at 400 because that face IS heavy; Newsreader needs 700
     to land the same colour on the page. (DESIGN.md Part 2 axis:
     headline anatomy — chosen deliberately, measured in rsmi.md #3.) */
  --weight-display: 700;
  --weight-body: 400;
  --weight-medium: 500;

  /* Neutrals tint toward the reference's teal ground, not gray. */
  --brand-h: 172;

  /* MEASURED from wired.com/story/wired-women-editors-letter/ */
  --ink-ground: #214540;   /* hero / masthead ground  */
  --ink-ground-2: #264A44; /* adjacent panel          */
  --ink-cream: #E4FAF6;    /* display ink on ground   */
  --magenta: #FF80F5;      /* the byline chip. HER NAME ONLY. */

  --accent: var(--magenta);
  --accent-strong: #C4239F;   /* text-safe fork of the accent (AA on white) */
  --accent-ink: #8E0F72;      /* accent as TEXT on light surfaces           */

  /* Editorial geometry: no radius anywhere. The rule is the separator. */
  --radius: 0px;
  --radius-lg: 0px;
}

/* ----------------------------------------------------------
   2. NEUTRALS — brand-tinted ramp (never pure gray)
   ---------------------------------------------------------- */
:root {
  --n-50:  oklch(0.985 0.004 var(--brand-h));
  --n-100: oklch(0.96  0.006 var(--brand-h));
  --n-200: oklch(0.91  0.008 var(--brand-h));
  --n-300: oklch(0.83  0.010 var(--brand-h));
  --n-500: oklch(0.60  0.020 var(--brand-h));
  --n-700: oklch(0.40  0.028 var(--brand-h));
  --n-900: oklch(0.25  0.030 var(--brand-h));
  --n-950: oklch(0.17  0.025 var(--brand-h));
}

/* ----------------------------------------------------------
   3. SEMANTIC COLOR + SECTION MODES
   Components consume ONLY these slots. Sections switch skin by
   mode class — components are never restyled per section.
   ---------------------------------------------------------- */
:root, .mode-light {
  --surface: #fff;
  --surface-2: var(--n-50);
  --text: var(--n-900);
  --text-2: var(--n-500);
  --line: var(--n-200);
  --link: var(--accent-strong);
}
.mode-tint {
  --surface: var(--n-50);
  --surface-2: #fff;
}
.mode-dark {
  --surface: var(--n-950);
  --surface-2: var(--n-900);
  --text: var(--n-50);
  --text-2: var(--n-300);
  --line: oklch(0.32 0.03 var(--brand-h));
  --link: oklch(0.75 0.12 var(--brand-h));
}


/* The teal editorial ground (rsmi.md #1). Declares EVERY slot the
   other mode classes declare — a mode that inherits is a bug. */
.mode-ink {
  --surface: var(--ink-ground);
  --surface-2: var(--ink-ground-2);
  --text: var(--ink-cream);
  --text-2: #9FC4BD;
  --line: #3A5F59;
  --link: var(--magenta);
}

/* ----------------------------------------------------------
   4. SPACE — 8px grid + the edge gutter
   ---------------------------------------------------------- */
:root {
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 32px;
  --s-6: 48px; --s-8: 64px; --s-12: 96px; --s-16: 128px; --s-20: 160px;
  --px: clamp(24px, 5vw, 96px);        /* viewport edge gutter */
  --measure: 62ch;                      /* body copy max width */
  --wrap: 1376px;
}

/* ----------------------------------------------------------
   5. TYPE SCALE — clamp()-fluid, tracking tightens as size grows
   ---------------------------------------------------------- */
:root {
  /* Scaled up 2026-09-21 (X: "make the text overall larger and more legible").
     Body sits at 18–20px, which is the Stripe-tier canon's 15–25px band. */
  --text-xs: 0.8125rem;                             /* 13 — mono labels */
  --text-sm: 0.9375rem;                             /* 15 — UI */
  --text-md: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);  /* 17 → 19 body */
  --text-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);      /* 20 → 24 */
  --text-xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --text-2xl: clamp(2.125rem, 1.6rem + 2.2vw, 3.25rem);
  --text-hero: clamp(2.75rem, 1.9rem + 3.8vw, 4.75rem);
}

/* ----------------------------------------------------------
   6. MOTION — the closed system. Two easings, four durations.
   ---------------------------------------------------------- */
:root {
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);        /* easeOutQuart — default */
  --ease-inout: cubic-bezier(0.45, 0.05, 0.55, 0.95); /* panels, nav */
  --dur-1: 150ms;   /* feedback: press, toggle */
  --dur-2: 240ms;   /* hover, small reveals */
  --dur-3: 450ms;   /* panels, section transitions */
  --dur-4: 800ms;   /* card lifts, entrances */
  --stagger: 70ms;  /* sibling choreography interval */
}

/* ----------------------------------------------------------
   7. ELEVATION + FOCUS — designed, tokenized
   ---------------------------------------------------------- */
:root {
  --shadow-soft: 0 20px 40px -20px rgb(0 0 0 / 0.12);
  --shadow-lift: 0 32px 64px -24px rgb(0 0 0 / 0.18);
  --focus-ring: 0 0 0 3px oklch(0.55 0.19 var(--brand-h) / 0.18);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius);
}

/* ----------------------------------------------------------
   8. BASE
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  font-size: var(--text-md);
  line-height: 1.62;
  color: var(--text);
  background: var(--surface);
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.1;
  margin: 0 0 var(--s-3);
  text-wrap: balance;
}
h1 { font-size: var(--text-hero); letter-spacing: -0.022em; line-height: 1.05; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.018em; }
h3 { font-size: var(--text-xl); letter-spacing: -0.012em; }
h4 { font-size: var(--text-lg); letter-spacing: -0.008em; font-weight: var(--weight-medium); }
p { margin: 0 0 var(--s-2); max-width: var(--measure); text-wrap: pretty; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }

/* Eyebrow / utility label — mono, tracked wide, the "instrument" voice */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* ----------------------------------------------------------
   9. LAYOUT — section + wrap (long-hand padding, always)
   ---------------------------------------------------------- */
.section {
  /* LONG-HAND on purpose: `padding: X 0` here silently resets
     .wrap's gutters when combined (documented failure). */
  padding-top: var(--s-12);
  padding-bottom: var(--s-12);
  background: var(--surface);
  color: var(--text);
}
.section--hero {
  min-height: 72vh;              /* never 100vh — next section peeks */
  display: flex;
  align-items: center;
}
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--px);
  padding-right: var(--px);
}

/* ----------------------------------------------------------
   10. PRIMITIVES — one spec each, reused verbatim on every page
   ---------------------------------------------------------- */

/* Button — asymmetric vertical padding (optical balance),
   transitions name their properties, hover moves ≥2. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 13px 24px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: var(--weight-medium) var(--text-md) / 1 var(--font-body);
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}
.btn:hover, .btn:focus-visible {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.btn:active { transform: translateY(0); transition-duration: var(--dur-1); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  background: var(--surface-2);
  border-color: var(--text-2);
  transform: translateY(-1px);
  box-shadow: none;
}
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* The one-variable hover engine — parent flips --hover, children
   consume it. Focus replays the full hover choreography for free. */
.hoverable { --hover: 0; }
.hoverable:hover, .hoverable:focus-visible, .hoverable:focus-within { --hover: 1; }

/* Link-arrow — title + arrow whose shaft draws in on hover */
.link-arrow {
  --hover: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--weight-medium);
  color: var(--link);
  text-decoration: none;
}
.link-arrow:hover, .link-arrow:focus-visible { --hover: 1; }
.link-arrow .arrow { transition: transform var(--dur-2) var(--ease-out); }
.link-arrow .arrow .shaft {
  opacity: var(--hover);
  transition: opacity var(--dur-2) var(--ease-out);
}
.link-arrow:hover .arrow, .link-arrow:focus-visible .arrow { transform: translateX(3px); }

/* Card — soft negative-spread shadow, lift on hover */
.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s-4);
  transition:
    transform var(--dur-4) var(--ease-out),
    box-shadow var(--dur-4) var(--ease-out),
    border-color var(--dur-2) var(--ease-out);
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--n-300);
}
.card > :last-child { margin-bottom: 0; }

/* Stat — big number, smaller unit, mono label underneath */
.stat { display: grid; gap: 4px; }
.stat b {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
  letter-spacing: -0.018em;
  line-height: 1;
}
.stat b small { font-size: 0.55em; font-weight: var(--weight-medium); }
.stat .eyebrow { margin-top: 2px; }

/* Dom-graphic scaffold — product UI as scaled live HTML.
   Design the mock at a fixed px width, scale the block. */
.dom-graphic {
  --gw: 320px;        /* design width */
  --gs: 1;            /* scale (set per placement / media query) */
  width: calc(var(--gw) * var(--gs));
  pointer-events: none;
  user-select: none;
}
.dom-graphic > .dg-frame {
  width: var(--gw);
  transform: scale(var(--gs));
  transform-origin: top left;
}

/* ----------------------------------------------------------
   11. REVEAL CHOREOGRAPHY — IO adds .in; siblings stagger.
   JS contract (site.js):
     const io = new IntersectionObserver(es => es.forEach(e => {
       if (e.isIntersecting) { e.target.classList.add('in'); io.unobserve(e.target); }
     }), { threshold: 0.15, rootMargin: '0px 0px -8% 0px' });
     document.querySelectorAll('.reveal').forEach(el => io.observe(el));
   Fail-safe: .reveal without JS must still be readable — the
   `no-js` class (set in <head>, removed by JS) keeps opacity 1.
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ----------------------------------------------------------
   12. REDUCED MOTION — designed static states, not freezes
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn--ghost, .card, .link-arrow .arrow, .link-arrow .arrow .shaft {
    transition: none;
  }
  .card:hover { transform: none; }
  .btn:hover { transform: none; }
  /* Per-project: every animated signature block MUST add its own
     designed fallback here (static frame, final state, or swap-in
     element) — never leave it half-animated. */
}
