/* SelfTune — selftune.io
   Static stylesheet. Fonts are self-hosted (SIL OFL): Newsreader, Hanken Grotesk. */

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette */
  --linen: #F3EFE6;
  --linen-deep: #ECE6DA;
  --stone: #DCD4C4;
  --stone-line: #CFC6B4;
  --ink: #1C1B18;
  --ink-soft: #4A463F;
  --ink-muted: #645E53;   /* 5.9:1 on linen */
  --sage: #7F8D75;
  --sage-deep: #4C5A47;   /* 6.6:1 on linen */
  --honey: #C69C5E;
  --honey-soft: #E7D3B0;
  --evening: #24271F;
  --evening-2: #2E3228;
  --evening-text: #ECE6D9;
  --evening-muted: #B8B2A3;

  --accent: var(--sage);

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1.06rem, 1rem + 0.25vw, 1.2rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.3vw, 3.6rem);
  --step-4: clamp(2.45rem, 1.6rem + 4.2vw, 5.6rem);

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 78rem;
  --section-space: clamp(5rem, 11vw, 10rem);

  --ease-breath: cubic-bezier(.45, 0, .55, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --breath: 10s;
  --focus-ring: 0 0 0 2px var(--linen), 0 0 0 4.5px var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  background: var(--linen);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100%;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

/* Paper grain: a very faint SVG noise to give the page a tactile surface. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .32;
  mix-blend-mode: multiply;
  background-image: url("assets/grain.svg");
  background-size: 220px 220px;
}

img, svg { display: block; max-width: 100%; }
main { overflow-x: clip; }
h1, h2, h3, p, dl, dd, ol, ul, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--sage); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

::selection { background: var(--honey-soft); color: var(--ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--linen);
  font-family: var(--sans); font-size: var(--step--1);
  padding: .7rem 1rem; border-radius: 999px; text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }

html.no-js .js-only { display: none !important; }

h1, h2, h3 { font-weight: 360; letter-spacing: -0.015em; line-height: 1.08; text-wrap: balance; }
h2 { font-size: var(--step-3); font-variation-settings: "opsz" 72; }
h3 { font-size: var(--step-1); font-weight: 450; letter-spacing: -0.005em; line-height: 1.25; }

.section-lede { color: var(--ink-soft); max-width: 36em; margin-top: 1.25rem; text-wrap: pretty; }

/* ───────── Header ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--linen) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color .4s ease;
}
.site-header.is-scrolled { border-bottom-color: color-mix(in srgb, var(--stone-line) 70%, transparent); }

.header-inner {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: .85rem var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 2rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink);
  border-radius: 999px;
}
.brand-mark { width: 1.75rem; height: 1.75rem; color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 1.32rem; font-weight: 500; letter-spacing: -0.01em; }
.brand-dot { transform-box: fill-box; transform-origin: center; animation: breathe-dot var(--breath) var(--ease-breath) infinite; }

.site-nav ul { display: flex; gap: clamp(1rem, 2.2vw, 2rem); justify-content: center; }
.site-nav a {
  position: relative;
  font-family: var(--sans); font-size: .93rem; font-weight: 450;
  color: var(--ink-soft); text-decoration: none;
  padding: .4rem 0;
  white-space: nowrap;
}
/* A dot that stretches into a line: the focus point becoming an underline. */
.site-nav a::after {
  content: "";
  position: absolute; left: 50%; bottom: .05rem;
  width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 999px; background: var(--honey);
  opacity: 0; transform: scale(.4);
  transition: opacity .3s ease, transform .3s var(--ease-out), width .45s var(--ease-out), margin-left .45s var(--ease-out), height .3s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); }
.site-nav a:hover::after, .site-nav a:focus-visible::after, .site-nav a[aria-current="true"]::after { opacity: 1; transform: scale(1); }
.site-nav a:hover::after, .site-nav a[aria-current="true"]::after { width: 100%; left: 0; margin-left: 0; height: 2px; }
.site-nav a[aria-current="true"] { color: var(--ink); }

