/* PhiNode tokens: the landing's design (concepts/landing-v1/final-redesign.html) as one file for the product.
   Colours keep the landing's names, so the landing and the product speak one language. The theme follows the system,
   dark first as on the landing; data-theme="dark" or "light" on any element pins it there and inside.
   Every token is drawn on the hub's UI → Foundations page (ui/index.html). */

/* Scales: the same in both themes */
:root {
  --sans: "Geist", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* type. The landing's half sizes (9.5, 10.5, 11.5, 13.5, 14.5) round to the nearest step */
  --fs-micro: 10px;    /* mono caps labels */
  --fs-xs: 11px;       /* badges; mono IDs and times */
  --fs-sm: 12px;       /* secondary lines, small buttons */
  --fs-ui: 13px;       /* controls, tables, navigation: the product's base */
  --fs-body: 14px;     /* reading text */
  --fs-md: 15px;       /* large buttons, emphasis */
  --fs-lead: 17px;     /* a page's intro */
  --fs-h3: 20px;       /* card title */
  --fs-h2: 26px;       /* section and dialog title */
  --fs-h1: 34px;       /* page title */
  --fs-display: 44px;  /* big numbers */
  --fs-hero: clamp(40px, 6.2vw, 80px);   /* the landing's first title, the biggest words on a site */
  --fs-giant: clamp(84px, 11vw, 150px);  /* a site's one big number: the findings' 689 */
  --fs-subtitle: clamp(30px, 3.4vw, 44px);  /* a panel's title on a site, under the section's */
  --fs-title: clamp(32px, 4.4vw, 56px);  /* the sites' page title: the landing's section titles, the hub's pages */
  --w-regular: 400; --w-medium: 500; --w-semi: 600; --w-bold: 650;
  --lh-tight: 1.05;    /* 26 and up */
  --lh-snug: 1.3;      /* card titles, titles in rows, mono */
  --lh-text: 1.5;
  --tr-tight: -.04em;  /* 26 and up */
  --tr-snug: -.02em;   /* card titles */
  --tr-mono: .06em;    /* mono IDs and numbers */
  --tr-caps: .1em;     /* mono caps labels */

  /* spacing: steps of 4 up to 24, then 8. The landing's in-betweens move to a neighbour:
     6 → 4 or 8, 10 → 8 or 12, 14 → 12 or 16, 18 → 16 or 20, 22 and 26 → 24, 28 and 34 → 32 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-14: 56px; --sp-16: 64px;

  /* radius. Inside a holder the inner radius is the outer one less the gap: a 20 panel with 8 inside holds 12 fields */
  --r-xs: 4px;      /* checkbox, code marks */
  --r-sm: 8px;      /* small wells, tags inside a field */
  --r-md: 12px;     /* fields, icon tiles */
  --r-lg: 14px;     /* cards, rows */
  --r-xl: 20px;     /* glass panels, dialogs */
  --r-pill: 999px;  /* buttons, badges, tabs, nav rows */

  /* glass blur: panels, and the lighter one for bars and big panels over content */
  --blur: blur(22px) saturate(160%);
  --blur-bar: blur(14px);

  /* drop shadows, as the landing draws them in both themes; pair each with --sh-edge */
  --sh-float: 0 10px 30px rgba(0,0,0,.25);  /* chips, menus, toasts */
  --sh-card: 0 20px 60px rgba(0,0,0,.25);   /* glass cards */
  --sh-panel: 0 30px 80px rgba(0,0,0,.35);  /* dialogs, big panels */

  /* motion */
  --ease-out: cubic-bezier(.2,.8,.2,1);      /* arrives, or follows the pointer */
  --ease-io: cubic-bezier(.4,0,.2,1);        /* changes in place: progress, state */
  --ease-spring: cubic-bezier(.2,1.4,.4,1);  /* small pops: a stamp, a step done */
  --ease-glide: cubic-bezier(.22,1,.36,1);   /* glides from one place to the next: the hover pill, a tab's thumb */
  --dur-hover: .25s; --dur-state: .35s; --dur-theme: .6s; --dur-enter: .8s;
}
@media (prefers-reduced-motion: reduce) { :root { --dur-hover: 0s; --dur-state: 0s; --dur-theme: 0s; --dur-enter: 0s; } }

