/*
 * Brevily website v3: the tokens. @tundralibs/ui 0.31, loaded after ui.css
 * and before brevily-site.css or the console's theme. Tokens only: every
 * colour, size and curve the website and the console draw with, in light
 * and dark.
 *
 * Unlayered, so these beat the bundle's `@layer tokens` without
 * `!important`. Both dark blocks carry identical values, with the exact
 * selectors the kit's tokens/default.css uses (data-theme, then
 * data-theme-default, then the system).
 */
/* The faces, cut to what the themes draw (2026-10-29): Latin, width 100%,
   Bricolage 400–800 with its optical sizes, Instrument 400–700, JetBrains
   Mono 400–700. 155 KB for the three, from 271. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* The fallbacks shown while those load, carried over from the live site
   (2026-10-27): a system face sized and spaced to the real one, so the
   text takes the same room before and after the swap. */
@font-face {
  font-family: "Bricolage Grotesque fallback";
  src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 90.2%;
  ascent-override: 93%;
  descent-override: 27%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "JetBrains Mono fallback";
  src: local("Menlo"), local("Courier New"), local("Roboto Mono");
  size-adjust: 99.7%;
  ascent-override: 102%;
  descent-override: 30%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Sans fallback";
  src: local("Arial"), local("Helvetica"), local("Roboto");
  size-adjust: 100.8%;
  ascent-override: 97%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root {
  /* Brand. Teal is the one colour that means something; coral and sun
     stay inside the mark. */
  --color-primary: #15202b;
  --color-primary-strong: #0a1118;
  --color-primary-contrast: #ffffff;
  --color-accent: #0a7369;
  --color-accent-strong: #08625a;
  --color-accent-contrast: #ffffff;
  --color-accent-inverse: #5ed6c6;
  --color-secondary: #52606b;
  --color-secondary-strong: #3b4751;
  --color-secondary-contrast: #ffffff;
  --color-brand-coral: #f0643c;
  --color-brand-sun: #f6b93b;

  --color-success: #177a4a;
  --color-success-contrast: #ffffff;
  --color-warning: #9a6200;
  --color-warning-contrast: #ffffff;
  --color-danger: #c0342b;
  --color-danger-contrast: #ffffff;
  --color-info: #2560b0;
  --color-info-contrast: #ffffff;
  --color-success-soft: #e2f4e9;
  --color-success-soft-text: #115a38;
  --color-warning-soft: #fcf1db;
  --color-warning-soft-text: #6b4400;
  --color-danger-soft: #fce8e5;
  --color-danger-soft-text: #8a241e;
  --color-info-soft: #e6eefb;
  --color-info-soft-text: #1b4787;

  /* The page is white; grey is for insets. */
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #f6f8f7;
  --color-surface-sunken: #eff3f2;
  --color-surface-inverse: #15202b;
  --color-overlay: rgb(21 32 43 / 0.5);
  --color-border-subtle: #edf1f0;
  --color-border: #dfe6e5;
  --color-border-strong: #c6d0cf;
  --color-border-control: #7c8a89;
  --color-text: #15202b;
  --color-text-muted: #4b5863;
  --color-text-subtle: #5c6a74;
  --color-text-inverse: #ffffff;
  --color-disabled: #eef2f1;
  --color-disabled-text: #5c6a74;
  --color-media-scrim: rgb(0 0 0 / 0.6);
  --color-on-media: #ffffff;

  /* The website's own grounds (new in v3).
     wash: the teal-tinted ground of a hero or a closing call.
     dot:  the link grid drawn behind a hero, masked to a soft edge.
     ring: the wide, faint rim round a specimen; an outline, never a shadow.
     band: the one band a page may have: the wash with white cards in light
     (2026-10-30, the owner: "Light theme is supposed to be light"), a deep
     teal ink in dark. */
  --brv-wash: #eef7f5;
  --brv-dot: rgb(10 115 105 / 0.16);
  --brv-ring: rgb(10 115 105 / 0.08);
  --brv-band: var(--brv-wash);
  --brv-band-raised: #ffffff;
  --brv-band-line: #c3d8d3;
  --brv-band-text: #15202b;
  --brv-band-muted: #4b5863;
  --brv-band-accent: #0a7369;
  --brv-band-never: #c0342b;
  --brv-band-never-soft: #fce8e5;
  --brv-after-band: var(--color-surface);
  --brv-never: #c0342b;
  --brv-never-soft: #fce8e5;

  /* Charts: the validated pair, unchanged. */
  --brv-series-1: #0d9488;
  --brv-series-2: #b7791f;
  --apx-series-1: #0d9488;
  --apx-series-2: #b7791f;
  /* Past the validated pair: a slate, then a deep teal, a deep amber and a grey,
     each told apart by lightness as well as hue (3:1 on the surface). */
  --apx-series-3: #5f7480;
  --apx-series-4: #0a5c54;
  --apx-series-5: #8a5a14;
  --apx-series-6: #7c8a89;
  --apx-accent: var(--color-accent);
  --ring-color: var(--color-accent);

  /* Type. Bricolage for display (its optical size axis does the work at
     large sizes), Instrument Sans for reading, JetBrains Mono for links
     and anything copied. */
  --font-family-display: "Bricolage Grotesque", "Bricolage Grotesque fallback", system-ui, sans-serif;
  --font-family-base: "Instrument Sans", "Instrument Sans fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-family-mono: "JetBrains Mono", "JetBrains Mono fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-size-2xs: 0.6875rem;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 3rem;
  --line-height-tight: 1.2;
  --line-height-base: 1.55;
  --line-height-relaxed: 1.7;
  --letter-spacing-tight: -0.015em;
  --letter-spacing-tighter: -0.03em;
  --letter-spacing-caps: 0.08em;
  /* Display steps, fluid from a 360px phone to a 1280px desktop. */
  --brv-display-xl: clamp(2.5rem, 1.6rem + 4vw, 4.375rem);
  --brv-display-lg: clamp(2.125rem, 1.5rem + 2.8vw, 3.5rem);
  --brv-display-md: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  --brv-display-sm: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --brv-weight-display: 680;
  --brv-measure: 36rem;

  /* Space and shape. Radii 4 / 7 / 11 / pill, as the brand has them. */
  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 11px;
  --radius-full: 9999px;
  --brv-radius-xl: 18px;
  --ring-width: 2px;
  --ring-offset: 2px;
  --control-height-sm-base: 30px;
  --control-height-md-base: 38px;
  --control-height-lg-base: 46px;
  --container-max-width: 75rem;
  --layout-max-width: 75rem;
  --brv-gutter: clamp(1rem, 0.4rem + 2.6vw, 2rem);
  /* Owner-reviewed on a 1578 × 849 laptop (2026-10-29): tighter, so the
     home hero and its facts strip share the first screen. */
  --brv-section: clamp(3rem, 2rem + 3.5vw, 5rem);
  --brv-header-h: 64px;
  --scroll-padding-top: calc(var(--brv-header-h) + var(--space-4));

  /* Shadows belong to things that genuinely overlay the page: menus,
     dialogs, toasts. The library's tokens, tinted to ink. */
  --shadow-color: 21 32 43;
  --shadow-sm: 0 1px 2px rgb(21 32 43 / 0.05);
  --shadow-md: 0 1px 2px rgb(21 32 43 / 0.04), 0 6px 16px -4px rgb(21 32 43 / 0.1);
  --shadow-lg: 0 2px 4px rgb(21 32 43 / 0.04), 0 16px 32px -8px rgb(21 32 43 / 0.14);
  --shadow-xl: 0 4px 8px rgb(21 32 43 / 0.05), 0 28px 64px -12px rgb(21 32 43 / 0.22);

  /* Motion: the library's five durations and four curves, tuned a touch
     calmer for a reading site. Reveal steps 70ms apart. */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 520ms;
  --duration-enter: 220ms;
  --duration-exit: 150ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --reveal-step: 70ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme-default="light"]) {
    --color-primary: #eef3f2;
    --color-primary-strong: #ffffff;
    --color-primary-contrast: #0d1418;
    --color-accent: #4fd1c0;
    --color-accent-strong: #7fe0d3;
    --color-accent-contrast: #05231f;
    --color-accent-inverse: #0a7369;
    --color-secondary: #9aa8af;
    --color-secondary-strong: #b9c4c9;
    --color-secondary-contrast: #0d1418;
    --color-brand-coral: #ff8a65;
    --color-brand-sun: #f7c35f;
    --color-success: #4cc387;
    --color-success-contrast: #0d1418;
    --color-warning: #e3ae4c;
    --color-warning-contrast: #0d1418;
    --color-danger: #f27d71;
    --color-danger-contrast: #0d1418;
    --color-info: #6fa8f2;
    --color-info-contrast: #0d1418;
    --color-success-soft: #11301f;
    --color-success-soft-text: #8fdcb0;
    --color-warning-soft: #33270e;
    --color-warning-soft-text: #ebc47e;
    --color-danger-soft: #3a1a17;
    --color-danger-soft-text: #f6aca3;
    --color-info-soft: #142640;
    --color-info-soft-text: #a6c7f5;
    --color-canvas: #0c1216;
    --color-surface: #0f171c;
    --color-surface-alt: #111a20;
    --color-surface-sunken: #16212a;
    --color-surface-inverse: #eef3f2;
    --color-overlay: rgb(0 0 0 / 0.6);
    --color-border-subtle: #16212a;
    --color-border: #22303a;
    --color-border-strong: #33434d;
    --color-border-control: #64747e;
    --color-text: #eef3f2;
    --color-text-muted: #a9b6bc;
    --color-text-subtle: #8e9ba2;
    --color-text-inverse: #0d1418;
    --color-disabled: #18222a;
    --color-disabled-text: #8e9ba2;
    --brv-wash: #0d1f1f;
    --brv-dot: rgb(79 209 192 / 0.14);
    --brv-ring: rgb(79 209 192 / 0.07);
    --brv-band: #0b2420;
    --brv-band-raised: #10302b;
    --brv-band-line: #1d4640;
    --brv-band-text: #eef3f2;
    --brv-band-muted: #a7c2bd;
    --brv-band-accent: #5ed6c6;
    --brv-band-never: #f6aca3;
    --brv-band-never-soft: color-mix(in srgb, #f27d71 18%, transparent);
    --brv-after-band: var(--brv-wash);
    --brv-never: #f27d71;
    --brv-never-soft: #3a1a17;
    --brv-series-1: #17a094;
    --brv-series-2: #bd8730;
    --apx-series-1: #17a094;
    --apx-series-2: #bd8730;
    --apx-series-3: #93a4ad;
    --apx-series-4: #5ed6c6;
    --apx-series-5: #e0b064;
    --apx-series-6: #64747e;
    --shadow-color: 0 0 0;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 16px -4px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 16px 32px -8px rgb(0 0 0 / 0.6);
    --shadow-xl: 0 4px 8px rgb(0 0 0 / 0.35), 0 28px 64px -12px rgb(0 0 0 / 0.7);
  }
}
:root[data-theme="dark"],
:root[data-theme-default="dark"]:not([data-theme="light"]) {
  --color-primary: #eef3f2;
  --color-primary-strong: #ffffff;
  --color-primary-contrast: #0d1418;
  --color-accent: #4fd1c0;
  --color-accent-strong: #7fe0d3;
  --color-accent-contrast: #05231f;
  --color-accent-inverse: #0a7369;
  --color-secondary: #9aa8af;
  --color-secondary-strong: #b9c4c9;
  --color-secondary-contrast: #0d1418;
  --color-brand-coral: #ff8a65;
  --color-brand-sun: #f7c35f;
  --color-success: #4cc387;
  --color-success-contrast: #0d1418;
  --color-warning: #e3ae4c;
  --color-warning-contrast: #0d1418;
  --color-danger: #f27d71;
  --color-danger-contrast: #0d1418;
  --color-info: #6fa8f2;
  --color-info-contrast: #0d1418;
  --color-success-soft: #11301f;
  --color-success-soft-text: #8fdcb0;
  --color-warning-soft: #33270e;
  --color-warning-soft-text: #ebc47e;
  --color-danger-soft: #3a1a17;
  --color-danger-soft-text: #f6aca3;
  --color-info-soft: #142640;
  --color-info-soft-text: #a6c7f5;
  --color-canvas: #0c1216;
  --color-surface: #0f171c;
  --color-surface-alt: #111a20;
  --color-surface-sunken: #16212a;
  --color-surface-inverse: #eef3f2;
  --color-overlay: rgb(0 0 0 / 0.6);
  --color-border-subtle: #16212a;
  --color-border: #22303a;
  --color-border-strong: #33434d;
  --color-border-control: #64747e;
  --color-text: #eef3f2;
  --color-text-muted: #a9b6bc;
  --color-text-subtle: #8e9ba2;
  --color-text-inverse: #0d1418;
  --color-disabled: #18222a;
  --color-disabled-text: #8e9ba2;
  --brv-wash: #0d1f1f;
  --brv-dot: rgb(79 209 192 / 0.14);
  --brv-ring: rgb(79 209 192 / 0.07);
  --brv-band: #0b2420;
  --brv-band-raised: #10302b;
  --brv-band-line: #1d4640;
  --brv-band-text: #eef3f2;
  --brv-band-muted: #a7c2bd;
  --brv-band-accent: #5ed6c6;
  --brv-band-never: #f6aca3;
  --brv-band-never-soft: color-mix(in srgb, #f27d71 18%, transparent);
  --brv-after-band: var(--brv-wash);
  --brv-never: #f27d71;
  --brv-never-soft: #3a1a17;
  --brv-series-1: #17a094;
  --brv-series-2: #bd8730;
  --apx-series-1: #17a094;
  --apx-series-2: #bd8730;
  --apx-series-3: #93a4ad;
  --apx-series-4: #5ed6c6;
  --apx-series-5: #e0b064;
  --apx-series-6: #64747e;
  --shadow-color: 0 0 0;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 16px -4px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 16px 32px -8px rgb(0 0 0 / 0.6);
  --shadow-xl: 0 4px 8px rgb(0 0 0 / 0.35), 0 28px 64px -12px rgb(0 0 0 / 0.7);
}

/* Code in the light theme (2026-10-30): the kit's defaults come from its
   soft-text tokens, all near ink, so a sample reads as one dark colour. Each
   is at least 4.5:1 on the block's ground, and variables stay ink. The kit
   sets these on .code, so they are set there too. Dark keeps the kit's. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme-default="dark"]) .code {
    --code-kw: #0a7369;
    --code-str: #a0480d;
    --code-num: #a3177a;
    --code-com: #5c6a74;
    --code-fn: #7a3fb8;
    --code-type: #7a3fb8;
    --code-attr: #1b5fb8;
    --code-tag: #b42318;
    --code-punct: #5c6a74;
    --code-op: #4b5863;
    --code-quiet: #5c6a74;
  }
}
:root[data-theme="light"] .code,
:root[data-theme-default="light"]:not([data-theme="dark"]) .code {
  --code-kw: #0a7369;
  --code-str: #a0480d;
  --code-num: #a3177a;
  --code-com: #5c6a74;
  --code-fn: #7a3fb8;
  --code-type: #7a3fb8;
  --code-attr: #1b5fb8;
  --code-tag: #b42318;
  --code-punct: #5c6a74;
  --code-op: #4b5863;
  --code-quiet: #5c6a74;
}
