/*
 * The one file of style variables for the head unit pages, and their shared components.
 * DESIGN.md (next to this file) is the short guide: colour roles, shape, type, components.
 *
 * Two looks live here:
 *   :root      the store page (index.html): pure white page, the iOS app's ink, hairlines and
 *              forest green, one dark "stage" for every picture; light and dark by OS setting.
 *              Values come from the iOS app (Logbook/ui/LBTheme.swift and its colour sets),
 *              except the page background, pure white here where the app uses #F4F4F3.
 *   .sales     the public sales page (landing.html): one dark cabin look with the E46's amber
 *              night lighting, in every OS setting. See "the sales page scope" below.
 *
 * Every colour, radius, space step and type size is a variable defined in this file. Component
 * rules and page rules only use var(); page <style> blocks keep layout only.
 */

:root {
  /* colour */
  --bg: #ffffff;            /* page */
  --panel: #f4f4f3;         /* quiet filled areas: the app's Paper */
  --card: #ffffff;          /* option cards, on a hairline */
  --ink: #0e171d;
  --muted: #626461;
  --line: #dedad2;
  --green: #315c4c;         /* buttons, links, selection */
  --green-tint: rgba(49, 92, 76, 0.14);
  --on-green: #ffffff;
  --accent: #b74922;        /* burnt orange: badges only */
  --accent-tint: rgba(183, 73, 34, 0.14);
  --warning: #975500;
  --warning-tint: rgba(151, 85, 0, 0.14);
  --danger: #c2261c;
  --stage: #0e171d;         /* always dark, in both themes */
  --stage-ink: #ffffff;
  --stage-soft: rgba(255, 255, 255, 0.8);
  --stage-muted: rgba(255, 255, 255, 0.65);
  --stage-line: rgba(255, 255, 255, 0.16);
  --stage-tint: rgba(255, 255, 255, 0.14);
  --bar: rgba(255, 255, 255, 0.86);   /* pinned bars, with a blur behind */

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter",
    "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "IBM Plex Mono", Menlo, Consolas, monospace;

  --t-display: clamp(2rem, 1.2rem + 3vw, 3rem);     /* page headline */
  --t-title: clamp(1.5rem, 1.2rem + 1.1vw, 1.75rem); /* section and step titles */
  --t-headline: 1.0625rem;  /* 17: card titles, buttons */
  --t-body: 1.0625rem;      /* 17 */
  --t-detail: 0.9375rem;    /* 15 */
  --t-foot: 0.8125rem;      /* 13 */
  --t-chip: 0.75rem;        /* 12 */
  --t-eyebrow: 0.6875rem;   /* 11 */

  /* shape and space */
  --r-sm: 6px;
  --r-md: 10px;
  --r-card: 12px;
  --r-lg: 14px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-2xl: 48px;
  --s-3xl: 72px;
  --ease: 0.22s ease;

  /* Added 2026-11-20 for the shared components. The store page does not read these, and the
     ones that stand in for a value its rules used to spell out keep that exact value. */
  --clear: transparent;
  --stage-glow: rgba(255, 255, 255, 0.07);         /* was literal in .stage__empty */
  --stage-scrim: rgba(0, 0, 0, 0.7);               /* was literal in .stage__caption */
  --stage-scrim-clear: rgba(0, 0, 0, 0);           /* was literal in .stage__caption */
  --font-label: var(--font-mono);                  /* .eyebrow */
  --t-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); /* was literal in .lede */
  --t-wordmark: 1.375rem;                          /* was literal in .wordmark */
  --t-tag: 0.6875rem;                              /* 11 */
  --track-display: -0.045em;
  --track-title: -0.021em;
  --track-eyebrow: 0.155em;
  --track-tag: 0.08em;
  --s-3xs: 2px;
  --s-2xs: 4px;
  --s-4xl: 96px;
  --control-h: 48px;                               /* buttons and fields; 44px is the floor */
  --pin: 24px;                                     /* callout number */
  --blur: 12px;
  --choice-h: 40px;                                /* a .choice option: shorter than a field */
  --hit: 44px;                                     /* the smallest touch target */
  --r-round: 50%;                                  /* the timeline's dots: the one round shape */
  --measure: 36em;
  --section-pad: clamp(56px, 1.5rem + 4.5vw, 104px);

  /* Roles for the shared components (button, form field, choice, tag, section, frame, FAQ
     row). Scopes such as .sales map them to their own palette; these defaults follow the store
     tokens above, so the components also read correctly on the store page, light or dark. */
  --ground: var(--bg);
  --ground-raised: var(--panel);
  --surface: var(--card);
  --text: var(--ink);
  --text-muted: var(--muted);
  --text-subtle: var(--muted);
  --edge: var(--line);
  --edge-strong: var(--muted);
  --hover: var(--green-tint);
  --action: var(--green);
  --action-hover: var(--green);
  --on-action: var(--on-green);
  --lit: var(--accent);
  --track: var(--muted);
  --focus: var(--green);
  --error: var(--danger);
  --photo-ink: var(--stage-ink);
  --photo-on-ink: var(--stage);
  --photo-glass: var(--stage-tint);
  --photo-glass-hover: var(--stage-line);
  --photo-edge: var(--stage-line);
  --scrim-strong: var(--stage-scrim);
  --scrim-mid: var(--stage-scrim);
  --scrim-soft: var(--stage-scrim-clear);
  --scrim-clear: var(--stage-scrim-clear);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e171d;
    --panel: #1c282e;
    --card: #1c282e;
    --ink: #f4f1ed;
    --muted: #b7b9b3;
    --line: #3b494d;
    --green: #a3c8b3;
    --green-tint: rgba(163, 200, 179, 0.16);
    --on-green: #0e171d;
    --accent: #f09b72;
    --accent-tint: rgba(240, 155, 114, 0.16);
    --warning: #f5c167;
    --warning-tint: rgba(245, 193, 103, 0.16);
    --danger: #ff7a70;
    --stage: #070c10;
    --stage-ink: #ffffff;
    --stage-soft: rgba(255, 255, 255, 0.8);
    --stage-muted: rgba(255, 255, 255, 0.65);
    --stage-line: rgba(255, 255, 255, 0.16);
    --stage-tint: rgba(255, 255, 255, 0.14);
    --bar: rgba(14, 23, 29, 0.86);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e171d;
  --panel: #1c282e;
  --card: #1c282e;
  --ink: #f4f1ed;
  --muted: #b7b9b3;
  --line: #3b494d;
  --green: #a3c8b3;
  --green-tint: rgba(163, 200, 179, 0.16);
  --on-green: #0e171d;
  --accent: #f09b72;
  --accent-tint: rgba(240, 155, 114, 0.16);
  --warning: #f5c167;
  --warning-tint: rgba(245, 193, 103, 0.16);
  --danger: #ff7a70;
  --stage: #070c10;
  --stage-ink: #ffffff;
  --stage-soft: rgba(255, 255, 255, 0.8);
  --stage-muted: rgba(255, 255, 255, 0.65);
  --stage-line: rgba(255, 255, 255, 0.16);
  --stage-tint: rgba(255, 255, 255, 0.14);
  --bar: rgba(14, 23, 29, 0.86);
  color-scheme: dark;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* The one wrapper that owns the side gutter. */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

