/* ============================================================
   tokens.css — design tokens defined in CSS
   ============================================================
   Most tokens live in Bricks (Variables + Color Manager); this
   file holds the tokens the framework keeps in CSS. A client site
   never edits this file: its own values go in site/site-specific.css
   › Site tokens (css-conventions.md §1b). Dark-mode
   colour remaps do NOT belong here — they are generated into
   dark-sections.css.

   Contents
     1. Elevation — dark-context overrides
     2. Gradient tokens
     3. Derived colour tokens (incl. --button-outline-bg-hover, --surface-base-hover)
     4. Text-shadow tokens
     5. Header height
   6. Hover lift — how far a clickable surface rises
   7. Split — gap and the 60-40 columns

   Last updated: 2026-10-12 (auto-stamped by the pre-commit hook)
   ============================================================ */


/* ------------------------------------------------------------
   1. Elevation — dark-context overrides
   ------------------------------------------------------------
   The default elevations use 4–12% black, tuned for light surfaces —
   near-invisible on dark. Boost the opacities ~5× so elevation still
   reads. The --elevation-* scale is overridden here, so the aliases
   (--elevation-card, …) pick it up automatically in any dark context.

   Shadows alone can't carry elevation on dark, though — dark-on-dark
   barely shows. So each level ALSO gets a translucent white overlay
   (--elevation-overlay-*): the higher the surface, the lighter it
   gets, like light falling on the closest layer. In light mode the
   overlays are `none`; components apply them via background-image, so
   one declaration works in both modes.

   The selector is the BARE attribute `[data-brx-theme="dark"]` (not
   `:root[…]`) on purpose: put it on any element and that subtree gets
   the dark elevation / gradient / divider.

   GOTCHA: for the elevation block the bare attribute is NOT enough on
   <html> itself — Bricks' global-variables.css sets the light
   --elevation-* on :root at the SAME specificity and loads later, so
   site-wide dark silently lost. Hence the extra :root[data-brx-theme]
   selector there (subtree opt-in still works via the bare one).
   ------------------------------------------------------------ */

/* Light mode: no overlays. The aliases mirror the Bricks elevation
   aliases (card=1, card-hover/dropdown/sticky-header=3, drawer=4,
   modal=5) — keep the two mappings in sync. */
:root {
    --elevation-overlay-0: none;
    --elevation-overlay-1: none;
    --elevation-overlay-2: none;
    --elevation-overlay-3: none;
    --elevation-overlay-4: none;
    --elevation-overlay-5: none;
    /* Aliases — same mapping as the Bricks elevation aliases. */
    --elevation-overlay-card:          var(--elevation-overlay-1);
    --elevation-overlay-card-hover:    var(--elevation-overlay-3);
    --elevation-overlay-dropdown:      var(--elevation-overlay-3);
    --elevation-overlay-sticky-header: var(--elevation-overlay-3);
    --elevation-overlay-drawer:        var(--elevation-overlay-4);
    --elevation-overlay-modal:         var(--elevation-overlay-5);
}

:root[data-brx-theme="dark"],
[data-brx-theme="dark"],
.section--dark,
.section--dark-neutral {
    --elevation-1: 0 1px 2px  rgb(0 0 0 / 0.30), 0 1px 3px   rgb(0 0 0 / 0.25);
    --elevation-2: 0 2px 4px  rgb(0 0 0 / 0.35), 0 4px 8px   rgb(0 0 0 / 0.30);
    --elevation-3: 0 4px 8px  rgb(0 0 0 / 0.45), 0 8px 16px  rgb(0 0 0 / 0.35);
    --elevation-4: 0 8px 16px rgb(0 0 0 / 0.55), 0 16px 32px rgb(0 0 0 / 0.45);
    --elevation-5: 0 12px 24px rgb(0 0 0 / 0.65), 0 24px 48px rgb(0 0 0 / 0.55);

    /* Surface lightening per level — a gradient so it layers ON TOP of
       the surface colour without replacing it. */
    --elevation-overlay-1: linear-gradient(rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.05));
    --elevation-overlay-2: linear-gradient(rgb(255 255 255 / 0.07), rgb(255 255 255 / 0.07));
    --elevation-overlay-3: linear-gradient(rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.09));
    --elevation-overlay-4: linear-gradient(rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.12));
    --elevation-overlay-5: linear-gradient(rgb(255 255 255 / 0.15), rgb(255 255 255 / 0.15));
}


/* ------------------------------------------------------------
   2. Gradient tokens
   ------------------------------------------------------------
   Gradients can't live in the Bricks Color Manager, so they're CSS
   tokens here, built from the grey primitives. Apply via the
   `.bg-gradient-*` utility or `background-image: var(--gradient-*)`.

   --gradient-neutral: a soft neutral "studio sweep", deliberately
   neutral so it never fights image colours. A deeper value is set for
   dark contexts so it still frames on a dark card.
   ------------------------------------------------------------ */