.motion-toggle {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 500 .86rem/1 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--stone-line);
  border-radius: 999px;
  padding: .55rem .9rem .55rem .7rem;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease;
}
.motion-toggle:hover { background: var(--linen-deep); border-color: var(--ink-muted); }
.motion-icon { display: inline-flex; gap: 3px; width: 12px; height: 12px; align-items: center; justify-content: center; }
.motion-icon span { width: 3px; height: 11px; border-radius: 2px; background: currentColor; transition: all .3s var(--ease-out); }
[data-motion="paused"] .motion-icon { gap: 0; }
[data-motion="paused"] .motion-icon span:first-child { width: 0; height: 0; border-radius: 0; background: none; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
[data-motion="paused"] .motion-icon span:last-child { width: 0; opacity: 0; }

@media (max-width: 860px) {
  .header-inner { grid-template-columns: 1fr auto; padding-bottom: .4rem; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; margin: 0 calc(var(--gutter) * -1); overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { justify-content: flex-start; padding: 0 var(--gutter) .2rem; gap: 1.4rem; }
}
@media (max-width: 420px) {
  .motion-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .motion-toggle { padding: .6rem; }
}

/* ───────── Buttons ───────── */
.actions { display: flex; flex-wrap: wrap; gap: .8rem 1rem; margin-top: 2.25rem; align-items: center; }
.actions-center { justify-content: center; }

.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.1rem;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  font: 500 .98rem/1.2 var(--sans);
  letter-spacing: .005em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: color .35s ease, border-color .35s ease, transform .35s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.button span { position: relative; z-index: 1; }
/* Hover ripple: a circle grows from where the pointer entered. */
.button::before {
  content: "";
  position: absolute; z-index: 0;
  left: var(--rx, 50%); top: var(--ry, 50%);
  width: 0; height: 0; border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .6s var(--ease-out), height .6s var(--ease-out);
}
.button:hover::before, .button:focus-visible::before { width: 260%; height: 0; padding-bottom: 260%; }
.button:active { transform: scale(.98); }

.button-primary { background: var(--ink); color: var(--linen); }
.button-primary::before { background: var(--sage-deep); }

.button-quiet { background: transparent; color: var(--ink); border-color: var(--stone-line); }
.button-quiet::before { background: var(--linen-deep); }
.button-quiet:hover { border-color: var(--ink-muted); }

.button-small { min-height: 2.6rem; padding: .55rem 1.1rem; font-size: .9rem; background: transparent; border-color: var(--stone-line); color: var(--ink); }
.button-small::before { background: var(--linen-deep); }

/* ───────── Status pill ───────── */
.status {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 500 .9rem/1 var(--sans);
  color: var(--sage-deep);
  padding: .5rem .9rem .5rem .75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sage) 13%, transparent);
}
.status-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--sage-deep); }
.status-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--sage);
  animation: ping 3.2s var(--ease-out) infinite;
}

/* ───────── Hero ───────── */
.hero {
  position: relative;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 8rem) var(--gutter) clamp(4rem, 10vw, 9rem);
  min-height: min(92svh, 60rem);
  display: grid;
  align-items: center;
}
.hero-copy { position: relative; z-index: 2; max-width: 50rem; }

.sync-title {
  position: relative;
  font-size: var(--step-4);
  font-weight: 330;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.028em;
  line-height: 1.02;
  margin-top: 1.75rem;
  max-width: 13.5em;
}
.sync-title .w { transition: color 1.1s var(--ease-out); }
.sync-title.is-syncing .w { color: color-mix(in srgb, var(--ink) 26%, var(--linen)); }
.sync-title.is-syncing .w.is-read { color: var(--ink); }
.sync-dot {
  position: absolute; left: 0; top: 0;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--honey) 22%, transparent);
  left: var(--dx, 0); top: var(--dy, 0);
  transition: left .6s var(--ease-out), top .6s var(--ease-out), opacity .6s ease;
  pointer-events: none;
}
.sync-dot.is-resting { animation: breathe-dot var(--breath) var(--ease-breath) infinite; }

