/*
  Design tokens – the only place where colours, type sizes, spacing, radii, shadows and motion are
  defined. Everything else uses these custom properties (docs/DESIGN.md).

  Since 2.12.2026 the accent is ember orange (#ee5a1c, decided by Mehdi: «Glut-Orange, eher dunkel, auf Schwarz»);
  where the notes below say «yellow», read «the accent».
  The palette: off-white, graphite and signal yellow – yellow on near-black, the colours of a print
  bed and a caution label. Deliberately no green as brand or accent colour (it would read as the
  Lian Chinaherb brand); green appears only as the semantic "success" status. The dark theme is the
  same brand turned around: graphite ground, yellow actions.

  Yellow means the same in both themes: what is yellow at night is yellow by day. Filled things (primary
  buttons, chosen boxes, switches, step numbers, bars) are yellow with graphite on them in both. Where
  yellow lines or letters would vanish on the pale ground (1.2:1), the light theme keeps them readable
  without giving up the yellow: icons are graphite on a yellow layer (chrome.css "accent icons"), words
  graphite on a yellow marker stripe, focus rings yellow with a graphite edge.

  Breakpoints (used in media queries, custom properties cannot hold them):
    phone < 640px · tablet 640–1023px · desktop ≥ 1024px · wide ≥ 1440px
*/