/* Dark: the landing's base look */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #140F0F;                  /* page */
  --fg: #F4EFE9;                  /* text */
  --mu: #9A8F88;                  /* muted text */
  --ln: #3A302D;                  /* lines and edges */
  --fa: #2A2220;                  /* fills: a switch's well, avatars, tracks */
  --ce: rgba(255,255,255,.045);   /* fields */
  --g1: #FF5F4F; --g2: #FF8A5B;   /* coral: the gradient's two ends */
  --g3: #FFB3A8;                  /* coral, soft: glows */
  --gt: #FF5F4F;                  /* accent text: eyebrows, links */
  --en: #A48BFF;                  /* the engine's violet */
  --on: #140F0F;                  /* text on the gradient pill */
  --g2t: #FF8A5B;                 /* the gradient's lower end under text (see --grad-text) */
  --knob: #F4EFE9;                /* a switch's knob */
  --gl: rgba(34,26,26,.62);       /* glass fill */
  --ed: rgba(255,255,255,.14);    /* glass edge */
  --hi: rgba(255,255,255,.3);     /* glass top light */
  --sh-well: inset 0 2px 5px rgba(0,0,0,.55), inset 0 1px 1px rgba(0,0,0,.4), inset 0 -1px 0 rgba(255,255,255,.07);  /* pressed in: a switch's track */
  /* status: not on the landing, made from its palette; text in them reaches 4.5:1 on --bg */
  --crit: #FF5F4F; --high: #FF8A5B; --med: #F0B35B; --low: #9A8F88; --ok: #7CC49A; --info: #A48BFF;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* Light: the system asks for it (the same values as the block below) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F4EFE9; --fg: #1A1414; --mu: #6E625C; --ln: #D3C8BE; --fa: #E2D9D0; --ce: rgba(255,255,255,.7);
    --g1: #BF3324; --g2: #D9532F; --g3: #F2A898; --gt: #A83A2A; --en: #6A4FE0; --on: #FFFFFF;
    --g2t: #CC4329; --knob: #FFFFFF;
    --gl: rgba(255,255,255,.62); --ed: rgba(255,255,255,.95); --hi: #FFFFFF;
    --sh-well: inset 0 2px 5px rgba(0,0,0,.12), inset 0 1px 1px rgba(0,0,0,.1), inset 0 -1px 0 rgba(255,255,255,.8);
    --crit: #B02E20; --high: #A0461A; --med: #7E5A10; --low: #6E625C; --ok: #2A6E4A; --info: #5E43D6;
    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  }
}
/* Light: pinned */
[data-theme="light"] {
  color-scheme: light;
  --bg: #F4EFE9; --fg: #1A1414; --mu: #6E625C; --ln: #D3C8BE; --fa: #E2D9D0; --ce: rgba(255,255,255,.7);
  --g1: #BF3324; --g2: #D9532F; --g3: #F2A898; --gt: #A83A2A; --en: #6A4FE0;
  --on: #FFFFFF;  /* the landing's ink (#1A1414) reads 3.2:1 on light coral; white reads 5.6 */
  --g2t: #CC4329; /* halfway to --g2: white keeps 4.5:1 all the way down the gradient */
  --knob: #FFFFFF;
  --gl: rgba(255,255,255,.62); --ed: rgba(255,255,255,.95); --hi: #FFFFFF;
  --sh-well: inset 0 2px 5px rgba(0,0,0,.12), inset 0 1px 1px rgba(0,0,0,.1), inset 0 -1px 0 rgba(255,255,255,.8);
  --crit: #B02E20; --high: #A0461A; --med: #7E5A10; --low: #6E625C; --ok: #2A6E4A; --info: #5E43D6;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Built from the colours. Declared wherever a theme is, so each theme computes its own */
:root, [data-theme] {
  --grad: linear-gradient(180deg, var(--g1), var(--g2));  /* the gradient: glows, dots, nodes */
  --grad-text: linear-gradient(180deg, var(--g1), var(--g2t));  /* the gradient pill under words: what is on */
  --glass: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 40%), var(--gl);
  --bar: color-mix(in srgb, var(--bg) 70%, transparent);  /* bars and big panels over content, with --blur-bar */
  --sh-edge: inset 0 1px 0 var(--hi);                     /* the light edge along the top of glass */
  --sh-pill: inset 0 1px 0 rgba(255,255,255,.22), 0 6px 14px -8px color-mix(in srgb, var(--g1) 70%, transparent);
  --glow: 0 0 22px color-mix(in srgb, var(--g1) 55%, transparent);  /* an "on" dot or node */
  --ring: 0 0 0 6px color-mix(in srgb, var(--g1) 16%, transparent); /* with --glow on a current step */
  --ground: radial-gradient(ellipse 80% 60% at 50% 115%, color-mix(in srgb, var(--g1) 10%, transparent), transparent 70%), var(--grain);  /* behind the page: coral glow from below, film grain */
}
