/* ==========================================================================
   Syncx (syncxfiles.com) - design system "Felt & Saffron"
   --------------------------------------------------------------------------
   Static stack, same as the sibling sites: plain HTML pages + this single
   stylesheet + an inline <script> per page. No build step, no frameworks.

   Deliberate deviation from the taste-skill default stack (React/Next,
   Tailwind v4, Motion): every page here is build-free static HTML, so the
   rules of that skill are applied with native CSS instead - custom
   properties for tokens, CSS Grid for layout, <details name> for the
   accordion, CSS transitions/keyframes for motion, IntersectionObserver or
   nothing for scroll effects (never a scroll listener).

   Palette   felt grey + indigo ink + saffron (the sun in the roof crown).
   Type      Archivo (variable: weight 100-900, width 62-125%). Wide cut
             (font-stretch 112-125%) for display, normal width for text.
             Martian Mono only inside code.
   Icons     Phosphor (regular), self-hosted sprite: assets/icons/sprite.svg
   Radii     --r-ctl 10px  buttons, inputs, selects, segmented items, tags
             --r-box 18px  panels, cards, code blocks, tables, toasts, media
             --r-frame 28px  large framed photographs (hero, CTA band, 404)
             6px  text-level chips only (inline code, method badges, kbd)
             50%  avatars, logo mark, icon discs
   Z-index   nav 50, mobile menu 60, toast 80, skip link 100
   Themes    light and dark through prefers-color-scheme, same tokens.
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2-variations"),
       url("assets/fonts/archivo-latin.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: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("assets/fonts/archivo-latin-ext.woff2") format("woff2-variations"),
       url("assets/fonts/archivo-latin-ext.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: "Archivo";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/archivo-latin-italic.woff2") format("woff2-variations"),
       url("assets/fonts/archivo-latin-italic.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: "Martian Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  src: url("assets/fonts/martian-mono-latin.woff2") format("woff2-variations"),
       url("assets/fonts/martian-mono-latin.woff2") format("woff2");
}

/* ---------- 2. Tokens ---------- */
:root {
  color-scheme: light dark;

  --font-sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  /* Light: felt by day */
  --bg: #E4E5E0;              /* undyed felt */
  --surface: #F2F3EF;         /* raised: inputs, panels, cards */
  --surface-sunk: #D9DBD5;    /* quiet fills, table heads, tracks */
  --code-bg: #EBECE7;
  --line: #C5C8C1;            /* hairlines between content */
  --line-strong: #787E89;     /* input borders, ghost buttons (3:1+) */
  --ink: #1A1F33;             /* indigo ink: headings, primary text */
  --ink-2: #474E61;           /* body copy */
  --ink-3: #575E70;           /* captions, hints, meta (4.5:1+) */
  --accent: #E9A80F;          /* saffron */
  --accent-hover: #D99700;
  --accent-ink: #1A1F33;      /* text on saffron */
  --accent-text: #835600;     /* saffron family readable as text on light */
  --accent-tint: color-mix(in srgb, #E9A80F 20%, #F2F3EF);   /* featured surfaces (light: pale saffron) */
  --featured-wash: color-mix(in srgb, #E9A80F 10%, transparent);  /* featured table column */
  --seg-on: #F2F3EF;          /* pressed segment */
  --seg-ring: #6E7482;        /* pressed segment outline, 3:1+ against the track */
  --featured-head: color-mix(in srgb, #E9A80F 16%, #D9DBD5);  /* opaque head of the featured column */
  --danger: #A6261C;
  --danger-tint: color-mix(in srgb, #A6261C 9%, #F2F3EF);
  --ok: #22663B;
  --ok-tint: color-mix(in srgb, #22663B 10%, #F2F3EF);
  --focus: #1A1F33;
  --nav-bg: color-mix(in srgb, #E4E5E0 86%, transparent);
  --shadow-sm: 0 1px 2px rgb(26 31 51 / .10);
  --shadow: 0 1px 0 rgb(26 31 51 / .04), 0 18px 40px -18px rgb(26 31 51 / .28);
  --selection: color-mix(in srgb, #E9A80F 45%, transparent);
  --felt-opacity: .16;
  --felt-blend: multiply;

  /* Syntax (code) */
  --syn-key: #2E3A8C;
  --syn-str: #835600;
  --syn-num: #3E4BA6;
  --syn-com: #5E6577;
  --syn-cmd: #1A1F33;
  --syn-flag: #474E61;
  --syn-punc: #575E70;

  /* Shape, space, motion */
  --r-ctl: 10px;
  --r-box: 18px;
  --r-frame: 28px;
  --r-chip: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --frame-gutter: clamp(10px, 1.4vw, 20px);
  --maxw: 1240px;
  --nav-h: 68px;
  --section-y: clamp(64px, 7.5vw, 104px);
  --measure: 32rem;           /* long text: at most about 76 characters of Archivo per line (rem, not ch: Archivo's zero is wider than its average letter) */
  --measure-table: 42rem;     /* tables inside long text: the wide column still stays under about 80 characters */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --z-nav: 50;
  --z-menu: 60;
  --z-toast: 80;
  --z-skip: 100;

  /* Type scale */
  --fs-display: clamp(2.5rem, 1.35rem + 3.6vw, 4.5rem);
  --fs-h1: clamp(2.25rem, 1.55rem + 2.6vw, 3.75rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 1.7vw, 2.75rem);
  --fs-h3: 1.25rem;
  --fs-lede: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-xs: .8125rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: felt by night (indigo sky, not neutral black) */
    --bg: #131826;
    --surface: #1B2131;
    --surface-sunk: #171C2A;
    --code-bg: #0F1320;
    --line: #2A3142;
    --line-strong: #6B7385;
    --ink: #ECECE6;
    --ink-2: #B3B8C5;
    --ink-3: #9AA1B1;
    --accent: #F2B42A;
    --accent-hover: #F7C552;
    --accent-ink: #131826;
    --accent-text: #F2B42A;
    /* Saffron mixed into indigo turns khaki, so featured surfaces at night are a lighter
       indigo; the saffron comes from their outline instead. */
    --accent-tint: #222A3D;
    --featured-wash: rgb(236 236 230 / .035);
    --seg-on: #2A3142;
    --seg-ring: #6B7385;
    --featured-head: #222A3D;
    --danger: #F2846F;
    --danger-tint: color-mix(in srgb, #F2846F 12%, #1B2131);
    --ok: #6CCB8C;
    --ok-tint: color-mix(in srgb, #6CCB8C 12%, #1B2131);
    --focus: #F2B42A;
    --nav-bg: color-mix(in srgb, #131826 84%, transparent);
    --shadow-sm: 0 1px 2px rgb(4 6 14 / .5);
    --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 22px 48px -20px rgb(4 6 14 / .7);
    --selection: color-mix(in srgb, #F2B42A 38%, transparent);
    --felt-opacity: .1;
    --felt-blend: soft-light;

    --syn-key: #A9B8F2;
    --syn-str: #F2C462;
    --syn-num: #C3CDF7;
    --syn-com: #8E95A6;
    --syn-cmd: #ECECE6;
    --syn-flag: #B3B8C5;
    --syn-punc: #9AA1B1;
  }
}

/* Fixed colour sets for text that sits on photographs.
   .on-photo-light / .on-photo-dark: the photo does not change with the theme, so neither does its text.
   .on-photo-auto: the photo has a day and a dusk version (hero, 404), so the text follows the theme. */
.on-photo-light,
.on-photo-auto {
  --ink: #1A1F33;
  --ink-2: #2A3145;
  --ink-3: #3B4256;
  --line-strong: #1A1F33;
  --accent: #E9A80F;
  --accent-hover: #D99700;
  --accent-ink: #1A1F33;
  --focus: #1A1F33;
  color: var(--ink);
}
.on-photo-dark {
  --ink: #F1F1EC;
  --ink-2: #D6D9E1;
  --ink-3: #C3C7D2;
  --line-strong: #F1F1EC;
  --accent: #F2B42A;
  --accent-hover: #F7C552;
  --accent-ink: #131826;
  --focus: #F2B42A;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .on-photo-auto {
    --ink: #F1F1EC;
    --ink-2: #D6D9E1;
    --ink-3: #C3C7D2;
    --line-strong: #F1F1EC;
    --accent: #F2B42A;
    --accent-hover: #F7C552;
    --accent-ink: #131826;
    --focus: #F2B42A;
  }
}

/* ---------- 3. Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The one anchor offset for the whole site: a target lands just under the sticky header.
     Elements add a scroll-margin only for extra sticky bars (the API section strip). */
  scroll-padding-top: calc(var(--nav-h) + 20px);
}
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.6;
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; display: block; }
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(ul[class], ol[class]) { list-style: none; padding: 0; }
p, li, dd, figcaption { text-wrap: pretty; }
h1, h2, h3, h4, h5 { color: var(--ink); font-weight: 600; text-wrap: balance; }
[hidden] { display: none !important; }
::selection { background: var(--selection); color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }
address { font-style: normal; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; }
strong, b { font-weight: 650; color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 4. Typography ---------- */
h1, .h1 {
  font-size: var(--fs-h1);
  font-stretch: 122%;
  font-weight: 640;
  line-height: 1.04;
  letter-spacing: -.025em;
}
h2, .h2 {
  font-size: var(--fs-h2);
  font-stretch: 116%;
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -.02em;
}
h3, .h3 {
  font-size: var(--fs-h3);
  font-stretch: 106%;
  font-weight: 620;
  line-height: 1.25;
  letter-spacing: -.01em;
}
h4, .h4 { font-size: 1.0625rem; font-weight: 620; line-height: 1.35; }
.display {
  font-size: var(--fs-display);
  font-stretch: 125%;
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -.03em;
}
.lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 52ch;
}
.small, small { font-size: var(--fs-small); }
.xs { font-size: var(--fs-xs); }
.muted { color: var(--ink-3); }
.ink { color: var(--ink); }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }

a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: .22em; }
.link,
.prose a,
.lede a {
  color: var(--ink);
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .24em;
  transition: text-decoration-color .2s, color .2s;
}
.link:hover,
.prose a:hover,
.lede a:hover { text-decoration-color: currentColor; }
.link--icon { display: inline-flex; align-items: center; gap: .4em; }
.link--quiet { color: var(--ink-2); font-weight: 500; text-decoration-color: var(--line-strong); }

code, kbd, samp, pre { font-family: var(--font-mono); font-stretch: 87.5%; }
:not(pre) > code {
  font-size: .82em;
  padding: .08em .28em;
  border-radius: var(--r-chip);
  /* a wash of the text colour stays visible on any surface, sunk panels included */
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
  overflow-wrap: anywhere;
}
@media (prefers-color-scheme: dark) {
  :not(pre) > code { background: color-mix(in srgb, var(--ink) 10%, transparent); }
}
kbd {
  font-size: .8em;
  padding: .1em .45em;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--ink);
}

/* ---------- 5. Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(880px + 2 * var(--gutter)); }
.container--text { max-width: calc(720px + 2 * var(--gutter)); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section + .section { padding-top: calc(var(--section-y) * .55); }
.section-head { display: grid; gap: 1rem; margin-bottom: clamp(32px, 4vw, 56px); max-width: 46rem; }
.section-head .lede { max-width: 56ch; }
.stack > * + * { margin-top: var(--flow, 1rem); }
.stack--sm { --flow: .5rem; }
.stack--lg { --flow: 1.75rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.grid-2 { display: grid; gap: 2rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; } }

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: var(--z-skip);
  padding: .6rem 1rem;
  border-radius: var(--r-ctl);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 10px; }

/* ---------- 6. Icons and brand ---------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.5rem; height: 1.5rem; }
.icon--xl { width: 2rem; height: 2rem; }
.icon-disc {
  display: inline-grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--surface-sunk);
  color: var(--ink);
  flex: none;
}
.icon-disc--accent { background: var(--accent-tint); color: var(--accent-text); }
.icon-disc--ok { background: var(--ok-tint); color: var(--ok); }
.icon-disc--danger { background: var(--danger-tint); color: var(--danger); }
.icon-disc--lg { width: 3.5rem; height: 3.5rem; }
.icon-disc--lg .icon { width: 1.75rem; height: 1.75rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark .bm-disc { fill: var(--accent); }
.brand-mark .bm-line { stroke: var(--accent-ink); stroke-width: 2.1; stroke-linecap: round; fill: none; }
.brand-word {
  font-size: 1.375rem;
  font-weight: 720;
  font-stretch: 125%;
  letter-spacing: -.035em;
  line-height: 1;
  transform: translateY(-1px);
}

/* ---------- 7. Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 46px;
  padding: 0 1.2rem;
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-ctl);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: .9375rem;
  font-weight: 620;
  font-stretch: 108%;
  letter-spacing: -.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); }
.btn--primary:hover { --btn-bg: var(--accent-hover); --btn-bd: var(--accent-hover); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--bg); --btn-bd: var(--ink); }
.btn--ink:hover { --btn-bg: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn--ghost { --btn-bd: var(--line-strong); --btn-fg: var(--ink); }
.btn--ghost:hover { --btn-bd: var(--ink); --btn-bg: color-mix(in srgb, var(--ink) 6%, transparent); }
.on-photo-light .btn--ghost,
.on-photo-auto .btn--ghost { --btn-bg: rgb(242 243 239 / .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.on-photo-light .btn--ghost:hover,
.on-photo-auto .btn--ghost:hover { --btn-bg: rgb(242 243 239 / .8); }
.on-photo-dark .btn--ghost { --btn-bg: rgb(19 24 38 / .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (prefers-color-scheme: dark) {
  /* Dusk photo: the button sits over the orange afterglow, where a thin indigo wash turns brown.
     The glow behind the plate is blurred, drained of colour and dimmed, then tinted night indigo. */
  .on-photo-auto .btn--ghost {
    --btn-bg: color-mix(in srgb, #1C2440 60%, transparent);
    backdrop-filter: blur(10px) saturate(0) brightness(.6);
    -webkit-backdrop-filter: blur(10px) saturate(0) brightness(.6);
  }
  .on-photo-auto .btn--ghost:hover { --btn-bg: color-mix(in srgb, #1C2440 80%, transparent); }
}
.btn--text {
  min-height: 0;
  padding: .25rem 0;
  border: 0;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .25em;
}
.btn--text:hover { text-decoration-color: currentColor; }
.btn--sm { min-height: 38px; padding: 0 .9rem; font-size: .875rem; }
.btn--lg { min-height: 52px; padding: 0 1.5rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

/* Loading: label hides, spinner takes its place, width stays the same */
.btn.is-loading,
.btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.btn.is-loading > *,
.btn[aria-busy="true"] > * { visibility: hidden; }
.btn.is-loading::after,
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}

/* Segmented control (currency, billing period, code language) */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: calc(var(--r-ctl) + 4px);
  background: var(--surface-sunk);
}
.segmented button {
  min-height: 36px;
  padding: 0 .95rem;
  border: 0;
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 620;
  font-stretch: 108%;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.segmented button:hover { color: var(--ink); }
/* The pressed segment is told apart by its outline (3:1+ against the track), not by shade alone */
.segmented button[aria-pressed="true"],
.segmented button[aria-selected="true"] {
  background: var(--seg-on);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--seg-ring), var(--shadow-sm);
}

/* Tags (sentence case, never all caps) */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .3em .7em;
  border-radius: var(--r-ctl);
  background: var(--surface-sunk);
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.tag--accent { background: var(--accent); color: var(--accent-ink); }
.tag--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }

/* ---------- 8. Header and navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--nav-h);
}
.nav-links {
  display: none;
  align-items: center;
  gap: .25rem;
  margin-right: auto;
}
.nav-links a,
.nav-signin {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 .8rem;
  border-radius: var(--r-ctl);
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 550;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover,
.nav-signin:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-links a[aria-current="page"],
.nav-signin[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .5em;
}
.nav-actions { display: none; align-items: center; gap: .5rem; }
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-left: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: var(--ink);
}
.nav-toggle .icon { width: 1.35rem; height: 1.35rem; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline-block; }
/* Overlay under the header: opening it never pushes the page down */
.nav-menu {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: var(--z-menu);
  border-top: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow);
  padding: .75rem var(--gutter) 1.25rem;
  max-height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav-menu ul { display: grid; gap: .25rem; list-style: none; padding: 0; }
.nav-menu a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 .5rem;
  border-radius: var(--r-ctl);
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  font-stretch: 110%;
  text-decoration: none;
}
.nav-menu a:not(.btn):hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-menu a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .35em; }
.nav-menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; }
@media (min-width: 900px) {
  .nav-links, .nav-actions { display: flex; }
  .nav-toggle, .nav-menu { display: none !important; }
}

/* ---------- 9. Footer ---------- */
.site-footer {
  position: relative;
  isolation: isolate;
  margin-top: auto;
  padding-block: clamp(56px, 7vw, 88px) 28px;
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: var(--fs-small);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("assets/img/felt-texture.jpg");
  background-image: image-set(url("assets/img/felt-texture.avif") type("image/avif"), url("assets/img/felt-texture.jpg") type("image/jpeg"));
  background-size: 420px;
  opacity: var(--felt-opacity);
  mix-blend-mode: var(--felt-blend);
  pointer-events: none;
}
.footer-grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.footer-brand { grid-column: 1 / -1; display: grid; gap: .9rem; align-content: start; max-width: 22rem; }
.footer-brand p { color: var(--ink-2); }
.footer-title {
  margin-bottom: .85rem;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 650;
  font-stretch: 110%;
}
.footer-col ul { display: grid; gap: .55rem; list-style: none; padding: 0; }
.footer-col a,
.footer-brand a:not(.brand) {
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s;
}
.footer-col a:hover,
.footer-brand a:not(.brand):hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 22px;
  color: var(--ink-2);
  font-size: var(--fs-xs);
}
/* The rule spans the content only, not the container's side gutters */
.footer-bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--line);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: auto; }
}

