/* ==========================================================================
   Tej Studio — design tokens. The single source of truth.
   Never hard-code a colour, size, radius, duration or ease outside this file.
   JS reads motion tokens from here (assets/js/modules/motion.config.js).
   ========================================================================== */

:root {
  /* ── Colour · "Tungsten" (default) ──────────────────────────────────────
     Warm near-black canvas; brand orange behaves like light.
     Brand: orange #F0781C, charcoal #404040 (from the logo). */
  --c-bg:            #0e0c0b;
  --c-surface-1:     #161311;
  --c-surface-2:     #1e1a17;
  --c-surface-3:     #29241f;
  --c-line:          rgb(244 239 233 / 0.1);
  --c-line-strong:   rgb(244 239 233 / 0.2);
  --c-text:          #f4efe9;   /* 17.3:1 on bg */
  --c-text-muted:    #a69c92;   /*  7.2:1 on bg */
  --c-accent:        #f0781c;   /*  6.9:1 on bg — the "light" */
  --c-accent-bright: #ffa04f;   /* only inside glows / beams */
  --c-accent-ink:    #170b02;   /* text on accent fills (7.0:1) */
  --c-accent-text:   var(--c-accent);
  --c-accent-rgb:    240 120 28;  /* the accent as channels, for rgb(var(--c-accent-rgb) / alpha) */
  --c-rec:           #ff4d3a;     /* the red REC dot on viewfinders */
  --c-danger:        #ff7a66;
  --c-success:       #7fd19a;
  --c-overlay:       rgb(14 12 11 / 0.72);

  /* Light-section variant (used via .theme-light) */
  --c-paper:         #f3eee8;
  --c-paper-1:       #fbf8f4;
  --c-paper-2:       #e9e2d9;
  --c-paper-3:       #ddd5cb;
  --c-ink:           #15110e;
  --c-ink-muted:     #5e554d;   /* 6.3:1 on paper */
  --c-accent-on-paper: #a5470a; /* 5.0:1 on paper */

  /* ── Typography ──────────────────────────────────────────────────────── */
  --font-display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-text:    "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --font-accent:  "Instrument Serif", Georgia, "Times New Roman", serif;

  --display-weight:   700;
  --display-stretch:  100%;
  --display-variation: "opsz" 96;
  --display-tracking: -0.04em;
  --display-leading:  0.92;
  --heading-tracking: -0.025em;
  --heading-leading:  1.02;
  --accent-scale:     1.06;  /* serif accent words optically match the display face */

  --text-weight:     400;
  --text-weight-med: 500;
  --text-weight-bold: 650;

  /* Fluid scale: 360px → 1920px viewport */
  --fs-display: clamp(3.25rem, 1.9rem + 6vw, 9.5rem);
  --fs-h1:      clamp(2.5rem, 1.7rem + 3.6vw, 6rem);
  --fs-title:   clamp(2.5rem, 1.5rem + 2.75vw, 4.5rem);   /* page H1s (.t-h1), a step below the home scene titles */
  --fs-h2:      clamp(2rem, 1.45rem + 2.45vw, 4.25rem);
  --fs-h3:      clamp(1.5rem, 1.27rem + 1vw, 2.5rem);
  --fs-h4:      clamp(1.25rem, 1.17rem + 0.36vw, 1.625rem);
  --fs-lead:    clamp(1.125rem, 1.06rem + 0.3vw, 1.4375rem);
  --fs-body:    clamp(1rem, 0.97rem + 0.12vw, 1.125rem);
  --fs-small:   0.875rem;
  --fs-eyebrow: 0.75rem;

  --lh-body:  1.6;
  --lh-lead:  1.45;
  --measure:  65ch;
  --eyebrow-tracking: 0.18em;

  /* ── Space · 8px base ────────────────────────────────────────────────── */
  --sp-0-5: 0.25rem;  /*   4 */
  --sp-1:   0.5rem;   /*   8 */
  --sp-2:   1rem;     /*  16 */
  --sp-3:   1.5rem;   /*  24 */
  --sp-4:   2rem;     /*  32 */
  --sp-5:   2.5rem;   /*  40 */
  --sp-6:   3rem;     /*  48 */
  --sp-8:   4rem;     /*  64 */
  --sp-10:  5rem;     /*  80 */
  --sp-12:  6rem;     /*  96 */
  --sp-16:  8rem;     /* 128 */
  --sp-20:  10rem;    /* 160 */

  --section-pad:       clamp(6rem, 2.5rem + 6vw, 9rem);  /* THE gap between two sections (~128px at 1440) */
  --section-pad-tight: clamp(3.5rem, 7vw, 6rem);
  --stack-gap:         clamp(1.5rem, 1.1rem + 1.6vw, 2.75rem);

  /* ── Grid ────────────────────────────────────────────────────────────── */
  --container-max: 1520px;
  --page-gutter:   clamp(1.25rem, 0.6rem + 3vw, 3.5rem);   /* side padding */
  --grid-gutter:   clamp(1rem, 0.7rem + 1.2vw, 2rem);      /* between columns */
  --header-h:      clamp(4.25rem, 3.8rem + 1.2vw, 5.25rem);
  --topbar-h:      2.5rem;
  --mobile-bar-h:  4.25rem;

  /* ── Shape ───────────────────────────────────────────────────────────── */
  --r-sm:   4px;
  --r-md:   12px;
  --r-lg:   24px;
  --r-pill: 999px;
  --border: 1px solid var(--c-line);
  --border-strong: 1px solid var(--c-line-strong);

  /* One elevation, one glow. */
  --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 30px 60px -30px rgb(0 0 0 / 0.75);
  --glow:   0 0 0 1px rgb(var(--c-accent-rgb) / 0.35), 0 0 48px -6px rgb(var(--c-accent-rgb) / 0.45);
  --glow-color: rgb(var(--c-accent-rgb) / 0.55);

  /* Light motif: a soft key light. Reused by beams, cursor, card hovers. */
  --light-spot: radial-gradient(closest-side, rgb(255 160 79 / 0.22), rgb(var(--c-accent-rgb) / 0.08) 45%, transparent 100%);
  --light-beam: linear-gradient(100deg, transparent 0%, rgb(var(--c-accent-rgb) / 0) 30%, rgb(255 160 79 / 0.28) 50%, rgb(var(--c-accent-rgb) / 0) 70%, transparent 100%);

  /* ── Icons ───────────────────────────────────────────────────────────── */
  --icon-size:   1.25em;
  --icon-stroke: 1.5;

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --dur-fast: 0.25s;
  --dur-base: 0.6s;
  --dur-slow: 1.1s;
  --dur-intro: 1.4s;
  --ease-signature: cubic-bezier(0.16, 1, 0.3, 1);   /* strong expo-out: reveals, page moves */
  --ease-hover:     cubic-bezier(0.33, 1, 0.68, 1);  /* cubic-out: hovers, small UI */
  --stagger-words:  0.06s;
  --stagger-items:  0.1s;
  --reveal-rise:    1.5rem;
  --marquee-dur:    60s;

  /* ── Layers ──────────────────────────────────────────────────────────── */
  --z-base:    1;
  --z-sticky:  50;
  --z-header:  100;
  --z-menu:    200;
  --z-overlay: 300;
  --z-cursor:  400;
  --z-intro:   500;
}