.lede {
  margin-top: 2rem;
  max-width: 34em;
  font-size: clamp(1.1rem, 1.02rem + .35vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.hero-field {
  position: absolute;
  z-index: 1;
  width: min(68rem, 92vw);
  aspect-ratio: 1;
  right: max(-26rem, -30vw);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero-field svg { width: 100%; height: 100%; overflow: visible; }
.field-rings circle {
  fill: none; stroke: var(--stone-line); stroke-width: 1;
  transform-box: view-box; transform-origin: 400px 400px;
  animation: breathe-ring var(--breath) var(--ease-breath) infinite;
}
.field-rings circle:nth-child(1) { animation-delay: 0s; stroke: color-mix(in srgb, var(--sage) 55%, var(--stone-line)); }
.field-rings circle:nth-child(2) { animation-delay: -.35s; }
.field-rings circle:nth-child(3) { animation-delay: -.7s; }
.field-rings circle:nth-child(4) { animation-delay: -1.05s; }
.field-rings circle:nth-child(5) { animation-delay: -1.4s; opacity: .75; }
.field-rings circle:nth-child(6) { animation-delay: -1.75s; opacity: .5; }
.field-ripples circle {
  fill: none; stroke: var(--honey); stroke-width: 1.2;
  transform-box: view-box; transform-origin: 400px 400px;
  opacity: 0;
  animation: ripple calc(var(--breath) * 1.2) var(--ease-out) infinite;
}
.field-ripples circle:nth-child(2) { animation-delay: calc(var(--breath) * -.4); }
.field-ripples circle:nth-child(3) { animation-delay: calc(var(--breath) * -.8); }
.field-halo {
  fill: color-mix(in srgb, var(--honey) 18%, transparent);
  transform-box: fill-box; transform-origin: center;
  animation: breathe-halo var(--breath) var(--ease-breath) infinite;
}
.field-core { fill: var(--honey); transform-box: fill-box; transform-origin: center; animation: breathe-dot var(--breath) var(--ease-breath) infinite; }

@media (max-width: 860px) {
  .hero { min-height: auto; padding-top: clamp(2rem, 6vw, 4rem); }
  .hero-field { width: 46rem; right: -26rem; top: -6rem; transform: none; opacity: .8; }
}
@media (max-width: 520px) {
  .hero-field { width: 34rem; right: -21rem; top: -9rem; opacity: .7; }
}

/* ───────── Session preview ───────── */
.session { padding: var(--section-space) var(--gutter); position: relative; }
.session::before {
  /* hairline that begins at a point */
  content: ""; position: absolute; top: 0; left: 50%;
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--stone-line) 30%, var(--stone-line) 70%, transparent);
}
.session-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}
.session-copy h2 { max-width: 10em; }

.device-figure { display: grid; justify-items: center; gap: 1.4rem; }
.device-figure figcaption { font: 400 var(--step--1)/1.5 var(--sans); color: var(--ink-muted); max-width: 22rem; text-align: center; }

.device {
  position: relative;
  width: min(20rem, 82vw);
  aspect-ratio: 9 / 18.6;
  border-radius: 2.9rem;
  padding: .7rem;
  background: linear-gradient(160deg, #2D2B26, #1A1916 60%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08) inset,
    0 40px 70px -40px rgba(60, 50, 30, .55),
    0 18px 30px -18px rgba(60, 50, 30, .35);
}
.device::after {
  /* soft sage reflection behind the device */
  content: ""; position: absolute; z-index: -1; inset: 12% -18% 6% -18%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent);
  transition: background 1s ease;
}
.device-screen {
  position: relative;
  height: 100%;
  border-radius: 2.3rem;
  background: var(--linen);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 2.4rem 1.5rem 1.4rem;
}
.device-screen::before {
  /* camera */
  content: ""; position: absolute; top: .8rem; left: 50%; width: .6rem; height: .6rem; margin-left: -.3rem; border-radius: 50%; background: #1A1916;
}
.screen-top { display: flex; justify-content: space-between; align-items: center; font: 500 .78rem/1 var(--sans); color: var(--ink-soft); }
.screen-theme { color: var(--ink); font-size: .85rem; font-weight: 600; transition: opacity .4s ease; }
.screen-voice { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .6rem; border-radius: 999px; background: var(--linen-deep); }
.screen-voice svg { width: .8rem; height: .8rem; color: var(--accent); transition: color 1s ease; }

.screen-text { align-self: center; display: grid; gap: 1.1rem; position: relative; }
.screen-text .line {
  font-size: 1.13rem; line-height: 1.38; font-weight: 400; letter-spacing: -0.005em;
  color: color-mix(in srgb, var(--ink) 30%, var(--linen));
  transition: color .8s ease, opacity .8s ease;
}
.screen-text .line.is-current { color: color-mix(in srgb, var(--ink) 58%, var(--linen)); }
html.no-js .screen-text .line.is-current { color: var(--ink); }
.screen-text .line.is-done { color: color-mix(in srgb, var(--ink) 55%, var(--linen)); }
.screen-text .w { transition: color .5s ease; }
.screen-text .w.is-read { color: var(--ink); }
.screen-text.is-swapping { opacity: 0; transition: opacity .35s ease; }
.screen-text { transition: opacity .5s ease; }