/* ---------- 10. Framed photographs (hero, CTA band, 404) ---------- */
.photo-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-frame);
  background: var(--surface-sunk);
}
.photo-frame > picture,
.photo-frame > picture > img,
.photo-frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-frame-body { position: relative; z-index: 1; }

/* ---------- 11. Index: hero ---------- */
.hero { padding: var(--frame-gutter) var(--frame-gutter) 0; }
.hero-frame {
  display: grid;
  min-height: clamp(560px, calc(100dvh - var(--nav-h) - 2 * var(--frame-gutter)), 900px);
  background: #CBD7E3;
}
@media (prefers-color-scheme: dark) { .hero-frame { background: #1C2440; } }
.hero-frame > picture > img { object-position: 64% 58%; }
.hero-frame::after {
  /* soft daylight veil behind the copy; strongest top-left, gone by mid-frame */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 75% at 0% 0%, rgb(226 233 240 / .62) 0%, rgb(226 233 240 / .3) 45%, transparent 70%);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  /* dusk photo: a little night pulled over the sky behind the copy */
  .hero-frame::after {
    background: radial-gradient(120% 75% at 0% 0%, rgb(14 18 32 / .55) 0%, rgb(14 18 32 / .25) 45%, transparent 70%);
  }
}
.hero-copy {
  align-self: start;
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(36px, 8vh, 96px) var(--gutter) 40px;
}
.hero-title { max-width: 14.5em; }
.hero-sub {
  margin-top: 1.25rem;
  max-width: 34rem;
  color: var(--ink-2);
  font-size: var(--fs-lede);
  font-weight: 450;
  line-height: 1.5;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

@media (max-width: 639px) {
  /* Small screens: copy on the page, photograph below it. No text over the image. */
  .hero { padding-top: 0; }
  .hero-frame {
    min-height: 0;
    background: none;
    overflow: visible;
    border-radius: 0;
  }
  .hero-frame::after { display: none; }
  .hero-frame > picture {
    position: relative;
    order: 2;
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: var(--r-box);
    overflow: hidden;
  }
  .hero-frame > picture > img { object-position: 72% 50%; }
  .hero-copy {
    order: 1;
    padding: 40px 6px 28px;
  }
  .hero-copy.on-photo-light,
  .hero-copy.on-photo-auto {
    /* back to theme colours when the copy is not on the photo */
    --ink: unset; --ink-2: unset; --ink-3: unset; --line-strong: unset;
    --accent: unset; --accent-hover: unset; --accent-ink: unset; --focus: unset;
    color: var(--ink);
  }
  .hero-copy.on-photo-light .btn--ghost,
  .hero-copy.on-photo-auto .btn--ghost { --btn-bg: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero-copy.on-photo-light .btn--ghost:hover,
  .hero-copy.on-photo-auto .btn--ghost:hover { --btn-bg: color-mix(in srgb, var(--ink) 6%, transparent); }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* ---------- 12. Live product preview (a real, small piece of the file list) ---------- */
.sync-preview {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  border-radius: var(--r-box);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  font-size: var(--fs-small);
}
.sync-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-xs);
}
.sync-preview-path { display: flex; align-items: center; gap: .35rem; min-width: 0; color: var(--ink-2); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-preview-path .icon { width: .95rem; height: .95rem; color: var(--ink-3); }
.sync-preview-path b { color: var(--ink); font-weight: 650; }
.sync-preview-devices { display: flex; align-items: center; gap: .45rem; flex: none; }
.sync-preview-devices .icon { width: 1.05rem; height: 1.05rem; color: var(--ink-2); }
.sync-list { list-style: none; padding: .35rem 0; margin: 0; }
.sync-row {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr) auto;
  gap: .35rem .8rem;
  align-items: center;
  padding: .55rem 1.1rem;
}
.sync-row > .icon { width: 1.25rem; height: 1.25rem; color: var(--ink-2); }
.sync-name { display: grid; min-width: 0; line-height: 1.35; }
.sync-file { color: var(--ink); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-meta { color: var(--ink-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-state { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.sync-state .icon { width: 1rem; height: 1rem; }
.sync-state--done .icon { color: var(--ok); }
.sync-state--busy { color: var(--accent-text); font-weight: 600; }
.sync-row--busy { background: color-mix(in srgb, var(--ink) 4%, transparent); }
/* Status bar: storage used on the plan, pinned to the bottom of the window */
.sync-usage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem 1rem;
  margin-top: auto;
  padding: .75rem 1.1rem .85rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.sync-usage b { color: var(--ink); font-weight: 600; }
.sync-usage-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.sync-usage-bar span { display: block; width: var(--used, 0%); height: 100%; border-radius: inherit; background: var(--ink-2); }

/* ---------- 13. Index: feature bento ---------- */
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}
.tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
  padding: clamp(22px, 2.6vw, 32px);
  border-radius: var(--r-box);
  background: var(--surface);
  overflow: hidden;
}
.tile h3 { font-size: 1.375rem; }
.tile p { color: var(--ink-2); max-width: 46ch; }
.tile > .icon { width: 1.75rem; height: 1.75rem; color: var(--ink); }
.tile-foot { margin-top: auto; padding-top: .5rem; }
/* Solid saffron in both themes: the one loud tile. Text uses the ink made for saffron. */
.tile--accent {
  --ink: var(--accent-ink);
  --ink-2: color-mix(in srgb, var(--accent-ink) 84%, var(--accent));
  --ink-3: color-mix(in srgb, var(--accent-ink) 78%, var(--accent));
  --focus: var(--accent-ink);
  background: var(--accent);
  color: var(--ink);
}
.tile--accent > .icon { color: var(--accent-ink); }
/* Large figure at the foot of a short tile, so the tile ends on something */
.tile-figure { margin-top: auto; padding-top: 1rem; display: grid; gap: .3rem; }
.tile-figure-num {
  color: var(--ink);
  font-size: clamp(2.5rem, 1.9rem + 2vw, 3.5rem);
  font-stretch: 125%;
  font-weight: 680;
  letter-spacing: -.04em;
  line-height: .95;
  font-variant-numeric: tabular-nums;
}
.tile-figure-label { color: var(--ink-3); font-size: var(--fs-small); max-width: 34ch; }
.tile--product { gap: .75rem; }
/* the list window takes the rest of the tile, like a file browser with room to spare */
.tile--product .sync-preview { flex: 1 1 auto; margin-top: .75rem; }
.tile--felt { background: var(--surface); }
.tile--felt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("assets/img/felt-texture.jpg");
  background-image: image-set(url("assets/img/felt-texture.avif") type("image/avif"), url("assets/img/felt-texture.jpg") type("image/jpeg"));
  background-size: 360px;
  opacity: calc(var(--felt-opacity) * 1.8);
  mix-blend-mode: var(--felt-blend);
  pointer-events: none;
}
.tile--photo { padding: 0; }
.tile--photo picture { flex: 1 1 auto; min-height: 280px; position: relative; }
.tile--photo picture img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.tile--photo .tile-body { display: grid; gap: .6rem; padding: clamp(22px, 2.6vw, 32px); }
.tile .platforms { color: var(--ink-3); font-size: var(--fs-small); }
.tile-art {
  position: relative;
  flex: 1 1 auto;
  min-height: 150px;
  max-width: none;
  margin: .75rem calc(-1 * clamp(22px, 2.6vw, 32px)) calc(-1 * clamp(22px, 2.6vw, 32px));
  overflow: hidden;
}
.tile-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile--code { gap: 1rem; }
.tile--code .code { margin-top: auto; }
/* Phones: the example wraps instead of scrolling out of sight. The address breaks after the host
   (a <wbr> in the markup), and wrapped parts hang under the command they continue. */
@media (max-width: 639px) {
  .tile--code .code-body { white-space: pre-wrap; overflow-wrap: anywhere; text-indent: 4ch hanging each-line; }
}
@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento > .tile { grid-column: span 3; }
  .bento > .tile--wide { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(220px, auto); }
  .bento > .tile-a { grid-column: 1 / 8; grid-row: 1 / 3; }
  .bento > .tile-b { grid-column: 8 / 13; grid-row: 1; }
  .bento > .tile-c { grid-column: 8 / 13; grid-row: 2; }
  .bento > .tile-d { grid-column: 1 / 6; grid-row: 3; }
  .bento > .tile-e { grid-column: 6 / 13; grid-row: 3; }
  .tile--photo picture { min-height: 300px; }
}

/* ---------- 14. Split: photograph + text (index residency, about) ---------- */
.split {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.split-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-box);
  aspect-ratio: 4 / 3;
  background: var(--surface-sunk);
}
.split-media > picture,
.split-media > img,
.split-media > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus-x, 50%) var(--focus-y, 50%); }
.split-body { display: grid; gap: 1.25rem; align-content: center; }
.split-body .lede { max-width: 44ch; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split--reverse { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--reverse .split-media { order: 2; }
  .split-media { aspect-ratio: 5 / 6; border-radius: var(--r-frame); }
}

/* Definition points: short labelled facts, no boxes */
.points { display: grid; gap: 1.1rem; margin-top: .5rem; }
.points > div { display: grid; gap: .2rem; padding-left: 1rem; border-left: 2px solid var(--accent); }
.points dt { color: var(--ink); font-weight: 650; font-stretch: 106%; }
.points dd { color: var(--ink-2); font-size: var(--fs-small); line-height: 1.5; }

/* ---------- 15. Index: plan rows with currency switch ---------- */
.plans-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(28px, 3.5vw, 44px);
}
.plans-head h2 { max-width: 18em; }
.plan-list { display: grid; gap: 12px; }
.plan-row {
  display: grid;
  gap: 1.1rem 2rem;
  padding: clamp(22px, 2.6vw, 30px);
  border-radius: var(--r-box);
  background: var(--surface);
  align-items: center;
}
.plan-row--featured { background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent); }
.plan-row-name h3 { font-size: 1.5rem; font-stretch: 118%; }
.plan-row-name p { margin-top: .3rem; color: var(--ink-3); font-size: var(--fs-small); max-width: 30ch; }
.plan-row-size { display: grid; gap: .1rem; }
.plan-row-num {
  color: var(--ink);
  font-size: 1.75rem;
  font-stretch: 118%;
  font-weight: 640;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.plan-row-size span:not(.plan-row-num) { color: var(--ink-3); font-size: var(--fs-small); }
.plan-row-feats { display: grid; gap: .35rem; font-size: var(--fs-small); }
.plan-row-feats li { display: flex; gap: .5rem; align-items: baseline; color: var(--ink-2); }
.plan-row-feats .icon { width: 1rem; height: 1rem; transform: translateY(.15em); color: var(--accent-text); }
.plan-row-price { display: grid; gap: .15rem; }
.plan-row-price .price { flex-direction: column; align-items: flex-start; gap: .15rem; }
.plan-row-cta .btn { width: 100%; }
/* 640-1199: name and size on top; features on the left, price and button on the right */
@media (min-width: 640px) and (max-width: 1199px) {
  .plan-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "name size" "feats price" "feats cta";
    align-items: start;
  }
  .plan-row-name { grid-area: name; }
  .plan-row-size { grid-area: size; }
  .plan-row-feats { grid-area: feats; }
  .plan-row-price { grid-area: price; }
  .plan-row-cta { grid-area: cta; align-self: end; }
}
/* Five columns only where every label fits on one or two lines; 1024-1199 keeps the two-column row */
@media (min-width: 1200px) {
  .plan-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1.7fr) minmax(0, 1fr) 11rem;
    gap: 2rem;
  }
  .plan-row-feats { grid-column: auto; grid-template-columns: 1fr; }
}
.plans-note { margin-top: 1.25rem; color: var(--ink-3); font-size: var(--fs-small); max-width: var(--measure); }

