/* The Bruh Media — design tokens.
   Two themes of one brand: "Paper" (light) and "Signal" (dark).
   Layer order for the whole site is declared here, so this file loads first. */

@layer reset, tokens, base, components, sections, utilities;

/* Animatable custom properties */
@property --zebra {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@layer tokens {
  :root {
    color-scheme: light dark;

    /* ---------- Brand constants (hex in comments are the source values) ---------- */
    --navy: oklch(29.7% 0.064 254);          /* #142E4C — ink of the logo */
    --navy-deep: oklch(24.2% 0.053 255);     /* #0D2038 */
    --paper: oklch(96.6% 0.007 107);         /* #F4F4EF */
    --night: oklch(17.7% 0.044 271);         /* #0A0F24 */
    --snow: oklch(95.6% 0.011 275);          /* #EEF0F8 */
    --violet: oklch(59.9% 0.23 286);         /* #7C5CFF — atmosphere only */
    --violet-soft: oklch(72.8% 0.152 291);   /* #A894FF — violet that passes as text */
    --orange: oklch(75% 0.167 51);           /* #FF8A3D — action, dark theme */
    --orange-soft: oklch(79.2% 0.137 54);    /* #FFA161 */
    --orange-print: oklch(66% 0.182 46);     /* #E8650A — micro-accent on paper, graphics only */

    /* ---------- Semantic colour: light-dark(Paper, Signal) ---------- */
    --bg: light-dark(var(--paper), var(--night));
    --bg-alt: light-dark(oklch(93.8% 0.009 107), oklch(22% 0.059 270));       /* #EBEBE4 / #101836 */
    --surface: light-dark(oklch(98.7% 0.004 106), oklch(25.5% 0.072 271));    /* #FBFBF8 / #161F45 */
    --ink: light-dark(var(--navy), var(--snow));                               /* headings, logo */
    --text: light-dark(oklch(32.4% 0.06 254), var(--snow));                    /* #1D3552 */
    --text-muted: light-dark(oklch(50.2% 0.042 257), oklch(74.4% 0.041 273));  /* #55657C / #A3ABC7 */
    --line: light-dark(oklch(29.7% 0.064 254 / 0.14), oklch(100% 0 0 / 0.09));
    --line-strong: light-dark(oklch(29.7% 0.064 254 / 0.32), oklch(100% 0 0 / 0.2));

    --accent: light-dark(var(--orange-print), var(--orange));  /* graphics: arrow tip, markers */
    --link: light-dark(var(--navy), var(--violet-soft));
    --focus: light-dark(var(--navy), var(--violet-soft));

    /* Primary action: navy on paper, orange on night */
    --btn-bg: light-dark(var(--navy), var(--orange));
    --btn-bg-hover: light-dark(var(--navy-deep), var(--orange-soft));
    --btn-fg: light-dark(var(--paper), var(--night));

    /* Logo: arrow tip may take the accent in large sizes (set --logo-accent: var(--accent)) */
    --logo-accent: currentColor;

    /* The one gradient: growth line and one word of the hero headline.
       On paper both stops are ink, so the word stays solid and gets an underline instead. */
    --grad-from: light-dark(var(--navy), var(--violet-soft));
    --grad-to: light-dark(var(--navy), var(--orange));
    --grad-underline: light-dark(var(--orange-print), transparent);

    /* Atmosphere (Signal only) and paper grain */
    --glow-violet: light-dark(transparent, oklch(59.9% 0.23 286 / 0.3));
    --glow-orange: light-dark(transparent, oklch(75% 0.167 51 / 0.1));
    --spot: light-dark(transparent, oklch(72.8% 0.152 291 / 0.16));
    --grain-opacity: 0.06;

    /* Zebra: ink / paper of the current theme */
    --stripe-a: light-dark(var(--navy-deep), var(--snow));
    --stripe-b: light-dark(var(--paper), var(--night));

    /* ---------- Geometry ---------- */
    --angle: 123.69deg;      /* gradient angle that draws stripes along the logo diagonal (56.31°, slope 3:2) */
    --slope-x: 2;            /* move 2 right … */
    --slope-y: -3;           /* … and 3 up to travel along the brand diagonal */

    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 20px;
    --r-pill: 999px;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;
    --space-section: clamp(4rem, 2rem + 8vw, 9rem);
    --gutter: clamp(1rem, 0.25rem + 3.5vw, 3rem);
    --container: 82rem;

    /* ---------- Type ---------- */
    --font-display: "Geologica", "Onest", system-ui, sans-serif;
    --font-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --fs-display: clamp(2.25rem, 1.1rem + 4.9vw, 5.25rem);
    --fs-h2: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem);
    --fs-h3: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
    --fs-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
    --fs-body: clamp(1.0625rem, 1.03rem + 0.15vw, 1.1875rem);
    --fs-small: 0.9375rem;
    --fs-label: 0.8125rem;

    /* ---------- Motion ---------- */
    --dur-1: 160ms;   /* micro: hover, press */
    --dur-2: 260ms;   /* state: open, switch */
    --dur-3: 600ms;   /* reveal */
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: linear(0, 0.36 9%, 0.72 19%, 0.94 29%, 1.04 39%, 1.06 48%, 1.03 62%, 1 78%, 1);

    --header-h: 4.25rem;
  }

  /* Manual choice beats the system setting */
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }

  @media (prefers-contrast: more) {
    :root {
      --line: var(--line-strong);
      --text-muted: var(--text);
      --grain-opacity: 0;
    }
  }
}
