/* The page. Colours, spacing and radii come from tokens.css (the app's), and the
   pieces copy the app's: the lime primary pill with its ink arrow nub, the outline
   button, the caps kicker and the display title. Dark only. */

@font-face {
  font-family: Urbanist;
  /* A subset of the app's TTF: npm run font (tools/font.mjs). */
  src: url('/fonts/Urbanist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* The app's monospace (DdFonts.mono), for the data-like labels: the kickers and the
   How steps' big numbers. Only the caps, figures and a few marks, at 700 to 800, from
   tools/mono-font.sh; keep its RANGE and the unicode-range here the same. */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Caps.woff2') format('woff2');
  font-weight: 700 800;
  font-display: swap;
  unicode-range: U+0020-0021, U+0023, U+0025-0029, U+002B-003A, U+003F, U+0041-005A, U+2013-2014, U+2019;
}

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

html { -webkit-text-size-adjust: 100%; }

/* The hero's photo is 100vw wide, which counts the scrollbar where it takes room (a
   Mac with a mouse, Windows): clip that sliver instead of scrolling to it. */
main { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font: 500 16px/1.4 Urbanist, system-ui, sans-serif;
}

/* The app's sun glows (DdColors.dark.sky), on a layer fixed to the screen behind the
   page: iOS ignores background-attachment: fixed, and desktops repaint it on scroll. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(60% 55% at 92% 6%, #ff8a3d57, #ff5a3624 38%, #ff5a3600 70%),
    radial-gradient(45% 45% at 4% 98%, #d7f73a1a, #d7f73a00 70%),
    radial-gradient(90% 60% at 50% 122%, #5b702547, #5b702500 70%);
}

a { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s-4) var(--s-4);
  padding-top: max(var(--s-4), env(safe-area-inset-top));
}

.brand {
  color: var(--text);
  font-size: 31.68px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

/* ---------- Buttons (DdButton) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  border-radius: var(--r-full);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Outline, sm: 48 high, 15/700. */
.btn-ghost {
  min-height: 48px;
  padding: 0 20px;
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.btn-ghost:hover { background: var(--glass-strong); }

/* Primary, lg: 64 high, 19/800, with the ink nub. */
.btn-primary {
  min-height: 64px;
  padding: 0 10px 0 28px;
  background: var(--accent-fill);
  box-shadow: 0 8px 26px var(--accent-glow);
  color: var(--on-accent);
  font-size: 19px;
  font-weight: 800;
}
.btn-primary::after {
  content: '';
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--nub-ink) center / 22px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d7f73a' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-primary:hover::after { transform: rotate(45deg) scale(1.06); }

/* Control, md: the cream pill for the page's other buttons. 56 high, 17/800. */
.btn-control {
  min-height: 56px;
  padding: 0 26px;
  background: var(--control);
  color: var(--control-text);
  font-size: 17px;
  font-weight: 800;
}
.btn-control:hover { background: var(--cream-200); }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn-primary::after, details summary::after { transition: none; }
}

/* ---------- Layout ---------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: var(--s-4);
}

/* Words beside a picture: stacked on phones, side by side from 860. */
.split {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}

.band { padding-block: var(--s-8); }

.kicker {
  margin: 0 0 var(--s-4);
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The H1 and the photo bands' lines are 800, the app's display weight; section and
   card headings are 700, a step lighter, so the page doesn't shout all the way down. */
h1, h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 14ch;
  font-weight: 800;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.02;
}

h2 {
  max-width: 18ch;
  font-weight: 700;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
}

h3 {
  margin: 0 0 var(--s-2);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p { margin: 0; }

.lead {
  max-width: 34ch;
  margin: var(--s-5) 0 var(--s-6);
  color: var(--text-2);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.note {
  margin-top: var(--s-3);
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- Hero ---------- */

/* The hero's bottom edge is a hairline the full width of the window: a border image
   pushed out 100vw each side, which paints past the wrap without adding a sideways
   scroll. */
.hero {
  padding-block: var(--s-7) 0;
  border-bottom: 1px solid var(--line-strong);
  border-image: linear-gradient(var(--line-strong) 0 0) 0 0 1 / 0 0 1px / 0 100vw;
}

/* The hero's phone is 1.3x the others and rises out of the page: the slot is the
   phone's top two-thirds (9 / 19.5 wide to tall, so 9 / 13), sits on the hero's
   bottom edge, and cuts the phone off on the line. The cut is only at the bottom,
   so the shadow still shows on the other three sides. */
.hero .shot {
  justify-self: center;
  align-self: end;
  align-items: flex-start;
  width: min(390px, 100%);
  aspect-ratio: 9 / 13;
  min-height: 0;
  clip-path: inset(-100px -100px 0 -100px);
}
.hero .phone {
  flex: none;
  width: 100%;
}

/* The promises under Start, in the hero: one quiet row, each with a lime dot. A promise never
   breaks across lines; the row wraps between them. */
.promises {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: var(--s-4) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
}
.promises li {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  white-space: nowrap;
}
.promises li::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Cards (DdCard: glass on the sky) ---------- */

.card {
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  border-radius: var(--r-3);
  background: var(--glass);
}

.card p {
  color: var(--text-2);
  line-height: 1.45;
}

.grid-2, .grid-3 {
  display: grid;
  gap: var(--s-3);
  margin: 0 0 var(--s-6);
  padding: 0;
  list-style: none;
}

/* ---------- How a session runs ---------- */

#how h2 { margin-bottom: var(--s-6); }

/* The ink nub with a lime figure, like the primary button's. */
.num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 19px;
  font-weight: 800;
}
button.num {
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Switcher (scripts/switcher.js) ----------
   Items beside a picture: choosing one shows its picture. Once the script runs
   (.is-live), the chosen item is lit in the accent and the others' numbers dim.
   On phones the picture comes first, then the items as a row of labelled tabs
   (their short label in place of the number), then the chosen item's words. */

.is-live .switch-item {
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.is-live .switch-item.card.is-on {
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
}

.is-live .switch-tab {
  background: var(--glass-strong);
  color: var(--text);
  transition: background-color 200ms ease, color 200ms ease;
}
.is-live .is-on .switch-tab {
  background: var(--accent-fill);
  color: var(--on-accent);
}
.switch-label { display: none; }

/* The pictures sit on top of each other. The chosen one fades in over the last,
   which goes once it's covered; the rest are hidden, from screen readers too. */
.switch [data-switch-pic] {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0s 200ms, visibility 0s 200ms;
}
.switch [data-switch-pic].is-on {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .is-live .switch-item, .is-live .switch-tab,
  .switch [data-switch-pic], .switch [data-switch-pic].is-on { transition: none; }
}

@media (max-width: 859px) {
  .switch > .shot { order: -1; }

  .is-live .switch-list {
    grid-template-columns: repeat(var(--switch-n, 4), 1fr);
    gap: 0 var(--s-2);
  }
  .is-live .switch-item { display: contents; }
  .is-live .switch-tab {
    grid-row: 1;
    width: 100%;
    height: 48px;
    margin-bottom: var(--s-5);
    border-radius: var(--r-full);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
  }
  .is-live .switch-n { display: none; }
  .is-live .switch-label { display: inline; }
  .is-live .switch-item > :not(.switch-tab) { grid-column: 1 / -1; }
  .is-live .switch-item:not(.is-on) > :not(.switch-tab) { display: none; }
  .is-live .switch-item > p { margin-top: var(--s-2); }
}

/* ---------- The steps' carousel (scripts/carousel.js) ----------
   Without the script the steps are listed, each shot above its words. Once it
   runs (.is-live) the slides share one place: the chosen one's shot sits right of
   centre with the next one peeking in at the edge, a big faint number sits behind
   the title, and the title overlaps the shot's left edge, darkened so it reads.
   The peeking shot runs off the edge of the page (main clips it). Moving on slides
   the shots left and brings the next words up. */

.slides {
  display: grid;
  gap: var(--s-7);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: slide;
}
.slide { counter-increment: slide; }

.slide-shot {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg);
  aspect-ratio: 4 / 5;
}
.slide-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.slide-words h3 { margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1.05; }
.slide-words p { margin-top: var(--s-3); max-width: 30ch; color: var(--text-2); }

.carousel-nav { display: none; }

.is-live .slides {
  gap: 0;
  touch-action: pan-y;
}
/* The shot is never taller than 70% of the window, so a phone held sideways
   still shows it and its words. */
.is-live .slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: min(84%, 70svh * 4 / 5);
  align-content: start;
}
.is-live .slide-shot {
  grid-area: 1 / 1;
  transition: transform 650ms cubic-bezier(.7, 0, .2, 1), opacity 650ms ease;
}
/* The bottom of the phone shot darkens into the page under the title. */
.is-live .slide-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0b0f0900 45%, #0b0f09f2 100%);
}
.is-live .slide-words {
  grid-area: 2 / 1 / 3 / 2;
  position: relative;
  z-index: 1;
  margin-top: -56px;
  padding-inline: var(--s-4);
  transition: opacity 300ms ease, transform 300ms ease;
}
.is-live .slide-words::before {
  content: "0" counter(slide);
  display: none;
  position: absolute;
  z-index: -1;
  bottom: 100%;
  left: var(--s-3);
  margin: 0 0 -0.42em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(96px, 13vw, 190px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--text);
  opacity: 0.09;
}

.is-live .slide.is-next .slide-shot { transform: translateX(106%); opacity: 0.35; cursor: pointer; }
.is-live .slide.is-after .slide-shot { transform: translateX(212%); opacity: 0; }
.is-live .slide.is-before .slide-shot { transform: translateX(-30%); opacity: 0; }
.is-live .slide:not(.is-on) .slide-words { opacity: 0; transform: translateY(24px); }
.is-live .slide.is-on .slide-words { transition-delay: 300ms; }
.is-live .slide:not(.is-on):not(.is-next) { visibility: hidden; transition: visibility 0s 650ms; }

.is-live .carousel-nav {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.carousel-dots { display: flex; gap: var(--s-2); margin-right: auto; }
.carousel-dots button {
  width: 36px;
  height: 24px;
  padding: 0;
  border: 0;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 3px no-repeat;
  cursor: pointer;
  transition: background-size 300ms ease;
}
.carousel-dots button[aria-current="true"] {
  background-image: linear-gradient(var(--accent), var(--accent));
}
.carousel-arrow {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
}
.carousel-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.carousel-arrow:hover:not(:disabled) { background: var(--glass-strong); }
.carousel-arrow:disabled { opacity: 0.35; cursor: default; }

/* The format links under the carousel: glass link cards, four across on desktop, each with
   its one-line blurb. The arrow nudges up and right on hover. */
.format-links-kicker { margin-top: var(--s-7); }
.format-links {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .format-links { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .format-links { grid-template-columns: repeat(4, 1fr); } }
.format-link {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  height: 100%;
  padding: var(--s-5);
  border: 1px solid var(--line-strong);
  border-top-color: var(--line-top);
  border-radius: var(--r-3);
  background: var(--glass);
  color: var(--text);
  text-decoration: none;
  transition: background-color 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.format-link:hover { border-color: var(--accent-line); background: var(--glass-strong); }
.format-link-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 18px;
  font-weight: 700;
}
.format-link-title svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.format-link:hover .format-link-title svg { transform: translate(2px, -2px); }
.format-link-text { color: var(--text-2); font-size: 15px; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) {
  .format-link, .format-link-title svg { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .is-live .slide-shot, .is-live .slide-words, .is-live .slide:not(.is-on):not(.is-next) { transition: none; }
}

/* From 860: the desktop shot, 72% across from 20% in, and the words from the left
   edge, the title running over the shot's darkened left side. The big number only
   shows here; on phones it would sit on the shot. */
@media (min-width: 860px) {
  .slide-shot { aspect-ratio: 2880 / 1800; }
  .slides { grid-template-columns: min(100%, 80svh * 2880 / 1800); }
  .is-live .slide {
    grid-template-columns: 20% 72% 8%;
    align-items: center;
    padding-top: var(--s-7);
  }
  .is-live .slide-shot { grid-area: 1 / 2; }
  .is-live .slide-shot::after {
    background: linear-gradient(90deg, #0b0f09f0 0%, #0b0f09b3 22%, #0b0f0900 42%);
  }
  .is-live .slide-words {
    grid-area: 1 / 1 / 2 / 3;
    margin-top: 0;
    padding: 0;
    max-width: 480px;
  }
  .is-live .slide-words h3 { font-size: clamp(40px, 4.4vw, 60px); }
  .is-live .slide-words p { max-width: 21ch; }
  .is-live .slide-words::before { display: block; left: -0.06em; margin-bottom: -0.3em; }
  .is-live .slide.is-next .slide-shot { transform: translateX(108%); }
  .is-live .slide.is-after .slide-shot { transform: translateX(216%); }
  .is-live .carousel-nav { margin-right: 8%; }
}

/* ---------- Players scan in ---------- */

/* The title is two lines, one phrase on each. */
#scan-title span { display: block; }

.ticks {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
  font-weight: 600;
}
.ticks li {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}
.ticks li::before {
  content: '';
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft) center / 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d7f73a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
  transform: translateY(3px);
}

/* ---------- Get the app ---------- */

/* The light band: one section on the app's cream, edge to edge, in the app's light
   theme ("Paper Court", DdColors.light). The theme colours are set again inside it,
   so its cards, steps, buttons, links and focus outlines take the ink and the olive
   (lime on cream is too faint), and lime stays only as a fill. The cream runs the
   width of the window as the hero's hairline does: a border image pushed out 100vw
   each side. */
.band-light {
  --text: #12160d;
  --text-2: #3a4030;
  --text-3: #575e46;
  --accent: var(--olive-600);
  --link: var(--olive-600);
  --line: #161a0e24;
  --line-strong: #161a0e57;
  --line-top: #ffffffe6;
  --glass: #fffdf59e;
  --glass-strong: #fffdf5d9;
  --glass-solid: #fcfaf1eb;
  --accent-soft: #3f52181f;
  --accent-line: #3f521899;
  --control: #12160d;
  --control-text: var(--cream-100);
  color-scheme: light;
  border-image: linear-gradient(var(--cream-100) 0 0) fill 0 / 0 / 0 100vw;
  color: var(--text);
}
/* The outline button's edge in the olive, so it reads as a button on the cream. */
.band-light .btn-ghost { border-color: var(--accent); }
.band-light .btn-control:hover { background: var(--ink-700); }
/* The cream shows any spare space, so the last thing in it keeps no margin. */
.band-light > :last-child { margin-bottom: 0; }

.numbered {
  display: grid;
  gap: var(--s-2);
  margin: var(--s-3) 0 0;
  padding-left: 1.3em;
  color: var(--text-2);
  line-height: 1.45;
}
.numbered li::marker {
  color: var(--accent);
  font-weight: 800;
}

/* One card per platform (scripts/platform.js): three across from 980, two and one
   between, and one column on phones. The visitor's card comes first, outlined in
   the accent, with its mark ("Your phone") above the title. */
@media (min-width: 640px) and (max-width: 979px) {
  .grid-3.platforms { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .grid-3.platforms { grid-template-columns: repeat(3, 1fr); }
}
.platforms .is-yours { border-color: var(--accent-line); }
.card .yours {
  width: fit-content;
  margin: 0 0 var(--s-3);
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 800;
}
.card .yours[hidden] { display: none; }

/* ---------- FAQ ---------- */

#faq h2 { margin-bottom: var(--s-6); }

/* The FAQ is reference, not selling: a smaller heading. Install keeps the section
   size, on one line wherever it fits (from 760 wide). */
#faq h2 { font-size: 32px; }
@media (min-width: 760px) {
  #install h2 { max-width: none; }
}

.faq {
  max-width: 760px;
  border-top: 1px solid var(--line);
}

details { border-bottom: 1px solid var(--line); }

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 64px;
  padding-block: var(--s-3);
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
/* The + is drawn, two lime bars on the glass circle, so it has no text for a
   screen reader to read out with the question. */
summary::after {
  content: '';
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat,
    var(--glass-strong);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
details[open] summary::after { transform: rotate(45deg); }

details p {
  max-width: 60ch;
  padding-bottom: var(--s-5);
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.5;
}

/* Two columns from 1100 wide. Each is its own list (faq.columns), so an answer
   opening only moves the questions under it, never one into the other column. */
@media (min-width: 1100px) {
  .faq {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: var(--s-7);
    max-width: none;
    border-top: 0;
  }
  .faq-col { border-top: 1px solid var(--line); }
}

/* ---------- Footer ----------
   The brand and the email, then two groups of links: the app's, and the privacy
   policy and terms. Stacked on phones; side by side from 860. The top rule runs the
   full width of the window, like the hero's bottom edge (the same border image). */

.foot {
  display: grid;
  gap: var(--s-3);
  padding-block: var(--s-7);
  padding-bottom: max(var(--s-7), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  border-image: linear-gradient(var(--line) 0 0) 1 0 0 / 1px 0 0 / 0 100vw;
  color: var(--text-2);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--s-5);
  margin-top: var(--s-3);
}
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}
.foot-title {
  flex-basis: 100%;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.made { margin-top: var(--s-3); color: var(--text-3); font-size: 14px; }

/* ---------- Privacy and terms (src/legal.html) ----------
   One readable column: the display title, then plain sections. */

.legal {
  max-width: 760px;
  padding-block: var(--s-7) var(--s-8);
}

.legal h1 { max-width: none; font-size: clamp(36px, 4.6vw, 56px); }

.updated {
  margin-top: var(--s-4);
  color: var(--text-3);
  font-size: 15px;
  font-weight: 600;
}
.updated time { color: var(--text); }

.legal .lead { max-width: none; margin-bottom: var(--s-7); }

.toc {
  margin-bottom: var(--s-7);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  border-radius: var(--r-3);
  background: var(--glass);
}
.toc-title {
  margin-bottom: var(--s-3);
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.toc ol {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding-left: 1.4em;
  color: var(--text-3);
}
.toc li::marker { font-weight: 700; }
.toc a { color: var(--text-2); font-weight: 600; text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }

.legal section {
  padding-top: var(--s-6);
  scroll-margin-top: var(--s-4);
}
.legal section + section { margin-top: var(--s-6); border-top: 1px solid var(--line); }

.legal h2 {
  max-width: none;
  margin-bottom: var(--s-4);
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.legal section p, .points li {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.55;
}
.legal section p + p, .legal .points + p { margin-top: var(--s-3); }
/* A section's worked-example cards sit a step below the paragraphs that lead into them. */
.legal section .grid-2 { margin-top: var(--s-5); }

.points {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-3) 0 0;
  padding-left: 1.2em;
}
.points:not(:has(li)) { display: none; }
.points li::marker { color: var(--accent); }

/* ---------- For players ----------
   The cards are a switcher, each with its number beside its title
   and its words below. On phones the heading comes first, then the phone, the
   Rating, Stats, Taps and History tabs, the chosen card's words and the account line. */

.feature {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: var(--s-3);
}
.feature .num { grid-row: auto; }
.feature h3 { align-self: center; margin: 0; }
.feature p { grid-column: 1 / -1; margin-top: var(--s-3); }

/* Under the cards, the account line: what an account gets you, Create an account
   and the quieter See your stats, then the note. */
.players-account-line {
  max-width: 34ch;
  margin-bottom: var(--s-5);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 859px) {
  .players { row-gap: var(--s-6); }
  .players-words { display: contents; }
  .players-head { order: -2; }
  .players .lead, .players .switch-list { margin-bottom: 0; }
  /* A hairline keeps the account line apart from the chosen card's words. */
  .players-account {
    padding-top: var(--s-6);
    border-top: 1px solid var(--line);
  }
  /* .feature .num comes later than the switcher's tab row, so put it back. */
  .is-live .feature .switch-tab { grid-row: 1; }
}

/* ---------- Picture slots ----------
   A phone frame per screenshot, from tools/shots.mjs (public/shots/phone/). A slot
   without one yet shows the app's dark surface with a faint court. */

.shot {
  margin: 0;
  display: flex;
  justify-content: center;
}

/* Phones are never taller than about 85% of the window, so a phone held
   sideways still shows the whole device. */
.phone {
  width: min(300px, 78vw, 85svh * 9 / 19.5);
  aspect-ratio: 9 / 19.5;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 46px;
  background: var(--ink-950);
  box-shadow: 0 30px 80px #00000080, 0 0 0 1px var(--line) inset;
}

.screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  background:
    linear-gradient(var(--line), var(--line)) 50% 50% / 70% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 50% 50% / 1px 40% no-repeat,
    radial-gradient(70% 40% at 80% 0%, #ff8a3d33, #ff8a3d00 70%),
    var(--bg);
}

img.screen {
  display: block;
  object-fit: cover;
  object-position: top;
}

/* A phone that holds a switcher's pictures on top of each other. */
.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: var(--bg);
}

.phone-screen .screen {
  position: absolute;
  inset: 0;
  border-radius: 0;
}

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 760px) {
  .top { padding-inline: var(--s-6); }
  .wrap { padding-inline: var(--s-6); }
  .hero { padding-top: var(--s-8); }
  .band { padding-block: 96px; }
}

@media (min-width: 860px) {
  .split { grid-template-columns: 1.2fr 1fr; gap: var(--s-8); }
  .split-flip > :first-child { order: 2; }
  .split-flip { grid-template-columns: 1fr 1.2fr; }
  .foot {
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "brand app legal" "contact app legal" "made made made";
    column-gap: var(--s-8);
    align-items: start;
  }
  .foot .brand { grid-area: brand; }
  .foot-contact { grid-area: contact; }
  .foot-app { grid-area: app; margin-top: 0; }
  .foot-legal { grid-area: legal; margin-top: 0; }
  .foot .made { grid-area: made; }
  /* Each group is as wide as its links on one line, or its title if that's wider. */
  .foot-title { width: 0; white-space: nowrap; }
}

/* ---------- Photo hero ----------
   The hero fills the window with a photo of a session, the header sits over it, and
   the words sit at the bottom over the empty court. Portrait phones and tablets get a
   tall crop of the girl and the man at the net and the organiser's phone; everything
   else, phones held sideways included, gets the wide photo with the words at the
   left. The hero's top padding keeps the words clear of the header. */

body:has(.hero-photo) .top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
}
.hero-photo {
  position: relative;
  isolation: isolate;
  grid-template-columns: 1fr;
  align-content: end;
  min-height: 100svh;
  padding-block: 96px clamp(32px, 7vh, 88px);
}
.hero-photo .hero-bg {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: -1;
  display: block;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
}
.hero-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 45%;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Darken the left and the bottom for the words, the top for the header, and fade
     the bottom edge into the page. */
  background:
    linear-gradient(to bottom, rgb(11 15 9 / 0.55), transparent 22%),
    linear-gradient(to right, rgb(11 15 9 / 0.88) 0%, rgb(11 15 9 / 0.55) 38%, transparent 64%),
    linear-gradient(to top, var(--bg) 0%, rgb(11 15 9 / 0.6) 18%, transparent 45%);
}
.hero-photo .lead { color: var(--text); }

/* Portrait: the tall crop sits at the top with the phone in its upper half and fades
   out behind the words. The words start no higher than just above the crop's bottom
   edge, so the crop never runs past the hero. */
@media (max-width: 859px) and (orientation: portrait) {
  .hero-photo { padding-top: calc(100vw * 2160 / 1950 - var(--s-7)); }
  .hero-photo .hero-bg {
    bottom: auto;
    aspect-ratio: 1950 / 2160;
    mask-image: linear-gradient(to top, transparent, #000 40%);
  }
  .hero-bg::after {
    background:
      linear-gradient(to bottom, rgb(11 15 9 / 0.6), transparent 22%),
      linear-gradient(to top, rgb(11 15 9 / 0.7), transparent 45%);
  }
}

/* The headline is always two lines, one sentence on each and never wrapped. On
   narrow screens it's as big as fits the longer line, "Skip the clipboard.", which is
   about 7.8em wide; the window less its 16px gutters, over 8, leaves a little to spare (from about
   550 wide the 64px cap takes over, well inside the wider gutters). */
.hero-photo h1 { max-width: none; }
.hero-photo h1 span { display: block; white-space: nowrap; }
@media (max-width: 859px) and (orientation: portrait) {
  .hero-photo h1 { font-size: min(64px, (100vw - 2 * var(--s-4)) / 8); }
}

/* The wide layout: two wide lines and a short block, so the words sit over the empty
   back of the court and not over the players. */
@media (min-width: 860px), (orientation: landscape) {
  .hero-photo h1 { font-size: clamp(36px, 4.4vw, 80px); }
  .hero-photo .lead { max-width: 46ch; margin-block: var(--s-4) var(--s-5); }
}
/* Phones held sideways are short: a smaller line and no room to spare above. */
@media (orientation: landscape) and (max-height: 520px) {
  .hero-photo { padding-top: 80px; }
  .hero-photo .lead { font-size: 16px; max-width: min(52ch, 60%); }
}

/* ---------- Scan photo ----------
   SCAN-01 sits beside the words like the other pictures: the wide photo, or on
   portrait phones its 4:5 crop of the two phones. */

.scan-photo { margin: 0; }
.scan-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-3);
}

/* ---------- Photo bands ----------
   A photo the full width of the window with the words over its empty ground: the
   statement band (PLAY-01) has its line over the empty court at the bottom left, the
   closing band (CTA-01) has its line and button in the sky at the top. Portrait
   phones get each photo's 9:16 partner, with the words in its clear bottom 40%. */

.photo-band {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: clamp(480px, 56.25vw, 100svh);
  overflow: hidden;
}
.photo-band .band-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.band-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.band-bg::after {
  content: '';
  position: absolute;
  inset: 0;
}
.band-words {
  width: 100%;
  padding-block: clamp(32px, 7vh, 88px);
}
.photo-band h2 {
  max-width: 14ch;
  font-weight: 800;
  font-size: clamp(40px, 6vw, 96px);
  line-height: 1;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgb(11 15 9 / 0.5);
}

/* Statement: the players are on the right, so the line sits bottom left. */
.statement { align-items: end; }
.statement .band-bg img { object-position: 70% 50%; }
.statement .band-bg::after {
  background:
    linear-gradient(to bottom, var(--bg), transparent 14%),
    linear-gradient(to right, rgb(11 15 9 / 0.7), transparent 55%),
    linear-gradient(to top, var(--bg), rgb(11 15 9 / 0.5) 22%, transparent 50%);
}

/* Close: the sky is at the top, so the line and the button sit there, centred. */
.close { align-items: start; }
.close .band-words { display: grid; justify-items: center; gap: var(--s-6); text-align: center; }
.close .band-bg img { object-position: 50% 60%; }
.close .band-bg::after {
  background:
    linear-gradient(to bottom, var(--bg), rgb(11 15 9 / 0.35) 18%, transparent 45%),
    linear-gradient(to top, var(--bg), transparent 18%);
}

@media (max-width: 859px) and (orientation: portrait) {
  .scan-photo img { border-radius: var(--r-2); }
  .photo-band {
    align-items: end;
    min-height: 0;
    aspect-ratio: 9 / 16;
    max-height: none;
  }
  .photo-band .band-bg img { object-position: 50% 50%; }
  .photo-band .band-bg::after {
    background:
      linear-gradient(to bottom, var(--bg), transparent 12%),
      linear-gradient(to top, var(--bg) 22%, rgb(11 15 9 / 0.6) 42%, transparent 60%);
  }
  .photo-band h2 { font-size: clamp(40px, 12vw, 64px); }
  .close .band-words { justify-items: start; text-align: left; }
}

/* ---------- Desktop QR ----------
   On a computer with a mouse, an "Open on your phone" button beside Start in the hero
   and the closing band, and above Install's steps, shows the QR code (public/qr-app.svg,
   from tools/qr.mjs) large in a panel over the page, to scan with a phone. Start stays
   the main action: the button is the quiet outline one. The panel is a popover, so it
   needs no script, and Esc or a click outside closes it. Phones and tablets, touch
   only or under 860, never see the buttons, and their layout is as before. */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-5);
}
#more .cta-row { margin-top: var(--s-3); }
.qr-open, .qr-install { display: none; }
.qr-open {
  gap: var(--s-2);
  background: var(--glass-solid);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.qr-open:hover { background: var(--glass-strong); }
.qr-open svg { width: 18px; height: 18px; fill: currentColor; }
.qr-install {
  align-items: center;
  gap: var(--s-4) var(--s-5);
  flex-wrap: wrap;
  margin-bottom: var(--s-6);
  color: var(--text-2);
  font-size: 16px;
  font-weight: 600;
}

@media (min-width: 860px) and (hover: hover) and (pointer: fine) {
  .qr-open { display: inline-flex; }
  .qr-install { display: flex; }
}

/* The panel: the code at 320 on the page's surface, in the middle of the window. */
.qr-panel {
  width: min(400px, calc(100vw - 32px));
  padding: var(--s-6);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-3);
  background: var(--surface);
  color: var(--text);
  text-align: center;
}
.qr-panel h2 {
  max-width: none;
  margin: 0 var(--s-6) var(--s-5);
  font-size: 24px;
  line-height: 1.15;
  text-wrap: balance;
}
.qr-panel img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
}
.qr-panel p {
  margin-top: var(--s-5);
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.qr-close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
}
.qr-close:hover { background: var(--glass-strong); }
.qr-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.qr-panel::backdrop {
  background: rgb(11 15 9 / 0.72);
  backdrop-filter: blur(6px);
}
