/* Tunavelo website. One stylesheet for every page. Colours and type come from the app's DesignSystem tokens
   (apple/Packages/TunaveloKit/Sources/DesignSystem/Theme.swift and Tokens/). The app is dark only; the light
   scheme uses the app's own light-side tokens (accentInk, ink, inkSecondary, platePressed). */

:root {
  color-scheme: dark light;
  /* Dark: Theme.background, surface, surfaceRaised, textPrimary, textSecondary, accent, onAccent. */
  --ground: #0b0d12;
  --surface: #151922;
  --raised: #212734;
  --ink: #f5f7fa;
  --muted: #a9b1be;
  --accent: #7ab2ff;
  --on-accent: #07111f;
  --focus: #ffffff;
  /* The footer field is the inverse of the page. */
  --inverse-ground: #f5f7fa;
  --inverse-ink: #0b0d12;
  --inverse-muted: #444c5b;
  --inverse-accent: #2f6fe0;
  --inverse-on-accent: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Five sizes: the monument, the page title, the section heading, the lead, the text. Plus one small step. */
  --size-text: 1.0625rem;      /* 17px, the app's body size */
  --size-small: 0.875rem;      /* 14px */
  --size-lead: clamp(1.1875rem, 1rem + 0.6vw, 1.5rem);
  --size-heading: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --size-title: clamp(2.5rem, 1.6rem + 4vw, 4.75rem);
  /* "Tunavelo" in SF Pro Display Bold at -0.065em is about 3.6 ems wide in Chrome and a little wider in Safari,
     so 3.68 fills the container with about 2% to spare in both. */
  --size-monument: calc(100cqw / 3.68);

  --margin: clamp(1rem, 0.5rem + 2vw, 2rem);
  --measure: 66ch;
  --radius: 12px;               /* Theme.cornerRadius */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #ffffff;          /* Theme.plate */
    --surface: #f0f2f5;
    --raised: #e3e6ec;          /* Theme.platePressed */
    --ink: #0b0d12;             /* Theme.ink */
    --muted: #444c5b;           /* Theme.inkSecondary */
    --accent: #2a63cc;          /* Theme.accentInk #2F6FE0, one step darker: 4.5:1 on the surface tone too */
    --on-accent: #ffffff;
    --focus: #0b0d12;           /* Theme.focusOutlineOnLight */
    --inverse-ground: #0b0d12;
    --inverse-ink: #f5f7fa;
    --inverse-muted: #a9b1be;
    --inverse-accent: #7ab2ff;
    --inverse-on-accent: #07111f;
  }
}

/* Base ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--size-text) / 1.55 var(--font);
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  /* Short pages keep the footer at the bottom of the window. */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }

img { display: block; max-width: 100%; height: auto; }
/* A layout rule (display: grid or flex) must never undo the hidden attribute. */
[hidden] { display: none !important; }

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.14em; }

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

::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--size-title); letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: var(--size-heading); letter-spacing: -0.02em; }
h3 { font-size: var(--size-lead); letter-spacing: -0.01em; }

p, ul, ol, dl, table, figure { margin: 0; }
strong { font-weight: 600; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* The site bar: on every page. ------------------------------------------- */

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 1.25rem var(--margin);
}
.site-bar .wordmark {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font: 600 var(--size-text)/1 var(--font-display);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-bar .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  padding: 0;
}
.site-bar .links a {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}
.site-bar .links a:hover { color: var(--accent); }

/* Logo: the Play eye lockup (brand/README.md); the <picture> swaps white (dark) for slate (light). */
.site-bar .logo { display: block; height: 1.75rem; width: auto; }
.site-bar .logo-tag { color: var(--muted); font-weight: 500; }
/* The small mark above every footer: decorative, so it lives in CSS, not in the page text. */
body > footer::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  background: url("/assets/logo/mark-small-white.svg") center / contain no-repeat;
}
@media (prefers-color-scheme: light) {
  body > footer:not(.close)::before { background-image: url("/assets/logo/mark-small.svg"); }  /* .close stays Ink */
}
@media print { body > footer::before { display: none; } }

