/* LS Design System v1 · tokens-core.css
   Colour-independent layer: typography, spacing, radii, shadows geometry, z-index, motion, breakpoints.
   Colours live in themes/*.css (one theme per page: <html data-theme="...">).
   Values taken from rankingkont.pl, /lukasz-scheibinger/ and eds.rankingkont.pl (production, 28.11.2026). */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-sans-subset.woff2") format("woff2");
  font-weight: 400 650;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-subset.woff2") format("woff2");
  font-weight: 400 550;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback keeps layout stable while Geist loads */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 22%;
  line-gap-override: 0%;
}

:root {
  /* ---------- Typography: families ---------- */
  --font-sans: "Geist", "Geist Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: var(--font-sans);   /* a theme may swap the display face; body stays one family */

  /* ---------- Typography: desktop and tablet scale (>= 48rem) ---------- */
  --fs-body: 1.0625rem;                                   /* 17px */
  --lh-body: 1.6;
  --fs-lead: clamp(1.125rem, 1.02rem + .4vw, 1.25rem);    /* 18-20px */
  --lh-lead: 1.55;
  --fs-h1: clamp(2.375rem, 1.55rem + 3.3vw, 3.875rem);    /* 38-62px */
  --lh-h1: 1.06;
  --ls-h1: -0.035em;
  --fs-h2: clamp(1.625rem, 1.3rem + 1.25vw, 2.25rem);     /* 26-36px */
  --lh-h2: 1.15;
  --ls-h2: -0.025em;
  --fs-h3: 1.125rem;                                      /* 18px */
  --lh-h3: 1.35;
  --ls-h3: -0.01em;
  --fs-small: .9375rem;                                   /* 15px: captions, card text */
  --fs-meta: .875rem;                                     /* 14px: decision-relevant metadata minimum */
  --fs-micro: .8125rem;                                   /* 13px: eyebrows, mono labels */
  --fs-figure: clamp(1.75rem, 2.2vw, 2.25rem);            /* key figures */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 550;
  --fw-bold: 600;
  --measure: 65ch;
  --measure-lead: 58ch;

  /* ---------- Spacing (4px base) ---------- */
  --sp-1: .25rem;   /*  4 */
  --sp-2: .5rem;    /*  8 */
  --sp-3: .75rem;   /* 12 */
  --sp-4: 1rem;     /* 16 */
  --sp-5: 1.25rem;  /* 20 */
  --sp-6: 1.5rem;   /* 24 */
  --sp-8: 2rem;     /* 32 */
  --sp-10: 2.5rem;  /* 40 */
  --sp-12: 3rem;    /* 48 */
  --sp-16: 4rem;    /* 64 */
  --sp-24: 6rem;    /* 96 */
  --section-pad: clamp(3.5rem, 7vw, 6rem);
  --hero-pad: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  --card-pad: clamp(1.25rem, 2.5vw, 1.75rem);
  --wrap: 70rem;                       /* 1120px content width */
  --pad: clamp(1.25rem, 4vw, 2rem);    /* side padding */
  --gutter: 1.5rem;                    /* 12-column gap */
  --header-h: 4rem;
  --subnav-h: 3.5rem;                  /* section bar: 44px links + padding; the only sticky bar from 48rem */

  /* ---------- Radii ---------- */
  --r-xs: 4px;      /* pills in compact grids, gate chips */
  --r-ctl: 8px;     /* buttons, segmented controls */
  --r-card: 12px;   /* cards, panels */
  --r-sheet: 16px;  /* popover sheet */
  --r-pill: 999px;  /* dock */

  /* ---------- Shadows (geometry here, colour from the theme's --shadow-rgb) ---------- */
  --shadow: 0 1px 2px rgb(var(--shadow-rgb) / .04), 0 4px 12px rgb(var(--shadow-rgb) / .03);
  --shadow-lg: 0 1px 2px rgb(var(--shadow-rgb) / .04), 0 12px 32px rgb(var(--shadow-rgb) / .06);
  --shadow-dock: 0 1px 2px rgb(var(--shadow-rgb) / .06), 0 10px 28px rgb(var(--shadow-rgb) / .12);
  --shadow-sheet: 0 1px 2px rgb(var(--shadow-rgb) / .06), 0 16px 40px rgb(var(--shadow-rgb) / .16);

  /* ---------- Z-index ---------- */
  --z-base: 0;
  --z-sticky: 40;      /* section sub-nav */
  --z-header: 50;      /* header (sticky only on phones without the dock) */
  --z-dock: 60;        /* phone dock */
  --z-sheet: 61;       /* Sections popover */
  --z-skip: 100;       /* skip link */

  /* ---------- Motion (decorative only; state never waits for it) ---------- */
  --ease-out: cubic-bezier(.2, .75, .25, 1);
  --dur-press: 80ms;
  --dur-marker: 150ms;
  --dur-sheet: 180ms;
  --dur-dock: 240ms;
  --dock-hide-after: 48;   /* px of accumulated scroll down (read by components.js) */
  --dock-show-after: 32;   /* px of scroll up */

  /* ---------- Breakpoints (reference only: custom properties do not work in @media) ----------
     phone   : max-width 47.99rem  (< 768px)  -> phone scale, static top, floating dock
     tablet  : 48rem - 63.99rem    (768-1023px)
     desktop : min-width 64rem     (>= 1024px) -> 4/8 editorial split, sticky section heads
     narrow  : max-width 30rem     (< 480px)   -> extra wrapping rules */
  --bp-phone-max: 47.99rem;
  --bp-desktop-min: 64rem;

  /* ---------- Touch ---------- */
  --target-min: 44px;
  --target-dock: 48px;
}

/* ---------- Phone scale (< 48rem): body 15/1.5 · lead 16 · H1 27 · H2 21 · H3 17 · meta 13 · sections 48px ---------- */
@media (max-width: 47.99rem) {
  :root {
    --fs-body: .9375rem;     /* 15px */
    --lh-body: 1.5;
    --fs-lead: 1rem;         /* 16px */
    --lh-lead: 1.46;
    --fs-h1: 1.6875rem;      /* 27px */
    --lh-h1: 1.12;
    --ls-h1: -0.025em;
    --fs-h2: 1.3125rem;      /* 21px */
    --lh-h2: 1.2;
    --ls-h2: -0.02em;
    --fs-h3: 1.0625rem;      /* 17px */
    --lh-h3: 1.25;
    --fs-small: .875rem;
    --fs-meta: .8125rem;     /* 13px */
    --fs-figure: 1.625rem;
    --section-pad: 3rem;     /* 48px */
    --hero-pad: .75rem 2.5rem;
    --card-pad: 1rem;        /* 16px */
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-press: 0ms; --dur-marker: 0ms; --dur-sheet: 0ms; --dur-dock: 0ms; }
}