@media (min-width: 720px) {
  .wrap {
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
}

/* ---------- type ---------- */

.display {
  font-size: var(--t-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

.title {
  font-size: var(--t-title);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: var(--track-title);
  text-wrap: balance;
}

.headline {
  font-size: var(--t-headline);
  font-weight: 600;
  line-height: 1.3;
}

.lede {
  font-size: var(--t-lede);
  line-height: 1.42;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}

.detail {
  font-size: var(--t-detail);
  line-height: 1.42;
  color: var(--muted);
}

.foot {
  font-size: var(--t-foot);
  line-height: 1.4;
  color: var(--muted);
}

/* Mono uppercase section label, as in the app. */
.eyebrow {
  font-family: var(--font-label);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

/* Prices and other read-out numbers. */
.num {
  font-family: var(--font-round);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  padding-block: var(--s-md);
}

.wordmark {
  font-size: var(--t-wordmark);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.topbar__side {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  font-size: var(--t-detail);
}

/* ---------- chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--r-sm);
  font-size: var(--t-chip);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--panel);
  color: var(--muted);
}

.chip--green {
  background: var(--green-tint);
  color: var(--green);
}

.chip--accent {
  background: var(--accent-tint);
  color: var(--accent);
}

.chip--warning {
  background: var(--warning-tint);
  color: var(--warning);
}

/* On the dark stage. */
.chip--stage {
  background: var(--stage-tint);
  color: var(--stage-ink);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--green);
  color: var(--on-green);
  font: inherit;
  font-size: var(--t-headline);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform var(--ease), opacity var(--ease);
}

.btn:hover {
  text-decoration: none;
  opacity: 0.92;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.btn--tinted {
  background: var(--green-tint);
  color: var(--green);
}

.btn--quiet {
  min-height: 44px;
  padding-inline: 8px;
  background: transparent;
  color: var(--green);
}

/* ---------- email sign-up ---------- */

.signup {
  display: grid;
  gap: var(--s-sm);
  max-width: 30rem;
}

.signup__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
}

.signup__row .field {
  flex: 1 1 14rem;
  min-width: 0;
}

.signup__row .btn {
  flex: 0 0 auto;
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-body);
}

.field::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.field:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-radius: var(--r-md);
}

.field[aria-invalid="true"] {
  border-color: var(--danger);
}

.label {
  font-size: var(--t-foot);
  font-weight: 600;
  color: var(--ink);
}

.form-msg {
  min-height: 1.4em;
  font-size: var(--t-foot);
  color: var(--muted);
}

.form-msg[data-kind="error"] {
  color: var(--danger);
}

/* ---------- the stage: every picture sits in one of these ---------- */

.stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--stage);
  color: var(--stage-ink);
  border: 1px solid var(--stage-line);
  max-width: 100%;
}

.stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* An empty frame that describes the picture to come. */
.stage__empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-xs);
  height: 100%;
  padding: clamp(20px, 6%, 48px);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--stage-glow), var(--clear) 60%),
    var(--stage);
}

.stage__empty .eyebrow {
  color: var(--stage-muted);
}

.stage__empty-title {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.14;
}

.stage__empty-text {
  max-width: 32em;
  font-size: var(--t-detail);
  line-height: 1.45;
  color: var(--stage-soft);
}

/* Caption strip along the bottom of a stage. */
.stage__caption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-xs);
  padding: 40px var(--s-md) var(--s-sm);
  background: linear-gradient(to top, var(--stage-scrim), var(--stage-scrim-clear));
  font-size: var(--t-foot);
  color: var(--stage-soft);
  pointer-events: none;
}

.stage__caption strong {
  font-weight: 600;
  color: var(--stage-ink);
}

/* ---------- quiet panels and hairline cards ---------- */

.panel {
  border-radius: var(--r-card);
  background: var(--panel);
  padding: var(--s-lg);
}

.card {
  border-radius: var(--r-card);
  background: var(--card);
  border: 1px solid var(--line);
  padding: var(--s-lg);
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   The sales page scope (.sales)
   ========================================================================== */

/* landing.html's root wrapper is <div class="sales">. One dark cabin look, whatever the OS
   setting. The :root:has() selector gives the whole document (body background, scrollbars,
   native controls) the same look; the .sales line keeps the wrapper right on its own. It comes
   after the store's light and dark blocks, so it wins on a page that has .sales and does
   nothing on one that does not. Colour rule: see DESIGN.md. */
:root:has(.sales),
.sales {
  color-scheme: dark;

  /* palette: the only literal colours of the sales look */
  --amber: #ffa040;              /* the E46's own night lighting */
  --amber-bright: #ffb870;       /* the primary button on hover */
  --amber-ink: #17110a;          /* label on amber */
  --night-0: #0b0c0e;            /* page ground: the cabin at night */
  --night-1: #141619;            /* raised ground: panels */
  --night-2: #1a1d21;            /* field surface */
  --night-3: #26292e;            /* hairlines */
  --grey-5: #6e737a;             /* field and choice edges (3:1 or more on every ground) */
  --grey-6: #8d9097;             /* captions and small print */
  --grey-8: #b4b7bc;             /* secondary text */
  --white: #ffffff;
  --red-soft: #ff8a80;           /* errors */
  --white-hover: rgba(255, 255, 255, 0.08);
  --white-60: rgba(255, 255, 255, 0.6);   /* the timeline's line, as in the teaser */
  --glass: rgba(11, 12, 14, 0.62);
  --glass-strong: rgba(11, 12, 14, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.28);
  --shade-94: rgba(11, 12, 14, 0.94);
  --shade-70: rgba(11, 12, 14, 0.7);
  --shade-35: rgba(11, 12, 14, 0.35);
  --shade-0: rgba(11, 12, 14, 0);

  /* roles */
  --ground: var(--night-0);
  --ground-raised: var(--night-1);
  --surface: var(--night-2);
  --text: var(--white);
  --text-muted: var(--grey-8);
  --text-subtle: var(--grey-6);
  --edge: var(--night-3);
  --edge-strong: var(--grey-5);
  --hover: var(--white-hover);
  --action: var(--amber);
  --action-hover: var(--amber-bright);
  --on-action: var(--amber-ink);
  --lit: var(--amber);
  --track: var(--white-60);
  --focus: var(--white);
  --error: var(--red-soft);
  --photo-ink: var(--white);
  --photo-on-ink: var(--night-0);
  --photo-glass: var(--glass);
  --photo-glass-hover: var(--glass-strong);
  --photo-edge: var(--glass-edge);
  --scrim-strong: var(--shade-94);
  --scrim-mid: var(--shade-70);
  --scrim-soft: var(--shade-35);
  --scrim-clear: var(--shade-0);

  /* the store tokens the shared base and type rules read */
  --bg: var(--ground);
  --panel: var(--ground-raised);
  --card: var(--surface);
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--edge);
  --danger: var(--error);

  /* type: the system face for now. When the brand picks its fonts, change --font-sans here
     (and self-host the files: the live CSP allows fonts from this site only). */
  --font-sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-label: var(--font-sans);
  --t-display: clamp(2.5rem, 1.6rem + 3vw, 4rem);      /* 40 to 64: the one h1 */
  --t-title: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);   /* 28 to 40: section titles */
  --t-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);  /* 17 to 20 */
  --t-eyebrow: 0.75rem;                                 /* 12 */
  --track-display: -0.025em;
  --track-title: -0.018em;
  --track-eyebrow: 0.14em;
}