/* Reading pages: help, legal, plans, changelog, roadmap and the rest. ---- */

body > header,
body > main,
body > footer { padding-inline: var(--margin); }

body > header { padding-block: clamp(2.5rem, 6vw, 5.5rem) 0; }
body > header > * { max-width: 22ch; }
body > header > p { max-width: var(--measure); margin-top: 1.25rem; color: var(--muted); font-size: var(--size-lead); line-height: 1.4; }

body > main {
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(5rem, 10vw, 9rem);
  max-width: calc(var(--measure) + 2 * var(--margin));
}
/* The reading column sits in the middle of the page, so the two outer margins match at every width. */
body:not(.home) > main, body:not(.home) > header { width: 100%; margin-inline: auto; }
body:not(.home) > header { max-width: calc(var(--measure) + 2 * var(--margin)); }
/* A page with no header puts its title inside main. */
body > main > h1:first-child { margin-top: clamp(0.5rem, 3vw, 2.5rem); margin-bottom: 0.25rem; max-width: 20ch; }

main > * + * { margin-top: 1.125rem; }
main > h2 { margin-top: 3rem; font-size: var(--size-lead); letter-spacing: -0.015em; }
main section > h2 { font-size: var(--size-lead); letter-spacing: -0.015em; }
main > h3, section > h3 { margin-top: 2rem; }
main > h2 + *, main > h3 + * { margin-top: 0.875rem; }
main section > * + * { margin-top: 1.125rem; }
main section > h2 + * { margin-top: 0.875rem; }
main section + section, main > section { margin-top: 3rem; }

main ul, main ol { padding-left: 1.4em; }
main li + li { margin-top: 0.5rem; }
main li::marker { color: var(--muted); }

/* The notice that opens the plan and help pages: a tone step, not a rule. */
main > p:first-child:has(> strong:first-child) {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
}

dl { display: grid; gap: 0.25rem 1.5rem; }
dt { font-weight: 600; }
dd { margin: 0 0 1rem; color: var(--ink); }
@media (min-width: 40rem) {
  dl { grid-template-columns: minmax(9rem, max-content) 1fr; }
  dd { margin: 0; }
}

table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
caption { text-align: left; font-weight: 600; padding-bottom: 0.75rem; }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 1rem 0.75rem 0; }
thead th { color: var(--muted); font-weight: 600; }
tbody tr { border-top: 1px solid var(--raised); }
body > main:has(table) { max-width: 80rem; overflow-x: auto; }
/* The reading column on a table page: one width taken from main's own font (a registered length is computed where it
   is set), so headings and text share one left edge, the same as on every other reading page. */
@property --column { syntax: '<length>'; inherits: true; initial-value: 0px; }
body > main:has(table) { --column: var(--measure); }
body > main:has(table) > :not(table) { max-width: none; margin-inline: max(0px, (100% - var(--column)) / 2); }

/* On a phone, a table with labelled cells becomes one block per row, each value under its column name. */
@media (max-width: 40rem) {
  table:has(td[data-label]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table:has(td[data-label]) tr { display: block; background: var(--surface); border-radius: var(--radius); padding: 0.75rem 1rem; border: 0; }
  table:has(td[data-label]) tr + tr { margin-top: 0.75rem; }
  table:has(td[data-label]) td { display: block; padding: 0.375rem 0; white-space: normal; overflow-wrap: anywhere; }
  td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: var(--size-small); font-weight: 600; }
}

article + article { margin-top: 3.5rem; }
article > * + * { margin-top: 1rem; }
time { font-variant-numeric: tabular-nums; }

/* Forms on the shop pages. */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.375rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 var(--size-text) / 1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
button:active, .button:active { transform: scale(0.97); }
/* A disabled button must look disabled: it does nothing until its condition is met. */
button:disabled, .button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.button.quiet { background: var(--raised); color: var(--ink); }