.player-dot {
  position: absolute; left: 0; top: 0;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 18px 4px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translate(var(--px, -40px), var(--py, -40px));
  transition: transform .45s var(--ease-out), background-color 1s ease, opacity .4s ease;
  opacity: 0;
}
.player-dot.is-on { opacity: 1; }

.screen-bottom { display: grid; gap: 1.1rem; color: var(--ink); }
.scrub { height: 3px; border-radius: 3px; background: var(--stone); overflow: hidden; }
.scrub-fill { display: block; height: 100%; width: 12%; background: var(--ink); border-radius: inherit; transition: width .45s var(--ease-out); }
.glyphs { width: 100%; height: auto; }
.glyph-cut { fill: var(--linen); }

.device-badge {
  position: absolute; top: -.9rem; right: -1.4rem;
  font: 600 .74rem/1 var(--sans); letter-spacing: .01em;
  color: var(--ink); background: var(--honey-soft);
  padding: .5rem .75rem; border-radius: 999px;
  transform: rotate(4deg);
  box-shadow: 0 8px 18px -10px rgba(60,50,30,.5);
}

.notes { margin-top: 2.5rem; display: grid; gap: 0; border-top: 1px solid var(--stone-line); }
.notes > div { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: .3rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--stone-line); }
.notes dt { font: 600 .95rem/1.4 var(--sans); color: var(--ink); padding-top: .15rem; }
.notes dd { color: var(--ink-soft); font-size: 1.04rem; line-height: 1.55; }

.player-controls { margin-top: 2.5rem; display: grid; gap: 1.25rem; }
.control-row { display: grid; gap: .6rem; }
.control-row-split { grid-template-columns: 1fr auto; align-items: end; gap: 1rem; }
.control-label { font: 500 .85rem/1.2 var(--sans); color: var(--ink-muted); display: block; margin-bottom: .55rem; }
.control-row > .control-label { margin-bottom: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: 500 .86rem/1 var(--sans); color: var(--ink-soft);
  background: transparent; border: 1px solid var(--stone-line); border-radius: 999px;
  padding: .55rem .8rem; cursor: pointer; min-height: 2.25rem;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.chip:hover { border-color: var(--ink-muted); color: var(--ink); }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--linen); }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--linen-deep); border: 1px solid var(--stone-line); }
.segmented button {
  font: 500 .88rem/1 var(--sans); color: var(--ink-soft);
  border: 0; background: transparent; border-radius: 999px; padding: .6rem 1rem; cursor: pointer; min-height: 2.3rem;
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.segmented button[aria-checked="true"] { background: var(--linen); color: var(--ink); box-shadow: 0 1px 2px rgba(60,50,30,.18); }
.control-note { font: 400 .86rem/1.5 var(--sans); color: var(--ink-muted); }

@media (max-width: 900px) {
  .session-inner { grid-template-columns: 1fr; gap: 0; }
  .session-copy { display: contents; }
  .session-copy h2, .session-copy .section-lede { order: 0; }
  .device-figure { order: 1; margin-top: 3rem; }
  .player-controls { order: 2; margin-top: 2rem; }
  .notes { order: 3; margin-top: 3.5rem; }
  .notes > div { grid-template-columns: 1fr; }
}

/* ───────── Themes ───────── */
.themes { padding: var(--section-space) var(--gutter); background: var(--linen-deep); position: relative; }
.themes::before, .themes::after {
  /* Gentle arched edges: the section sits like a lens on the page. */
  content: ""; position: absolute; left: 0; right: 0; height: clamp(2rem, 5vw, 4rem);
  background: var(--linen);
}
.themes::before { top: 0; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.themes::after { bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }

.themes-head, .themes-body { max-width: var(--max); margin: 0 auto; position: relative; z-index: 1; }
.themes-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 4rem; align-items: end; padding-top: clamp(1rem, 3vw, 2rem); }
.themes-head .section-lede { margin-top: 0; }

.themes-body {
  margin-top: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.theme-tabs { display: grid; border-top: 1px solid var(--stone-line); counter-reset: none; }
.theme-tab {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--stone-line);
  padding: .85rem .25rem .85rem 0;
  font: 380 clamp(1.5rem, 1.2rem + 1.4vw, 2.35rem)/1.15 var(--serif);
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.015em;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color .35s ease, padding-left .5s var(--ease-out);
}
.theme-tab:hover { color: var(--ink); }
.theme-tab[aria-selected="true"] { color: var(--ink); padding-left: 1.6rem; }
.theme-tab::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: .62rem; height: .62rem; margin-top: -.31rem; border-radius: 50%;
  background: var(--tab-accent, var(--sage));
  transform: scale(0); transition: transform .5s var(--ease-out);
}
.theme-tab[aria-selected="true"]::before { transform: scale(1); }
.theme-tab .tab-ring {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 1px solid var(--tab-accent, var(--sage));
  opacity: 0; transform: scale(.5);
  transition: opacity .35s ease, transform .5s var(--ease-out);
}
.theme-tab:hover .tab-ring, .theme-tab:focus-visible .tab-ring { opacity: .9; transform: scale(1); }
.theme-tab[aria-selected="true"] .tab-ring { opacity: 1; transform: scale(1); background: color-mix(in srgb, var(--tab-accent, var(--sage)) 18%, transparent); }
.theme-tab:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 8px; }