.sales {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
}

.sales a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sales :focus-visible {
  outline-color: var(--focus);
}

/* ==========================================================================
   Shared components. Each reads only the role tokens, so it takes the look of whatever scope
   it sits in. Names are BEM: block, block__part, block--variant.
   ========================================================================== */

/* ---------- button ---------- */
/* .button              the primary action, filled with --action. One per region.
   .button--photo       for a control that sits on a picture: dark glass, white label.
                        With aria-pressed="true" it fills white (a switch's chosen side).
   .button--photo-quiet the low-key action on a picture: white label, no fill until hover. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  min-height: var(--control-h);
  padding: 0 var(--s-lg);
  border: 1px solid var(--clear);
  border-radius: var(--r-md);
  background: var(--action);
  color: var(--on-action);
  font: inherit;
  font-size: var(--t-headline);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.button:hover {
  background: var(--action-hover);
  text-decoration: none;
}

.button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

.button--photo {
  background: var(--photo-glass);
  border-color: var(--photo-edge);
  color: var(--photo-ink);
  font-weight: 600;
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}

.button--photo:hover {
  background: var(--photo-glass-hover);
}

.button--photo[aria-pressed="true"] {
  background: var(--photo-ink);
  border-color: var(--photo-ink);
  color: var(--photo-on-ink);
}

.button--photo-quiet {
  padding-inline: var(--s-sm);
  background: var(--clear);
  color: var(--photo-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.button--photo-quiet:hover {
  background: var(--photo-glass);
  text-decoration: underline;
}

/* ---------- form field ---------- */
/* Top to bottom: the label (with .form-field__required or .form-field__optional after the
   text when a form uses them), the control, then one line: the hint, or the error in its
   place. The control lists the hint's and the error's ids in aria-describedby. */
.form-field {
  display: grid;
  gap: var(--s-2xs);
  min-width: 0;
}

.form-field__label {
  font-size: var(--t-foot);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.form-field__required {
  margin-left: var(--s-3xs);
  color: var(--error);
}

.form-field__optional {
  margin-left: var(--s-2xs);
  font-weight: 400;
  color: var(--text-muted);
}

.form-field__input {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--s-md);
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--t-body);
}

