/* The sheet the static pages wear: About, Pricing, Map credits, Terms,
   Privacy and the two /pro pages. Deliberately standalone — no bundle, no
   index.css: these must render even if the app never boots, and crawlers
   should get plain HTML. /tokens.css is linked first on every page and holds
   the primitives (Passage's cinema palette and its two faces, Fraunces and
   Geist); everything below is page semantics built out of them.

   Brief 97c rewrote it in the landing's material (src/components/Hero.css):
   ink first, cream when the reader's system asks for light (or, since Brief
   99o, the reader picks light mode with the header's switch), Fraunces for
   the headings, Geist for the text, glass for every panel. It began as Voyarc's
   public/pages.css @ 23e7122 and no longer follows it — the flight app's
   pages keep Voyarc's look, Passage's wear the film's.

   Two registers share this sheet:
   · document (Terms, Privacy) — one measure, a contents list, numbered
     sections. Body class `doc`.
   · product (About, Map credits, Pricing and the /pro pages) — the same
     type, plus the plan table and the /pro forms. Body class `product`.
   · content (the guides at /guides, /for and /vs, Brief 99j), on top of
     product: numbered steps, named points, a fact table and a row of
     related links. Body class `product content`. The breadcrumb and the
     cards are shared with the track tools (src/tools/tools.css), which load
     this sheet first.

   Every colour pair here was measured (Brief 97c): text clears 4.5:1 on the
   page and on the glass in both registers, the numbers beside each token. */