.theme-stage { position: sticky; top: 7rem; }
html.no-js .theme-stage { position: static; }
.theme-visual {
  width: min(100%, 34rem, 54vh); aspect-ratio: 1; margin: -2rem auto 0 -1rem;
  color: var(--accent);
  transition: color 1s ease;
}
.theme-visual svg { width: 100%; height: 100%; overflow: visible; }
.theme-visual circle, .theme-visual ellipse { fill: none; stroke: currentColor; stroke-width: 1.1; }
.theme-visual .tv-core { fill: currentColor; stroke: none; }
.theme-visual .tv-rings > * { transform-box: view-box; transform-origin: 200px 200px; }

.theme-panels { margin-top: -5.5rem; position: relative; }
.theme-panel h3 { font-size: var(--step-3); font-weight: 340; letter-spacing: -0.025em; font-variation-settings: "opsz" 72; }
.theme-panel > p { margin-top: 1rem; color: var(--ink-soft); max-width: 30em; }
.theme-panel blockquote { margin-top: 1.75rem; padding-left: 1.25rem; border-left: 2px solid var(--accent); transition: border-color 1s ease; }
.theme-panel blockquote p { font-style: italic; font-size: var(--step-2); line-height: 1.25; font-weight: 340; color: var(--ink); letter-spacing: -0.01em; }
.sample-note { margin-top: 1.5rem; font: 400 var(--step--1)/1.5 var(--sans); color: var(--ink-muted); }

html.js .theme-panel[hidden] { display: none; }
html.js .theme-panel.is-entering { animation: panel-in .7s var(--ease-out) both; }
html.no-js .theme-panels { display: grid; gap: 3rem; margin-top: 2rem; }
html.no-js .theme-panel h3 { font-size: var(--step-2); }
html.no-js .theme-panel blockquote p { font-size: var(--step-1); }

@media (max-width: 900px) {
  .themes-head { grid-template-columns: 1fr; }
  .themes-body { grid-template-columns: 1fr; }
  .theme-stage { position: static; }
  .theme-visual { width: min(70%, 18rem); margin: 0 auto; }
  .theme-panels { margin-top: 0; }
  .theme-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; gap: .4rem; }
  .theme-tab { font-size: 1.12rem; border: 1px solid var(--stone-line); border-radius: 999px; padding: .65rem .5rem; justify-content: center; grid-template-columns: auto; text-align: center; }
  .theme-tab[aria-selected="true"] { padding-left: .5rem; background: var(--ink); color: var(--linen); border-color: var(--ink); }
  .theme-tab::before, .theme-tab .tab-ring { display: none; }
  .theme-tab:focus-visible { border-radius: 999px; }
}
@media (max-width: 380px) { .theme-tab { font-size: 1rem; } }

/* ───────── How it works (evening) ───────── */
.how {
  --focus-ring: 0 0 0 2px var(--evening), 0 0 0 4.5px var(--evening-text);
  background: var(--evening);
  color: var(--evening-text);
  padding: var(--section-space) var(--gutter);
  position: relative;
  overflow: hidden;
}
.how::before {
  /* low horizon glow */
  content: ""; position: absolute; left: 50%; bottom: -60%; width: 140%; aspect-ratio: 2 / 1; transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sage) 30%, transparent), transparent 70%);
  pointer-events: none;
}
.how-inner { position: relative; max-width: var(--max); margin: 0 auto; }
.how .section-lede { color: var(--evening-muted); }