/* Price (shared by plan rows and plan cards) */
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; }
.price-amount {
  color: var(--ink);
  font-size: 1.75rem;
  font-stretch: 118%;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.price-per { color: var(--ink-3); font-size: var(--fs-small); }
.price-note { color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- 16. Accordion (native <details name="...">) ---------- */
.faq-layout { display: grid; gap: 1.5rem 4rem; }
.faq-layout .faq-aside { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 1024px) {
  .faq-layout { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .faq-layout .faq-aside { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
}
.accordion { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.2rem .25rem;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 620;
  font-stretch: 104%;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
  border-radius: var(--r-ctl);
}
.acc-summary::-webkit-details-marker { display: none; }
.acc-summary::marker { content: ""; }
.acc-summary:hover { color: var(--ink); }
.acc-summary:hover .acc-icon { background: var(--surface); }
.acc-icon {
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  flex: none;
  border-radius: 50%;
  background: var(--surface-sunk);
  color: var(--ink);
  transition: transform .35s var(--ease), background-color .2s;
}
.acc-icon .icon { width: 1rem; height: 1rem; }
.acc-item[open] .acc-icon { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); }
.acc-panel { padding: 0 .25rem 1.4rem; color: var(--ink-2); }
@media (min-width: 640px) { .acc-panel { padding-right: 3.25rem; } }
.acc-panel > * + * { margin-top: .75rem; }
.acc-panel p { max-width: var(--measure); }
@supports selector(::details-content) {
  .acc-item::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size .35s var(--ease), content-visibility .35s allow-discrete;
  }
  .acc-item[open]::details-content { block-size: auto; block-size: calc-size(auto, size); }
}

/* ---------- 17. Index: closing CTA band ---------- */
.cta-band { padding: 0 var(--frame-gutter) calc(var(--section-y) * .7); }
.cta-frame {
  display: grid;
  min-height: clamp(460px, 42vw, 600px);
  background: #2C3654;
}
.cta-frame > picture > img { object-position: 50% 40%; }
.cta-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to top, rgb(14 18 32 / .78) 0%, rgb(14 18 32 / .35) 38%, transparent 62%);
  pointer-events: none;
}
.cta-body {
  align-self: end;
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding: 48px var(--gutter) clamp(36px, 5vw, 64px);
  display: grid;
  gap: 1rem;
  justify-items: start;
}
.cta-body h2 { max-width: 16em; }
.cta-body p { max-width: 40ch; color: var(--ink-2); font-size: var(--fs-lede); }
.cta-body .btn { margin-top: .75rem; }
.cta-frame--short { min-height: clamp(420px, 36vw, 520px); }
@media (max-width: 639px) {
  .cta-frame { min-height: 520px; border-radius: var(--r-box); }
  .cta-frame > picture > img { object-position: 38% 50%; }
}

