/* Vestra Player download page, template B "Depth stage": a dark, cinematic page whose hero is a
   3D stage of player windows. Motion is transform and opacity only. */

:root {
  /* Violet-tinted near-blacks of the player's Aurora palette (bg-video, bg-bar, bg-panel). */
  --ink: #09080d;
  --ink-1: #0f0d14;
  --ink-2: #16141c;
  --ink-3: #201d28;
  --line: rgba(226, 214, 255, 0.09);
  --line-2: rgba(226, 214, 255, 0.16);
  --text: #eef0f6;
  --muted: #a59fb4;
  --faint: #8a849a;
  /* Brand: the logo's spectrum. accent = Aurora magenta, accent-hi its light tint for link text,
     brand = the player's progress fill (amber → magenta → violet → cyan). */
  --accent: #f72aa6;
  --accent-hi: #ff7cc8;
  --brand: linear-gradient(100deg, #fcc402 0%, #fb5a35 20%, #fa0aa8 45%, #7a0afa 72%, #10a8fc 100%);
  --button: linear-gradient(100deg, #e0245e 0%, #c8178f 40%, #a41fd8 70%, #7a2cff 100%);
  --button-ink: #ffffff;
  /* Download buttons: dark surface, white text, a thin brand-gradient border (brighter on hover). */
  --dl-fill: linear-gradient(var(--ink-2), var(--ink-2)) padding-box;
  --dl-fill-hover: linear-gradient(#1d1a25, #1d1a25) padding-box;
  --brand-hi: linear-gradient(100deg, #ffd23a 0%, #ff7a5c 20%, #ff3cc0 45%, #9a46ff 72%, #45c0ff 100%);
  --radius: 16px;
  --win-radius: 10px;
  --gutter: 16px;
  --header: 64px;
  --wide: 1200px;
  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "SF Pro Display", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  /* Type scale: a steep cinematic ramp. */
  --t-hero: clamp(2.25rem, min(4.3vw, 6.2vh), 4.25rem);
  --t-h2: clamp(2rem, 4.6vw, 3.75rem);
  --t-h3: clamp(1.5rem, 2.5vw, 2.25rem);
  --t-lede: clamp(1.02rem, 1.5vw, 1.2rem);
  color-scheme: dark;
}

/* The stage tilt (main.js): registered and not inherited, so writing them on the tilt layer
   does not restyle the windows inside it on every pointer move. */
@property --rx { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --ry { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); background: var(--ink); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-x: clip;
}
@supports not (overflow: clip) { body { overflow-x: hidden; } }

a { color: var(--text); text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.3); }
a:hover { text-decoration-color: var(--accent); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--ink-3); padding: 0.05em 0.35em; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.08; letter-spacing: -0.035em; font-weight: 680; text-wrap: balance; }
:root[lang="zh-Hans"] h1, :root[lang="zh-Hans"] h2, :root[lang="zh-Hans"] h3 { letter-spacing: 0; line-height: 1.22; }
img, video { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

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

.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 50; background: var(--ink-3); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

.no-js .js-only, .no-js .nav-dl { display: none !important; }
.sep { margin: 0 0.55em; opacity: 0.5; }

/* ---- Visitor's system: its button first (main.js sets data-visitor; Windows without script) ---- */

/* Every system's button shows, all in the same primary style; the visitor's comes first
   (without script: Windows first). */
.cta-btn.os-macos, .cta-btn.os-linux,
:root[data-visitor="macos"] .cta-btn.os-windows, :root[data-visitor="linux"] .cta-btn.os-windows { order: 1; }
:root[data-visitor="macos"] .cta-btn.os-macos, :root[data-visitor="linux"] .cta-btn.os-linux { order: 0; }

/* ---- Header: fixed over the stage, no blur (it sits over moving pictures) ---- */

.top {
  position: fixed; inset: 0 0 auto; z-index: 30;
  background: linear-gradient(to bottom, rgba(9, 8, 13, 0.92), rgba(9, 8, 13, 0.78));
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 24px; max-width: var(--wide); height: var(--header); margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 650 1rem/1 var(--display); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; margin: 0 auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.nav-gh { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }
.nav-gh:hover { color: var(--text); background: var(--ink-3); }
.gh-icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.lang { background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 13px; font-size: 0.84rem; white-space: nowrap; color: var(--muted); }
.lang:hover { color: var(--text); border-color: var(--muted); }
.nav-dl {
  padding: 5px 14px; border-radius: 999px; font-size: 0.86rem; font-weight: 650; white-space: nowrap;
  color: var(--text); text-decoration: none; border: 1.5px solid transparent; background: var(--dl-fill), var(--brand) border-box;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Hidden (and inert) while another download button is on screen. It keeps its room, so showing
   it moves nothing (no layout, no shift); only opacity and transform change. */
:root:not(.nav-dl-on) .nav-dl {
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

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

.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 600 0.74rem/1.2 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.kicker::before { content: ""; width: 24px; height: 2px; border-radius: 1px; background: var(--brand); }
:root[lang="zh-Hans"] .kicker { letter-spacing: 0.08em; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 { font-size: var(--t-h2); }
.section-lede { margin: 20px 0 0; color: var(--muted); font-size: var(--t-lede); max-width: 640px; }
.text-link { color: var(--accent-hi); text-decoration: none; font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* ---- Perspective dot floor (IINA precedent): a dotted plane tipped back toward a horizon ---- */

.floor {
  position: absolute; left: -25%; right: -25%; bottom: -4%; height: 92%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(214, 160, 255, 0.42) 1.2px, transparent 1.8px) 50% 100% / 30px 30px;
  transform: perspective(600px) rotateX(58deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 35%, transparent 80%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 35%, transparent 80%);
}

/* ---- Hero: copy and the stage (base = the flat layout: phones, no scroll-driven animations) ---- */

.hero { position: relative; }
.pin {
  position: relative; overflow: hidden; isolation: isolate;
  padding: calc(var(--header) + clamp(40px, 8vh, 88px)) var(--gutter) 72px;
}
/* The projector: warm light behind the windows, a cool rim above. */
.pin::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 38% at 50% 66%, rgba(250, 10, 168, 0.16), transparent 72%),
    radial-gradient(36% 30% at 30% 72%, rgba(122, 10, 250, 0.12), transparent 70%),
    radial-gradient(70% 45% at 50% 0%, rgba(16, 168, 252, 0.10), transparent 70%);
}
.hero-copy { position: relative; z-index: 2; text-align: center; max-width: 1200px; margin: 0 auto; }
/* An empty line keeps the room of the grey line that sat under the hero buttons (18px gap, one
   0.83rem line), so the stage starts exactly where it did. */
.hero-copy::after { content: "\00a0"; display: block; margin-top: 18px; font-size: 0.83rem; }
.hero h1 { font-size: var(--t-hero); font-weight: 700; letter-spacing: -0.045em; max-width: 19em; margin: 0 auto; }
:root[lang="zh-Hans"] .hero h1 { letter-spacing: 0.01em; }
.hero h1::after { content: ""; display: block; width: 96px; height: 3px; margin: 20px auto 0; border-radius: 2px; background: var(--brand); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 30px; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 24px 8px 20px; border-radius: 12px;
  color: var(--text); text-decoration: none; border: 1.5px solid transparent; background: var(--dl-fill), var(--brand) border-box;
  transition: transform 0.15s ease;
}
a.cta-btn:hover { transform: translateY(-1px); }
:is(a.cta-btn, .nav-dl, .pf-get):hover { background: var(--dl-fill-hover), var(--brand-hi) border-box; }
.cta-btn .cta-sub { color: var(--muted); }
.cta-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.cta-sub { margin-top: 3px; font-size: 0.76rem; font-weight: 500; }
/* Linux: not built yet. A greyed entry, not a link. */
.cta-btn.cta-soon {
  order: 2; cursor: not-allowed; background: transparent; color: var(--faint);
  box-shadow: none; border: 1.5px dashed var(--line-2);
}
.cta-soon .cta-title { font-size: 0.98rem; font-weight: 650; }

.cta-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cta-title { font-weight: 700; font-size: 1.05rem; }
.ghost-btn {
  order: 3; display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 22px; border-radius: 12px;
  border: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-weight: 600; background: rgba(255, 255, 255, 0.02);
}
.ghost-btn:hover { border-color: var(--muted); background: rgba(255, 255, 255, 0.05); }

.stage { position: relative; z-index: 1; margin: clamp(40px, 7vh, 72px) auto 0; max-width: 1120px; }
.card-far, .card-near { display: none; }
.card {
  /* --ar: a card in a narrowed window (a clip without the playlist pane) takes its shape. */
  position: relative; aspect-ratio: var(--ar, 2220 / 1390); border-radius: var(--win-radius); overflow: hidden; background: var(--ink-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(250, 10, 168, 0.2);
}
/* A fullscreen take (no window frame): the picture alone, its own --ar (build.mjs). */
.card.is-full { background: #000; }
.card > img, .card-far img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot { position: absolute; overflow: hidden; background: #000; }
.shot img, .shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shot video { opacity: 0; transition: opacity 0.4s ease; }
.shot.is-live video { opacity: 1; }


/* ---- The depth stage (wide screens): five windows fanned in depth, standing still ---- */

@media (min-width: 861px) {
  .hero {
    /* The front window's width, as shown: every card is laid out (and rastered) at the size it
       appears, no scaling. */
    --w: min(605px, 45vw, (100vh - var(--header) - 72px) * 0.862);
    --h: calc(var(--w) * 0.62613);
  }
  .stage { max-width: none; height: calc(var(--h) + 70px); perspective: 1800px; perspective-origin: 50% 35%; }
  .tilt, .fan { position: absolute; inset: 0; transform-style: preserve-3d; }
  .tilt {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
  }
  .card {
    /* Every card is as tall as the front window; a narrower one (--ar) keeps its inner edge
       where a full-width card's would be (--pull: half the missing width, foreshortened). */
    --fx: 0; --fz: 0px; --fr: 0deg; --pull: 0;
    --cw: calc(var(--h) * var(--ar, 2220 / 1390));
    position: absolute; left: 50%; top: 50%; width: var(--cw);
    margin: calc(var(--h) / -2) 0 0 calc(var(--cw) / -2);
    transform: translate3d(calc(var(--w) * var(--fx) + (var(--w) - var(--cw)) * var(--pull)), 0, var(--fz)) rotateY(var(--fr));
    backface-visibility: hidden;
  }
  .card-near, .card-far { display: block; }
  .card-near { --fz: -440px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 20px 45px -15px rgba(0, 0, 0, 0.95); }
  .card-near.card-l { --fx: -0.93; --fr: 36deg; --pull: 0.4; }
  .card-near.card-r { --fx: 0.93; --fr: -36deg; --pull: -0.4; }
  .card-far { --fz: -760px; opacity: 0.55; box-shadow: none; }
  .card-far.card-l { --fx: -1.67; --fr: 46deg; }
  .card-far.card-r { --fx: 1.67; --fr: -46deg; }
  /* Side windows sit dimmer: a dark veil (opacity only, no filter). */
  .card-near::after { content: ""; position: absolute; inset: 0; background: rgba(9, 8, 13, 0.5); }
}

/* A short entrance on load (time-based, transform and opacity only; runs once). */
@media (min-width: 861px) and (prefers-reduced-motion: no-preference) {
  .card { animation: fan-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .card-near { animation-delay: 0.08s; }
  .card-far { animation-delay: 0.16s; }
}
@keyframes fan-in { from { opacity: 0; transform: translate3d(0, 48px, -240px); } }

/* ---- Quiet backgrounds for the middle sections (the hero's and the end's language, fainter):
   a thin spectrum divider on top and a dot grid at the page's edges that fades in and out.
   Static: nothing moves. ---- */

/* The glows reach past the viewport's sides: clipped here (body's clip alone still lets a phone
   widen its layout viewport). clip, not hidden: no scroll container. */
main { overflow-x: clip; }
.chapters, .open { position: relative; isolation: isolate; }
/* Full-bleed layers inside the centred sections (body clips the overflow). */
.chapters::before, .chapters::after, .open::before, .open::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; left: 50%; width: 100vw; margin-left: -50vw;
}
/* The spectrum divider: the brand line, fading out at both ends. */
.chapters::after, .open::before {
  top: 0; height: 1px; left: 50%; width: min(960px, 100vw - 2 * var(--gutter)); margin-left: max(-480px, var(--gutter) - 50vw);
  background: var(--brand); opacity: 0.45;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 30%, #000 70%, transparent);
}
/* The dot grid: the floor's dots laid flat, at the edges only (clear of the copy and the clips). */
.chapters::before {
  top: 0; bottom: 0; z-index: -2;
  background: radial-gradient(circle, rgba(214, 160, 255, 0.2) 1px, transparent 1.6px) 50% 0 / 30px 30px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, transparent 34%, #000 58%, transparent 80%, #000 92%, transparent), linear-gradient(to right, #000, transparent 28%, transparent 72%, #000);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, transparent 34%, #000 58%, transparent 80%, #000 92%, transparent), linear-gradient(to right, #000, transparent 28%, transparent 72%, #000);
  mask-composite: intersect;
}
/* Open source: a cool rim from the left, a warm one low on the right (the end's glow takes over below). */
.open::after {
  /* Room above and below so the glows fade out before the layer's edge. */
  top: -100px; bottom: -100px; z-index: -2;
  background:
    radial-gradient(620px 360px at 14% 42%, rgba(16, 168, 252, 0.12), transparent 70%),
    radial-gradient(560px 340px at 86% 62%, rgba(122, 10, 250, 0.12), transparent 70%);
}
/* ---- Features: three themes as a sticky scroll showcase. The themes scroll on the left, one
   entry each: a head, the active beat's caption and a rail of its beats (main.js follows the
   video's clock). One sticky window on the right shows the theme at the reading line, playing its
   loop (its beats in sequence). Without motion (no script, reduced motion, Save-Data) the poster
   stays and a list of every beat replaces the caption and the rail. ---- */

.chapters { max-width: var(--wide); margin: 0 auto; padding: 96px var(--gutter) 60px; }
.themes .section-head { margin-bottom: 16px; }
/* The window's geometry, shared by the grid, the window and its sticky offset: it takes 7 of 12
   parts of the content width (--wide less the gutters) after the gap, at 16 / 10. */
.themes {
  --th-gap: clamp(32px, 5vw, 72px);
  --th-win-h: calc((min(var(--wide), 100vw) - 2 * var(--gutter) - var(--th-gap)) * 7 / 12 / 1.6);
}
.th-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--th-gap); }

/* An entry: tall enough that the reading line rests on it while its loop plays. */
.theme {
  min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0;
  transition: opacity 0.4s ease;
}
.theme:last-child { min-height: 88vh; }
/* While the window plays, the other themes sit dimmer (without motion every entry shows in full). */
:root.motion .theme { opacity: 0.32; }
:root.motion .theme[data-on] { opacity: 1; }
.th-head { margin-bottom: 20px; }
.ch-num { margin: 0 0 12px; font: 700 0.8125rem/1 var(--mono); letter-spacing: 0.14em; color: var(--accent); width: fit-content; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .ch-num { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.ch-num span { margin-left: 6px; color: var(--faint); }
.th-head h3 { font-size: clamp(1.75rem, 2.8vw, 2.5rem); font-weight: 720; line-height: 1.08; letter-spacing: -0.025em; }
:root[lang="zh-Hans"] .th-head h3 { letter-spacing: 0; line-height: 1.22; }

/* Centred in the screen under the header. */
.th-sticky { position: sticky; top: calc(var(--header) + max(16px, (100vh - var(--header) - var(--th-win-h)) / 2)); }
/* The window: one layer per theme, cross-fading; each its poster underneath, its loop on top once it plays. */
.th-window {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--win-radius); overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 40px 100px -30px rgba(0, 0, 0, 0.95), 0 0 90px -24px rgba(250, 10, 168, 0.22);
}
.th-frame { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; }
.th-frame[data-on] { opacity: 1; }
.th-frame img, .th-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.th-frame video { opacity: 0; transition: opacity 0.4s ease; }
.th-frame.is-live video { opacity: 1; }

/* Caption: the beat's name over its sentence; a minimum height so the rail never moves. */
.th-live { container-type: inline-size; }
.th-cap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 112px; margin: 0; }
.th-name { font: 700 1.3rem/1.3 var(--display); letter-spacing: -0.01em; }
.th-text { color: var(--muted); font-size: 1.04rem; line-height: 1.5; }
.th-fine { display: block; margin-top: 4px; color: var(--faint); font-size: 0.82rem; }
/* Beat change: out in 120 ms, in over 240 ms from 8 px below (outExpo). */
.th-cap > * { transition: opacity 0.12s linear; }
.th-cap.out > * { opacity: 0; }
.th-cap.in > * { animation: cap-in 0.24s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes cap-in { from { opacity: 0; transform: translateY(8px); } }

/* Rail: one button per beat. */
.th-rail { display: flex; align-items: flex-start; gap: 16px; margin-top: 14px; }
.th-items { display: flex; flex-wrap: wrap; gap: 10px; }
.th-item {
  flex: 0 0 auto; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0;
  background: none; color: var(--faint); font: 600 11.5px/1.2 var(--font); text-align: center; opacity: 0.62;
  transition: opacity 0.24s ease, color 0.24s ease;
}
.th-item .ic {
  width: 52px; height: 52px; border-radius: 14px; background: var(--ink-2); display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-2);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.th-item .ic img { display: block; width: 100%; height: 100%; }
.th-item svg, .th-list svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Progress: the active beat's bar is scaled by script (--p, from the video's clock); earlier beats are full. */
.th-item .pg { display: block; width: 52px; height: 3px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.th-item .pg b { display: block; height: 100%; background: var(--brand); transform-origin: 0 50%; transform: scaleX(0); }
.th-item[aria-current] .pg b { transform: scaleX(var(--p, 0)); }
.th-item.done .pg b { transform: scaleX(1); }
.th-item[aria-current], .th-item.done { opacity: 1; color: var(--text); }
.th-item[aria-current] .ic { transform: scale(1.1); box-shadow: 0 0 0 2px #fa0aa8, 0 0 26px -4px rgba(250, 10, 168, 0.75); }
/* The store's outro: every icon takes the ring, 60 ms apart; on the wrap they clear together. */
.th-items.all .th-item { opacity: 1; color: var(--text); }
.th-items.all .th-item .pg b { transform: scaleX(1); }
.th-items.all .th-item .ic { box-shadow: 0 0 0 2px #fa0aa8, 0 0 22px -6px rgba(250, 10, 168, 0.7); transition-delay: calc(var(--k) * 60ms); }

/* Plugin rails: the logos alone, evenly spaced on one line (no names under them, user request
   2026-11-13; each name stays its button's accessible label). */
.th-icons .th-items { flex-wrap: nowrap; gap: 16px; }
.th-icons .th-item { width: 52px; }
/* More than six plugins (2026-11-23: the store theme lists all nine): two even rows of five and four, every icon the
   same size; the ones without a beat (.th-xtra) are not buttons and light up with the others in the outro. */
.th-icons.th-rows .th-items { flex-wrap: wrap; row-gap: 14px; max-width: calc(5 * 52px + 4 * 16px); }
.th-xtra { cursor: default; }

/* Chip rails (themes without plugin icons): a line glyph and the label; the bar is the chip's bottom edge. */
.th-chips .th-item {
  position: relative; width: auto; flex-direction: row; gap: 9px; padding: 9px 15px 9px 11px; border-radius: 12px; overflow: hidden;
  background: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2); font-size: 13.5px; transition: opacity 0.24s ease, color 0.24s ease, box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.th-chips .th-item .ic { width: 24px; height: 24px; border-radius: 0; background: none; box-shadow: none; }
.th-chips .th-item .pg { position: absolute; left: 0; right: 0; bottom: 0; width: auto; border-radius: 0; background: transparent; }
.th-chips .th-item[aria-current] { box-shadow: 0 0 0 1.5px #fa0aa8, 0 0 24px -8px rgba(250, 10, 168, 0.8); }
.th-chips .th-item[aria-current] .ic { transform: none; box-shadow: none; color: var(--accent-hi); }
/* A long chip rail needs about 900px: narrower, only the active chip keeps its label. */
@container (max-width: 900px) {
  .th-chips.th-many .th-item:not([aria-current]) .lb { display: none; }
}

/* Without motion: a list of every beat in place of the caption and the rail. */
:root.motion .th-static, :root:not(.motion) .th-live { display: none; }
.th-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.th-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
.th-list .ic { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2); color: var(--accent-hi); }
.th-list .ic img { display: block; width: 100%; height: 100%; }
.th-list .tx { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.th-list .tx b { display: block; font: 700 16px/1.3 var(--display); color: var(--text); }
.th-list .th-fine { display: block; white-space: normal; }
.th-outro { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); }
.th-outro b { color: var(--text); font-family: var(--display); }

/* Narrow screens (as 1d56f43): the window sticks under the header, the themes scroll beneath. */
@media (max-width: 860px) {
  .th-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .th-media {
    order: -1; position: sticky; top: var(--header); z-index: 4; margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) 10px;
    background: linear-gradient(var(--ink) 88%, rgba(9, 8, 13, 0));
  }
  .th-sticky { position: static; }
  .theme { min-height: 60vh; justify-content: flex-start; padding: 32px 0; }
  .theme:last-child { min-height: 70vh; }
}

/* ---- Open source ---- */

.open { max-width: var(--wide); margin: 0 auto; padding: 120px var(--gutter) 40px; }


.os-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 2px solid; border-image: var(--brand) 1; }
.os-card { display: flex; flex-direction: column; gap: 12px; padding: 28px 28px 8px 0; }
.os-card + .os-card { padding-left: 28px; border-left: 1px solid var(--line); }
.os-card h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.os-card p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.os-card p a { color: var(--text); }

/* ---- Closing: one sentence, one button, the floor again ---- */

.end { position: relative; overflow: hidden; isolation: isolate; margin-top: 80px; padding: 140px var(--gutter) 160px; text-align: center; }
.end::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 50% at 50% 70%, rgba(250, 10, 168, 0.13), transparent 75%), radial-gradient(40% 40% at 65% 80%, rgba(122, 10, 250, 0.12), transparent 75%); }
.end h2 { position: relative; z-index: 1; font-size: var(--t-h2); max-width: 15em; margin: 0 auto; }
.end .cta { position: relative; z-index: 1; margin-top: 36px; }
.floor-end { bottom: 0; height: 100%; z-index: -1; transform: perspective(600px) rotateX(50deg); }

/* ---- Footer ---- */

.foot { max-width: var(--wide); margin: 0 auto; padding: 36px var(--gutter) 52px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.88rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 28px; margin-bottom: 18px; }
.foot h2 { font: 600 0.74rem/1.2 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.foot ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.foot p { margin: 6px 0 0; }

/* ---- Other platforms dialog ---- */

.platforms {
  width: min(560px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 48px); padding: 24px;
  color: var(--text); background: var(--ink-1); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.platforms::backdrop { background: rgba(3, 4, 7, 0.72); }
.pf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pf-head h2 { font-size: 1.35rem; }
.pf-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; }
.pf-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.pf-fallback { margin: 0 0 12px; font-size: 0.88rem; color: var(--muted); }
.pf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pf-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); }
.pf-text { flex: 1; min-width: 0; }
.pf-name { margin: 0; font-size: 0.95rem; }
.pf-note { margin: 4px 0 0; font-size: 0.8rem; color: var(--muted); }
.pf-note b { color: var(--text); font-weight: 600; }
.pf-get { flex: none; padding: 7px 15px; border-radius: 10px; font-weight: 650; font-size: 0.88rem; color: var(--text); text-decoration: none; border: 1.5px solid transparent; background: var(--dl-fill), var(--brand) border-box; }
.pf-req { margin: 14px 0 0; font-size: 0.82rem; color: var(--muted); }

/* ---- Reveals: each block rises into place once (main.js adds .reveals, then .in per block) ---- */

@media (prefers-reduced-motion: no-preference) {
  .reveals :is(.reveal, .os-grid) {
    transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .reveals :is(.reveal, .os-grid):not(.in) { opacity: 0; transform: translateY(32px); }
}

/* ---- Narrow screens: the fan collapses to its front window ---- */

@media (max-width: 1020px) {
  .nav-links { gap: 18px; }
  /* Two by two: the cards that start a row lose the divider on their left. */
  .os-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-card:nth-child(odd) { padding-left: 0; border-left: 0; }
  .os-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  /* Only "All downloads" stays, next to the brand (the hero has no other way to the dialog). */
  .nav-links { margin: 0; }
  .nav-links a:not(.nav-all) { display: none; }
  .nav-links + .nav-actions { margin-left: auto; position: relative; }
  /* The download button appears in the empty room left of the actions, so it never moves the others. */
  .nav-dl { position: absolute; right: calc(100% + 10px); }
  .chapters, .open { padding-top: 88px; }
  .os-grid { grid-template-columns: minmax(0, 1fr); }
  .os-card, .os-card + .os-card { padding: 22px 0; border-left: 0; }
  .os-card + .os-card { border-top: 1px solid var(--line); }
  .floor { height: 46%; }
  /* The edges are narrow here: fainter dots. */
  .chapters::before { opacity: 0.6; }
}

@media (max-width: 600px) {
  .brand span { display: none; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .cta { flex-direction: column; align-items: stretch; }
  .cta-btn, .ghost-btn { justify-content: center; }
  .cta-text { align-items: center; text-align: center; }
  .section-head { margin-bottom: 36px; }
  .pf-item { flex-direction: column; align-items: stretch; }
  .pf-get { text-align: center; }
  .end { padding: 96px var(--gutter) 110px; }
}

/* ---- Phones: smaller head, caption and rail ---- */

@media (max-width: 640px) {
  .theme { padding: 24px 0; }
  .th-head { margin-bottom: 14px; }
  .th-head h3 { font-size: 28px; }
  .th-cap { gap: 3px; min-height: 104px; }
  .th-name { font-size: 18px; }
  .th-text { font-size: 15px; }
  .th-rail { flex-direction: column; align-items: stretch; gap: 12px; }
  /* Icon rail: smaller logos, spread across the width. */
  /* One row of equal columns, each logo centred in its column (2026-11-27: the desktop rows rule, 5 per row with
     space-between, left a short last row pinned to both edges on phones). */
  .th-icons .th-items, .th-icons.th-rows .th-items { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); justify-items: center; max-width: none; gap: 0; }
  /* Sized to the column so seven logos keep a gap at 360 px, and the lit one (scaled 1.1) does not touch its neighbours. */
  .th-icons .th-item { width: auto; --ic: clamp(32px, 10vw, 44px); }
  .th-icons .th-item .ic { width: var(--ic); height: var(--ic); border-radius: 12px; }
  .th-icons .th-item .pg { width: var(--ic); }
  /* Chip rails: a long rail shows glyphs only, the active chip with its label. */
  .th-chips .th-items { gap: 6px; }
  .th-chips .th-item { gap: 6px; padding: 8px 9px 8px 7px; font-size: 12.5px; }
  .th-chips .th-item .ic { width: 20px; height: 20px; }
  .th-chips .th-item svg { width: 19px; height: 19px; }
  .th-chips.th-many .th-item:not([aria-current]) .lb { display: none; }
}

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