.steps {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5.5rem);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem;
  counter-reset: step;
}
.steps::before {
  content: ""; position: absolute; left: 0; right: 0; top: .55rem; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--evening-text) 35%, transparent), color-mix(in srgb, var(--evening-text) 10%, transparent));
}
.step { position: relative; padding-top: 2.6rem; counter-increment: step; cursor: default; }
.step-node {
  position: absolute; top: 0; left: 0;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--evening-text) 45%, transparent);
  background: var(--evening);
  transition: border-color .4s ease, transform .5s var(--ease-out);
}
.step.is-active .step-node { border-color: var(--honey); transform: scale(1.35); }
.step h3 { font-size: var(--step-1); color: var(--evening-text); }
.step h3::before { content: counter(step) ". "; color: var(--honey); font-variant-numeric: oldstyle-nums; }
.step p { margin-top: .7rem; color: var(--evening-muted); font-size: 1.04rem; line-height: 1.58; }

.steps-dot {
  position: absolute; left: 0; top: 0;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--honey) 20%, transparent), 0 0 24px 6px color-mix(in srgb, var(--honey) 30%, transparent);
  transform: translate(var(--sx, 0), var(--sy, 0));
  transition: transform .9s var(--ease-out), opacity .4s ease;
  opacity: 0;
  pointer-events: none;
}
.steps-dot.is-on { opacity: 1; }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 2.2rem; padding-left: 2.6rem; }
  .steps::before { left: .55rem; right: auto; top: 0; bottom: 0; width: 1px; height: auto; background: linear-gradient(180deg, color-mix(in srgb, var(--evening-text) 35%, transparent), color-mix(in srgb, var(--evening-text) 8%, transparent)); }
  .step { padding-top: 0; }
  .step-node { left: -2.6rem; top: .3rem; }
}

/* Ripple reveal: the evening section surfaces as an expanding circle while it scrolls into view.
   Progressive enhancement only, where scroll-driven animations are supported. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="paused"]) .how {
      animation: surface linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 85%;
    }
    html:not([data-motion="paused"]) .closing-inner {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }
  }
}

/* ───────── Access ───────── */
.access { padding: var(--section-space) var(--gutter); }
.access-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(3rem, 7vw, 7rem); align-items: center;
}
.access-copy h2 { max-width: 11em; }

.access-modes { border: 0; margin: 2.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.access-modes legend { font: 500 .85rem/1.2 var(--sans); color: var(--ink-muted); padding: 0; margin-bottom: .6rem; }
.access-modes label { position: relative; cursor: pointer; }
.access-modes input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.access-modes label span {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem;
  font: 500 .92rem/1 var(--sans); color: var(--ink-soft);
  padding: .6rem 1rem; border-radius: 999px; border: 1px solid var(--stone-line);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.access-modes label span::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; border: 1px solid currentColor; transition: background-color .3s ease; }
.access-modes label:hover span { border-color: var(--ink-muted); color: var(--ink); }
.access-modes input:checked + span { background: var(--ink); color: var(--linen); border-color: var(--ink); }
.access-modes input:checked + span::before { background: var(--honey); border-color: var(--honey); }
.access-modes input:focus-visible + span { box-shadow: var(--focus-ring); }

.access-list { margin-top: 2rem; border-top: 1px solid var(--stone-line); }
.access-item { padding: 1.15rem 0 1.15rem 1.4rem; border-bottom: 1px solid var(--stone-line); position: relative; transition: opacity .4s ease; }
.access-item::before { content: ""; position: absolute; left: 0; top: 1.55rem; width: .55rem; height: .55rem; border-radius: 50%; border: 1px solid var(--ink-muted); transition: background-color .4s ease, border-color .4s ease, transform .4s var(--ease-out); }
.access-item dt { font: 600 1rem/1.4 var(--sans); }
.access-item dd { margin-top: .3rem; color: var(--ink-soft); font-size: 1.04rem; line-height: 1.55; max-width: 32em; }

.access:has(input[value="free"]:checked) .access-item[data-mode="free"]::before,
.access:has(input[value="ads"]:checked) .access-item[data-mode="ads"]::before,
.access:has(input[value="all"]:checked) .access-item[data-mode="all"]::before { background: var(--honey); border-color: var(--honey); transform: scale(1.25); }

.access-figure { display: grid; gap: 1.25rem; }
.dot-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: clamp(.55rem, 1.6vw, 1.05rem);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: 1.75rem;
  background: var(--linen-deep);
  box-shadow: inset 0 0 0 1px var(--stone);
}
.dot {
  aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid var(--stone-line);
  background: transparent;
  transition: background-color .5s ease var(--delay, 0s), border-color .5s ease var(--delay, 0s), transform .6s var(--ease-out) var(--delay, 0s);
}
.dot.is-free { background: var(--sage-deep); border-color: var(--sage-deep); }
.access:has(input[value="ads"]:checked) .dot:not(.is-free),
.access[data-mode="ads"] .dot:not(.is-free) { border-style: dashed; border-color: var(--honey); }
.access:has(input[value="all"]:checked) .dot,
.access[data-mode="all"] .dot { background: var(--ink); border-color: var(--ink); transform: scale(1.04); }
.access[data-mode="all"] .dot.is-free,
.access:has(input[value="all"]:checked) .dot.is-free { background: var(--sage-deep); border-color: var(--sage-deep); }
.access-figure figcaption { font: 400 var(--step--1)/1.55 var(--sans); color: var(--ink-muted); max-width: 30rem; min-height: 3em; }

