/*
 * theme.css: the look's tokens with the base's values, the light scheme's. kit.css reads only these custom properties.
 * The brand file (content/brand.json: the scheme, the palette's five roles, the font pair, the radius, the buttons)
 * sets them over these values on every page (brand_tokens(): the roles and every colour derived from them, under these
 * names), so an edit here loses to it: the brand's values go into the brand file, any other value of the Site's own is
 * a :root rule in site.css, which wins over all of them.
 * zendor-base: neutral. Greys with black as the main colour (every link, mark, button and the dark bands) and no accent
 * colour; one font family, Inter, one variable file (weights 300 to 900, served by the Site:
 * templates/partials/fonts.php); concentric corners from one R, --radius (cards and photos 20 px, fields 10 px), and
 * the capsule, --capsule (buttons, badges and the header as pills). Text keeps ≥ 4.5:1 contrast on every tone (the
 * pairs are in kit.css's tone blocks).
 */

@layer tokens {
  :root {
    /* Primitives: the greys (oklch, no hue) and the paper */
    --gray-50: oklch(0.985 0 0);
    --gray-100: oklch(0.97 0 0);
    --gray-200: oklch(0.922 0 0);
    --gray-300: oklch(0.87 0 0);
    --gray-400: oklch(0.708 0 0);
    --gray-500: oklch(0.556 0 0);
    --gray-600: oklch(0.49 0 0);
    --gray-700: oklch(0.371 0 0);
    --gray-800: oklch(0.269 0 0);
    --gray-900: oklch(0.205 0 0);
    --gray-950: oklch(0.145 0 0);

    /* The palette's five roles (the brand file's colors): the paper (the ground), the text, the surface (cards, a
       field's list), the main colour and the accent; and what each tone draws from them (kit.css's tone blocks). */
    --paper: oklch(1 0 0);
    --text: var(--gray-950);
    --surface: var(--gray-50);
    /* the ground's second surface (a hover, a chip) and its muted text: 4.5:1 on the paper and both surfaces */
    --surface-2: var(--gray-100);
    --text-muted: var(--gray-600);
    /* the contrasting band (tone-dark): its ground, two surfaces, its text and muted text, its mark (--brand-bright),
       the label on that mark and the accent's mark (no accent colour in the neutral look: the band's mark) */
    --band: var(--gray-900);
    --band-surface: var(--gray-800);
    --band-surface-2: var(--gray-700);
    --band-text: var(--gray-50);
    --band-text-muted: var(--gray-300);
    --band-on-mark: var(--gray-950);
    --band-accent: var(--brand-bright);
    /* the brand band (tone-brand): the main colour as a ground, its surfaces, the text on it (also a button's label on
       the main colour), its muted text and the accent's mark (the text on it in the neutral look) */
    --brand-surface: var(--gray-900);
    --brand-surface-2: var(--gray-800);
    --on-brand: white;
    --on-brand-muted: var(--gray-300);
    --brand-accent: var(--on-brand);
    /* each tone's flips by its own ground (light or dark): the browser's controls, the Zendor „z” inverted (1) or as
       drawn (0), the error's red: the ground light, the band and the brand band dark */
    --paper-scheme: light;
    --paper-logo-invert: 1;
    --paper-danger: var(--danger);
    --band-scheme: dark;
    --band-logo-invert: 0;
    --band-danger: var(--error-on-dark);
    --brand-scheme: dark;
    --brand-logo-invert: 0;
    --brand-danger: var(--error-on-dark);

    /* Type: one family, Inter, one variable file of every weight from 300 to 900: 400 for text, 600 for headlines,
       labels and buttons here, any of the range for a Site's own. Its optical size follows the size
       (font-optical-sizing), so a headline draws Inter's display design. Only code falls back to the system's monospace. */
    --font-display: "Inter", "Inter Fallback", system-ui, sans-serif;
    --font-text: "Inter", "Inter Fallback", system-ui, sans-serif;
    --font-label: var(--font-text);
    --font-code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --heading-stretch: 100%;
    --heading-weight: 600;
    /* A headline's shape at h2's size: its tracking and its leading. Every headline reads them (kit.css, site.css, the
       components): a larger line tracks tighter (a multiple of the tracking) and leads less (the leading minus a step). */
    --heading-tracking: -0.025em;
    --heading-leading: 1.2;
    --text-stretch: 100%;

    /* Shape (komponensvalaszto 09, concentric corners): two knobs, the brand file's. R, --radius, is a card's corner
       (its `radius`, 0 to 1.5 rem); --capsule is its `buttons`: 999px for pill buttons, badges and trays at any R
       (the default), 0px for corners that follow R. R = 0 squares every corner but the capsule's: all square takes
       radius 0 and buttons radius. Every other corner is a level of them, never a number:
       an inner corner is concentric with its box's, R − the border − the gap between them, and never under a floor
       (R × 0.5, or R × 0.25 for a small one), so a gap wider than R keeps a corner of its own.
         --radius-card        R: a card, a panel, a dropdown, a select's list
         --radius-media       R: a photo on its own
         --radius-card-inner  a box, a field or a photo inside a card's padding: --inset-card, .card's and
                              .card-quiet's; a wider one (.card-feature's --space-l) is past R too, so the floor holds
         --radius-card-rim    a photo framed in a card's thin rim, a dropdown's row (--inset-rim)
         --radius-media-flush a photo running to a card's edge
         --radius-field       R × 0.5: a field, a choice, a notice, an icon's box
         --radius-control     a button: a pill, or R × 0.5
         --radius-badge       a chip, a status, a tag, a count: a pill, or R × 0.25
         --radius-tray        a bar of controls (the header's pill, a segmented control): a pill, or R × 0.5
         --radius-tray-inner  a control in a tray (--inset-rim): a pill in a pill, or concentric with the tray's
       The gaps: --border-w, --inset-card (a card's padding, kit.css's --space-m) and --inset-rim. */
    --radius: 1.25rem;
    --capsule: 999px;
    --border-w: 1px;
    --inset-card: var(--space-m);
    --inset-rim: 0.375rem;
    --radius-card: var(--radius);
    --radius-media: var(--radius);
    --radius-card-inner: max(calc(var(--radius) * 0.5), calc(var(--radius) - var(--border-w) - var(--inset-card)));
    --radius-card-rim: max(calc(var(--radius) * 0.25), calc(var(--radius) - var(--border-w) - var(--inset-rim)));
    --radius-media-flush: max(0px, calc(var(--radius) - var(--border-w)));
    --radius-field: calc(var(--radius) * 0.5);
    --radius-control: max(calc(var(--radius) * 0.5), var(--capsule));
    --radius-badge: max(calc(var(--radius) * 0.25), var(--capsule));
    --radius-tray: max(calc(var(--radius) * 0.5), var(--capsule));
    --radius-tray-inner: max(calc(var(--radius) * 0.25), calc(var(--radius-tray) - var(--border-w) - var(--inset-rim)));

    /* The role tokens (creative-sites-2 01): what kit.css's type, sections, cards and buttons read, so one value of the
       Site's (its site.css brand block repeats them) reaches every page. Each type role has a size, a weight, a
       tracking and a leading. The scale: from 360 to 1440 px each level is 1.25 to 1.32 × the one under it (body, lead,
       h3, h2, h1); the display, a hero's one line, is 1.25 × the h1 on a phone and 104 px on a desktop. */
    --type-display-size: clamp(3.0518rem, 1.9024rem + 5.1084vw, 6.5rem);
    --type-display-weight: var(--heading-weight);
    --type-display-tracking: calc(var(--heading-tracking) * 1.6);
    --type-display-leading: calc(var(--heading-leading) - 0.15);
    --type-h1-size: clamp(2.4414rem, 2.2431rem + 0.8812vw, 3.0362rem);
    --type-h1-weight: var(--heading-weight);
    --type-h1-tracking: calc(var(--heading-tracking) * 1.4);
    --type-h1-leading: calc(var(--heading-leading) - 0.1);
    --type-h2-size: clamp(1.9531rem, 1.8375rem + 0.5139vw, 2.3rem);
    --type-h2-weight: var(--heading-weight);
    --type-h2-tracking: var(--heading-tracking);
    --type-h2-leading: var(--heading-leading);
    --type-h3-size: clamp(1.5625rem, 1.5025rem + 0.2665vw, 1.7424rem);
    --type-h3-weight: var(--heading-weight);
    --type-h3-tracking: var(--heading-tracking);
    --type-h3-leading: calc(var(--heading-leading) + 0.13);
    --type-lead-size: clamp(1.25rem, 1.2267rem + 0.1037vw, 1.32rem);
    --type-lead-weight: 400;
    --type-lead-tracking: 0em;
    --type-lead-leading: 1.5;
    --type-body-size: 1rem;
    --type-body-weight: 400;
    --type-body-tracking: 0em;
    --type-body-leading: 1.5;
    /* a label: an eyebrow, a field's label, a table's head (shadcn's text-sm font-medium) */
    --type-label-size: 0.875rem;
    --type-label-weight: 500;
    --type-label-tracking: 0em;
    --type-label-leading: 1.43;
    /* Above and below a section, and between a section's head and what it heads (kit.css's --space-* steps) */
    --section-space: var(--space-2xl);
    --section-gap: var(--space-xl);
    /* The accent's one job: the main action (the contact button), its label and its hover */
    --action: var(--accent);
    --on-action: var(--on-accent);
    --action-hover: var(--accent-hover);

    /* The main colour in its roles: black on the light ground (--brand, --accent: links, marks, the contact action, its
       label --on-accent), white on the band (--brand-bright), a step toward the text for small marks on a tint
       (--brand-deep) */
    --brand: var(--gray-950);
    --brand-bright: var(--gray-50);
    --brand-deep: var(--gray-800);
    --accent: var(--gray-950);
    --on-accent: white;

    /* Shader hero (hero.js reads these): the ground at the top and at the foot, a line, and a line where the moving
       light band crosses it. The band's line stays light enough that the hero's muted text keeps 4.5:1 over it. */
    --shader-0: var(--gray-50);
    --shader-1: var(--paper);
    --shader-2: oklch(0.85 0 0);
    --shader-3: oklch(0.78 0 0);
    /* the muted text over the line waves: 4.5:1 over --shader-3 */
    --shader-text-muted: var(--gray-700);
  }
}