/*
  The brand font, served with the site (public/fonts/, SIL Open Font License beside the files): no request
  to another site. One variable file per alphabet covers every weight; the browser loads the second file
  only when a page shows one of its letters (unicode-range).
*/
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../../../public/fonts/albert-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../../../public/fonts/albert-sans-latin-wght-normal.woff2") format("woff2-variations");
  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 {
  /* ---------------------------------------------------------------- brand */
  --brand-graphite: #16161a;
  --brand-graphite-2: #26262b;
  --brand-yellow: #ee5a1c;
  --brand-offwhite: #f7f7f7;

  /* ---------------------------------------------------------------- colour roles (light) */
  --bg: #f7f7f7;                 /* page */
  --surface: #ebebeb;            /* tinted panels, image placeholders, tiles */
  --raised: #ffffff;             /* fields, menus, dialogs, cards that float */
  --ink: #16161a;                /* text */
  --muted: #63646b;              /* secondary text (5.6:1 on --bg) */
  --line: color-mix(in oklab, var(--ink) 11%, transparent);
  --line-strong: color-mix(in oklab, var(--ink) 22%, transparent);

  --accent: #ee5a1c;             /* highlights, badges, the brand band */
  --accent-text: #a03a08;        /* only where a yellow word cannot get its marker (e.g. inside a field) */
  --accent-stroke: #b8450c;      /* the outline of a yellow-filled shape (a star) on light surfaces */
  --accent-ink: #16161a;
  --action: var(--accent);       /* primary buttons, chosen boxes and tiles, switches, steps, bars, focus */
  --action-ink: #16161a;
  /* a filled button under the pointer: the yellow deepens a step here, in dark it lightens a step */
  --action-hover: color-mix(in oklab, var(--accent) 86%, #16161a);
  --action-hover-ink: var(--accent-ink);
  /* the graphite edge a thin yellow ring needs on the pale ground (none on the dark one) */
  --action-edge: color-mix(in oklab, var(--ink) 70%, transparent);
  /* hover, keyboard selection and hint boxes: neutral in both themes, never a yellow tint
     (yellow appears only as a solid accent: lines, layers, badges) */
  --highlight: color-mix(in oklab, var(--ink) 6%, var(--raised));

  --inverse: #16161a;            /* the hero box, toasts */
  --inverse-ink: #f7f7f7;
  --inverse-muted: #a8a9ae;

  --danger: #b42318;
  --danger-soft: color-mix(in oklab, var(--danger) 10%, var(--raised));
  --success: #1e7a46;
  --success-soft: color-mix(in oklab, var(--success) 12%, var(--raised));
  --warn: #8f5300;
  --warn-soft: color-mix(in oklab, #f2a900 18%, var(--raised));
  --info: #285a85;
  --info-soft: color-mix(in oklab, var(--info) 10%, var(--raised));

  /* the keyboard's ring: a gap, the yellow ring, its edge (graphite by day, invisible at night) */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--action), 0 0 0 5px var(--action-edge);

  /* ---------------------------------------------------------------- type */
  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400;
  --tracking-display: -0.025em;
  --tracking-hero: -0.035em;

  --t-label: 13px;
  --t-small: 14px;
  --t-body: 16px;
  --t-lead: 18px;
  --t-card: 18px;
  --t-h3: 22px;
  --t-h2: clamp(30px, 1.72vw + 23.3px, 48px);
  --t-h1: clamp(36px, 2.6vw + 26px, 64px);
  --t-hero: clamp(40px, 3.05vw + 28px, 72px);

  /* ---------------------------------------------------------------- space (4 / 8 scale) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --container: 1280px;
  --gut: 80px;                   /* side gutter: 80 desktop, 48 tablet, 20 phone */
  --gap: 24px;                   /* grid gap */
  --header-h: 78px;              /* room under the 40px header icons for their hover label above the line */
  --section-y: clamp(64px, 8vw, 120px);

  /* ---------------------------------------------------------------- shape */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --r-btn: 10px;
  --control-h: 44px;             /* buttons and fields: the touch target */
  --control-h-sm: 36px;
  --control-h-lg: 52px;

  --shadow-sm: 0 1px 2px rgb(22 22 26 / .06), 0 1px 1px rgb(22 22 26 / .04);
  --shadow-md: 0 6px 16px -6px rgb(22 22 26 / .18), 0 2px 4px rgb(22 22 26 / .05);
  --shadow-lg: 0 24px 48px -16px rgb(22 22 26 / .28), 0 6px 12px -6px rgb(22 22 26 / .08);
  /* the header's lower edge: one crisp line and a short soft shade right under it – nothing wider */
  --shadow-header: 0 1px 0 rgb(22 22 26 / .10), 0 3px 8px -1px rgb(22 22 26 / .08);
  --scrollbar-thumb: color-mix(in oklab, var(--ink) 26%, transparent);

  /* ---------------------------------------------------------------- motion
     --motion-scale is 1; the debug panel sets 5 (slow motion) to inspect every transition. */
  --motion-scale: 1;
  --ease: cubic-bezier(.2, .8, .2, 1);          /* UI: fast start, soft landing */
  --ease-enter: cubic-bezier(.22, 1, .36, 1);   /* things arriving: long soft tail */
  --ease-io: cubic-bezier(.65, 0, .35, 1);      /* things travelling: leaves and lands softly */
  --dur-fast: calc(120ms * var(--motion-scale));
  --dur: calc(180ms * var(--motion-scale));
  --dur-panel: calc(260ms * var(--motion-scale));
  --dur-slow: calc(600ms * var(--motion-scale));

  /* ---------------------------------------------------------------- layers */
  --z-sticky: 30;
  --z-header: 50;
  --z-fab: 45;
  --z-scrollbar: 90;             /* the floating page scrollbar flies over header and content */

  color-scheme: light;
}

/* ---------------------------------------------------------------- dark theme: the brand inverted */
:root[data-theme="dark"] {
  --bg: #121214;
  --surface: #1b1b1f;
  --raised: #232328;
  --ink: #f3f3f1;
  --muted: #a1a2a8;
  --line: color-mix(in oklab, var(--ink) 13%, transparent);
  --line-strong: color-mix(in oklab, var(--ink) 26%, transparent);

  --accent-text: var(--accent);
  --accent-stroke: var(--accent);
  --action: #ee5a1c;
  --action-ink: #16161a;
  --action-hover: color-mix(in oklab, var(--action) 86%, #ffffff);
  --action-hover-ink: var(--action-ink);
  --action-edge: transparent;
  --highlight: #2c2c32;

  --inverse: #0a0a0c;
  --inverse-ink: #f3f3f1;
  --inverse-muted: #a1a2a8;

  --danger: #ff8a7a;
  --success: #6fd39a;
  --warn: #f2c14e;
  --info: #8fc1ec;
  --danger-soft: color-mix(in oklab, var(--danger) 14%, var(--raised));
  --success-soft: color-mix(in oklab, var(--success) 14%, var(--raised));
  --warn-soft: color-mix(in oklab, var(--warn) 16%, var(--raised));
  --info-soft: color-mix(in oklab, var(--info) 14%, var(--raised));

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
  --shadow-md: 0 8px 20px -8px rgb(0 0 0 / .55);
  --shadow-lg: 0 28px 56px -18px rgb(0 0 0 / .7);
  --shadow-header: 0 1px 0 rgb(0 0 0 / .55), 0 3px 8px -1px rgb(0 0 0 / .4);

  color-scheme: dark;
}

@media (max-width: 1023px) {
  :root { --gut: 48px; --t-h3: 20px; }
}

@media (max-width: 639px) {
  :root { --gut: 20px; --gap: 12px; --header-h: 60px; --t-lead: 17px; --t-card: 17px; }
}

@media (min-width: 1024px) {
  :root { --t-lead: 20px; --t-card: 19px; --t-h3: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-scale: 0.001; }
}