.form-field__input:hover {
  border-color: var(--text-muted);
}

.form-field__input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-md);
}

.form-field__input[aria-invalid="true"] {
  border-color: var(--error);
}

.form-field__hint,
.form-field__error {
  font-size: var(--t-foot);
  line-height: 1.4;
  color: var(--text-muted);
}

.form-field__error {
  color: var(--error);
}

.form-field__error:empty {
  display: none;
}

.form-field:has(.form-field__error:not(:empty)) .form-field__hint {
  display: none;
}

/* ---------- two-way choice ---------- */
/* A fieldset of real radio inputs drawn as two separate outlined buttons with a gap. They are
   shorter than a field (--choice-h), so they never read as a third text box; each radio covers
   its button and reaches the --hit height, so the touch target stays 44px. Nothing is picked
   until the visitor picks; the picked one fills with --text. Arrow keys move between them.
   It eases in whenever it appears (the sign-up forms show it once the email has a character). */
.choice {
  display: grid;
  gap: var(--s-2xs);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  animation: choice-in var(--ease) both;
}

.choice > legend {
  padding: 0;
  margin-bottom: var(--s-2xs);
}

.choice__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
}

.choice__option {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  max-width: 100%;
  cursor: pointer;
}

.choice__input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: var(--hit);
  margin: 0;
  opacity: 0;
  transform: translateY(-50%);
  cursor: pointer;
}

.choice__label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--choice-h);
  padding: 0 var(--s-md);
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-md);
  background: var(--clear);
  color: var(--text);
  font-size: var(--t-detail);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.choice__option:hover .choice__label {
  background: var(--hover);
  border-color: var(--text-muted);
}

.choice__input:checked + .choice__label {
  background: var(--text);
  border-color: var(--text);
  color: var(--ground);
}

.choice__input:focus-visible + .choice__label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@keyframes choice-in {
  from {
    opacity: 0;
    transform: translateY(calc(-1 * var(--s-2xs)));
  }
}

/* ---------- sign-up confirmation ---------- */
/* Takes a sign-up form's place once the address is in: a check that draws itself and glows
   once, a title, one line naming the address, and a quiet way back to the form. The form
   gets data-state="done" and every other child hides. The check is --text, not amber: amber
   stays for the one action and for things that are lit.
   While the sign-up is on its way, the form's button carries aria-disabled="true". */
.signup-form[data-state="done"] > :not(.signup-done) {
  display: none;
}

.button[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.75;
}

.button[aria-disabled="true"]:hover {
  background: var(--action);
}

.signup-done {
  display: grid;
  justify-items: start;
  gap: var(--s-sm);
  min-width: 0;
}

.signup-done:focus {
  outline: none;
}

.signup-done__mark {
  width: 56px;
  height: 56px;
  margin-bottom: var(--s-2xs);
  overflow: visible;
  fill: none;
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: done-glow 1.4s 0.75s ease-out both;
}

/* pathLength="1" on both shapes, so one dash is the whole stroke. */
.signup-done__ring,
.signup-done__tick {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.signup-done__ring {
  transform: rotate(-90deg);
  transform-origin: center;
  transform-box: fill-box;
  animation: done-draw 0.6s cubic-bezier(0.65, 0, 0.35, 1) both;
}

.signup-done__tick {
  stroke-width: 3;
  animation: done-draw 0.3s 0.5s ease-out both;
}

.signup-done > :not(.signup-done__mark) {
  animation: done-rise 0.5s 0.3s ease-out both;
}

.signup-done__body {
  color: var(--text-muted);
}

.signup-done__body strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.signup-done__again {
  min-height: var(--hit);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--t-detail);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.signup-done__again:hover {
  color: var(--text);
}

.signup-done__again:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@keyframes done-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes done-rise {
  from {
    opacity: 0;
    transform: translateY(var(--s-xs));
  }
}

@keyframes done-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
  35% {
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--text) 55%, transparent));
  }
}