:root {
  color-scheme: dark light;
  /* ---- the night register (the default, as the landing is) ---- */
  --page: var(--passage-ink, #03050b);
  --text: var(--passage-paper, #f6f1e7);
  /* Secondary text, solid rather than the hero's translucent cream so the
     ratio is one number wherever it sits: 7.7:1 on the ink, 7.0:1 on the
     glass, 5.8:1 on the Pro column's tint. */
  --muted: #a39f97;
  /* A link's words, and the colour of everything clickable: the gold
     accent (Brief 100a), 11.7:1 on the ink, 10.5:1 on the glass, 8.8:1 on
     the Pro tint. */
  --link: var(--passage-accent, #ffb703);
  /* The underline and the marks: the accent in both registers' own shade. */
  --accent: var(--passage-accent, #ffb703);
  /* The pill: gold on the ink, its words the ink (11.7:1). */
  --pill: var(--passage-accent, #ffb703);
  --on-pill: var(--passage-ink, #03050b);
  /* Hairlines between things, and the material panels are made of. */
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-edge: rgba(255, 255, 255, 0.12);
  /* The Pro column's tint, laid over the glass. */
  --tint: rgba(255, 183, 3, 0.1);
  /* What floats over the page (back to top): glass you can still read
     through, frosted. */
  --float: rgba(14, 18, 32, 0.78);
  /* The ring round what floats (Brief 99o): the accent at the first step of
     5% that clears 3:1 on the ink, gold's 3.4:1 (45% gives 2.96:1). */
  --ring: color-mix(in srgb, var(--accent) 50%, transparent);
  --glow: radial-gradient(110% 640px at 78% -120px, #0b1430 0%, rgba(3, 5, 11, 0) 70%);
  /* The reading measure: one number, so both registers agree. */
  --measure: 68ch;
}

/* The cream register, twice (Brief 99o): once for a reader who chose light
   mode with the header's switch (`data-theme="light"` on <html>, set by
   /theme.js from `passage-theme`), once for a reader who follows a light
   system and has not chosen dark. CSS cannot share one declaration list
   between the two, so the bodies are copies: they must match byte for byte
   once the media block's extra indent is taken off, and
   scripts/pages.test.mjs fails when they do not. */
:root[data-theme='light'] {
  /* ---- the cream register ---- */
  --page: var(--passage-paper, #f6f1e7);
  --text: var(--passage-ink, #03050b);
  /* 5.9:1 on the cream, 5.3:1 on its glass, 4.9:1 on the Pro tint. */
  --muted: #615c54;
  /* --passage-link-paper (tokens.css), the bronze: 6.3:1 on the cream, 5.7:1
     on its glass, 5.2:1 on the Pro tint. Gold is never words or a hairline on
     the cream (1.55:1, Brief 100a): the underline and the marks are the ink
     accent, gold's partner on paper. */
  --link: var(--passage-link-paper, #7a4f00);
  --accent: var(--passage-accent-ink, #2c2c2c);
  /* Words on an accent fill: paper on the ink accent, 12.4:1 (tokens.css). */
  --on-accent: var(--passage-paper, #f6f1e7);
  /* The pill turns over: ink, its words the cream (18:1). */
  --pill: var(--passage-ink, #03050b);
  --on-pill: var(--passage-paper, #f6f1e7);
  --line: rgba(3, 5, 11, 0.12);
  --glass: rgba(3, 5, 11, 0.05);
  --glass-edge: rgba(3, 5, 11, 0.1);
  --tint: rgba(44, 44, 44, 0.05);
  --float: rgba(246, 241, 231, 0.86);
  /* The ink accent at the first step of 5% that clears 3:1 on the cream:
     55% gives 3.3:1, 50% 2.88:1. */
  --ring: color-mix(in srgb, var(--accent) 55%, transparent);
  --glow: none;
}

/* Must match the block above, byte for byte but for the indent
   (scripts/pages.test.mjs). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    /* ---- the cream register ---- */
    --page: var(--passage-paper, #f6f1e7);
    --text: var(--passage-ink, #03050b);
    /* 5.9:1 on the cream, 5.3:1 on its glass, 4.9:1 on the Pro tint. */
    --muted: #615c54;
    /* --passage-link-paper (tokens.css), the bronze: 6.3:1 on the cream, 5.7:1
       on its glass, 5.2:1 on the Pro tint. Gold is never words or a hairline on
       the cream (1.55:1, Brief 100a): the underline and the marks are the ink
       accent, gold's partner on paper. */
    --link: var(--passage-link-paper, #7a4f00);
    --accent: var(--passage-accent-ink, #2c2c2c);
    /* Words on an accent fill: paper on the ink accent, 12.4:1 (tokens.css). */
    --on-accent: var(--passage-paper, #f6f1e7);
    /* The pill turns over: ink, its words the cream (18:1). */
    --pill: var(--passage-ink, #03050b);
    --on-pill: var(--passage-paper, #f6f1e7);
    --line: rgba(3, 5, 11, 0.12);
    --glass: rgba(3, 5, 11, 0.05);
    --glass-edge: rgba(3, 5, 11, 0.1);
    --tint: rgba(44, 44, 44, 0.05);
    --float: rgba(246, 241, 231, 0.86);
    /* The ink accent at the first step of 5% that clears 3:1 on the cream:
       55% gives 3.3:1, 50% 2.88:1. */
    --ring: color-mix(in srgb, var(--accent) 55%, transparent);
    --glow: none;
  }
}

/* A reader's choice sets the native controls and the scrollbar too; on the
   system's register `dark light` above lets the browser follow the OS. */
:root[data-theme='light'] {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* Several controls here ship hidden and are unhidden by script (the plan
   state, "Manage plan", the staging restore link, the flight app's
   hand-off). An author `display` rule outranks the UA sheet's [hidden]
   whatever its specificity, so the sheet has to say it itself — otherwise a
   page without JavaScript shows every one of them, dead. */
[hidden] {
  display: none !important;
}

/* Said to a screen reader and to nothing else — the comparison table's
   caption, which the columns already say in type. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* One ring for everything that takes the keyboard, in the link colour, so
   it is seen on the ink and on the cream alike. */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

::selection {
  background: var(--link);
  color: var(--page);
}

/* The first thing in every page's tab order, and the first child of every
   body: one key past the header's links and into the page itself. Parked off
   the top rather than `display: none` — a link nothing can focus is a link
   nothing can use — and it comes down over the header when it is. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  padding: 10px 18px;
  border-radius: 0 0 14px 0;
  background: var(--pill);
  color: var(--on-pill);
  font: 600 0.92rem/1.3 var(--font-text, system-ui, sans-serif);
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* <main> is the target, so it takes focus (tabindex="-1") and the next Tab
   carries on inside it. The ring would be a box round the whole page and says
   nothing the jump has not already said. */
main:focus {
  outline: none;
}

/* Chrome on macOS can leave the page stuck rubber-banded above its top after
   a hard trackpad flick (blank band above the header, nav unclickable until
   reload). The pages have nothing to pull down to, so refuse to overscroll.
   Vertical only: the plan table still scrolls sideways. */
html {
  overscroll-behavior-y: none;
  background: var(--page);
}

body {
  margin: 0;
  padding: 28px 24px 64px;
  /* The landing's night, its glow at the top of the page only: the ratios
     above are measured on the ink, and the glow is no lighter than #0b1430,
     where every one of them still clears 6.7:1. */
  background: var(--glow) no-repeat, var(--page);
  color: var(--text);
  font-family: var(--font-text, system-ui, sans-serif);
  /* 17px: these are pages you read, not a panel you work in. */
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* One width for every page, so the header, the nav and the footer line up
   across the set and the plan table has room for its three columns. */
.wrap {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* The container is that width everywhere, so a block that is meant to be read
   says so and keeps the reading measure. The /pro pages have no .prose: their
   paragraphs and the form keep the measure on their own. */
.wrap .prose,
main > p,
main > form {
  max-width: var(--measure);
}

/* A phone keeps 16px either side and nothing scrolls sideways but the plan
   table, inside its own box. */
@media (max-width: 640px) {
  body {
    padding: 20px 16px 56px;
  }

  .wrap {
    gap: 24px;
  }
}

/* ---------- shared header / footer ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* The hero's kicker (Hero.css .hero-kicker): the brand dot, then the lockup
   in sentence case, "by Voyarc" a step back. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.brand .by {
  color: var(--muted);
  font-weight: 500;
}

/* The trade mark sign after the name (Brief 410t): small, raised and quiet,
   in the muted ink (never the gold), on both modes. Out of the flow, just past
   the name in the gap before the nav, so the header's row, its height and the
   phone's one-row fit (e2e/pages.spec.ts) are what they were without it. Its
   top sits at the name's cap height: half the box down is the name's middle,
   and 0.75 of the sign's em back up is the caps' top. The landing's bar wears
   the same sign (src/components/Landing.css .landing .mark .tm). */
.brand .tm {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 1px;
  translate: 0 -0.75em;
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

/* The brand dot (src/components/brand.css), still: gold, ivory and sky
   round a conic gradient, with the gold's glow (Brief 100a). */
.brand-dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #ffb703, #f6f1e7, #7fd1ff, #ffb703);
  box-shadow: 0 0 14px rgba(255, 183, 3, 0.55);
}

/* `margin-left: auto` holds the nav and the theme switch after it together
   at the right, where space-between alone would set the nav in the middle. */
.head-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 500;
}

.head-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.head-nav a:hover,
.head-nav a[aria-current='page'] {
  color: var(--text);
}

/* The way into the thing every one of these pages is about: the last item of
   the nav rather than a floating button, so on a phone it wraps with the
   links and nothing scrolls sideways. A pill, as the landing's buttons are,
   and it never takes aria-current: the map is not one of the pages. */
.head-nav .nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--on-pill);
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.2s ease;
}

.head-nav .nav-cta:hover {
  color: var(--on-pill);
  filter: brightness(1.08);
}

/* Light mode or dark mode (Brief 99o): the last thing in the header, a round
   button the CTA's height that shows the register it turns the page to (a
   sun on the ink, a moon on the cream). It ships `hidden` and /pages.js
   unhides it, as it does the back-to-top button; its ring and its icon's
   colour are that button's, under "back to top and the theme switch" below. */
.theme-switch {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

/* A phone: the switch moves up beside the wordmark, at the right, and the
   nav follows it, on the same row while the three fit (390 px does, 356 of
   its 358 px, with the gaps a step tighter) and on a row of its own below
   when they do not. The source order stays nav then switch, so the Tab
   order is the desktop's. */
@media (max-width: 760px) {
  .page-head {
    column-gap: 8px;
  }

  .theme-switch {
    order: 1;
    margin-left: auto;
  }

  .head-nav {
    order: 2;
    column-gap: 12px;
    margin-left: 0;
  }

  .head-nav .nav-cta {
    padding: 8px 12px;
  }
}

/* A finger's worth (Brief 145; the film row's, src/components/PlayChrome.css):
   the header's links and the switch keep their drawn sizes (the switch 36 px,
   the header under 70) and each takes a hit box 44 px tall on its centre and
   its width plus half the gap each side (`--tap-x`), so neighbours' boxes
   meet and never cover each other: 11 px between the nav's links (22), 10
   between the nav and the switch (the header's 20). The wordmark stands
   alone at the left, so its box is only the taller one. */
.page-head .brand,
.head-nav a,
.theme-switch {
  position: relative;
}

.page-head .brand::after,
.head-nav a::after,
.theme-switch::after {
  content: '';
  position: absolute;
  left: calc(-1 * var(--tap-x, 0px));
  right: calc(-1 * var(--tap-x, 0px));
  top: 50%;
  height: 44px;
  translate: 0 -50%;
  pointer-events: auto;
}

.head-nav a {
  --tap-x: 11px;
}

.head-nav a:last-child::after {
  right: -10px;
}

.theme-switch {
  --tap-x: 10px;
}

/* The switch's box is drawn from inside its 1 px border. */
.theme-switch::after {
  left: calc(-1px - var(--tap-x));
  right: calc(-1px - var(--tap-x));
}

/* A phone: 6 px between the links (12), and the switch, beside the wordmark,
   stands 8 px before the nav's first link when they share the row. */
@media (max-width: 760px) {
  .head-nav a {
    --tap-x: 6px;
  }

  .head-nav a:first-child::after {
    left: -4px;
  }

  .head-nav a:last-child::after {
    right: -6px;
  }

  .theme-switch {
    --tap-x: 4px;
  }
}

.page-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

.page-foot p {
  margin: 0;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.foot-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.foot-nav a:hover {
  color: var(--text);
}

/* The accounts, icon-only like the app panel: the footer's muted at rest,
   the link colour on hover, glyphs the size of the text. */
.foot-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.foot-social a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s ease;
}

.foot-social a:hover {
  color: var(--link);
}

.foot-social svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* ---------- back to top ---------- */

/* The way back up a long page, floating clear of the measure. It ships
   `hidden` and the page's own script unhides it, so a reader without
   JavaScript never gets a button that cannot scroll; past the first screen
   the script adds `show` and it fades in. Above the plan table's sticky row
   heads (z-index 1) and nothing else on these pages. */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  /* Out of the tab order and out of the accessibility tree until it is worth
     reaching: `visibility` cannot tween, so it is held to the end of the fade
     on the way out and dropped at once on the way in. */
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s;
}

.to-top.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

/* ---------- back to top and the theme switch ---------- */

/* The two controls that sit over the page rather than in its text wear the
   page's own material (Brief 99o): the frosted float, the --ring token and
   the icon in the link colour. The ring is the accent at a dose for each
   register, the first step of 5% that clears the 3:1 a control's boundary
   needs against the page: 60% on the ink, 3.2:1 (3.4:1 where it sits over
   the float), and 80% on the cream, 3.2:1. The icon is 7.1:1 on the float
   over the ink and 5.5:1 over the cream. Hover and the keyboard make the
   ring the solid accent (7.6:1 on the ink, 4.1:1 on the cream) and change
   nothing else; the focus outline is the global :focus-visible ring. The
   shorthand's accent is only what stands if --ring cannot be computed. */
.to-top,
.theme-switch {
  border: 1px solid var(--accent);
  border-color: var(--ring);
  background: var(--float);
  color: var(--link);
}

.to-top:hover,
.to-top:focus-visible,
.theme-switch:hover,
.theme-switch:focus-visible {
  border-color: var(--accent);
  color: var(--link);
}

/* A browser without color-mix() gets the solid accent, 1 px, at rest too. */
@supports not (color: color-mix(in srgb, red, red)) {
  .to-top,
  .theme-switch {
    border-color: var(--accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .to-top,
  .theme-switch {
    transition: none;
  }
}

/* A phone has less room beside the text, and a thumb reaches the corner. */
@media (max-width: 760px) {
  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

/* ---------- text ---------- */

/* Block layout, not flex: adjacent heading/paragraph margins should collapse
   rather than stack into airy gaps between sections. */
main {
  display: block;
}

/* Fraunces at the hero's weight, in the hero's scale family: the title a step
   under the landing's own (clamp(64px, 7.4vw, 108px)), soft as the landing
   sets it. */
h1,
h2,
h3 {
  font-family: var(--font-display, Georgia, serif);
  font-variation-settings: 'SOFT' 30;
  text-wrap: balance;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
}

h2 {
  margin: 48px 0 14px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3 {
  margin: 28px 0 8px;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p,
ul,
ol {
  margin: 0 0 18px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
}

li::marker {
  color: var(--muted);
}

strong,
b {
  font-weight: 600;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.meta {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Underlined in the accent, 2px clear of the words. */
a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* Route and key text is monospace (typography doctrine), on a glass chip. */
code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--glass);
  font-family: var(--font-mono, monospace);
  font-size: 0.88em;
  white-space: nowrap;
}

/* ---------- document register (Terms, Privacy) ---------- */

.doc main {
  counter-reset: section;
}

.doc .lede {
  margin-bottom: 30px;
}

/* Numbers come from a counter, not the copy: the legal wording is untouched
   and the contents list can't drift out of step with it. The sections are
   the reading block's own headings (one of them inside the flight app's
   section), so the contents list's own "On this page" heading, nested in the
   .toc, is not one of them and takes no number. */
.doc main .prose > h2,
.doc main .prose > section > h2 {
  counter-increment: section;
  scroll-margin-top: 18px;
}

.doc main .prose > h2::before,
.doc main .prose > section > h2::before {
  content: counter(section) '. ';
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* The one place a page speaks of the flight app: its own section, set off by
   a hairline above, so it reads as an aside to the page rather than its
   subject. */
.flight-app {
  margin-top: 48px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.flight-app > h2 {
  margin-top: 28px;
}

.toc {
  margin: 0 0 8px;
  padding: 18px 22px 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--glass);
}

.toc h2 {
  margin: 0 0 10px;
  font: 600 0.8rem/1.3 var(--font-text, system-ui, sans-serif);
  color: var(--muted);
}

.toc ol {
  margin: 0 0 10px;
  padding-left: 22px;
  columns: 2;
  column-gap: 28px;
  font-size: 0.94rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}

.toc a {
  color: var(--text);
  text-decoration-color: var(--line);
}

.toc a:hover {
  color: var(--link);
  text-decoration-color: var(--accent);
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

/* ---------- product register (About, Map credits) ---------- */

.credit-list li {
  margin-bottom: 14px;
}

/* ---------- pricing ---------- */

/* One comparison table, three columns: the plans are read across, so they are
   one table rather than three lists that have to be kept in step. It never
   makes the page scroll sideways — the wrapper scrolls instead, and the
   feature column stays put while it does. */
/* Said in words at the width where it is true — a phone shows the labels and
   most of Free, and nothing about the page says the other two plans are a
   swipe away. Above the table, because a caption under it is read after the
   reader has already decided there is nothing else. */
.swipe-hint {
  display: none;
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .swipe-hint {
    display: block;
  }
}

.plan-matrix-wrap {
  /* Flex so the fade below can be a flex item of its own: a pseudo-element in
     a scroll container is laid out with the content and scrolls away with it,
     and the cue has to stay at the edge of the screen. */
  display: flex;
  margin-bottom: 24px;
  overflow-x: auto;
  /* Room for a focus ring on a CTA. */
  padding-bottom: 4px;
}

/* The cue: a fade at the right edge for as long as there is more table to the
   right of it. Sticky, so it rides the scrollport rather than the table, and
   pulled back over the last 44px by its own negative margin so it adds
   nothing to the scroll width. Off until the page's own script turns it on
   (build-pricing.mjs) — without JavaScript there is nothing keeping it honest,
   and a fade that never moves is worse than no fade. */
.plan-matrix-wrap::after {
  content: '';
  position: sticky;
  right: 0;
  flex: none;
  align-self: stretch;
  width: 44px;
  margin-left: -44px;
  background: linear-gradient(to right, transparent, var(--page));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.plan-matrix-wrap.more::after {
  opacity: 1;
}

.plan-matrix {
  width: 100%;
  /* Separate, not collapsed: a collapsed table drops border-radius, and the
     column heads are glass panels. */
  border-collapse: separate;
  border-spacing: 0;
  /* Fixed, so the three plans are three columns of exactly the same width and
     the labels take what is left: the heads are compared across, and columns
     sized by their own copy would put the prices at three widths. */
  table-layout: fixed;
  /* Below this the columns would squeeze the blurbs into slivers; the wrapper
     scrolls instead, and a phone scrolls the table sideways (.swipe-hint
     says so). */
  min-width: 36rem;
  text-align: left;
}

/* The column heads: what the plan is, what it costs, its button. The 1px
   height is the old table trick, not a size: a cell never shrinks below its
   content, but naming a height at all is what lets the grid inside it ask
   for 100% of the row (below, `.plan-head`). */
.plan-matrix th.plan {
  /* What the label column leaves, split three ways. */
  width: calc(74% / 3);
  height: 1px;
  padding: 20px 16px 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 18px 18px 0 0;
  background: var(--glass);
  vertical-align: top;
  font-weight: 400;
}

/* One head, in slots: name, pitch, price, the line under it, button. The
   pitch row is the only flexible one, so it swallows every difference in
   blurb length (and the "Pro is active until…" line the script fills in)
   while the price and the button stay level across the three columns. */
.plan-head {
  display: grid;
  /* One column, allowed to be narrower than its widest child: without the
     minmax a child's own minimum (the button, the price) could push a head
     wider than its cell on a phone. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 8px;
  height: 100%;
}

/* Pro is the recommendation, so it is the column with the tint and the edge. */
.plan-matrix th.plan.featured,
.plan-matrix td.featured {
  background: linear-gradient(var(--tint), var(--tint)), var(--glass);
}

.plan-matrix th.plan.featured {
  border-color: var(--accent);
}

.plan h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* The labels take what they need at this width and no more, so the three
   plans get the rest, in three equal columns. */
.plan-matrix .corner {
  width: 26%;
}

/* The empty corner and the feature labels stay legible while the table is
   scrolled sideways: opaque, in the page's own colour. */
.plan-matrix .corner,
.plan-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--page);
}

.plan-matrix tbody th {
  padding: 14px 14px 14px 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  font-weight: 500;
  text-wrap: pretty;
}

.plan-matrix tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

/* In or out, then the qualifier: "1080p", "2160p (4K)". */
.mark {
  display: block;
}

.mark.yes {
  color: var(--accent);
}

.mark.no {
  color: var(--muted);
  opacity: 0.7;
}

.cell-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

/* Every column has one, in dollars or in words. */
.price {
  margin: 4px 0 0;
  font: 400 1.9rem/1.15 var(--font-display, Georgia, serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* The line under the price — how it is billed, or what the price covers.
   Three lines' worth of room whether it needs them or not, so the prices
   above it stay level: the Film pass's line ("48 hours from purchase. One
   payment, nothing to cancel.") runs to three lines in a column this width. */
.billed,
.price-note {
  min-height: 4.05em;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}

.plan-state {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 600;
}

.plan .blurb {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  text-wrap: pretty;
}

/* Buttons are pills of glass with a hairline; the one that matters is the
   header's pill (accent on the ink, ink on the cream). The plan buttons only
   work with JavaScript (they call /api/checkout), so they ship as links to
   the restore page and are upgraded in place — a reader without it still
   lands somewhere useful. */
.cta {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  font: 600 0.95rem/1.3 var(--font-text, system-ui, sans-serif);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    filter 0.2s ease;
}

.cta:hover {
  border-color: var(--accent);
}

.cta.primary {
  border-color: var(--pill);
  background: var(--pill);
  color: var(--on-pill);
}

.cta.primary:hover {
  filter: brightness(1.08);
}

/* One button per column, the width of the column it belongs to and the last
   row of its grid — the copy is short enough to stay on one line. */
.plan-matrix th.plan .cta {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 10px 8px;
}

.cta.manage {
  margin-top: 8px;
}

/* Forget on this device (Brief 335): the quietest thing in the head, a text
   button under Manage plan in --muted with no fill or edge until hovered, so
   it never reads as a second offer. Full column width like the others, and
   its two words wrap rather than push a phone's narrow column wider. */
.plan-matrix th.plan .cta.forget {
  margin-top: 4px;
  border-color: transparent;
  background: none;
  color: var(--muted);
  font-weight: 500;
  white-space: normal;
}

.plan-matrix th.plan .cta.forget:hover {
  border-color: var(--glass-edge);
  color: var(--text);
}

/* Only ever filled by the script, and only when something went wrong. */
.plan-note:empty {
  display: none;
}

/* The way back to a film (Brief 215): /pages.js shows it when the reader came
   from the export room. Words in --text on the page's glass, in either
   register (over 15:1); the link is the site's pill at the 44 px floor. */
.from-film {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 24px;
  padding: 14px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  background: var(--glass);
}

.from-film p {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.from-film .cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0;
}

/* What every plan has alike, said once above the rows that differ. */
.every-plan {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.95rem;
}

/* Pro's price in passes: the first line of its note, in the page's ink. */
.price-anchor {
  display: block;
  color: var(--text);
  font-weight: 600;
}

/* A cell that answers in words ("48 hours", "A year"), not a mark. */
.cell-value {
  font-size: 0.94rem;
}

.plan-note {
  color: var(--link);
}

.faq h3 {
  margin-top: 24px;
}

/* A guide's pointer to the questions every app shares, said once on the hub. */
.faq-shared {
  margin-top: 24px;
  color: var(--muted);
}

/* The hub's "From the track to the film": the steps every guide shares, what
   the film shows and the questions every app shares (Brief 148b). */
.film-section h3 {
  margin-top: 28px;
}

.film-section h4 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
}

.film-section .cta {
  margin-top: 24px;
}

/* Where the plan columns stop being wide enough for the price and the button
   copy to hold one line each, the heads give back some of their padding and
   the price comes down a size. Below 820px or so the wrapper is scrolling the
   table sideways as well, and the columns are at their narrowest. */
@media (max-width: 1024px) {
  .plan-matrix th.plan {
    padding: 16px 10px 16px;
  }

  /* A price is one unbreakable word: at this width the big size would run
     out of the column rather than wrap. */
  .price {
    font-size: 1.45rem;
  }

  .plan-matrix th.plan .cta {
    padding: 9px 4px;
    font-size: 0.88rem;
  }

  .plan-matrix tbody td {
    padding: 14px 10px;
  }
}

/* Where the columns bottom out (the table is at its min-width and scrolling
   sideways), the Film pass's note can run to four lines rather than three.
   Every column reserves the fourth line, not just the pass's — the
   reservation is what keeps the three prices and the three buttons level. */
@media (max-width: 860px) {
  .billed,
  .price-note {
    min-height: 5.4em;
  }
}

/* ---------- the /pro pages ---------- */

.pro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.pro-actions .cta {
  margin-top: 0;
}

/* /pro/activate holds its way back shut until the token is in localStorage:
   clicking it while /api/activate is still in flight aborts the call that
   writes it, and the map boots free. Muted, and not clickable, until then. */
.cta[aria-disabled='true'] {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

/* "Email me a link": one field, one button, on one line where there is room. */
.restore-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px;
}

.restore-form label {
  flex: 1 0 100%;
  font-size: 0.875rem;
  color: var(--muted);
}

.restore-form input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.restore-form input::placeholder {
  color: var(--muted);
}

.restore-form input:focus-visible {
  border-color: var(--accent);
}

.restore-form .cta {
  flex: 0 0 auto;
  margin-top: 0;
}

/* ---------- the trail and the cards (the tools and the guides) ---------- */

/* Where a page sits under its hub, the page itself last and unlinked. */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
}

.crumbs li {
  margin: 0;
}

.crumbs li + li::before {
  content: '/';
  margin-right: 6px;
  opacity: 0.6;
}

.crumbs a {
  color: var(--muted);
  text-decoration-color: var(--line);
}

.crumbs a:hover {
  color: var(--text);
}

/* A hub's links, and a tool's neighbours: a grid of glass cards, each a name,
   a line and an arrow, the whole card the link. */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tool-cards li {
  margin: 0;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px 44px 16px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--glass);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.card-name {
  font-family: var(--font-display, Georgia, serif);
  font-variation-settings: 'SOFT' 30;
  font-size: 1.2rem;
  line-height: 1.25;
}

.card-line {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.card-arrow {
  position: absolute;
  top: 18px;
  right: 16px;
  color: var(--accent);
}

.tool-group h2 {
  margin-top: 40px;
}

.group-lead {
  max-width: var(--measure);
  color: var(--muted);
}

/* The hub's sample trips (Brief 331a): a hub card with the trip's poster at
   its start, the name and the line beside it. */
.trip-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding-left: 12px;
}

.card-poster {
  flex: 0 0 auto;
  width: 56px;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.card-words {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.trip-card .card-arrow {
  top: 50%;
  margin-top: -9px;
}

/* ---------- content register (the guides, Brief 99j) ---------- */

/* The tools' title size: a guide's H1 is a sentence, not a word. */
.content h1 {
  font-size: clamp(42px, 5.4vw, 72px);
}

.content-intro .lede {
  margin-bottom: 10px;
}

.content-intro .updated {
  margin: 0;
}

.content-section h2 {
  margin-top: 40px;
}

/* Numbered steps: the number in the display face on a ring of glass, the
   step beside it, so a reader with the other app open finds their place. */
.steps {
  display: grid;
  gap: 14px;
  margin: 4px 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background-color: var(--glass);
  color: var(--link);
  font: 400 1.05rem/1 var(--font-display, Georgia, serif);
  font-variant-numeric: tabular-nums;
}

/* The step's words, one grid item however many links they hold, their
   first line level with the middle of the number. */
.steps li > span {
  padding-top: 4px;
}

/* Named points: what Voyarc does for a trip, two to a row where there is room. */
.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 4px 0 18px;
  padding: 0;
  list-style: none;
}

.points li {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background-color: var(--glass);
}

.points h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.points p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

/* A sample film, as the one card on the page with depth: the play mark in
   the pill's colours, then the film's name and what happens in it. */
.film-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 48px 18px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  background-color: var(--glass);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.75);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.film-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.film-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pill);
  color: var(--on-pill);
}

.film-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.film-card .card-arrow {
  top: 50%;
  margin-top: -9px;
}

/* A sample film on an answer page (Brief 409): the <video> a sample page's
   intro carries, on its poster, its caption under it. Until the film is
   pressed the browser sizes a <video> by its poster, which is the film's own
   frame; the ratio is said outright as well, should a poster ever be another
   shape. A 9:16 film stands at a phone's width rather than the column's, so
   it never runs off a laptop's screen. */
.film-figure {
  margin: 6px 0 18px;
}

.film-figure video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  background: var(--glass);
}

.film-figure.tall video {
  max-width: 340px;
  aspect-ratio: 9 / 16;
}

.film-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

/* The comparison (Brief 409): one column an app, ours last, the labels held
   at the left while a phone scrolls the table sideways in its own box, so the
   page itself never scrolls sideways. */
.compare-wrap {
  margin: 4px 0 14px;
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.94rem;
}

.compare-table caption {
  margin-bottom: 10px;
  color: var(--muted);
  text-align: left;
}

.compare-table th,
.compare-table td {
  padding: 12px 12px 12px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.compare-table thead th,
.compare-table thead td {
  border-top: 0;
  font-weight: 500;
}

.compare-table .corner,
.compare-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 22%;
  background: var(--page);
  font-weight: 500;
}

/* A cell's source: its number, a link to the list under the table. */
.cite {
  margin-left: 3px;
  font-size: 0.75em;
}

.sources {
  margin: 0 0 18px;
  padding-left: 1.4em;
  color: var(--muted);
  font-size: 0.88rem;
}

.sources li {
  margin: 2px 0;
}

/* The panel before the questions: one line, one button, on one row where
   there is room. The one panel of glass with depth on a guide, so the next
   press is the thing that stands out. */
.content-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 44px;
  padding: 22px 24px;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background-color: var(--glass);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.75);
}

.content-cta p {
  flex: 1 1 22rem;
  max-width: var(--measure);
  margin: 0;
}

.content-cta .cta {
  margin-top: 0;
}

/* Where to go next: a row of glass pills, tools, samples and pages mixed. */
.related-links h2 {
  margin-top: 40px;
  font-size: clamp(24px, 2.4vw, 30px);
}

.related-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-links li {
  margin: 0;
}

.related-links a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background-color: var(--glass);
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.related-links a:hover {
  border-color: var(--accent);
}

/* The hub's way on to the tools; the way on to the app closes the film
   section above it. */
.hub-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.next-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 26px;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background-color: var(--glass);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.75);
}

.next-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.4vw, 32px);
}

.next-panel p {
  flex: 1 0 auto;
  margin: 0;
  color: var(--muted);
}

/* The cards on the cream, chosen or the system's (Brief 99o): two copies
   that must match byte for byte but for the indent (scripts/pages.test.mjs),
   as the cream tokens at the top of the sheet. */
:root[data-theme='light'] .film-card,
:root[data-theme='light'] .content-cta,
:root[data-theme='light'] .next-panel {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  box-shadow: 0 22px 50px -30px rgba(40, 30, 20, 0.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .film-card,
  :root:not([data-theme='dark']) .content-cta,
  :root:not([data-theme='dark']) .next-panel {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    box-shadow: 0 22px 50px -30px rgba(40, 30, 20, 0.35);
  }
}

/* A phone: a sample film's card draws in, its mark smaller. */
@media (max-width: 640px) {
  .film-card {
    gap: 14px;
  }

  .film-mark {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .film-card,
  .related-links a {
    transition: none;
  }

  .tool-card:hover,
  .film-card:hover {
    transform: none;
  }
}