input[type="text"], input:not([type]), input[type="email"] {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--muted);   /* 3:1 or more against the page, as an input edge must be */
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  min-height: 3rem;
  width: min(100%, 26rem);
}
/* A field the last answer refused: a heavier edge, and the message under the form names it (aria-describedby). */
input[aria-invalid="true"] { border-width: 2px; border-color: var(--ink); }
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); vertical-align: -0.2em; margin-right: 0.5rem; }
label { display: inline-block; }
#new-number { font-size: var(--size-heading); font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
/* Empty status lines stay in the accessibility tree (so screen readers announce what arrives) and take no room. */
[role="status"]:empty { margin: 0; }

/* My account (and the admin dashboard's forms). */
.site-bar .links a[aria-current="page"] { color: var(--accent); }
.account-form { display: grid; gap: 0.5rem; max-width: 34rem; }
.account-form label { font-weight: 600; }
.field-hint { color: var(--muted); }
main > .account-form + * { margin-top: 1rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.field-row input { flex: 1 1 14rem; width: auto; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.account-plan { background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.account-plan h2 { font-size: var(--size-heading); }
.device-list { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
main .device-list li + li { margin-top: 0; }
.device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.875rem 1rem 0.875rem 1.25rem;
}
.device-list li { flex-wrap: wrap; }
/* The text takes the line; on a narrow screen the Remove button moves under it instead of squeezing it. */
.device-list li > div { display: grid; gap: 0.125rem; min-width: 0; flex: 1 1 14rem; }
.device-list strong { overflow-wrap: anywhere; }
.device-list span { color: var(--muted); font-size: var(--size-small); }

/* The help index. */
.help-list { list-style: none; padding: 0; columns: 18rem 2; column-gap: 3rem; }
.help-list li { break-inside: avoid; margin: 0 0 0.25rem; }
.help-list a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); text-decoration: none; }
.help-list a:hover { color: var(--accent); text-decoration: underline; }

/* Footer: a tone step, the legal links spread out. */
body > footer {
  background: var(--surface);
  padding-block: 2rem 2.5rem;
}
body > footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}
body > footer a {
  color: var(--ink);
  font-size: var(--size-small);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;   /* 44 px tap target */
}
body > footer a:hover { color: var(--accent); text-decoration: underline; }

/* Home page ------------------------------------------------------------- */

.home > main { max-width: none; padding: 0; }
.home > main > * + * { margin-top: 0; }
.home .site-bar { position: relative; z-index: 1; }

.hero { padding: 0 var(--margin); container-type: inline-size; }
.hero .site-bar { padding-inline: 0; }
.hero-lead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem 3rem;
  padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3.5rem);
}
.hero-lead p { max-width: 32ch; }
.hero-lead p { font-size: var(--size-lead); line-height: 1.35; letter-spacing: -0.01em; }
.hero-lead .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.hero-lead .soon { color: var(--muted); font-size: var(--size-small); }

/* The name is the monument: as wide as the page, its baseline sitting on the screenshot below it. */
.hero h1 {
  font-size: var(--size-monument);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.8;
  /* Room above and below the letters so the rise mask never shaves their tops or bowls; the margins give it back. */
  padding: 0.14em 0 0.1em;
  margin: calc(clamp(2rem, 8vw, 7rem) - 0.14em) 0 -0.03em;
  white-space: nowrap;
  max-width: none;
}
.hero h1 span { display: block; }

/* Screenshots sit on a plate one tone off the ground, so a dark screen never melts into a dark page. */
.stage > img {
  width: 100%;
  border-radius: var(--radius);
  background: #0b0d12;
  outline: clamp(0.5rem, 2vw, 1.5rem) solid var(--surface);
  outline-offset: 0;
}
.stage { padding-inline: calc(var(--margin) + clamp(0.5rem, 2vw, 1.5rem)); }
.stage figcaption { margin-top: calc(clamp(0.5rem, 2vw, 1.5rem) + 0.875rem); }
.stage figcaption {
  color: var(--muted);
  font-size: var(--size-small);
}

/* Section rhythm. */
.home section { padding: clamp(6rem, 14vw, 13rem) var(--margin) 0; }

