/* =====================================================================
   TTM Builder Design Tokens  ·  v1 · 2026-10-20
   One source of truth for the DIY builder app (checkout, wizard, review).
   Same family as the store homepage (build.tothemaxmedia.com):
   cream ground, ink, Archivo condensed display, IBM Plex body, TTM blue.
   Usage: <link rel="stylesheet" href="tokens.css"> then use var(--…).
   Buyer-facing copy must never name the AI vendor.
   ===================================================================== */

/* ---------- 1. Fonts (self-hosted copies of the homepage files) ------
   Fallback if files are missing: Google Fonts
   https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,100..900&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&family=Kalam:wght@700&display=swap */
@font-face{font-family:"Archivo Variable";src:url(fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations");font-weight:100 900;font-stretch:62% 125%;font-display:swap}
@font-face{font-family:"IBM Plex Sans";src:url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"IBM Plex Sans";src:url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"IBM Plex Sans";src:url(fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Kalam";src:url(fonts/kalam-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}

:root{
  /* ---------- 2. Font families ---------- */
  --font-display:"Archivo Variable","Archivo","Arial Narrow",sans-serif; /* headings, big numbers, buttons */
  --font-body:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif; /* everything you read */
  --font-mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,monospace;  /* tiny eyebrow labels ONLY, never counters */
  --font-hand:"Kalam","Comic Sans MS",cursive;                          /* one hand-note per screen max */

  /* Display recipe (matches homepage poster type) */
  --display-stretch:75%;          /* condensed */
  --display-weight:850;
  --display-tracking:-0.02em;
  --display-case:uppercase;

  /* ---------- 3. Type scale (fluid, 390px → 1440px) ---------- */
  --text-xs:  0.8125rem;                          /* 13  eyebrow / legal (min) */
  --text-sm:  0.875rem;                           /* 14  helper text (never smaller) */
  --text-md:  1rem;                               /* 16  body, inputs (16 stops iOS zoom) */
  --text-lg:  clamp(1.0625rem, 1rem + .3vw, 1.1875rem);   /* 17–19 lead text */
  --text-xl:  clamp(1.25rem, 1.1rem + .6vw, 1.5rem);      /* 20–24 card titles */
  --text-2xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);     /* 28–40 step titles */
  --text-3xl: clamp(2.5rem, 1.8rem + 3.2vw, 4.25rem);     /* 40–68 question headline */
  --text-4xl: clamp(3.25rem, 2rem + 6vw, 7rem);           /* 52–112 hero / celebration */
  --leading-tight:0.92;   /* display */
  --leading-snug:1.2;
  --leading-body:1.55;
  --weight-regular:400; --weight-semibold:600; --weight-bold:700;

  /* ---------- 4. Colour: brand ---------- */
  --ttm-blue:#29AAEF;     --ttm-blue-600:#0E8BD0; --ttm-blue-700:#0C68A1; --ttm-blue-50:#E3F4FD;
  --ink:#231F20;          --ink-2:#4A4446;  --ink-3:#5B524A;   /* ink-3 = muted text, 7:1 on cream */
  --cream:#EEE3CC;        --cream-2:#E3D5B8; --cream-line:#C9B99A;
  --paper:#FFFBF2;        /* card surface on cream */
  --white:#FFFFFF;
  --orange:#FF5A1F;       /* “mark” – circles, stickers, 1 accent per view */
  --yellow:#FFC21A;       /* highlight / guessed values */
  --green:#34A853; --green-700:#1F6B35; --green-50:#E3F3E6;
  --red:#B01E2D;   --red-50:#FBE7E9;

  /* ---------- 5. Colour: roles (use these in components) ---------- */
  --bg:var(--cream);
  --surface:var(--paper);
  --surface-sunk:var(--cream-2);
  --text:var(--ink);
  --text-muted:var(--ink-3);
  --border:rgba(35,31,32,.16);
  --border-strong:var(--ink);
  --accent:var(--ttm-blue);
  --accent-ink:var(--ink);          /* text on blue = ink (contrast 8:1); never white */
  --primary-bg:var(--ink);  --primary-fg:var(--cream);      /* main CTA = ink, like homepage */
  --focus:var(--ttm-blue-700);
  --guess-bg:#FBF1D9; --guess-line:#D9A520; --guess-ink:#6B4E00;   /* “We guessed” */
  --ok-bg:var(--green-50); --ok-ink:var(--green-700);
  --error-bg:var(--red-50); --error-ink:var(--red);
  --overlay:rgba(35,31,32,.55);

  /* ---------- 6. Spacing (4px base) ---------- */
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:20px;
  --space-6:24px; --space-8:32px; --space-10:40px; --space-12:48px; --space-16:64px; --space-20:80px; --space-24:96px;
  --gutter:clamp(20px, 4vw, 56px);
  --measure:62ch;            /* max line length */
  --question-width:720px;    /* one-question card */
  --page-max:1280px;
  --tap:48px;                /* minimum touch target */

  /* ---------- 7. Radii ---------- */
  --radius-xs:4px; --radius-sm:8px; --radius-md:14px; --radius-lg:22px; --radius-xl:32px; --radius-pill:999px;

  /* ---------- 8. Borders & shadows ---------- */
  --border-w:1.5px; --border-w-strong:2px;
  --shadow-sm:0 1px 2px rgba(35,31,32,.08), 0 1px 1px rgba(35,31,32,.04);
  --shadow-md:0 6px 18px -6px rgba(35,31,32,.18), 0 2px 4px rgba(35,31,32,.06);
  --shadow-lg:0 24px 48px -16px rgba(35,31,32,.28), 0 6px 12px -4px rgba(35,31,32,.08);
  --shadow-pop:4px 4px 0 var(--ink);          /* homepage “sticker” hard shadow */
  --shadow-pop-press:1px 1px 0 var(--ink);
  --ring:0 0 0 3px var(--cream), 0 0 0 5.5px var(--focus);   /* focus ring, works on any bg */

  /* ---------- 9. Motion ---------- */
  --dur-instant:90ms;   /* press feedback */
  --dur-fast:160ms;     /* hover, chips */
  --dur-base:260ms;     /* cards, toggles */
  --dur-slow:480ms;     /* question → question */
  --dur-hero:800ms;     /* celebration, preview reveal */
  --ease-out:cubic-bezier(.23,1,.32,1);       /* homepage --pt-ease: the default */
  --ease-in-out:cubic-bezier(.65,0,.35,1);
  --ease-standard:cubic-bezier(.4,0,.2,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1); /* small overshoot: chips, ticks, stickers */
  --stagger:45ms;                              /* list item delay step */
  --lift:-2px;                                 /* hover translateY */

  /* ---------- 10. Layers ---------- */
  --z-sticky:20; --z-overlay:40; --z-modal:50; --z-toast:60;
}

/* Reduced motion: keep fades (≤120ms), drop movement, loops and scroll effects */
@media (prefers-reduced-motion: reduce){
  :root{
    --dur-fast:1ms; --dur-base:120ms; --dur-slow:120ms; --dur-hero:120ms;
    --stagger:0ms; --lift:0px; --ease-spring:var(--ease-standard);
  }
  *,*::before,*::after{animation-iteration-count:1 !important;scroll-behavior:auto !important}
  [data-motion="loop"],[data-motion="parallax"]{animation:none !important;transform:none !important}
}

/* ---------- Base helpers (opt-in, safe to import) ---------- */
.ttm-display{font-family:var(--font-display);font-stretch:var(--display-stretch);font-weight:var(--display-weight);
  letter-spacing:var(--display-tracking);text-transform:var(--display-case);line-height:var(--leading-tight)}
.ttm-eyebrow{font-family:var(--font-mono);font-size:var(--text-xs);letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted)}
.ttm-hand{font-family:var(--font-hand);font-weight:700;color:var(--orange)}
:where(.ttm) :focus-visible{outline:none;box-shadow:var(--ring)}