.access-facts { margin-top: 1.4rem; font: 400 var(--step--1)/1.55 var(--sans); color: var(--ink-muted); }

@media (max-width: 900px) { .access-inner { grid-template-columns: 1fr; } }

/* ───────── FAQ ───────── */
.faq { padding: 0 var(--gutter) var(--section-space); }
.faq-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  border-top: 1px solid var(--stone-line);
  padding-top: clamp(3rem, 7vw, 6rem);
}
.faq-head { position: sticky; top: 7rem; align-self: start; }
.faq-list { border-top: 1px solid var(--stone-line); }
.faq details { border-bottom: 1px solid var(--stone-line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center;
  padding: 1.35rem 0;
  font-size: var(--step-1); font-weight: 420; line-height: 1.3; letter-spacing: -0.008em;
  transition: color .3s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 1px solid var(--stone-line);
  background:
    linear-gradient(var(--ink), var(--ink)) center / .62rem 1.2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.2px .62rem no-repeat;
  transition: transform .45s var(--ease-out), background-color .3s ease, border-color .3s ease;
}
.faq summary:hover::after { border-color: var(--ink-muted); background-color: var(--linen-deep); }
.faq details[open] > summary::after { transform: rotate(135deg); border-color: var(--honey); background-color: color-mix(in srgb, var(--honey) 16%, transparent); }
.faq summary:focus-visible { box-shadow: none; outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.faq .answer { padding: 0 3rem 1.6rem 0; color: var(--ink-soft); max-width: 38em; }
.faq details[open] .answer { animation: answer-in .5s var(--ease-out); }

@media (max-width: 860px) {
  .faq-inner { grid-template-columns: 1fr; }
  .faq-head { position: static; }
  .faq .answer { padding-right: 0; }
}

/* ───────── Closing ───────── */
.closing {
  position: relative; overflow: hidden;
  padding: clamp(6rem, 14vw, 12rem) var(--gutter);
  text-align: center;
  background: radial-gradient(ellipse at 50% 55%, var(--linen) 0%, var(--linen-deep) 70%);
}
.closing-field { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.closing-field span {
  grid-area: 1 / 1;
  width: clamp(14rem, 34vw, 26rem); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--stone-line);
  animation: closing-ripple calc(var(--breath) * 1.4) var(--ease-out) infinite;
  opacity: 0;
}
.closing-field span:nth-child(2) { animation-delay: calc(var(--breath) * -.28); }
.closing-field span:nth-child(3) { animation-delay: calc(var(--breath) * -.56); }
.closing-field span:nth-child(4) { animation-delay: calc(var(--breath) * -.84); }
.closing-field span:nth-child(5) { animation-delay: calc(var(--breath) * -1.12); }
.closing-inner { position: relative; max-width: 44rem; margin: 0 auto; }
.closing h2 { margin-top: 1.75rem; font-size: var(--step-4); font-weight: 320; letter-spacing: -0.03em; line-height: 1; }
.closing-lede { margin: 1.5rem auto 0; max-width: 28em; color: var(--ink-soft); font-size: clamp(1.1rem, 1.02rem + .35vw, 1.3rem); }

/* ───────── Footer ───────── */
.site-footer { background: var(--linen); border-top: 1px solid var(--stone-line); padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) calc(2.5rem + env(safe-area-inset-bottom, 0px)); }
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.5rem 4rem;
}
.footer-brand p { margin-top: .9rem; color: var(--ink-soft); font-size: 1rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: flex-end; }
.footer-nav a { font: 500 .93rem/1.4 var(--sans); color: var(--ink); text-decoration: none; padding: .3rem 0; background: linear-gradient(var(--honey), var(--honey)) 0 100% / 0 1.5px no-repeat; transition: background-size .45s var(--ease-out); }
.footer-nav a:hover, .footer-nav a:focus-visible { background-size: 100% 1.5px; }
.footer-fine { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem 2rem; padding-top: 1.75rem; border-top: 1px solid var(--stone); font: 400 .84rem/1.55 var(--sans); color: var(--ink-muted); }
.footer-fine p:first-child { flex: 1 1 26rem; }
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav ul { justify-content: flex-start; }
}

