/* ==========================================================================
   tokens.css — design tokens for azamatdesign.com
   Load order: tokens.css → base.css → layout.css

   Breakpoints (mobile-first, min-width). Custom properties cannot be used
   inside @media, so these are the reference values used across the CSS:
     --bp-sm: 40em   (640px)
     --bp-md: 64em   (1024px)
     --bp-lg: 90em   (1440px)
   ========================================================================== */

/* ---- Fonts: self-hosted variable subsets (SIL OFL, licences in /fonts).
   latin-ext carries the Czech letters and only loads when they appear. ---- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  /* ---- Color: warm editorial palette (named by role) ----
     Contrast measured against --color-bg (#F5F3EE). Two palette values fall
     under WCAG AA for small text (#74746D 4.2:1, #92977A 2.7:1), so they are
     kept for large text and non-text details, and text-sized uses get a
     deeper shade of the same hue. */
  --color-bg: #f5f3ee;              /* warm ivory — dominant background */
  --color-surface: #eae7df;         /* soft warm stone — secondary surfaces */
  --color-text: #242521;            /* deep charcoal — 13.9:1 on bg */
  --color-grey: #74746d;            /* palette muted grey — details, ticks */
  --color-text-muted: #66665f;      /* muted grey for body-size copy — 5.2:1 */
  --color-accent: #92977a;          /* muted sage/olive — rules, dots, marks */
  --color-accent-ink: #5f6449;      /* sage as text + focus ring — 5.6:1 */
  --color-accent-tint: rgb(146 151 122 / 0.14); /* faint sage wash */
  --color-border: #dedbd2;          /* subtle warm grey — hairlines */
  --color-border-strong: #242521;   /* emphasis rules */
  --color-accent-hover: var(--color-accent-ink);
  --color-grid-line: rgb(36 37 33 / 0.045);  /* drafting grid in the media panel */
  --color-status: #4e5538;          /* "Open to roles" text + dot — 6.3:1 on status-bg (dark: 7.9:1) */
  --color-status-bg: #e6e8da;       /* soft sage tint behind the status label */
  --color-grade-good-bg: #dfe3c8;   /* pastel olive behind a passing SUS grade */
  --color-grade-bad-bg: #fbd2cc;    /* pastel coral (Migration hero family) behind a failing grade */
  --color-grade-label: #5a5a54;     /* muted label on grade tiles — 5.3:1 olive, 5.0:1 coral */

  /* Case-study hero bands: matched to each hero image's flat background, so
     they stay the same in dark mode (as does the ink set on them). */
  --color-hero-topnatur: #ffd4e0;   /* Topnatur hero-img ground */
  --color-hero-migration: #f9a59e;  /* Migration hero ground (sampled) — ink 8:1 */
  --color-hero-stamp: #e5d8b8;      /* Stamp hero ground (sampled) */
  --color-hero-atlas: #a0aca8;      /* Atlas hero ground (sampled, top centre) — ink 6.6:1 */
  --color-hero-atlas-base: #cbd5d2; /* Atlas hero image, bottom-edge average — intro ground */
  --color-hero-rituals: #cac9e9;    /* Rituals hero image, flat edge colour (sampled) */
  --color-hero-ink: #242521;        /* title on light hero bands — 11:1 on #ffd4e0 */
  --color-hero-ink-muted: rgb(36 37 33 / 0.72); /* subtitle — 5.9:1 on #ffd4e0 */

  /* ---- Spacing: strict 8px scale (token number × 8px) ---- */
  --space-1: 0.5rem;   /*   8px */
  --space-2: 1rem;     /*  16px */
  --space-3: 1.5rem;   /*  24px */
  --space-4: 2rem;     /*  32px */
  --space-5: 2.5rem;   /*  40px */
  --space-6: 3rem;     /*  48px */
  --space-8: 4rem;     /*  64px */
  --space-10: 5rem;    /*  80px */
  --space-12: 6rem;    /*  96px */
  --space-16: 8rem;    /* 128px */

  /* ---- Radii (shape, not spacing) — kept modest ---- */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-md: 8px;   /* preview cards */
  --radius-pill: 999px;

  /* ---- Sizes (component dimensions, not spacing) ---- */
  --size-avatar: 3.5rem; /* 56px hero byline avatar */
  --size-icon-sm: 1rem;  /* 16px inline line icons */
  --size-header: 4.875rem; /* 78px sticky header (one row); js/site.js sets
                              --header-h to the real height when it wraps */

  /* ---- Borders ---- */
  --border-hairline: 1px solid var(--color-border);
  --border-strong: 1px solid var(--color-border-strong);

  /* ---- Typography ----
     Manrope: interface, body, headings, labels and metadata · Geist: hero
     headline, pull quotes. No serif typeface. Loaded from Google Fonts in
     <head>. No webfont monospace (IBM Plex Mono was removed on purpose):
     --font-mono is the system stack, for <code> only, never for labels. */
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  /* Fluid type scale: linear from 320px (20rem) to 1440px (90rem) viewport.
     Body reaches 18px and nav 20px on desktop. */
  --step--2: clamp(0.6875rem, 0.6696rem + 0.0893vw, 0.75rem);   /* 11 → 12px   */
  --step--1: clamp(0.8125rem, 0.7946rem + 0.0893vw, 0.875rem);  /* 13 → 14px   */
  --step-0:  clamp(1.0625rem, 1.0446rem + 0.0893vw, 1.125rem);  /* 17 → 18px   */
  --text-meta: 0.875rem;                                        /* 14px fixed: hero byline (status + location) */
  --step-nav: clamp(1.0625rem, 1.0089rem + 0.2679vw, 1.25rem);  /* 17 → 20px   */
  --step-1:  clamp(1.2rem, 1.1144rem + 0.428vw, 1.4996rem);     /* 19.2 → 24px */
  --step-2:  clamp(1.44rem, 1.2803rem + 0.7986vw, 1.999rem);    /* 23 → 32px   */
  --step-3:  clamp(1.728rem, 1.4604rem + 1.3381vw, 2.6647rem);  /* 27.6 → 42.6px */
  --step-4:  clamp(2.0736rem, 1.6512rem + 2.112vw, 3.552rem);   /* 33.2 → 56.8px */
  --step-5:  clamp(2.4883rem, 1.8465rem + 3.2093vw, 4.7348rem); /* 39.8 → 75.8px */

  --leading-tight: 1.05;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;

  --tracking-display: -0.035em;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.08em;

  /* ---- Motion: smooth but restrained ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 160ms;
  --duration-base: 240ms;

  /* ---- Measure & layout ---- */
  --measure: 62ch;
  --container-max: 117rem; /* 1872px — content runs wide like the reference */
  /* One fluid side gutter shared by header, hero and every section:
     7% of the window width: ~26px on phones, ~100px at 1440, capped at 128px */
  --gutter: clamp(1.5rem, 7vw, 8rem);
}