/* ── Device tiers ────────────────────────────────────────────────────────────
   Desktop (≥1024) uses the fluid clamps above. Phones and tablets use fixed,
   app-standard steps (close to iOS/Material type scales), so text never drifts
   below readable sizes on narrow screens.
     phone   < 768   display 40 · H2 30 · H3 24 · card 20 · lead 17 · body 16
     tablet 768–1023 display 56 · H2 40 · H3 28 · card 22 · lead 19 · body 17
   Nothing on the site is smaller than --fs-caption (12px). */
:root {
  --fs-caption: 0.75rem;   /* 12 — the floor for any text */
  --tap: 3rem;             /* 48 — primary touch targets */
  --tap-min: 2.75rem;      /* 44 — smallest acceptable touch target */
  --bar-h: 4rem;           /* mobile action bar, before safe-area inset */
}
@media (max-width: 767.98px) {
  :root {
    --fs-display: 2.5rem;
    --fs-h1: 2.5rem;
    --fs-title: 2.25rem;
    --fs-h2: 1.875rem;
    --fs-h3: 1.5rem;
    --fs-h4: 1.25rem;
    --fs-lead: 1.0625rem;
    --fs-body: 1rem;
    --section-pad: 4.5rem;   /* 72 */
    --section-pad-tight: 2.5rem;
    --page-gutter: 1.25rem;
    --grid-gutter: 1rem;
    --stack-gap: 1.5rem;
    --header-h: 3.5rem;
  }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  :root {
    --fs-display: 3.5rem;
    --fs-h1: 3.5rem;
    --fs-title: 3rem;
    --fs-h2: 2.5rem;
    --fs-h3: 1.75rem;
    --fs-h4: 1.375rem;
    --fs-lead: 1.1875rem;
    --fs-body: 1.0625rem;
    --section-pad: 6rem;     /* 96 */
    --section-pad-tight: 3.5rem;
    --page-gutter: 2rem;
    --grid-gutter: 1.25rem;
    --header-h: 4rem;
  }
}