/* ---------- tag ---------- */
/* A small uppercase label, never a control. .tag--photo sits on a picture ("3D render"). */
.tag {
  display: inline-flex;
  align-items: center;
  min-height: var(--s-lg);
  padding: var(--s-3xs) var(--s-xs);
  border-radius: var(--r-sm);
  background: var(--ground-raised);
  color: var(--text-muted);
  font-size: var(--t-tag);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: var(--track-tag);
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--photo {
  border: 1px solid var(--photo-edge);
  background: var(--photo-glass);
  color: var(--photo-ink);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}

/* ---------- section ---------- */
/* One section, one stated job. The head is .eyebrow, .title and one short .lede. */
.section {
  padding-block: var(--section-pad);
}

.section__head {
  display: grid;
  gap: var(--s-sm);
  max-width: var(--measure);
}

.section__head .lede {
  color: var(--text-muted);
}

/* ---------- ruled list ---------- */
/* A plain list on hairlines. .ruled-list--across lays the items side by side from 760px. */
.ruled-list > * {
  padding-block: var(--s-md);
  border-top: 1px solid var(--edge);
}

.ruled-list > :last-of-type {
  border-bottom: 1px solid var(--edge);
}

@media (min-width: 760px) {
  .ruled-list--across {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    column-gap: var(--s-lg);
  }

  .ruled-list--across > :last-of-type {
    border-bottom: 0;
  }
}

/* ---------- timeline ---------- */
/* An ordered list of milestones on one line, after the teaser's end card: a dot per milestone
   on a thin line, the label above each dot and the date below it. The line and the dots are
   pseudo-elements, so they are decoration and never announced; each item reads label, then
   date. The dots are amber (--lit), the colour rule's second permitted use (see DESIGN.md).
   Under 400px the line turns vertical, with the label and date beside each dot: narrower than
   that, every label and date would break onto two lines.
   The page's script adds .timeline--armed (not drawn yet) and, once the list scrolls into
   view, .timeline--draw: the line draws from the first dot to the last (--seg for each stretch
   between two dots, about 0.9 s for three milestones) and each dot appears as the line reaches
   it. Without those classes (no script, reduced motion) the timeline is simply drawn. */
.timeline {
  --dot: 14px;
  --line: 2px;
  --gap: var(--s-md);
  --gap-y: var(--s-lg);
  --seg: 0.45s;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: auto var(--dot) auto;
  column-gap: var(--gap);
  row-gap: var(--s-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline > :nth-child(2) {
  --i: 1;
}

.timeline > :nth-child(3) {
  --i: 2;
}

.timeline > :nth-child(4) {
  --i: 3;
}

.timeline > :nth-child(5) {
  --i: 4;
}

.timeline__item {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  justify-items: center;
  min-width: 0;
  font-size: var(--t-headline);
  text-align: center;
}

.timeline__label {
  grid-row: 1;
  align-self: end;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.timeline__date {
  grid-row: 3;
  font-size: var(--t-detail);
  line-height: 1.4;
  color: var(--text-muted);
}

/* The dot. */
.timeline__item::before {
  content: "";
  grid-row: 2;
  grid-column: 1;
  place-self: center;
  width: var(--dot);
  height: var(--dot);
  border: 2px solid var(--text);
  border-radius: var(--r-round);
  background: var(--lit);
}

/* The line, from this dot to the next one. */
.timeline__item::after {
  content: "";
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  justify-self: start;
  width: calc(100% + var(--gap) - var(--dot));
  height: var(--line);
  margin-left: calc(50% + var(--dot) / 2);
  background: var(--track);
  transform-origin: left center;
}

.timeline__item:last-of-type::after {
  display: none;
}

.timeline--armed .timeline__item::before {
  opacity: 0;
  transform: scale(0);
}

.timeline--armed .timeline__item::after {
  transform: scaleX(0);
}

.timeline--draw .timeline__item::before {
  animation: timeline-dot 0.2s ease-out both;
  animation-delay: calc(var(--i, 0) * var(--seg));
}

.timeline--draw .timeline__item::after {
  animation: timeline-line-x var(--seg) linear both;
  animation-delay: calc(var(--i, 0) * var(--seg));
}

@media (max-width: 399px) {
  .timeline {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-rows: none;
    row-gap: var(--gap-y);
  }

  .timeline__item {
    display: block;
    position: relative;
    grid-row: auto;
    justify-items: normal;
    padding-left: calc(var(--dot) + var(--s-md));
    text-align: left;
  }

  .timeline__label,
  .timeline__date {
    display: block;
  }

  /* 0.65em is half the label's line: the dot sits on the label's middle. */
  .timeline__item::before {
    position: absolute;
    top: calc(0.65em - var(--dot) / 2);
    left: 0;
  }

  .timeline__item::after {
    position: absolute;
    top: calc(0.65em + var(--dot) / 2);
    left: calc((var(--dot) - var(--line)) / 2);
    width: var(--line);
    height: calc(100% + var(--gap-y) - var(--dot));
    margin: 0;
    transform-origin: center top;
  }

  .timeline--armed .timeline__item::after {
    transform: scaleY(0);
  }

  .timeline--draw .timeline__item::after {
    animation-name: timeline-line-y;
  }
}

@keyframes timeline-dot {
  from {
    opacity: 0;
    transform: scale(0);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes timeline-line-x {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes timeline-line-y {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

/* ---------- picture frame ---------- */
/* A figure: the picture in a fixed-ratio box (--frame-ratio, 16 / 9 unless set), its tag in
   the top left corner, and a caption of at most two lines under it. A video can take the
   picture's place in the same box. */
.frame {
  display: grid;
  gap: var(--s-sm);
  min-width: 0;
  margin: 0;
}

.frame__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--frame-ratio, 16 / 9);
  border-radius: var(--r-card);
  background: var(--ground-raised);
}

.frame__media > img,
.frame__media > video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame__tag {
  position: absolute;
  top: var(--s-sm);
  left: var(--s-sm);
  z-index: 2;
}

/* A caption may start with a .tag ("3D render") when the picture itself is too busy for one. */
.frame__caption {
  max-width: var(--measure);
  font-size: var(--t-foot);
  line-height: 1.4;
  color: var(--text-subtle);
  text-wrap: pretty;
}

.frame__caption > .tag {
  margin-right: var(--s-2xs);
  vertical-align: 1px;
}

/* ---------- callouts on a picture ---------- */
/* .frame--callouts: numbered labels for the parts of a picture. Each item carries --x and --y
   (where the part is, in percent of the picture), data-tier (1 or 2), data-place (left, right
   or below) and data-align (start, center or end, for place below).
   Under 1200px: a short pin drops from each part to its number on the picture (.callout-pin,
   decorative), and the list (.callouts) reads as numbered rows under the picture.
   From 1200px: the pins go and each list item sits on the picture itself, a leader line from
   the part to its label: below it (down to --tier-1 or --tier-2, percent of the picture's
   height), or out to the left or right by --reach (percent of its width). The page sets these
   for its picture. */
.frame--callouts {
  position: relative;
  --tier-1: 60%;
  --tier-2: 75%;
  --reach: 1.5%;
  --side-label: 11rem;
}

.callout-pins,
.callouts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.callout-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 18%;
}

.callout-pin[data-tier="2"] {
  height: 34%;
}

/* The leader line. */
.callout-pin::before,
.callout::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -0.5px;
  width: 1px;
  background: var(--photo-ink);
}

/* The pin's head: a small square on the part itself. */
.callout-pin::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--s-xs);
  height: var(--s-xs);
  border-radius: var(--s-3xs);
  background: var(--photo-ink);
  transform: translate(-50%, -50%);
}

.callout-pin__num,
.callout__num {
  display: inline-grid;
  place-items: center;
  width: var(--pin);
  height: var(--pin);
  border-radius: var(--r-sm);
  background: var(--photo-ink);
  color: var(--photo-on-ink);
  font-size: var(--t-foot);
  font-weight: 700;
  line-height: 1;
}

.callout-pin__num {
  position: absolute;
  top: 100%;
  left: 0;
  transform: translate(-50%, 0);
}

.callouts {
  display: grid;
  gap: var(--s-sm);
}

.callout {
  display: grid;
  grid-template-columns: var(--pin) minmax(0, 1fr);
  column-gap: var(--s-sm);
  align-items: start;
}

.callout::before {
  display: none;
}

.callout__label {
  display: block;
  font-size: var(--t-body);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.callout__text {
  display: block;
  font-size: var(--t-detail);
  line-height: 1.4;
  color: var(--text-muted);
}

@media (min-width: 1200px) {
  .frame--callouts .callout-pins {
    display: none;
  }

  .frame--callouts .callouts {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    aspect-ratio: var(--frame-ratio, 16 / 9);
    display: block;
    pointer-events: none;
  }

  /* Below: the item runs from the part down to its tier; the label hangs from its foot. */
  .frame--callouts .callout {
    position: absolute;
    left: var(--x);
    top: var(--y);
    display: block;
    width: 0;
    height: calc(var(--tier-1) - var(--y));
  }

  .frame--callouts .callout[data-tier="2"] {
    height: calc(var(--tier-2) - var(--y));
  }

  .frame--callouts .callout::before {
    display: block;
  }

  /* Left and right: the item runs sideways from the part by --reach; the label sits at its end. */
  .frame--callouts .callout[data-place="left"],
  .frame--callouts .callout[data-place="right"] {
    width: var(--reach);
    height: 0;
  }

  .frame--callouts .callout[data-place="left"] {
    left: calc(var(--x) - var(--reach));
  }

  .frame--callouts .callout[data-place="left"]::before,
  .frame--callouts .callout[data-place="right"]::before {
    top: -0.5px;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }

  .frame--callouts .callout__num {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--s-xs);
    height: var(--s-xs);
    border-radius: var(--s-3xs);
    transform: translate(-50%, -50%);
    font-size: 0;
  }

  .frame--callouts .callout[data-place="left"] .callout__num {
    left: 100%;
  }

  .frame--callouts .callout__body {
    position: absolute;
    top: 100%;
    width: max-content;
    max-width: 16rem;
    padding: var(--s-xs) var(--s-sm);
    border: 1px solid var(--photo-edge);
    border-radius: var(--r-sm);
    background: var(--photo-glass);
    -webkit-backdrop-filter: blur(var(--blur));
    backdrop-filter: blur(var(--blur));
  }

  .frame--callouts .callout[data-align="start"] .callout__body {
    left: calc(-1 * var(--s-sm));
  }

  .frame--callouts .callout[data-align="center"] .callout__body {
    left: 0;
    transform: translateX(-50%);
    text-align: center;
  }

  .frame--callouts .callout[data-align="end"] .callout__body {
    right: calc(-1 * var(--s-sm));
    text-align: right;
  }

  .frame--callouts .callout[data-place="left"] .callout__body,
  .frame--callouts .callout[data-place="right"] .callout__body {
    top: 0;
    max-width: var(--side-label);
    transform: translateY(-50%);
  }

  .frame--callouts .callout[data-place="left"] .callout__body {
    left: auto;
    right: 100%;
    text-align: right;
  }

  .frame--callouts .callout[data-place="right"] .callout__body {
    left: 100%;
    right: auto;
    text-align: left;
  }

  .frame--callouts .callout__label {
    font-size: var(--t-detail);
  }

  .frame--callouts .callout__text {
    font-size: var(--t-foot);
  }
}

/* ---------- FAQ row ---------- */
/* A native <details>: the question is the <summary>, the answer follows, all in the page. */
.faq {
  border-top: 1px solid var(--edge);
}

.faq:last-of-type {
  border-bottom: 1px solid var(--edge);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  min-height: var(--control-h);
  padding-block: var(--s-md);
  color: var(--text);
  font-size: var(--t-headline);
  font-weight: 600;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
}

.faq__q::-webkit-details-marker {
  display: none;
}

/* The chevron: two borders of a small square, turned. */
.faq__q::after {
  content: "";
  flex: none;
  width: var(--s-xs);
  height: var(--s-xs);
  margin-right: var(--s-2xs);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform var(--ease);
}

.faq[open] > .faq__q::after {
  transform: translateY(25%) rotate(-135deg);
}

.faq__q:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.faq__a {
  max-width: var(--measure);
  padding-bottom: var(--s-lg);
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .choice__label,
  .faq__q::after {
    transition: none;
  }

  .choice,
  .timeline--draw .timeline__item::before,
  .timeline--draw .timeline__item::after,
  .signup-done__mark,
  .signup-done__ring,
  .signup-done__tick,
  .signup-done > * {
    animation: none;
  }

  .timeline--armed .timeline__item::before,
  .timeline--armed .timeline__item::after {
    opacity: 1;
    transform: none;
  }
}
