/* ============================================================================
   Design tokens for adityaseth.in.

   One palette for the whole site. The Component Lab modules read --lab-* only
   (that is their contract), so every --lab-* name is defined here as an alias
   of the site token next to it. A module dropped into any page therefore
   inherits the page's theme with no per-module wiring.

   Light is the default. [data-theme="dark"] on <html> or any ancestor flips
   the whole subtree, so a single dark section is just a wrapper attribute.
   ========================================================================= */

:root,
[data-theme="light"] {
    /* Surfaces, warm paper rather than flat white so photography sits calmly */
    --bg: #f4f2ee;
    --surface: #ffffff;
    --surface-2: #ebe8e2;
    --surface-3: #e2ded6;

    /* Ink */
    --ink: #141414;
    --ink-soft: #5c5c5c;
    /* Was #8a8a8a, which carried real text (section counts, captions, the
       awards row heading) at 3.09:1 on --bg and 3.45:1 on --surface. Both
       fail AA. This clears 4.5 against both surfaces in this theme and is
       still plainly fainter than --ink-soft. */
    --ink-faint: #6e6e6e;

    /* Lines and accent */
    --line: rgba(20, 20, 20, 0.12);
    --line-strong: rgba(20, 20, 20, 0.22);
    --accent: #2196f3;
    --accent-ink: #ffffff;
    --accent-soft: rgba(33, 150, 243, 0.12);
    --glow: rgba(33, 150, 243, 0.35);

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.16), 0 6px 16px rgba(0, 0, 0, 0.09);

    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0e0e0f;
    --surface: #1b1b1d;
    --surface-2: #262628;
    --surface-3: #313134;

    --ink: #f2f2f2;
    --ink-soft: #a3a3a3;
    /* Was #767678: 4.26:1 on --bg and 3.79:1 on --surface, so it failed AA on
       the page and failed it worse on every raised card. 4.73:1 and 5.31:1
       now, still a clear third rank below --ink and --ink-soft. */
    --ink-faint: #868688;

    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.24);
    --accent: #42a5f5;
    --accent-ink: #0e0e0f;
    --accent-soft: rgba(66, 165, 245, 0.16);
    --glow: rgba(66, 165, 245, 0.45);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 34px 80px rgba(0, 0, 0, 0.65), 0 8px 20px rgba(0, 0, 0, 0.5);

    color-scheme: dark;
}

:root {
    /* ---- Type ------------------------------------------------------------
       IBM Plex throughout. Mono is the accent voice: eyebrows, metadata,
       labels and numbers. It is what makes the pages read as an engineer's
       site without having to say so. */
    --font-display: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Fluid modular scale (~1.2 at 360px, ~1.25 at 1280px+) */
    --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
    --step--1: clamp(0.84rem, 0.81rem + 0.15vw, 0.90rem);
    --step-0: clamp(1.00rem, 0.96rem + 0.20vw, 1.0625rem);
    --step-1: clamp(1.18rem, 1.10rem + 0.40vw, 1.35rem);
    --step-2: clamp(1.40rem, 1.26rem + 0.70vw, 1.75rem);
    --step-3: clamp(1.70rem, 1.46rem + 1.20vw, 2.35rem);
    --step-4: clamp(2.05rem, 1.66rem + 1.90vw, 3.10rem);
    --step-5: clamp(2.60rem, 1.80rem + 3.80vw, 4.90rem);

    /* ---- Space ----------------------------------------------------------
       A single spacing ramp. Section rhythm is deliberately generous: the
       premium feel comes from restraint and air, not from more effects. */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;
    --sp-9: 96px;
    --sp-10: 128px;
    /* Tightened from clamp(72px, 10vw, 160px): with sections merged into
       tabbed groups the page no longer needs that much air to separate
       one idea from the next, and the gaps were reading as dead space. */
    --section-y: clamp(40px, 4.5vw, 80px);
    --gutter: clamp(20px, 5vw, 64px);
    --measure: 68ch;
    --maxw: 1240px;
    --maxw-wide: 1560px;

    /* ---- Shape and motion ----------------------------------------------- */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-1: 0.18s;
    --dur-2: 0.32s;
    --dur-3: 0.6s;

    --z-base: 1;
    --z-sticky: 50;
    --z-nav: 100;
    --z-overlay: 500;
    --z-loader: 900;

    /* Lab bridge, theme-independent half. The colour half must live in the
       rule below, not here: see the note there. */
    --lab-font-display: var(--font-display);
    --lab-font-body: var(--font-body);
    --lab-font-mono: var(--font-mono);
    --lab-radius: var(--radius);
    --lab-ease-out: var(--ease-out);
    --lab-ease-spring: var(--ease-spring);
}

/* ---- Component Lab bridge, colour half -----------------------------------
   Modules under /components read --lab-* exclusively, so aliasing is what
   lets any of them drop into any page and follow its theme with no wiring.

   This MUST match every themed scope, not just :root. A custom property is
   substituted where it is DECLARED, not where it is used: declaring
   --lab-ink: var(--ink) only on :root freezes it to the root theme's ink, and
   descendants inherit that frozen value. A dark island inside a light page
   (<section data-theme="dark">) would then render its modules with near-black
   ink on a dark background. Matching [data-theme] re-resolves the alias inside
   each island, which is what makes per-section theming work at all. */
:root,
[data-theme] {
    --lab-bg: var(--bg);
    --lab-surface: var(--surface);
    --lab-surface-2: var(--surface-2);
    --lab-ink: var(--ink);
    --lab-ink-soft: var(--ink-soft);
    --lab-line: var(--line);
    --lab-accent: var(--accent);
    --lab-accent-ink: var(--accent-ink);
    --lab-glow: var(--glow);
    --lab-shadow: var(--shadow);
}