/* ---------- 18. Panels and notices ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  padding: clamp(20px, 3vw, 32px);
}
.panel--sunk { background: var(--surface-sunk); border-color: transparent; }
.panel--accent { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

/* Felt: the brand material as a surface (support hours, legal and API page heads).
   One felt surface per page at most. */
.felt { position: relative; isolation: isolate; overflow: hidden; }
.felt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("assets/img/felt-texture.jpg");
  background-image: image-set(url("assets/img/felt-texture.avif") type("image/avif"), url("assets/img/felt-texture.jpg") type("image/jpeg"));
  background-size: 360px;
  opacity: calc(var(--felt-opacity) * 1.8);
  mix-blend-mode: var(--felt-blend);
  pointer-events: none;
}
.panel.felt { border-color: transparent; }

.notice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem 1.1rem;
  border-radius: var(--r-ctl);
  background: var(--surface-sunk);
  color: var(--ink);
  font-size: var(--fs-small);
  line-height: 1.5;
}
.notice > .icon { width: 1.2rem; height: 1.2rem; margin-top: .1rem; }
.notice p + p { margin-top: .35rem; }
.notice--accent { background: var(--accent-tint); }
.notice--accent > .icon { color: var(--accent-text); }
.notice--danger { background: var(--danger-tint); color: var(--danger); }
.notice--ok { background: var(--ok-tint); color: var(--ok); }
.notice--danger strong, .notice--ok strong { color: inherit; }

/* ---------- 19. Forms ---------- */
.form { display: grid; gap: 1.25rem; }
/* Fields grouped in a <fieldset> so they can be disabled together while a form is "sending" */
.form-fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.form-title { font-size: 1.375rem; font-stretch: 112%; }
.form-row { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .form-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: .45rem; min-width: 0; align-content: start; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.label { color: var(--ink); font-size: .9375rem; font-weight: 620; line-height: 1.3; }
.label .optional { color: var(--ink-3); font-weight: 450; }
.hint { color: var(--ink-3); font-size: .875rem; line-height: 1.45; }
.field-error {
  display: flex;
  gap: .4rem;
  align-items: flex-start;
  color: var(--danger);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.45;
}
.field-error .icon { width: 1rem; height: 1rem; margin-top: .12rem; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem .95rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 140px; resize: vertical; }
.input::placeholder,
.textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--ink-2); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"],
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea { border-color: var(--danger); }
.input[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus,
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.field.is-valid .input { border-color: var(--ok); }
.input:disabled,
.select:disabled,
.textarea:disabled,
.input[readonly] { background: var(--surface-sunk); color: var(--ink-3); border-color: var(--line); cursor: not-allowed; }
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
  caret-color: var(--ink);
}
.select {
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23474E61' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 1.1rem;
  cursor: pointer;
}
/* Placeholder option ("Choose a topic") reads as a placeholder until a real value is picked.
   :invalid works because the select is required and its first option has an empty value. */
.select:invalid { color: var(--ink-3); }
.select option { color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23B3B8C5' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  }
}

/* Input with a trailing button (password visibility, copy) */
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 3.25rem; }
.input-affix {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: calc(var(--r-ctl) - 3px);
  background: transparent;
  color: var(--ink-2);
}
.input-affix:hover { background: var(--surface-sunk); color: var(--ink); }

/* Checkbox and radio: native control, themed */
.check {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.45;
  cursor: pointer;
}
.check input {
  width: 1.15rem; height: 1.15rem;
  margin-top: .12rem;
  flex: none;
  accent-color: var(--ink);
  cursor: pointer;
}
@media (prefers-color-scheme: dark) { .check input { accent-color: var(--accent); } }
.field.is-invalid .check { color: var(--danger); }