:root {
    --gradient-neutral: radial-gradient(
        140% 120% at 50% 18%,
        var(--grey-200),
        var(--grey-600) 92%
    );
}

[data-brx-theme="dark"],
.section--dark,
.section--dark-neutral {
    --gradient-neutral: radial-gradient(
        140% 120% at 50% 18%,
        var(--grey-600),
        var(--grey-900) 92%
    );
}


/* ------------------------------------------------------------
   3. Derived colour tokens
   ------------------------------------------------------------
   --border-divider: the section-divider hairline colour. Always a
   tonal shade of the section's OWN surface — darker on light, lighter
   on dark. --divider-shift is the strength knob (bigger = more
   visible). Full rationale: DESIGN-SYSTEM.md §8.1.
   ------------------------------------------------------------ */
:root {
    --divider-shift: 0.2;

    /* Light contexts → a DARKER shade of the surface. */
    --border-divider: oklch(from var(--surface-base) calc(l - var(--divider-shift)) c h);
}

/* --button-outline-bg-hover: the outline button's hover fill — a
   translucent wash that pushes the ground AWAY from the text colour
   (dark text on light surfaces -> white wash; white text on dark ->
   dark wash). Theme Style's outline "Background (hover)" fields point
   at this ONE token; the surface decides its value. Decided 20/21-08:
   family shows in the hovered border, the fill stays surface-neutral. */
:root {
    --button-outline-bg-hover: color-mix(in srgb, var(--overlay-light) 50%, transparent);
}
[data-brx-theme="dark"],
.section--dark,
.section--dark-neutral {
    --button-outline-bg-hover: color-mix(in srgb, var(--overlay-dark) 25%, transparent);
}

/* Each light surface class re-derives from its own surface, so the
   divider tones with the section's actual colour (warm on beige). */
.section--subtle {
    --border-divider: oklch(from var(--surface-subtle) calc(l - var(--divider-shift)) c h);
}
.section--soft {
    --border-divider: oklch(from var(--surface-soft) calc(l - var(--divider-shift)) c h);
}

/* Dark contexts → a LIGHTER shade of the surface. Each derives from
   its own surface token, so the divider always tones with that
   section's actual colour. */
[data-brx-theme="dark"] {
    --border-divider: oklch(from var(--surface-base) calc(l + var(--divider-shift)) c h);
}
.section--dark {
    --border-divider: oklch(from var(--surface-dark) calc(l + var(--divider-shift)) c h);
}
.section--dark-neutral {
    --border-divider: oklch(from var(--surface-dark-neutral) calc(l + var(--divider-shift)) c h);
}

/* Page Dark Mode flips --surface-subtle/--surface-soft to dark values,
   so the per-surface rules above must flip their shift direction too
   (a class sets the property ON the element, beating the inherited
   [data-brx-theme] value — hence these explicit counterparts). */
[data-brx-theme="dark"] .section--subtle {
    --border-divider: oklch(from var(--surface-subtle) calc(l + var(--divider-shift)) c h);
}
[data-brx-theme="dark"] .section--soft {
    --border-divider: oklch(from var(--surface-soft) calc(l + var(--divider-shift)) c h);
}

/* --border-media: the keyline drawn OVER image edges (gallery,
   carousel — applied via `outline` with a negative offset). It is
   translucent, so it blends with the image's own pixels: a soft dark
   line on light images, invisible on dark ones (they contrast with
   the section on their own). Lives here, not the Bricks palette, so
   the whole treatment ships with the CSS file — no Color Manager step. */
:root {
    --border-media: var(--grey-900-t-1);
}

/* Dark contexts flip to a translucent LIGHT line — same effect in
   reverse: visible on dark images, invisible on light ones. */
[data-brx-theme="dark"],
.section--dark,
.section--dark-neutral {
    --border-media: var(--grey-200-t-4);
}

/* --border-panel: the edge of a panel that sits ON a section and has
   its own fill — a card, a team member, a content box. Always a tonal
   shade of the SECTION's surface: hue and chroma stay, only lightness
   moves. Darker on light sections, lighter on dark ones, so the line
   is warm on the beige band and cool on the grey one instead of
   carrying its own blue-grey (Katrine, 25-09-2026).

   Why not --border-subtle: that one is translucent, and a translucent
   border blends with whatever is painted UNDER it. On a panel with its
   own fill that is the panel, never the section, so the same grey came
   out on every surface. --border-subtle stays for elements WITHOUT a
   fill of their own (.chip--outline, the .border-subtle utility), where the
   transparency does real work.

   --panel-shift is the strength knob. It is deliberately well below
   --divider-shift: a panel's edge must stay quieter than the seam
   between two sections. */
:root {
    --panel-shift: 0.07;

    /* Light contexts → a DARKER shade of the section's surface. */
    --border-panel: oklch(from var(--surface-base) calc(l - var(--panel-shift)) c h);
}

