/* =============================================================================
   TOMASZ FRYZEL — DESIGN SYSTEM · TOKENS
   =============================================================================
   Design tokens are the single source of truth for the whole site.
   They live in TWO TIERS — this is the core idea of the system:

     1. PRIMITIVES — the raw palette. Named for WHAT THEY ARE (red-500, grey-900).
                     Never referenced directly by components.
     2. SEMANTIC   — named for THE JOB THEY DO (--color-bg, --color-red).
                     They point at primitives. Components ONLY use these.

   Payoff: change a primitive and the whole site shifts in lockstep. Want a dark
   mode later? Re-point the semantic layer once — components never change.

   Build order:  [x] Colour   [ ] Type   [ ] Spacing   [ ] Radius/border
                 [ ] Elevation   [ ] Motion   [ ] Breakpoints/z-index
   ========================================================================== */


/* -----------------------------------------------------------------------------
   1 · PRIMITIVES  —  the palette (raw values, no meaning attached)
   -------------------------------------------------------------------------- */
:root {

  /* Neutrals — a cool-grey ramp anchored to your two originals:
     grey-50 (#f6f6f6) and grey-900 (#151719). The steps between are derived so
     we have borders, muted states and secondary text. Tweak any value to taste. */
  --white:    #ffffff;
  --grey-50:  #f6f6f6;  /* your "Grey"  · page background            */
  --grey-100: #eceeef;  /* sunken surface / hover row                */
  --grey-200: #dfe1e3;  /* hairline borders                         */
  --grey-300: #c8cacd;  /* dividers / input borders                 */
  --grey-400: #9aa0a6;  /* disabled, icons — NOT for body text      */
  --grey-500: #6b7177;  /* secondary text · AA on both surfaces     */
  --grey-600: #4a4f54;  /* secondary text · AAA when you need it    */
  --grey-900: #151719;  /* your "Black" · primary ink · AAA         */

  /* Red — "Polska Red". With white, this is the whole brand palette (the flag). */
  --red-500: #e02a23;   /* your "Polska Red" · the brand red        */
}


/* -----------------------------------------------------------------------------
   2 · SEMANTIC  —  roles (the only colour tokens components should touch)
   Contrast notes are AA = 4.5:1 (normal text), AAA = 7:1, verified.
   -------------------------------------------------------------------------- */
:root {

  /* Surfaces */
  --color-bg:             var(--grey-50);   /* the page                        */
  --color-surface:        var(--white);     /* cards, panels                   */
  --color-surface-sunken: var(--grey-100);  /* wells, hover rows, code         */

  /* Text */
  --color-text:           var(--grey-900);  /* primary / body          · AAA   */
  --color-text-secondary: var(--grey-500);  /* captions, meta, placeholders · AA */
  --color-text-muted:     var(--grey-400);  /* disabled ONLY — 2.6:1, never live text */
  --color-text-inverse:   var(--white);     /* text on dark or accent fills    */

  /* Borders */
  --color-border:         var(--grey-200);  /* hairlines                       */
  --color-border-strong:  var(--grey-300);  /* dividers, inputs                */

  /* Red & white — the brand. Red is PRIMARY, used boldly (never small accents). */
  --color-red:            var(--red-500);   /* brand red · white text on it = AA */
  --color-on-red:         var(--white);     /* text / icons on a red fill        */

  /* Focus — ink, never red (red on a field reads as an error/validation state) */
  --color-focus:          var(--grey-900);
}


/* -----------------------------------------------------------------------------
   TYPE  —  families · weights · size scale · line-heights · tracking
   These are primitive VALUES. The type ROLES that compose them (and apply them
   to real HTML) live in base.css — tokens.css stays pure values.

   Scale: musical "perfect fourth" (x1.333), base 18px — the sizes ring like a
   chord. Line-heights are snapped to the 4px grid so vertical rhythm stays clean.
   -------------------------------------------------------------------------- */
