/* ============================================================
   Worth Spreading — self-hosted fonts (latin subsets, OFL).
   Fraunces is the variable "full" build: opsz 9–144, wght 100–900,
   SOFT 0–100, WONK 0–1 — the site depends on those axes.
   ============================================================ */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/fraunces-latin-full-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/hanken-grotesk-latin-wght-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/newsreader-latin-opsz-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-display: swap;
  font-weight: 300 900;
  src: url("/fonts/figtree-latin-wght-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("/fonts/lora-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url("/fonts/lora-latin-wght-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/fonts/nunito-sans-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: italic;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/fonts/nunito-sans-latin-wght-italic.woff2") format("woff2-variations");
}

/* ============================================================
   Worth Spreading — Colour
   The four-colour world, measured from the logo files:
   amber/marigold · terracotta/rust · warm near-black · cream/bone.
   A muted navy is allowed sparingly as a cool counter-note.

   TWO-TIER ACCENT MODEL
   The house owns every neutral, the amber, the terracotta and the
   navy. Each child app is allowed exactly ONE signature accent.
   That accent lives in a single slot: --accent (+ its on-colour and
   soft tint). Default house accent = amber. Switch a whole app's
   accent by setting one attribute on a root element:
       <body data-app="outkeep"> … </body>
   Nothing else needs to change.
   ============================================================ */

:root {
  /* ---- Amber / marigold (primary house colour) ---- */
  --amber-100: #FBF0D8;
  --amber-200: #FCE3B8;
  --amber-300: #FACE84;
  --amber-400: #F7B547;
  --amber-500: #F5A623;   /* brand amber — measured */
  --amber-600: #D98E12;
  --amber-700: #B5740C;

  /* ---- Terracotta / rust (supporting warm tone) ---- */
  --clay-100: #F5E4DA;
  --clay-200: #EDCDBC;
  --clay-300: #E2AE96;
  --clay-400: #D38C6E;
  --clay-500: #C4724F;   /* terracotta — measured */
  --clay-600: #B5532E;   /* deep rust — measured */
  --clay-700: #8F3F1E;

  /* ---- Warm near-black (ink + on-dark ground) ---- */
  --ink-900: #1B1714;    /* warm near-black — measured. Prefer over #000 */
  --ink-800: #2A2420;
  --ink-700: #3D352F;
  --ink-600: #574D45;
  --ink-500: #786C61;
  --ink-400: #9B8F83;
  --ink-300: #C2B7A9;
  --ink-200: #E0D8CB;
  --ink-100: #EFE9DD;

  /* ---- Cream / bone (paper grounds) ---- */
  --bone:    #FAF8F4;    /* lightest ground */
  --paper:   #F7F4EC;    /* default page paper — measured */
  --paper-deep: #F0EBDF; /* slightly recessed paper */

  /* ---- Navy / teal (cool counter-note, use sparingly) ---- */
  --navy-700: #18242B;
  --navy-600: #243642;
  --navy-500: #324B58;
  --navy-300: #8AA0AC;

  /* ---- Pure-ish warm white for cards ---- */
  --warm-white: #FFFDF9;

  /* ============================================================
     SEMANTIC ALIASES — reference these in product code, not the
     raw scale values above.
     ============================================================ */

  /* Surfaces */
  --surface-page:    var(--paper);
  --surface-card:    var(--warm-white);
  --surface-sunken:  var(--paper-deep);
  --surface-dark:    var(--ink-900);
  --surface-dark-raised: var(--ink-800);

  /* Text on light */
  --text-strong: var(--ink-900);
  --text-body:   var(--ink-700);
  --text-muted:  var(--ink-500);
  --text-faint:  var(--ink-400);

  /* Text on dark */
  --text-on-dark:        var(--bone);
  --text-on-dark-muted:  #C9C0B4;
  --text-on-dark-faint:  #978C7F;

  /* Borders / lines */
  --border-subtle: var(--ink-200);
  --border-strong: var(--ink-300);
  --border-on-dark: rgba(247,244,236,0.14);

  /* Brand roles */
  --brand-amber: var(--amber-500);
  --brand-clay:  var(--clay-500);
  --brand-ink:   var(--ink-900);

  /* Status — kept warm + muted, never neon */
  --positive: #5C7A4A;   /* olive-leaning green */
  --notice:   var(--amber-600);
  --critical: var(--clay-600);
  --info:     var(--navy-500);

  /* ============================================================
     THE ACCENT SLOT  — house default = amber
     Each app overrides these three variables and nothing else.
     ============================================================ */
  --accent:        var(--amber-500);
  --accent-strong: var(--amber-600);
  --accent-soft:   var(--amber-100);   /* tint for washes / chips */
  --accent-on:     var(--ink-900);     /* text/icon colour ON the accent */
  --focus-ring:    var(--amber-600);
}