/* Each light surface class re-derives from its own surface. */
.section--subtle {
    --border-panel: oklch(from var(--surface-subtle) calc(l - var(--panel-shift)) c h);
}
.section--soft {
    --border-panel: oklch(from var(--surface-soft) calc(l - var(--panel-shift)) c h);
}

/* Dark contexts → a LIGHTER shade, same as the divider does. */
[data-brx-theme="dark"] {
    --border-panel: oklch(from var(--surface-base) calc(l + var(--panel-shift)) c h);
}
.section--dark {
    --border-panel: oklch(from var(--surface-dark) calc(l + var(--panel-shift)) c h);
}
.section--dark-neutral {
    --border-panel: oklch(from var(--surface-dark-neutral) calc(l + var(--panel-shift)) c h);
}

/* Page Dark Mode flips --surface-subtle/--surface-soft to dark values,
   so these two must flip their shift direction too — same reason as
   the divider's counterparts above. */
[data-brx-theme="dark"] .section--subtle {
    --border-panel: oklch(from var(--surface-subtle) calc(l + var(--panel-shift)) c h);
}
[data-brx-theme="dark"] .section--soft {
    --border-panel: oklch(from var(--surface-soft) calc(l + var(--panel-shift)) c h);
}

/* --surface-base-hover: a hover/fill highlight INSIDE a panel that is
   already on --surface-base (the dropdown row fill on today's
   --surface-base panel). Always a tonal shade of --surface-base
   itself, not of the section — a dropdown panel's own background is
   --surface-base unconditionally, regardless of what section it opens
   over (dropdown.css §1). Darker in light mode (the house "grey hover
   on white" look); lighter in dark mode, so hover still reads as
   "closer to the light" now that --surface-base is the LIGHTER of the
   two surface roles in dark mode too (row 122, 29-09-2026). */
:root {
    --hover-shift: 0.05;
    --surface-base-hover: oklch(from var(--surface-base) calc(l - var(--hover-shift)) c h);
}
[data-brx-theme="dark"] {
    --surface-base-hover: oklch(from var(--surface-base) calc(l + var(--hover-shift)) c h);
}


/* ------------------------------------------------------------
   4. Text-shadow tokens
   ------------------------------------------------------------
   --text-shadow-on-dark: a soft legibility shadow for light text
   on a dark surface or photo (the hero heading, headings inside a
   .section--dark). A composite value, so it can't be a Bricks
   colour — it lives here. Built on --shadow-color (black, space-
   separated) like the elevation tokens. Constant across modes: it's
   only ever used where the text already sits on dark.
   ------------------------------------------------------------ */
:root {
    --text-shadow-on-dark: 0 2px 8px rgb(var(--shadow-color) / 0.5);
}


/* ------------------------------------------------------------
   5. Header height
   ------------------------------------------------------------
   The bar's height as a token, for every rule that must know it:
   the scroll padding under the sticky header (layout.css §8) and the
   "header on top of the photo" hero state (navigation.css §1,
   hero.css §10). It lives here, beside the other CSS-only tokens.

   The sum of the header section's two --space-s paddings and the
   logo's height — both Bricks variables (Variable Manager: 03-Spacing
   and 05-Layout). The Logo element's Height field on both header
   logos says var(--logo-height), so the logo's size is set in ONE
   place, and this token follows it by itself. Nothing to keep in
   sync here.
   ------------------------------------------------------------ */
:root {
    --header-height: calc(2 * var(--space-s) + var(--logo-height));

    /* Revealed by scrolling up, the bar is slimmer (navigation.css §1;
       Katrine's choice B, 15-09-2026): logo 3rem, padding --space-xs.
       min() keeps the logo from ever growing past its resting size on a
       narrow screen. Defined HERE, on :root, so var(--logo-height) still
       means the resting value — on the header it is already overridden. */
    --logo-height-revealed: min(3rem, var(--logo-height));
    --header-height-revealed: calc(2 * var(--space-xs) + var(--logo-height-revealed));
}


/* ------------------------------------------------------------
   6. Hover lift — how far a clickable surface rises
   ------------------------------------------------------------
   Cards and gallery figures move up by this much on hover and
   keyboard focus, together with their deeper shadow: closer to you,
   bigger shadow — one story. Half a --space-2xs, chosen on a trial
   page (Katrine, 19-09-2026). Motion only: `transform`, never a
   margin, so nothing around it moves.
   ------------------------------------------------------------ */
:root {
    --lift-hover: calc(var(--space-2xs) / 2);
}


/* ------------------------------------------------------------
   7. Split — gap and the 60-40 columns
   ------------------------------------------------------------
   Shared by .split--* (layout.css §5) and .testimonial, so the gutter
   and the column edge line up down the page. --space-xl, chosen on a
   trial page (Katrine, 01-10-2026): with a divider the space is this
   much on EACH side of the line.
   ------------------------------------------------------------ */
:root {
    --split-gap: var(--space-xl);
    --split-60-40: minmax(0, 3fr) minmax(0, 2fr);
}