:root {

  /* Families */
  --font-sans: 'Akkurat LL', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;   /* fallback = the system font */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Weights — Akkurat LL ships Thin/Light/Regular/Bold/Black. There is NO
     Medium and nothing above Black, so two tokens had to be re-pointed when
     the typeface changed (2026-11-13):
       · --weight-medium  → 700. Akkurat has no 500; left alone it would
         resolve DOWN to Regular and flatten H2/H3/Meta/nav/buttons to body
         weight. Mapping it to Bold keeps the hierarchy intact.
       · --weight-extrablack → 900. Black is the heaviest cut, so Display and
         H1 now share a weight and separate by SIZE alone (they differed
         950 vs 900 in the previous typeface).
     The names are kept so every component still reads semantically. */
  --weight-regular:    400;
  --weight-medium:     700;   /* Bold — Akkurat has no Medium */
  --weight-black:      900;
  --weight-extrablack: 900;   /* Black — Akkurat has nothing heavier */

  /* Size scale — perfect fourth, base 18 (each step ≈ x1.333). One deliberate
     exception: H2 is 40, not 43 — his Figma (2026-11-19), where the intro
     statement became the system's H2. Figma variables = this file, 1:1. */
  --size-display: 76px;   /* hero moment — one per view  */
  --size-h1:      57px;
  --size-h2:      40px;   /* his call 2026-11-19 (was 43) */
  --size-h3:      32px;
  --size-lead:    24px;
  --size-body:    18px;   /* base                        */
  --size-meta:    14px;

  /* Line-heights — every value a multiple of 4 */
  --lh-display: 80px;
  --lh-h1:      64px;
  --lh-h2:      56px;   /* his call 2026-11-19 (was 48) */
  --lh-h3:      40px;
  --lh-lead:    32px;
  --lh-body:    28px;
  --lh-meta:    20px;

  /* Letter-spacing — tighten as the type grows */
  --track-tight:  -0.03em;   /* display          */
  --track-snug:   -0.02em;   /* h1 / h2          */
  --track-slight: -0.01em;   /* h3 / lead        */
  --track-normal:  0;        /* body             */
  --track-wide:    0.04em;   /* meta (uppercase) */
}


/* -----------------------------------------------------------------------------
   SPACING  —  one scale, every value a multiple of 4
   Dense at the small end (component padding); decisive jumps at the large end
   (layout & section rhythm). One grid under everything = coherence by default.
   -------------------------------------------------------------------------- */
:root {
  --space-4:     4px;
  --space-8:     8px;
  --space-12:   12px;
  --space-16:   16px;
  --space-24:   24px;
  --space-32:   32px;
  --space-48:   48px;
  --space-64:   64px;
  --space-96:   96px;
  --space-128: 128px;

  /* Semantic rhythm — the spacing decisions the site repeats everywhere */
  --gutter:      var(--space-48);    /* page side inset (desktop)             */
  --section-gap: var(--space-128);   /* vertical space between major sections */
  --stack-gap:   var(--space-24);    /* default gap between stacked elements  */
  --container:   1080px;             /* max content width (nav, sections, footer align to this) */
}


/* -----------------------------------------------------------------------------
   CORNERS — none. Every corner in this system is square (border-radius: 0).
   A deliberate, system-wide choice: architectural, Swiss, confident. There is
   no radius scale and no radius token — "square" is simply the default we never
   override. Borders stay: 1px hairlines via --color-border.
   -------------------------------------------------------------------------- */


/* -----------------------------------------------------------------------------
   RESPONSIVE — on phones the type shifts a few steps DOWN the same scale and the
   gutter tightens. One source, so the whole system (page + components) adapts.
   -------------------------------------------------------------------------- */
@media (max-width: 720px){
  :root{
    --size-display: 43px;  --lh-display: 48px;
    --size-h1:      32px;  --lh-h1:      40px;
    --size-h2:      32px;  --lh-h2:      40px;
    --size-h3:      24px;  --lh-h3:      32px;
    --gutter:       var(--space-24);
  }
}


/* -----------------------------------------------------------------------------
   NEXT: Elevation, Motion — if/when needed.
   -------------------------------------------------------------------------- */