/* Six-digit code */
.otp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 6px repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 24rem;
}
.auth-card .otp { max-width: none; }   /* same width as the inputs and buttons of the card */
.otp-legend { margin-bottom: .45rem; padding: 0; }
/* The two groups of three are told apart by a wider gap (an empty grid track), not by a line,
   which would read as a dash */
.otp-cell:nth-of-type(4) { grid-column-start: 5; }
.otp-cell {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 620;
  font-stretch: 110%;
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--accent-text);
  transition: border-color .15s, box-shadow .15s;
}
.otp-cell:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.otp.is-invalid .otp-cell { border-color: var(--danger); }
.otp.is-invalid { animation: nudge .4s var(--ease); }

/* Password strength: four segments, no track */
.meter { display: grid; gap: .4rem; }
.meter-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter-bar span { height: 4px; border-radius: 2px; background: var(--line); transition: background-color .2s; }
.meter[data-level="1"] .meter-bar span:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] .meter-bar span:nth-child(-n+2) { background: var(--accent); }
.meter[data-level="3"] .meter-bar span:nth-child(-n+3) { background: var(--ok); }
.meter[data-level="4"] .meter-bar span { background: var(--ok); }
.meter-label { color: var(--ink-3); font-size: .8125rem; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.form-foot { color: var(--ink-3); font-size: var(--fs-small); }

/* Confirmation block that replaces a form */
.form-done { display: grid; gap: .9rem; justify-items: start; align-content: center; }
.form-done h2, .form-done h3 { font-size: 1.5rem; font-stretch: 112%; }
.form-done p { color: var(--ink-2); max-width: 52ch; }
.form-done strong { overflow-wrap: anywhere; }   /* a long email address must not widen the page */

/* ---------- 20. Loading: skeleton and spinner ---------- */
.skeleton { display: grid; gap: .7rem; }
.skeleton-line,
.skeleton-block {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-chip);
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}
.skeleton-line { height: .85rem; }
.skeleton-line--title { height: 1.4rem; width: 55%; }
.skeleton-line--short { width: 40%; }
.skeleton-line--mid { width: 72%; }
.skeleton-block { height: 48px; border-radius: var(--r-ctl); }
.skeleton-line::after,
.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}
.spinner {
  display: inline-block;
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
.spinner--lg { width: 2rem; height: 2rem; border-width: 3px; }

/* ---------- 21. Toast ---------- */
.toast-region {
  position: fixed;
  z-index: var(--z-toast);
  left: 16px; right: 16px; bottom: 16px;
  display: grid;
  justify-items: center;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .7rem;
  max-width: 26rem;
  padding: .85rem 1.1rem;
  border-radius: var(--r-box);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.toast.is-visible { opacity: 1; transform: none; }
.toast > .icon { width: 1.25rem; height: 1.25rem; color: var(--accent); }
@media (prefers-color-scheme: dark) { .toast > .icon { color: #8A5C00; } }
.toast--error > .icon { color: #F2846F; }
@media (prefers-color-scheme: dark) { .toast--error > .icon { color: #A6261C; } }
@media (min-width: 768px) {
  .toast-region { left: auto; right: 24px; bottom: 24px; justify-items: end; }
}

/* ---------- 22. Auth pages (login, signup, forgot) ---------- */
/* Small screens: the photograph is a short band above the card. 1024+: a tall frame beside it. */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: calc(100dvh - var(--nav-h));
}
.auth-aside {
  position: relative;
  overflow: hidden;
  margin: var(--frame-gutter) var(--frame-gutter) 0;
  height: clamp(140px, 34vw, 260px);
  border-radius: var(--r-box);
  background: #D9D6CE;
}
/* The roof crown: the band keeps the ring and the crossed bars in view */
.auth-aside picture,
.auth-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.auth-aside-caption { display: none; }
.auth-main {
  display: grid;
  place-items: start center;
  min-width: 0;
  padding: clamp(28px, 6vw, 56px) var(--gutter) clamp(48px, 8vw, 72px);
}
.auth-card { width: 100%; min-width: 0; max-width: 27rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.auth-head { display: grid; gap: .6rem; }
.auth-head h1 { font-size: clamp(1.875rem, 1.5rem + 1.2vw, 2.375rem); font-stretch: 118%; }
.auth-head p { color: var(--ink-2); }
.auth-head strong { overflow-wrap: anywhere; }   /* long email addresses wrap instead of widening the page */
.auth-step { display: grid; gap: 1.5rem; }
.auth-alt {
  display: grid;
  gap: .4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-small);
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: fit-content;
  color: var(--ink-2);
  font-size: var(--fs-small);
  font-weight: 550;
  text-decoration: none;
}
.auth-back:hover { color: var(--ink); }
button.auth-back { padding: 0; border: 0; background: none; }
.resend { color: var(--ink-3); font-size: var(--fs-small); }
.resend button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .22em;
}
.resend button:disabled { color: var(--ink-3); text-decoration-color: var(--line); cursor: default; }
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: none; }
  .auth-aside {
    margin: var(--frame-gutter) 0 var(--frame-gutter) var(--frame-gutter);
    height: auto;
    border-radius: var(--r-frame);
  }
  .auth-main { place-items: center; padding-block: clamp(32px, 6vw, 72px); }
  .auth-aside img { object-position: 50% 40%; }
  /* The caption sits low, on the white felt of the wall: a felt-light veil keeps dark text readable */
  .auth-aside-caption {
    display: block;
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 80px 32px 28px;
    background: linear-gradient(to top, rgb(242 243 239 / .94), rgb(242 243 239 / .8) 45%, rgb(242 243 239 / 0));
    font-size: var(--fs-small);
    line-height: 1.5;
  }
  .auth-aside-caption p { max-width: 34ch; }
  .auth-aside-caption p + p { margin-top: .35rem; color: var(--ink-3); }
}
/* Dark theme: the daylight photo is dimmed so it does not glare beside the night page,
   and the caption (.on-photo-auto) turns light on a night-indigo veil */
@media (prefers-color-scheme: dark) {
  .auth-aside { background: #2A2F3A; }
  .auth-aside img { filter: brightness(.78) saturate(.92); }
  .auth-aside-caption { background: linear-gradient(to top, rgb(19 24 38 / .9), rgb(19 24 38 / .7) 45%, rgb(19 24 38 / 0)); }
}

/* ---------- 23. Tables ---------- */
.table-wrap {
  position: relative;   /* contains the .sr-only spans of the cells, or they widen the page */
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  line-height: 1.45;
}
.table caption { padding: 1rem 1.1rem 0; text-align: left; color: var(--ink-3); font-size: var(--fs-xs); caption-side: top; }
.table th,
.table td { padding: .85rem 1.1rem; text-align: left; vertical-align: top; }
.table thead th {
  background: var(--surface-sunk);
  color: var(--ink);
  font-weight: 650;
  font-stretch: 106%;
  white-space: nowrap;
}
.table tbody th { color: var(--ink); font-weight: 550; }
.table tbody td { color: var(--ink-2); }
.table tbody tr + tr > * { border-top: 1px solid var(--line); }
.table tbody tr.table-group > * {
  padding-top: 1.4rem;
  color: var(--ink);
  font-weight: 650;
  font-stretch: 108%;
  background: color-mix(in srgb, var(--surface-sunk) 45%, transparent);
}
.table .icon { width: 1.1rem; height: 1.1rem; }
.cell-yes { color: var(--accent-text); }
.cell-no { color: var(--ink-3); }

/* Plan comparison (pricing): one table, rows grouped in <tbody>, each group folds.
   Lines only between groups, never under every row. A plain cell means "not included"
   (its text is for screen readers). The featured column is washed through <col>, so the
   wash runs unbroken through the group rows. */
.table--compare { table-layout: fixed; }
.table--compare col.is-featured { background: var(--featured-wash); }
.table--compare thead th:first-child { width: 34%; }
.table--compare th:not(:first-child),
.table--compare td { text-align: center; }
.table--compare td .icon { display: inline-block; }
.table--compare thead th { padding-block: 1rem; font-size: 1rem; }
.table--compare thead th.is-featured { background: var(--featured-head); box-shadow: inset 0 3px 0 var(--accent); }
.table--compare tbody tr + tr > * { border-top: 0; }
.table--compare tbody + tbody tr.table-group > * { border-top: 1px solid var(--line); }
.table--compare tbody tr:not(.table-group) > * { padding-block: .5rem; }
.table--compare tbody tr:not(.table-group):last-child > * { padding-bottom: 1.15rem; }
.table--compare tbody tr.table-group > * { padding: 0; background: none; }
.table--compare tbody tr.table-group > th { padding: 0; }
/* A group head spans the whole row (colspan), and a column background does not reach a
   spanning cell, so the Plus wash is drawn across it: the first column is 34%, the plan
   columns 22% each, Plus is the second of them */
.table--compare tbody tr.table-group > th[colspan] {
  background: linear-gradient(90deg, transparent 56%, var(--featured-wash) 56%, var(--featured-wash) 78%, transparent 78%);
}
.cmp-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 52px;
  padding: .85rem 1.1rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 650;
  font-stretch: 108%;
  text-align: left;
}
.cmp-toggle:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cmp-toggle .icon { width: 1rem; height: 1rem; color: var(--ink-3); transition: transform .25s var(--ease); }
.cmp-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.cmp-count { color: var(--ink-3); font-weight: 450; font-stretch: 100%; white-space: nowrap; }
.cmp-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.cmp-switch { display: none; }
.cmp-all { margin-left: auto; }
/* Phones: one plan at a time, picked with a segmented control (set up by the page script) */
@media (max-width: 639px) {
  .cmp-switch { display: inline-flex; }
  .cmp-count { display: none; }
  .table--compare:not([data-plan]) { min-width: 36rem; }
  .table--compare[data-plan] thead th:first-child { width: 58%; }
  .table--compare[data-plan] tbody tr.table-group > th[colspan] { background: none; }
  .table--compare[data-plan="plus"] tbody tr.table-group > th[colspan] { background: linear-gradient(90deg, transparent 58%, var(--featured-wash) 58%); }
  .table--compare[data-plan="free"] :is(col:nth-child(3), col:nth-child(4), tr > :nth-child(3), tr > :nth-child(4)),
  .table--compare[data-plan="plus"] :is(col:nth-child(2), col:nth-child(4), tr > :nth-child(2), tr > :nth-child(4)),
  .table--compare[data-plan="team"] :is(col:nth-child(2), col:nth-child(3), tr > :nth-child(2), tr > :nth-child(3)) { display: none; }
}
/* Sticky header for the long comparison (desktop only; needs a non-scrolling wrapper) */
@media (min-width: 900px) {
  .table-wrap--sticky { overflow: visible; }
  .table-wrap--sticky thead th { position: sticky; top: var(--nav-h); z-index: 2; }
  .table-wrap--sticky thead th:first-child { border-top-left-radius: var(--r-box); }
  .table-wrap--sticky thead th:last-child { border-top-right-radius: var(--r-box); }
}

/* Parameter tables (API) */
/* At the reading measure the columns are tight: a name never breaks inside, a long type
   ("array of strings") wraps at its spaces instead */
.table--params td:first-child code,
.table--params th:first-child code { background: none; padding: 0; font-weight: 600; color: var(--ink); white-space: nowrap; overflow-wrap: normal; }
.table--params .type { color: var(--ink-3); font-family: var(--font-mono); font-stretch: 87.5%; font-size: .8125rem; }
.table--params .req { color: var(--accent-text); font-size: .8125rem; font-weight: 600; white-space: nowrap; }

/* Below 560px a row becomes a block: name (and type) on one line, the description under it.
   Explicit roles keep the table semantics that display:block would drop. */
@media (max-width: 559px) {
  :is(.table--params, .table-stack) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  :is(.table--params, .table-stack),
  :is(.table--params, .table-stack) tbody,
  :is(.table--params, .table-stack) tr { display: block; }
  :is(.table--params, .table-stack) tbody tr { padding: .9rem 1.1rem; }
  :is(.table--params, .table-stack) tbody tr + tr { border-top: 1px solid var(--line); }
  :is(.table--params, .table-stack) tbody tr > * { display: block; padding: 0; border-top: 0 !important; }
  .table--params tbody tr:not(.table-group) { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .75rem; }
  .table--params tbody tr:not(.table-group) > td:last-child { flex-basis: 100%; }
  .table--params tbody tr:not(.table-group) > td:not(:last-child) br { display: none; }
  .table--params tbody tr:not(.table-group) > td:not(:last-child) .req { margin-left: .5rem; }
  .table--params tbody tr.table-group { padding-block: 1.1rem .35rem; background: color-mix(in srgb, var(--surface-sunk) 45%, transparent); }
  .table--params tbody tr.table-group > * { padding: 0; background: none; }
  .table-stack tbody td { display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); gap: .75rem; margin-top: .5rem; }
  .table-stack tbody td::before { content: attr(data-label); color: var(--ink-3); }
}

/* ---------- 24. Code blocks and syntax ---------- */
.code {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  background: var(--code-bg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  padding: 4px 6px 4px 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 550;
}
.code-title { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; }
.code-tab {
  min-height: 32px;
  padding: 0 .7rem;
  border: 0;
  border-radius: var(--r-chip);
  background: transparent;
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.code-tab:hover { color: var(--ink); }
.code-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 32px;
  padding: 0 .65rem;
  border: 0;
  border-radius: var(--r-chip);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  flex: none;
}
.code-copy:hover { background: var(--surface-sunk); color: var(--ink); }
.code-copy .icon { width: 1rem; height: 1rem; }
.code-copy.is-copied { color: var(--ok); }
.code-body {
  margin: 0;
  padding: 1rem 1.15rem 1.1rem;
  overflow-x: auto;
  color: var(--syn-cmd);
  font-size: .8125rem;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
}
.code-body code { font: inherit; background: none; padding: 0; color: inherit; }
.code--plain .code-body { padding-top: 1.1rem; }
.t-k { color: var(--syn-cmd); font-weight: 600; }   /* command / keyword */
.t-f { color: var(--syn-flag); }                    /* flag / option */
.t-s { color: var(--syn-str); }                     /* string */
.t-n { color: var(--syn-num); }                     /* number, boolean, null */
.t-p { color: var(--syn-key); }                     /* JSON key / property */
.t-c { color: var(--syn-com); }                     /* comment (no italic: Martian Mono has none) */
.t-o { color: var(--syn-punc); }                    /* punctuation */
.t-v { color: var(--syn-key); font-weight: 600; }   /* variable / placeholder */

/* HTTP method badges: told apart by form, not by new hues */
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.4em;
  padding: .38em .55em;
  border-radius: var(--r-chip);
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .01em;
  flex: none;
}
.method--get { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.method--post { background: var(--accent); color: var(--accent-ink); }
.method--put,
.method--patch { background: var(--ink); color: var(--bg); }
.method--delete { color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.method--sm { min-width: 3.6em; padding: .28em .4em; font-size: .6875rem; }

/* ---------- 25. API docs layout ---------- */
.docs {
  display: grid;
  gap: 2rem;
  padding-block: clamp(24px, 4vw, 48px) var(--section-y);
}
.docs-nav {
  position: sticky;
  top: var(--nav-h);
  z-index: 3;
  display: flex;
  gap: .25rem;
  margin-inline: calc(-1 * var(--gutter));
  padding: .6rem var(--gutter);
  overflow-x: auto;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.docs-nav::-webkit-scrollbar { display: none; }
.docs-nav-group { display: contents; }
.docs-nav-group ul { display: contents; list-style: none; padding: 0; }
.docs-nav-title { display: none; }
.docs-nav a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 36px;
  padding: 0 .7rem;
  border-radius: var(--r-ctl);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.docs-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.docs-nav a[aria-current="true"],
.docs-nav a.is-active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
/* Badges share one width, so every label starts on the same line */
.docs-nav .method--sm { width: 4.9em; min-width: 0; padding-inline: 0; }
.docs-body { min-width: 0; max-width: 56rem; }
/* Headings land under the header (html scroll-padding) and, below 1024px, under the section strip */
.docs [id] { scroll-margin-top: var(--docs-strip, 0px); }
.docs { --docs-strip: 48px; }   /* strip height (56px) minus the 20px already in scroll-padding, plus 12px */
.docs-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.docs-intro > p { max-width: var(--measure); }
.docs-intro-head { display: grid; gap: .9rem; padding: clamp(22px, 3vw, 36px); border-radius: var(--r-box); background: var(--surface); }
.docs-intro-head .lede { max-width: 54ch; }
.docs-section { display: grid; gap: 1.1rem; padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--line); }
.docs-section:last-child { border-bottom: 0; margin-bottom: 0; }
.docs-section > h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
.docs-section > p,
.docs-section > ul,
.docs-section > ol { max-width: var(--measure); }
.docs-section ul:not([class]),
.docs-section ol:not([class]) { padding-left: 1.25rem; display: grid; gap: .35rem; }
.docs-h { margin-top: .75rem; font-size: 1.0625rem; font-stretch: 104%; }
.endpoint-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .85rem; }
.endpoint-head h2,
.endpoint-head h3 { font-size: clamp(1.375rem, 1.2rem + .7vw, 1.75rem); flex-basis: 100%; }
.endpoint-path {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-size: .9375rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
:not(pre) > code.endpoint-path { background: none; padding: 0; font-size: .9375rem; }
.endpoint-examples { display: grid; gap: 1rem; }
.base-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .55rem .55rem .55rem 1.1rem;
  border-radius: var(--r-ctl);
  background: var(--surface);
  border: 1px solid var(--line);
}
.base-url-value { display: flex; align-items: center; gap: .5rem; flex: 1 1 12rem; min-width: 0; }
/* The address never breaks inside: it scrolls if the screen is narrower than it */
.base-url code {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  overflow-wrap: normal;
  background: none;
  padding: 0;
  font-size: .875rem;
  scrollbar-width: none;
}
.base-url code::-webkit-scrollbar { display: none; }
.base-url .code-copy { margin-left: auto; }
/* Phones: "Base URL" and Copy share the first row, the address gets the whole second row,
   so the version at its end is never hidden behind a scroll (one row needs about 600px) */
@media (max-width: 599px) {
  .base-url { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .45rem .45rem .75rem 1rem; }
  .base-url-value { grid-column: 1 / -1; grid-row: 2; }
  .base-url .code-copy { grid-column: 2; grid-row: 1; margin-left: 0; }
}
@media (max-width: 400px) { .base-url code { font-size: .75rem; } }
@media (max-width: 359px) { .base-url code { font-size: .6875rem; } }
/* Two right edges: text and the parameter and error tables keep the reading measure;
   only code samples and the base URL take the full column */
.docs-section > .table-wrap { max-width: var(--measure); }
.docs-help { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.1rem; align-items: start; }
.docs-help p { max-width: var(--measure); }
@media (min-width: 1024px) {
  .docs { grid-template-columns: 236px minmax(0, 1fr); gap: 4rem; --docs-strip: 12px; }
  .docs-nav {
    top: calc(var(--nav-h) + 28px);
    align-self: start;
    display: block;
    max-height: calc(100dvh - var(--nav-h) - 48px);
    margin: 0;
    padding: 0 .25rem .25rem 0;
    overflow-y: auto;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    scrollbar-width: thin;
  }
  /* More links below the fold: the list fades out at the bottom edge (class set by the page script) */
  .docs-nav.has-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); }
  .docs-nav-group { display: block; }
  .docs-nav-group + .docs-nav-group { margin-top: 1rem; }
  .docs-nav-group ul { display: grid; gap: 1px; }
  .docs-nav-title { display: block; margin: 0 0 .3rem .7rem; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 650; }
  .docs-nav a { display: flex; min-height: 32px; white-space: normal; }
}
@media (min-width: 1280px) {
  .endpoint-examples--split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 26. Inner page header ---------- */
.page-head { padding-block: clamp(48px, 7vw, 96px) clamp(28px, 4vw, 52px); }
.page-head-inner { display: grid; gap: 1.1rem; max-width: 50rem; }
.page-head h1 { max-width: 16em; }
.page-head .lede { max-width: 56ch; }
/* Split head: headline on the left, one supporting element (not a paragraph) on the right */
.page-head--split { display: grid; gap: 2rem; }
@media (min-width: 1024px) {
  .page-head--split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 4rem; }
}

/* ---------- 27. Long-form text (legal, docs prose) ---------- */
.prose { max-width: var(--measure); color: var(--ink-2); }
.prose > * + * { margin-top: 1rem; }
.prose h2 {
  margin-top: 3rem;
  font-size: clamp(1.375rem, 1.2rem + .7vw, 1.75rem);
  font-stretch: 112%;
}
.prose h3 { margin-top: 2rem; font-size: 1.125rem; font-stretch: 104%; }
.prose h2 + *,
.prose h3 + * { margin-top: .75rem; }
.prose ul:not([class]),
.prose ol:not([class]) { padding-left: 1.3rem; display: grid; gap: .45rem; }
.prose li::marker { color: var(--ink-3); }
.prose ol:not([class]) > li::marker { font-weight: 600; font-variant-numeric: tabular-nums; }
.prose dl { display: grid; gap: .9rem; }
.prose dt { color: var(--ink); font-weight: 620; }
.prose dd { margin-top: .15rem; }
.prose blockquote {
  padding: .25rem 0 .25rem 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}
.prose .table-wrap { margin-top: 1.25rem; }
.prose address { padding: 1rem 1.15rem; border-radius: var(--r-ctl); background: var(--surface); line-height: 1.6; }

/* Legal pages: side contents (1024+) or a folding contents list (below), then the text.
   The bottom padding sits on the text column, so the sticky contents can travel to the end. */
.legal {
  display: grid;
  gap: 2rem;
  padding-top: clamp(40px, 6vw, 80px);
}
.legal-body { min-width: 0; padding-bottom: var(--section-y); }
.legal-body.prose { max-width: none; }
/* Text keeps a reading measure (under 80 characters); tables take the whole column */
.legal-body > :not(section):not(.legal-head):not(.toc-fold):not(.legal-summary),
.legal-body :where(section) > :not(.table-wrap) { max-width: var(--measure); }
.legal-body :where(section) > * + * { margin-top: 1rem; }
.legal-body section { scroll-margin-top: 12px; }
.legal-body [id] { scroll-margin-top: 12px; }
/* The head is the page's one felt surface. Head, summary and tables share one edge (the table measure),
   the text another (the reading measure): two right edges, not a staircase. */
.legal-head,
.legal-summary,
.toc-fold { max-width: var(--measure-table); }
.legal-head { display: grid; gap: .75rem; padding: clamp(24px, 3.4vw, 40px); margin-bottom: .5rem; border-radius: var(--r-box); background: var(--surface); }
.legal-meta { color: var(--ink-3); font-size: var(--fs-small); }
.legal-summary { margin-top: 2rem; }
.legal-summary h2 { margin-top: 0; font-size: 1.125rem; font-stretch: 110%; letter-spacing: -.01em; }
.legal-summary dl { gap: 1.15rem 2.5rem; }
.legal-summary-note { margin-top: 1.25rem; color: var(--ink-3); font-size: var(--fs-small); }
@media (min-width: 768px) { .legal-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legal-body .table code { white-space: nowrap; overflow-wrap: normal; }
.legal-body .table-wrap { max-width: var(--measure-table); }
.legal-toc {
  align-self: start;
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-box);
  background: var(--surface);
  font-size: var(--fs-small);
}
.legal-toc-title { margin-bottom: .6rem; color: var(--ink); font-weight: 650; font-stretch: 108%; }
.legal-toc ol { margin: 0; padding-left: 1.4rem; display: grid; gap: .35rem; }
.legal-toc li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.legal-toc li:has(> a[aria-current="true"])::marker { color: var(--accent-text); }
.legal-toc a { color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.legal-toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.legal-toc a[aria-current="true"],
.legal-toc a.is-active { color: var(--ink); font-weight: 600; }
/* Folding contents list for small screens */
.toc-fold { border-radius: var(--r-box); background: var(--surface); font-size: var(--fs-small); }
.toc-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 52px; padding: 0 1.1rem 0 1.25rem; border-radius: var(--r-box);
  color: var(--ink); font-weight: 650; font-stretch: 108%;
  list-style: none; cursor: pointer;
}
.toc-fold > summary::-webkit-details-marker { display: none; }
.toc-fold > summary::marker { content: ""; }
.toc-fold > summary .icon { transition: transform .25s var(--ease); }
.toc-fold[open] > summary .icon { transform: rotate(180deg); }
.toc-fold ol { margin: 0; padding: 0 1.25rem 1rem 2.65rem; gap: 0; }
.toc-fold ol > li::marker { color: var(--ink-3); font-weight: 400; }
.toc-fold a { display: block; padding: .45rem 0; color: var(--ink-2); font-weight: 400; text-decoration: none; line-height: 1.35; }
.toc-fold a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.toc-fold a[aria-current="true"] { color: var(--ink); font-weight: 600; }
@media (max-width: 1023px) {
  .legal-toc { display: none; }
  .toc-fold { margin-top: 1.5rem; }
  .toc-fold + .legal-summary { margin-top: 1.25rem; }
}
@media (min-width: 1024px) {
  .legal { grid-template-columns: 264px minmax(0, 1fr); gap: 4.5rem; }
  .legal-toc {
    position: sticky;
    top: calc(var(--nav-h) + 28px);
    max-height: calc(100dvh - var(--nav-h) - 56px);
    overflow-y: auto;
    padding: 0 .5rem 0 2px;   /* the scroll box clips: room for the overhang of the first letter */
    background: none;
  }
  .legal-toc ol { padding-left: 1.75rem; }   /* two-digit markers ("14.") stay inside the scroll box */
  .toc-fold { display: none; }
}
.footer-col a[aria-current="page"] { color: var(--ink); }

/* ---------- 28. Pricing page ---------- */
.plans {
  display: grid;
  gap: 14px;
  align-items: stretch;
}
.plan {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(24px, 2.8vw, 34px);
  border-radius: var(--r-box);
  background: var(--surface);
}
.plan-head { display: grid; gap: .45rem; }
.plan-name { font-size: 1.5rem; font-stretch: 118%; }
.plan-desc { color: var(--ink-3); font-size: var(--fs-small); max-width: 34ch; }
.plan .price-amount { font-size: clamp(2.25rem, 1.9rem + 1.2vw, 2.875rem); }
.plan .btn { width: 100%; }
.plan-divider { height: 1px; background: var(--line); }
.plan--featured {
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent), var(--shadow);
}
.plan--featured .plan-name { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
@media (min-width: 1024px) {
  .plans { grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .plan--featured { margin-top: -14px; padding-bottom: calc(clamp(24px, 2.8vw, 34px) + 14px); }
  .plan-desc { min-height: 3.2em; }   /* two lines in every card, so the prices line up */
}
/* Tablets: one wide card per plan, split in two. Name, price and button on the left,
   the list on the right, the divider turned upright between them. */
@media (min-width: 640px) and (max-width: 1023px) {
  .plan {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1.2fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 1.25rem clamp(24px, 4vw, 40px);
  }
  .plan > :nth-child(-n+3) { grid-column: 1; }
  .plan > .btn { align-self: end; }
  .plan > .plan-divider { grid-column: 2; grid-row: 1 / -1; width: 1px; height: auto; }
  .plan > :last-child { grid-column: 3; grid-row: 1 / -1; align-self: start; }
}
.checklist { display: grid; gap: .6rem; font-size: var(--fs-small); }
.checklist li { display: grid; grid-template-columns: 1.15rem 1fr; gap: .6rem; align-items: start; color: var(--ink-2); line-height: 1.45; }
.checklist .icon { width: 1.05rem; height: 1.05rem; margin-top: .14rem; color: var(--accent-text); }
.checklist .is-off { color: var(--ink-3); }
.checklist .is-off .icon { color: var(--ink-3); }
.pricing-controls { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-bottom: clamp(24px, 3vw, 40px); }
.save-note { color: var(--accent-text); font-size: var(--fs-small); font-weight: 600; }

/* ---------- 29. Contact page ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding-bottom: var(--section-y);
}
.contact-aside { display: grid; gap: 2rem; align-content: start; min-width: 0; }
.contact-aside-title { font-size: 1.375rem; font-stretch: 112%; }
/* Addresses in two groups of three, plain icons (no discs) */
.mail-groups { display: grid; gap: 2rem 2.5rem; }
.mail-group { display: grid; gap: 1rem; align-content: start; }
.mail-group-title { color: var(--ink-3); font-size: var(--fs-small); font-weight: 600; font-stretch: 106%; }
.mail-list { display: grid; gap: 1.1rem; }
.mail-item { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: .8rem; align-items: start; }
.mail-item > .icon { width: 1.25rem; height: 1.25rem; margin-top: .15rem; color: var(--ink-3); }
.mail-label { color: var(--ink); font-weight: 620; }
.mail-text { color: var(--ink-3); font-size: var(--fs-small); }
.mail-item a { font-size: var(--fs-small); overflow-wrap: anywhere; }
@media (min-width: 640px) and (max-width: 1023px) {
  .mail-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .contact { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4rem; align-items: start; }
  /* After sending, the card keeps the height the form had (set by the page script) */
  .contact > .form { min-height: var(--sent-height, auto); }
}
/* Support hours on felt, beside the page headline */
.hours { display: grid; gap: .9rem; align-content: start; }
.hours h2 { font-size: 1.125rem; font-stretch: 110%; }
.hours dl { display: grid; gap: .75rem; }
.hours dt { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.hours dd { color: var(--ink); font-size: var(--fs-small); font-weight: 550; }
@media (min-width: 640px) { .hours dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.5rem; } }

/* ---------- 30. About page ---------- */
/* Principles: a portrait photograph beside two large statements and two small ones */
.principles { display: grid; gap: 2rem 4rem; align-items: start; }
.principles-media { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: var(--r-box); overflow: hidden; background: var(--surface-sunk); }
.principles-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.principles-body { display: grid; gap: 2rem; }
.principle-major { display: grid; gap: 1.75rem; }
.principle-major h3 { font-size: var(--fs-h3); font-stretch: 108%; line-height: 1.25; letter-spacing: -.01em; max-width: 26em; }
.principle-major p { margin-top: .6rem; color: var(--ink-2); max-width: 52ch; }
.principle-minor { display: grid; gap: 1.5rem 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.principle-minor h3 { font-size: 1.0625rem; }
.principle-minor p { margin-top: .35rem; color: var(--ink-2); font-size: var(--fs-small); max-width: 44ch; }
@media (min-width: 640px) { .principle-minor { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .principles { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .principles-media { aspect-ratio: 4 / 5; border-radius: var(--r-frame); position: sticky; top: calc(var(--nav-h) + 28px); }
}

/* Team: monograms (no photographs), one colour rule: founders saffron, everyone else ink */
.team { display: grid; gap: 2.5rem 2rem; }
@media (min-width: 640px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .team { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem 2.5rem; } }
.person { display: grid; gap: .25rem; align-content: start; }
.person .monogram { margin-bottom: .9rem; }
.monogram {
  display: grid;
  place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 1.5rem;
  font-weight: 720;
  font-stretch: 125%;
  letter-spacing: -.03em;
  line-height: 1;
  flex: none;
}
.monogram--accent { background: var(--accent); color: var(--accent-ink); }
.monogram--ink { background: var(--ink); color: var(--bg); }
.person-name { color: var(--ink); font-size: 1.125rem; font-weight: 650; font-stretch: 108%; line-height: 1.3; }
.person-role { color: var(--ink-3); font-size: var(--fs-small); }
.person-bio { margin-top: .4rem; color: var(--ink-2); font-size: var(--fs-small); line-height: 1.55; max-width: 40ch; }
@media (max-width: 639px) {
  .team { gap: 1.75rem; }
  .person { grid-template-columns: 56px minmax(0, 1fr); column-gap: 1rem; row-gap: .1rem; align-items: center; }
  .person .monogram { grid-row: 1 / span 2; width: 56px; height: 56px; margin-bottom: 0; font-size: 1.125rem; align-self: center; }
  .person-name { grid-column: 2; align-self: end; }
  .person-role { grid-column: 2; align-self: start; }
  .person-bio { grid-column: 1 / -1; margin-top: .6rem; max-width: none; }
}

.figure { margin: 0; }
.figure picture,
.figure img { border-radius: var(--r-frame); overflow: hidden; }
.figure figcaption { margin-top: .75rem; color: var(--ink-3); font-size: var(--fs-small); }

/* Timeline: vertical on small screens, a horizontal band of years from 900px */
.timeline { position: relative; display: grid; gap: 1.75rem; padding-left: 1.75rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: .5rem; bottom: .5rem; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; gap: .25rem; align-content: start; }
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem);
  top: .4rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2.5px var(--accent-text);
}
.timeline-year { color: var(--ink); font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; }
.timeline p { color: var(--ink-2); font-size: var(--fs-small); max-width: 52ch; }
@media (min-width: 900px) {
  .timeline--row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.75rem; padding: 2.25rem 0 0; }
  .timeline--row::before { left: 0; right: 0; top: 5px; bottom: auto; width: auto; height: 2px; }
  .timeline--row li::before { left: 0; top: calc(-2.25rem); }
  .timeline--row .timeline-year { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); font-weight: 680; font-stretch: 125%; letter-spacing: -.03em; }
  .timeline--row p { max-width: 24ch; }
}

/* ---------- 31. 404 ---------- */
.notfound { padding: var(--frame-gutter) var(--frame-gutter) var(--section-y); }
.notfound-frame {
  display: grid;
  min-height: clamp(520px, calc(100dvh - var(--nav-h) - 2 * var(--frame-gutter)), 820px);
  background: #D8DCDD;
}
@media (prefers-color-scheme: dark) { .notfound-frame { background: #26304A; } }
.notfound-frame > picture > img { object-position: 50% 80%; }
.notfound-body {
  align-self: start;
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(40px, 9vh, 96px) var(--gutter) 40px;
  display: grid;
  gap: 1rem;
  justify-items: start;
}
.notfound-code {
  color: var(--ink);
  font-size: clamp(4.5rem, 2.5rem + 9vw, 10rem);
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: -.05em;
  line-height: .9;
  font-variant-numeric: tabular-nums;
}
.notfound-body h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); font-stretch: 116%; max-width: 18em; }
.notfound-body p:not(.notfound-code) { max-width: 42ch; color: var(--ink-2); font-size: var(--fs-lede); }
.notfound-links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }

/* ---------- 32. Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  60% { transform: translateX(5px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes settle {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
/* The one orchestrated moment: hero copy rises in sequence while the photo settles. */
@media (prefers-reduced-motion: no-preference) {
  .hero-frame > picture > img { animation: settle 1.8s var(--ease) both; transform-origin: 64% 60%; }
  /* backwards, not both: once risen, the copy keeps no animation, which would otherwise cut the
     ghost button's backdrop blur off from the photograph behind it */
  .hero-copy > * { animation: rise .9s var(--ease) backwards; }
  .hero-copy > :nth-child(1) { animation-delay: .12s; }
  .hero-copy > :nth-child(2) { animation-delay: .24s; }
  .hero-copy > :nth-child(3) { animation-delay: .36s; }
  .auth-step:not([hidden]),
  .form-done:not([hidden]) { animation: rise .5s var(--ease) both; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* loading indicators must still say "busy" without spinning */
  .spinner { animation: none !important; border-right-color: currentColor; opacity: .6; }
  .btn.is-loading::after,
  .btn[aria-busy="true"]::after { animation: none !important; border-right-color: var(--btn-fg); opacity: .6; }
  .skeleton-line::after,
  .skeleton-block::after { display: none; }
}

/* ---------- 33. Print ---------- */
@media print {
  .site-header, .site-footer, .nav-menu, .docs-nav, .legal-toc, .toc-fold, .toast-region, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .legal { display: block; }
  a { color: #000; }
}