/* ---- Outkeep (first child app) — accent = terracotta ---- */
[data-app="outkeep"] {
  --accent:        var(--clay-500);
  --accent-strong: var(--clay-600);
  --accent-soft:   var(--clay-100);
  --accent-on:     var(--bone);        /* cream reads better on clay */
  --focus-ring:    var(--clay-600);
}

/* ---- Example template for a future app (commented) ----
[data-app="example"] {
  --accent:        #2E6F6A;
  --accent-strong: #245550;
  --accent-soft:   #DCEAE8;
  --accent-on:     var(--bone);
  --focus-ring:    #245550;
}
*/

/* ============================================================
   Worth Spreading — Typography
   Fraunces for display/headlines; Hanken Grotesk for body & UI.
   Use sentence case in running copy. Reserve UPPERCASE only for
   small tracked eyebrows / labels.
   ============================================================ */

:root {
  /* ---- Families ---- */
  --font-display: "Fraunces", "Fraunces 72", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- Fraunces optical / soft axis defaults ----
     Headlines use a high optical size (display contrast) with a
     little SOFT for the warm, calm terminals. */
  --display-opsz: 144;     /* @kind other */
  --display-soft: 40;      /* @kind other */
  --display-settings: "opsz" var(--display-opsz), "SOFT" var(--display-soft), "WONK" 0;

  /* ---- Weights ---- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Type scale (1.250 major-third-ish, tuned) ---- */
  --text-xs:   0.75rem;   /* 12 — micro labels, legal footnotes */
  --text-sm:   0.875rem;  /* 14 — captions, meta */
  --text-base: 1rem;      /* 16 — body */
  --text-md:   1.125rem;  /* 18 — lead body */
  --text-lg:   1.25rem;   /* 20 */
  --text-xl:   1.5rem;    /* 24 */
  --text-2xl:  1.875rem;  /* 30 */
  --text-3xl:  2.5rem;    /* 40 */
  --text-4xl:  3.25rem;   /* 52 */
  --text-5xl:  4.25rem;   /* 68 */
  --text-6xl:  5.5rem;    /* 88 — hero display */

  /* ---- Line heights ---- */
  --leading-tight: 1.04;   /* big display */
  --leading-snug:  1.16;   /* sub-display / headings */
  --leading-normal: 1.5;   /* body */
  --leading-relaxed: 1.65; /* long-form reading */

  /* ---- Tracking ---- */
  --tracking-display: -0.02em;  /* tighten large serif */
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-eyebrow: 0.16em;   /* UPPERCASE eyebrows / labels */
  --tracking-wide: 0.04em;

  /* ---- Semantic role aliases ---- */
  --font-heading: var(--font-display);
  --font-ui: var(--font-body);
}

/* ============================================================
   Worth Spreading — Spacing, radii, borders, shadows, motion,
   and the brand texture tokens (paper grain + soft radial glow).
   ============================================================ */

:root {
  /* ---- Spacing scale (4px base) ---- */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 2.5rem;    /* 40 */
  --space-8: 3rem;      /* 48 */
  --space-9: 4rem;      /* 64 */
  --space-10: 5rem;     /* 80 */
  --space-12: 6rem;     /* 96 */
  --space-16: 8rem;     /* 128 */
  --space-20: 10rem;    /* 160 — section rhythm */

  /* ---- Layout ---- */
  --measure: 68ch;            /* long-form reading width */
  --container: 1200px;        /* marketing content max width */
  --container-wide: 1400px;
  --gutter: clamp(1.25rem, 5vw, 4rem); /* @kind spacing */

  /* ---- Radii — mid-century restraint: modest, never pill-y on chrome ---- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-2xl: 40px;
  --radius-pill: 999px;
  --radius-card: var(--radius-lg);

  /* ---- Borders ---- */
  --border-hairline: 1px;
  --border-regular: 1.5px;
  --border-heavy: 2px;

  /* ---- Shadows — warm-tinted (ink), low and soft. No hard drop shadows
     in UI chrome; the dramatic long shadow is an ILLUSTRATION device only. */
  --shadow-xs: 0 1px 2px rgba(27,23,20,0.05);
  --shadow-sm: 0 2px 6px rgba(27,23,20,0.06);
  --shadow-md: 0 6px 20px rgba(27,23,20,0.08);
  --shadow-lg: 0 18px 48px rgba(27,23,20,0.12);
  --shadow-xl: 0 32px 70px rgba(27,23,20,0.16);
  --shadow-focus: 0 0 0 3px var(--accent-soft), 0 0 0 1.5px var(--focus-ring);

  /* ---- Motion — calm: short, eased, no bounce ---- */
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1); /* @kind other */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* @kind other */
  --dur-fast: 120ms; /* @kind other */
  --dur-base: 200ms; /* @kind other */
  --dur-slow: 340ms; /* @kind other */

  /* ---- Brand texture: subtle paper / riso grain.
     Apply as a layered background; keep opacity low. ---- */
  --grain-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"); /* @kind other */
  --grain-opacity: 0.04; /* @kind other */

  /* ---- Signature soft radial glow (the ONLY blessed gradient).
     Use behind hero marks / dark sections, never in chrome. ---- */
  --glow-amber: radial-gradient(60% 60% at 50% 42%, rgba(245,166,35,0.22) 0%, rgba(245,166,35,0) 70%); /* @kind other */
  --glow-accent: radial-gradient(60% 60% at 50% 42%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%); /* @kind other */
}