@layer tokens {
  /* The kit's fixed colours, shadows and widths: every colour kit.css and site.css use outside the tones (the nav,
     the menu, the dropdowns, the lightbox, the footer, the heroes, states), as tokens, so a new theme rewrites them
     here (tools/lint-css.mjs refuses a colour written anywhere else). */
  :root {
    /* the dark grounds over photos (a photo's caption tag, the lightbox, scrims), the same in both schemes: their ink and
       the text on it */
    --ink: var(--gray-950);
    --ink-2: var(--gray-900);
    --ink-3: var(--gray-800);
    --ink-4: var(--gray-700);
    --on-ink: white;
    --on-ink-1: var(--gray-50);
    --on-ink-faint: var(--gray-400);
    --on-ink-low: var(--gray-600);
    --on-ink-muted: var(--gray-300);
    --on-ink-soft: var(--gray-200);
    /* the contact action under the pointer */
    --accent-hover: var(--gray-800);
    /* the closed chip's dot */
    --status-closed-glow: color-mix(in oklch, var(--gray-400) 30%, transparent);
    /* the open chip's dot: a state, so it keeps its green */
    --status-open: oklch(0.72 0.17 150);
    --status-open-glow: oklch(0.72 0.17 150 / 0.25);
    /* veils: white washes on a dark ground (the lightbox, the photo strips' buttons) */
    --veil-10: color-mix(in oklch, white 10%, transparent);
    --veil-16: color-mix(in oklch, white 16%, transparent);
    --veil-45: color-mix(in oklch, white 45%, transparent);
    /* the chrome (the nav, its dropdowns, the phone menu): glass of the paper over the page, opaque enough that its muted
       text keeps 4.5:1 over the brand band */
    --nav-bg: color-mix(in oklch, var(--paper) 90%, transparent);
    --nav-scrolled-bg: color-mix(in oklch, var(--paper) 94%, transparent);
    --dropdown-bg: color-mix(in oklch, var(--paper) 94%, transparent);
    --menu-bg: color-mix(in oklch, var(--paper) 94%, transparent);
    /* shadows (neutral, soft, layered) */
    --shadow-brand: 0 1px 2px oklch(0 0 0 / 0.06), 0 16px 40px -16px oklch(0 0 0 / 0.25);
    --shadow-card: 0 1px 2px oklch(0 0 0 / 0.05), 0 12px 32px -12px oklch(0 0 0 / 0.14);
    /* a field's resting shadow (shadcn's shadow-xs) */
    --shadow-field: 0 1px 2px 0 oklch(0 0 0 / 0.05);
    --shadow-cover: 0 30px 60px -30px oklch(0 0 0 / 0.45);
    --shadow-flag: 0 0 0 1px color-mix(in oklch, var(--gray-950) 12%, transparent);
    --shadow-lift: 0 10px 30px -18px oklch(0 0 0 / 0.25);
    --shadow-nav: 0 1px 2px oklch(0 0 0 / 0.04), 0 8px 24px -12px oklch(0 0 0 / 0.16);
    --shadow-panel: 0 1px 2px oklch(0 0 0 / 0.05), 0 20px 44px -18px oklch(0 0 0 / 0.22);
    --shadow-photo: 0 1px 2px oklch(0 0 0 / 0.05), 0 24px 56px -28px oklch(0 0 0 / 0.3);
    --shadow-photo-tilted: 0 24px 48px -24px oklch(0 0 0 / 0.35);
    /* a field's error and the error notice: red, a state (5.7:1 on the paper, 5.2:1 on gray-100) */
    --danger: oklch(0.52 0.19 27);
    /* a field's error on a dark ground (the dark scheme's, the band's) */
    --error-on-dark: oklch(0.75 0.15 27);
    /* a success notice */
    --success-line: oklch(0.6 0.15 150);
    /* the lightbox */
    --lightbox-button-bg: color-mix(in oklch, var(--gray-900) 82%, transparent);
    /* a mask's opaque end (mask-image) */
    --mask: black;
    /* shades: black washes over a photo (the blog's cover) */
    --shade-35: color-mix(in oklch, black 35%, transparent);
    --shade-55: color-mix(in oklch, black 55%, transparent);
    /* the post cover's text scrim */
    --cover-scrim: oklch(0.13 0 0 / 0.6);
    --cover-scrim-strong: oklch(0.13 0 0 / 0.92);
    /* the admin's states: a message's hue says new, in progress or done (admin.css mixes it into the tone's ground and
       text, so it reads on either scheme) */
    --state-done: oklch(0.6 0.12 150);
    --state-new: oklch(0.6 0.13 250);
    --state-progress: oklch(0.7 0.13 75);
    /* the manifesto's glow (none in the neutral look) */
    --glow-25: transparent;
  }
}