/* ---- Dark theme ----------------------------------------------------------
   Same roles, warm charcoal ground. Applies when the visitor's system is
   dark (unless they picked light), or when they pick dark with the toggle.
   Contrast on --color-bg #1B1C19: text 14.3:1 · muted 7.2:1 · sage ink 8.7:1 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #1b1c19;
  --color-surface: #25261f;
  --color-text: #ecebe5;
  --color-grey: #8f8f88;
  --color-text-muted: #a9a9a1;
  --color-accent: #92977a;
  --color-accent-ink: #b7bc9e;
  --color-accent-tint: rgb(146 151 122 / 0.2);
  --color-border: #3a3b35;
  --color-border-strong: #ecebe5;
  --color-grid-line: rgb(236 235 229 / 0.05);
  --color-status: #c3c8a8;
  --color-status-bg: #2c2f25;
  --color-grade-good-bg: #30351f;
  --color-grade-bad-bg: #42292a;
  --color-grade-label: #a9a9a1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #1b1c19;
    --color-surface: #25261f;
    --color-text: #ecebe5;
    --color-grey: #8f8f88;
    --color-text-muted: #a9a9a1;
    --color-accent: #92977a;
    --color-accent-ink: #b7bc9e;
    --color-accent-tint: rgb(146 151 122 / 0.2);
    --color-border: #3a3b35;
    --color-border-strong: #ecebe5;
    --color-grid-line: rgb(236 235 229 / 0.05);
    --color-status: #c3c8a8;
    --color-status-bg: #2c2f25;
    --color-grade-good-bg: #30351f;
    --color-grade-bad-bg: #42292a;
    --color-grade-label: #a9a9a1;
  }
}