/* Reduced-motion: drop transitions/animations */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms; /* @kind other */
    --dur-base: 0ms; /* @kind other */
    --dur-slow: 0ms; /* @kind other */
  }
}

/* ============================================================
   Worth Spreading — Base element defaults + brand utilities.
   Opinionated, lightweight reset wired to the tokens.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headlines — Fraunces display, sentence case, tight tracking */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); font-variation-settings: var(--display-settings); }
h2 { font-size: var(--text-3xl); letter-spacing: var(--tracking-display); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 1em; text-wrap: pretty; }

a { color: inherit; text-decoration-color: var(--border-strong); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }

strong, b { font-weight: var(--weight-semibold); }

small { font-size: var(--text-sm); }

::selection { background: var(--accent-soft); color: var(--text-strong); }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-xs); }

hr { border: none; border-top: var(--border-hairline) solid var(--border-subtle); margin: var(--space-6) 0; }

img { max-width: 100%; display: block; }

/* ============================================================
   BRAND UTILITIES
   ============================================================ */

/* Eyebrow / tracked label — the ONLY blessed uppercase */
.ws-eyebrow {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Display headline helper */
.ws-display {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-variation-settings: var(--display-settings);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--text-strong);
}

/* Paper grain overlay — put on a ::before or a dedicated layer */
.ws-grain { position: relative; }
.ws-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain-url);
  background-size: 160px 160px;
  opacity: var(--grain-opacity);
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Dark section ground (warm near-black, not pure black) */
.ws-dark {
  background: var(--surface-dark);
  color: var(--text-on-dark);
}
.ws-dark h1, .ws-dark h2, .ws-dark h3, .ws-dark h4 { color: var(--text-on-dark); }

/* The signature soft radial glow layer */
.ws-glow { position: relative; isolation: isolate; }
.ws-glow::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: var(--glow-accent);
  z-index: -1;
  pointer-events: none;
}

/* Centred content container */
.ws-container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.ws-measure { max-width: var(--measure); }


/* ---- I'd Rather accent slot (HANDOFF §2) ---- */
[data-app="idrather"] {
  --accent: #1C5C3D;
  --accent-strong: #123D29;
  --accent-soft: rgba(28, 92, 61, 0.10);
  --accent-on: #F4EFE6;
  --focus-ring: #123D29;
}

/* ---- Make It Again accent slot (chili, the market palette) ---- */
[data-app="makeitagain"] {
  --accent: #D9482B;
  --accent-strong: #B23318;
  --accent-soft: rgba(217, 72, 43, 0.10);
  --accent-on: #FFF9F0;
  --focus-ring: #B23318;
}

/* ---- Hover styles ported from the prototype's style-hover attributes ---- */
.hov-strong:hover { color: var(--text-strong) !important; }
.hov-toc:hover { color: var(--text-strong) !important; border-left-color: var(--accent) !important; }
.hov-gap:hover { gap: 12px !important; }
.hov-amber:hover { border-bottom-color: var(--brand-amber) !important; }

/* ---- DS SiteFooter / AppStoreButtons behaviours ---- */
.ws-store:hover { background: var(--ink-800) !important; }
.ws-store:active { transform: translateY(1px); }
.ws-foot-link:hover { color: var(--bone) !important; }
@media (max-width: 760px) { .ws-footer-grid { grid-template-columns: 1fr 1fr !important; } }

/* ---- Reduced motion: videos swap to their poster stills ---- */
[data-motion-fallback] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  video[data-loop-rest] { display: none !important; }
  [data-motion-fallback] { display: block !important; }
}