/* Bring your own TV: a square plate and spare text, split. */
.own {
  display: grid;
  gap: 2.5rem 3rem;
  align-items: stretch;
}
.plate {
  background: var(--surface);
  border-radius: var(--radius);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  margin: 0;
}
/* Pinned inside the square, so the phone shot never sets the column's width. */
.plate img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; }
.own-text { display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; }
.devices li + li { margin-top: 0; }
.devices { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; padding: 0; margin-top: 2rem; font-size: var(--size-lead); font-weight: 600; letter-spacing: -0.01em; }
.own-text h2 { font-size: var(--size-title); letter-spacing: -0.035em; line-height: 1; }
.own-text p { max-width: 36ch; margin-top: 1.5rem; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cells a {
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.cells a:first-child { background: var(--ink); color: var(--ground); }
.cells a:active { transform: scale(0.98); }
@media (min-width: 52rem) {
  .own { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* What it does: names at one size, in three columns, and a fourth for the Apple TV channel list. */
.does h2 { font-size: var(--size-heading); margin-bottom: clamp(2.5rem, 6vw, 6rem); }
.does-grid { display: grid; gap: 2.5rem 2rem; }
.does-grid h3 { font: 600 1.0625rem/1.25 var(--font); letter-spacing: 0; margin: 0 0 1.25em; }
.does-grid ul { list-style: none; padding: 0; color: var(--muted); line-height: 1.3; }
.does-grid li + li { margin-top: 0.3em; }
@media (min-width: 40rem) {
  .does-grid { grid-template-columns: repeat(3, 1fr); }
}
.does .stage { padding: clamp(4rem, 8vw, 7rem) clamp(0.5rem, 2vw, 1.5rem) 0; }

/* Plans: three figures, very large. */
.plans { display: grid; gap: 3rem; }
.plans-intro p { margin-top: 1.25rem; max-width: 34ch; }
.plans-intro p + p { margin-top: 1rem; color: var(--muted); }
.plan-list { list-style: none; padding: 0; display: grid; gap: clamp(3rem, 5vw, 4.5rem); }
.plan { display: grid; align-items: end; gap: 0.5rem 2rem; }
@media (min-width: 40rem) {
  .plan { grid-template-columns: auto minmax(12rem, 1fr); }
}
.plan h3 { grid-column: 1 / -1; font: 600 var(--size-lead)/1.2 var(--font); letter-spacing: -0.01em; }
.figure {
  font: 700 clamp(4rem, 12vw, 10.5rem)/0.82 var(--font-display);
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin: 0.1em 0 0.15em -0.04em;
}
.figure .currency { font-size: 0.5em; vertical-align: 0.62em; letter-spacing: 0; margin-right: 0.04em; }
.figure .per { font: 400 var(--size-text)/1 var(--font); letter-spacing: 0; margin-left: 0.6rem; color: var(--muted); }
.plan-plus .figure { color: var(--accent); }
.plan ul { list-style: none; padding: 0 0 0.6rem; }
.plan li + li { margin-top: 0.2rem; }
.plans-more { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0 1.5rem; align-items: center; }
.plans-more a { display: inline-flex; align-items: center; min-height: 2.75rem; }
@media (min-width: 52rem) {
  .plans { grid-template-columns: 3fr 0.5fr 8.5fr; }
  .plans-intro { grid-column: 1; }
  .plan-list { grid-column: 3; }
}

/* Questions: a wide heading, the questions indented, the iPhone guide closing the left third. */
.faq h2 { font-size: var(--size-title); letter-spacing: -0.035em; line-height: 1; max-width: 14ch; }
.faq-body { display: grid; gap: 3rem; margin-top: clamp(2.5rem, 5vw, 5rem); }
.faq-body figure { margin: 0; }
.faq-body figure img { width: min(100%, 17rem); border-radius: 1.5rem; }
/* The open tile reaches past the text by 1.5rem, or by the page margin on a phone, never past the screen. */
details {
  --bleed: min(1.5rem, var(--margin));
  border-radius: var(--radius);
  margin: 0 calc(-1 * var(--bleed));
  padding: 0 var(--bleed);
  transition: background-color 200ms ease;
}
details + details { margin-top: 0.5rem; }
details[open] { background: var(--surface); padding-bottom: 1.5rem; }
summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  font-size: var(--size-lead);
  cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform 200ms var(--ease-out);
}
details[open] summary::after { transform: translateY(15%) rotate(-135deg); }
details p { max-width: 52ch; }
@media (min-width: 52rem) {
  .faq-body { grid-template-columns: 4fr 8fr; }
  .faq-body figure { position: sticky; top: 2rem; align-self: start; }
}

/* The close: the inverse field, an invitation, and the name cropped by the bottom edge. */
.close {
  margin-top: clamp(6rem, 14vw, 13rem);
  background: var(--inverse-ground);
  color: var(--inverse-ink);
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) var(--margin) 0;
}
.close a { color: var(--inverse-ink); }
/* The focus ring is drawn in the field's own ink, or it would vanish on the inverse ground. */
.close { --focus: var(--inverse-ink); }
.close-top { display: grid; gap: 2.5rem; }
.close-name-box { container-type: inline-size; }
.close h2 { font-size: var(--size-title); letter-spacing: -0.035em; line-height: 1; max-width: 12ch; }
.close .button { background: var(--inverse-accent); color: var(--inverse-on-accent); margin-top: 2rem; }
.close-links { list-style: none; padding: 0; display: grid; gap: 0.25rem; align-content: start; }
.close-links a { text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.close-links a:hover { text-decoration: underline; }
.close-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: clamp(4rem, 10vw, 9rem);
  font-size: var(--size-small);
  color: var(--inverse-muted);
}
.close-legal nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.close-legal a { color: var(--inverse-muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.close-legal a:hover { color: var(--inverse-ink); text-decoration: underline; }
.close-name {
  font: 700 var(--size-monument)/0.8 var(--font-display);
  letter-spacing: -0.065em;
  white-space: nowrap;
  margin: 0.5rem 0 0;
  transform: translateY(22%);
}
@media (min-width: 52rem) {
  .close-top { grid-template-columns: 7fr 2fr 3fr; }
  .close-links { grid-column: 3; }
}

/* Motion: the name rises from behind its baseline once; everything else answers the visitor. */
@media (prefers-reduced-motion: no-preference) {
  /* The mask clips only below the letters, where they rise from; the sides stay open. */
  .hero h1 { clip-path: inset(-1em -1em 0 -1em); }
  .hero h1 span { animation: rise 900ms var(--ease-out) both; }
  .hero-lead { animation: fade 600ms 450ms var(--ease-out) both; }
  .stage img.lead-shot { animation: fade 700ms 300ms var(--ease-out) both; }
}
/* Each part of a section rises into place as it scrolls in: CSS only (no script on public pages), and where a
   browser has no scroll timeline everything is simply there. */
@media screen and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    main > section > *, main > section > * > *, body:not(.home) > main > *, .close-top > * {
      animation: enter linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}
@keyframes enter { from { transform: translateY(32px); } to { transform: none; } }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover, .button:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
  .button.quiet:not(:disabled):hover { background: color-mix(in srgb, var(--raised) 80%, var(--ink)); color: var(--ink); }
  .close .button:hover { background: color-mix(in srgb, var(--inverse-accent) 86%, var(--inverse-ink)); }
  .cells a:hover { background: color-mix(in srgb, var(--raised) 80%, var(--ink)); }
  .cells a:first-child:hover { background: color-mix(in srgb, var(--ink) 88%, var(--ground)); }
  summary:hover { color: var(--accent); }
}

@media (max-width: 30rem) {
  .cells { grid-template-columns: 1fr; }
  .site-bar .links { gap: 0.25rem 1.1rem; }
}

@media print {
  :root { --ground: #fff; --surface: #fff; --raised: #ccc; --ink: #000; --muted: #333; --accent: #000; }
  .site-bar, body > footer, .close, button { display: none; }
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
  .cells a, .cells a:first-child, .button { color: #000; background: none; text-decoration: underline; }
}

/* The shop's checkout steps: space between the buy buttons and between the number and its boxes. */
#buy-area { display: flex; flex-wrap: wrap; gap: 0.75rem; }
#number-step { display: grid; gap: 0.75rem; justify-items: start; }
/* The account reference is copied whole for support (one tap selects it all). */
#account-ref { user-select: all; -webkit-user-select: all; }