/* ───────── Keyframes ───────── */
@keyframes breathe-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  45%, 55% { transform: scale(1.045); opacity: .7; }
}
@keyframes breathe-dot {
  0%, 100% { transform: scale(1); }
  45%, 55% { transform: scale(1.35); }
}
@keyframes breathe-halo {
  0%, 100% { transform: scale(1); opacity: .9; }
  45%, 55% { transform: scale(1.9); opacity: .35; }
}
@keyframes ripple {
  0% { transform: scale(.04); opacity: 0; }
  8% { opacity: .65; }
  100% { transform: scale(1); opacity: 0; }
}
@keyframes ping {
  0% { transform: scale(.5); opacity: .9; }
  70%, 100% { transform: scale(1.6); opacity: 0; }
}
@keyframes closing-ripple {
  0% { transform: scale(.2); opacity: 0; }
  12% { opacity: .9; }
  100% { transform: scale(3.6); opacity: 0; }
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(.6rem); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes answer-in {
  from { opacity: 0; transform: translateY(-.35rem); }
  to { opacity: 1; transform: none; }
}
@keyframes surface {
  from { clip-path: circle(12% at 50% 0%); }
  to { clip-path: circle(150% at 50% 0%); }
}
@keyframes settle {
  from { opacity: .25; transform: translateY(2.5rem) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes tv-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(var(--tv-scale, 1.06)); opacity: var(--tv-fade, .55); }
}
@keyframes tv-converge {
  0% { transform: scale(1.25); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: scale(.2); opacity: 0; }
}
@keyframes tv-spin { to { transform: rotate(360deg); } }
@keyframes tv-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(var(--tv-dx, 0px), var(--tv-dy, 0px)); }
}

/* ───────── Motion control ───────── */
/* Global pause, driven by the header button (defaults to paused for reduced-motion users). */
html[data-motion="paused"] *,
html[data-motion="paused"] *::before,
html[data-motion="paused"] *::after {
  animation-play-state: paused !important;
}
html[data-motion="paused"] .field-ripples circle,
html[data-motion="paused"] .closing-field span:nth-child(n+3) { opacity: 0 !important; animation: none !important; }
html[data-motion="paused"] .closing-field span:nth-child(1) { animation: none; opacity: .9; transform: scale(1); }
html[data-motion="paused"] .closing-field span:nth-child(2) { animation: none; opacity: .5; transform: scale(1.7); }
html[data-motion="paused"] .status-dot::after { animation: none; opacity: 0; }

/* Without JavaScript, still honour the OS setting. */
@media (prefers-reduced-motion: reduce) {
  html.no-js *, html.no-js *::before, html.no-js *::after { animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  .dot.is-free, .chip[aria-checked="true"], .access-modes input:checked + span { forced-color-adjust: none; }
  .button { border: 1px solid ButtonText; }
}

@media print {
  .site-header, .hero-field, .closing-field, .player-controls, body::after { display: none !important; }
  .how { background: none; color: #000; }
}

/* ───────── 404 ───────── */
.closing-404 { min-height: 100svh; display: grid; place-items: center; }
.closing-404 h1 { margin-top: 2.5rem; font-size: var(--step-4); font-weight: 320; letter-spacing: -0.03em; line-height: 1; }

/* Without JavaScript the themes read as a simple editorial list. */
html.no-js .themes-body { grid-template-columns: 1fr; }
html.no-js .theme-visual { display: none; }
html.no-js .theme-panels { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 3rem 4rem; }

/* Keep touch controls comfortable without changing the desktop composition. */
@media (pointer: coarse), (max-width: 700px) {
  button, .chip, .button-small, .segmented button, .site-nav a { min-height: 44px; }
  .motion-toggle { min-width: 44px; }
}
