/* ==========================================================================
   Home — OPEN STRING · 第七泛音 / The Seventh Overtone
   Rev3rie Records strung across a summer sky: every release is a string, and
   the page climbs the overtone series from the fundamental (24:00) to the
   seventh harmonic (24:60), the note no key marks.

   This file holds the home design system: palette and environments, the sky,
   the logotype-as-glyphs, section anatomy (boundary strings, node lines, room
   numerals) and the home skin of the shared chrome. Sections live in
   css/home/*.css. Everything is scoped to html[data-page="home"].
   ========================================================================== */

/* Chrome colours are registered so the bar, timecode and dock can glide
   between environments (only those elements transition them). */
@property --bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #09090b;
}

@property --fg {
  syntax: "<color>";
  inherits: true;
  initial-value: #eeebe4;
}

@property --fg-2 {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(238, 235, 228, 0.66);
}

@property --line {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(238, 235, 228, 0.13);
}

/* --- Palette ---------------------------------------------------------------- */
html[data-page="home"] {
  --ink: #10183a;
  --ink-rgb: 16 24 58;
  --bone-rgb: 247 241 243;
  --sky-zenith: #74c2da;
  --sky-mid: #a6dae8;
  --sky-low: #d3ecf0;
  --haze: #f2ede0;
  --blush-dawn: #f6e6da;
  --sun: #fff7e3;
  --vermilion: #ff4f2b;
  --signal-ink: #b83a28; /* small red text on light grounds */
  --azure: #2f5f9e;
  --paper: #eef4f1;
  --mist: #d6e9e7;
  --parchment: #f8f2d9;
  --brass: #e2bf4d;
  --brass-ink: #5c4a12;
  --blush: #f6eaf0;
  --rose: #ea8ba2;
  --rose-ink: #9e3a55;
  --night: #141842;
  --lilac: #ccbac8;
  --glass: #7bd8fd;
  --firefly: #e9c452;
  --teal: #2f5e57;
  --teal-2: #bfe3da;
  --violet: #26246e;
  --peri: #a9a9ff;
  --ember: #ff6b4a;

  --sky: linear-gradient(180deg, #74c2da 0%, #a6dae8 38%, #d3ecf0 70%, #f2ede0 88%, #f6e6da 100%);

  /* Motion */
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --d-tune: 700ms;
  --d-scene: 900ms;

  /* Section anatomy */
  --band: 120px;

  color-scheme: light;
  background: var(--sky-zenith);
}

:root[data-page="home"]:is([data-tier="mid"], [data-tier="low"]) {
  --d-tune: 360ms;
}

@media (max-width: 900px) {
  html[data-page="home"] {
    --band: 72px;
  }
}

/* Default (paper) tokens for everything outside a block. */
html[data-page="home"] body {
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-2: rgb(var(--ink-rgb) / 0.72);
  --fg-3: rgb(var(--ink-rgb) / 0.66);
  --fg-4: rgb(var(--ink-rgb) / 0.36);
  --line: rgb(var(--ink-rgb) / 0.14);
  --line-strong: rgb(var(--ink-rgb) / 0.3);
  --surface: rgb(var(--ink-rgb) / 0.04);
  --surface-2: rgb(var(--ink-rgb) / 0.07);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  background: var(--paper);
  color: var(--fg);
}

html[data-page="home"] ::selection {
  background: rgb(255 79 43 / 0.3);
  color: inherit;
}

/* --- Environments (generated by scratchpad/redesign/gen_env.py) ---------------
   Each block re-colours the base components inside it. Chrome (bar, Index
   trigger, timecode, dock) takes the env under it: data-env-top / -bottom. */

html[data-page="home"] [data-env="sky"] {
  --bg: #a6dae8;
  --ground: transparent;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.78);
  --fg-3: rgb(16 24 58 / 0.72);
  --fg-4: rgb(16 24 58 / 0.42);
  --line: rgb(16 24 58 / 0.16);
  --line-strong: rgb(16 24 58 / 0.32);
  --surface: rgb(16 24 58 / 0.05);
  --surface-2: rgb(16 24 58 / 0.05);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="paper"] {
  --bg: #eef4f1;
  --ground: #eef4f1;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="mist"] {
  --bg: #d6e9e7;
  --ground: #d6e9e7;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="parchment"] {
  --bg: color-mix(in oklab, rgb(var(--art)) 14%, #f8f2d9);
  --ground: color-mix(in oklab, rgb(var(--art)) 14%, #f8f2d9);
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="vermilion"] {
  --bg: #ff4f2b;
  --ground: #ff4f2b;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58);
  --fg-3: rgb(16 24 58 / 0.86);
  --fg-4: rgb(16 24 58 / 0.5);
  --line: rgb(16 24 58 / 0.3);
  --line-strong: rgb(16 24 58 / 0.5);
  --surface: rgb(16 24 58 / 0.06);
  --surface-2: rgb(16 24 58 / 0.06);
  --accent: rgb(16 24 58);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px rgb(16 24 58);
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="brass"] {
  --bg: #e2bf4d;
  --ground: #e2bf4d;
  --fg: rgb(16 24 58);
  --fg-2: #5c4a12;
  --fg-3: #5c4a12;
  --fg-4: rgb(92 74 18 / 0.55);
  --line: rgb(16 24 58 / 0.22);
  --line-strong: rgb(16 24 58 / 0.4);
  --surface: rgb(16 24 58 / 0.05);
  --surface-2: rgb(16 24 58 / 0.05);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="blush"] {
  --bg: #f6eaf0;
  --ground: #f6eaf0;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ea8ba2;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
  color: var(--fg);
}

html[data-page="home"] [data-env="teal"] {
  --bg: #2f5e57;
  --ground: #2f5e57;
  --fg: rgb(247 241 243);
  --fg-2: #bfe3da;
  --fg-3: #bfe3da;
  --fg-4: rgb(191 227 218 / 0.55);
  --line: rgb(247 241 243 / 0.18);
  --line-strong: rgb(247 241 243 / 0.34);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #e9c452;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #e9c452;
  color-scheme: dark;
  color: var(--fg);
}

html[data-page="home"] [data-env="violet"] {
  --bg: #26246e;
  --ground: #26246e;
  --fg: rgb(247 241 243);
  --fg-2: #ccbac8;
  --fg-3: #ccbac8;
  --fg-4: rgb(204 186 200 / 0.55);
  --line: rgb(247 241 243 / 0.16);
  --line-strong: rgb(247 241 243 / 0.32);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #a9a9ff;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #a9a9ff;
  color-scheme: dark;
  color: var(--fg);
}

html[data-page="home"] [data-env="night"] {
  --bg: #141842;
  --ground: #141842;
  --fg: rgb(247 241 243);
  --fg-2: #ccbac8;
  --fg-3: rgb(247 241 243 / 0.66);
  --fg-4: rgb(247 241 243 / 0.36);
  --line: rgb(247 241 243 / 0.13);
  --line-strong: rgb(247 241 243 / 0.3);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #7bd8fd;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #7bd8fd;
  color-scheme: dark;
  color: var(--fg);
}

html[data-page="home"][data-env-top="sky"] .bar {
  --bg: #a6dae8;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.78);
  --fg-3: rgb(16 24 58 / 0.72);
  --fg-4: rgb(16 24 58 / 0.42);
  --line: rgb(16 24 58 / 0.16);
  --line-strong: rgb(16 24 58 / 0.32);
  --surface: rgb(16 24 58 / 0.05);
  --surface-2: rgb(16 24 58 / 0.05);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-top="paper"] .bar {
  --bg: #eef4f1;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-top="mist"] .bar {
  --bg: #d6e9e7;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-top="parchment"] .bar {
  --bg: color-mix(in oklab, rgb(var(--art)) 14%, #f8f2d9);
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-top="vermilion"] .bar {
  --bg: #ff4f2b;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58);
  --fg-3: rgb(16 24 58 / 0.86);
  --fg-4: rgb(16 24 58 / 0.5);
  --line: rgb(16 24 58 / 0.3);
  --line-strong: rgb(16 24 58 / 0.5);
  --surface: rgb(16 24 58 / 0.06);
  --surface-2: rgb(16 24 58 / 0.06);
  --accent: rgb(16 24 58);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px rgb(16 24 58);
  color-scheme: light;
}

html[data-page="home"][data-env-top="brass"] .bar {
  --bg: #e2bf4d;
  --fg: rgb(16 24 58);
  --fg-2: #5c4a12;
  --fg-3: #5c4a12;
  --fg-4: rgb(92 74 18 / 0.55);
  --line: rgb(16 24 58 / 0.22);
  --line-strong: rgb(16 24 58 / 0.4);
  --surface: rgb(16 24 58 / 0.05);
  --surface-2: rgb(16 24 58 / 0.05);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-top="blush"] .bar {
  --bg: #f6eaf0;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ea8ba2;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-top="teal"] .bar {
  --bg: #2f5e57;
  --fg: rgb(247 241 243);
  --fg-2: #bfe3da;
  --fg-3: #bfe3da;
  --fg-4: rgb(191 227 218 / 0.55);
  --line: rgb(247 241 243 / 0.18);
  --line-strong: rgb(247 241 243 / 0.34);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #e9c452;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #e9c452;
  color-scheme: dark;
}

html[data-page="home"][data-env-top="violet"] .bar {
  --bg: #26246e;
  --fg: rgb(247 241 243);
  --fg-2: #ccbac8;
  --fg-3: #ccbac8;
  --fg-4: rgb(204 186 200 / 0.55);
  --line: rgb(247 241 243 / 0.16);
  --line-strong: rgb(247 241 243 / 0.32);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #a9a9ff;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #a9a9ff;
  color-scheme: dark;
}

html[data-page="home"][data-env-top="night"] .bar {
  --bg: #141842;
  --fg: rgb(247 241 243);
  --fg-2: #ccbac8;
  --fg-3: rgb(247 241 243 / 0.66);
  --fg-4: rgb(247 241 243 / 0.36);
  --line: rgb(247 241 243 / 0.13);
  --line-strong: rgb(247 241 243 / 0.3);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #7bd8fd;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #7bd8fd;
  color-scheme: dark;
}

html[data-page="home"][data-env-bottom="sky"] :is(.tc, .dock) {
  --bg: #a6dae8;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.78);
  --fg-3: rgb(16 24 58 / 0.72);
  --fg-4: rgb(16 24 58 / 0.42);
  --line: rgb(16 24 58 / 0.16);
  --line-strong: rgb(16 24 58 / 0.32);
  --surface: rgb(16 24 58 / 0.05);
  --surface-2: rgb(16 24 58 / 0.05);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="paper"] :is(.tc, .dock) {
  --bg: #eef4f1;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="mist"] :is(.tc, .dock) {
  --bg: #d6e9e7;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="parchment"] :is(.tc, .dock) {
  --bg: color-mix(in oklab, rgb(var(--art)) 14%, #f8f2d9);
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="vermilion"] :is(.tc, .dock) {
  --bg: #ff4f2b;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58);
  --fg-3: rgb(16 24 58 / 0.86);
  --fg-4: rgb(16 24 58 / 0.5);
  --line: rgb(16 24 58 / 0.3);
  --line-strong: rgb(16 24 58 / 0.5);
  --surface: rgb(16 24 58 / 0.06);
  --surface-2: rgb(16 24 58 / 0.06);
  --accent: rgb(16 24 58);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px rgb(16 24 58);
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="brass"] :is(.tc, .dock) {
  --bg: #e2bf4d;
  --fg: rgb(16 24 58);
  --fg-2: #5c4a12;
  --fg-3: #5c4a12;
  --fg-4: rgb(92 74 18 / 0.55);
  --line: rgb(16 24 58 / 0.22);
  --line-strong: rgb(16 24 58 / 0.4);
  --surface: rgb(16 24 58 / 0.05);
  --surface-2: rgb(16 24 58 / 0.05);
  --accent: #ff4f2b;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="blush"] :is(.tc, .dock) {
  --bg: #f6eaf0;
  --fg: rgb(16 24 58);
  --fg-2: rgb(16 24 58 / 0.72);
  --fg-3: rgb(16 24 58 / 0.66);
  --fg-4: rgb(16 24 58 / 0.36);
  --line: rgb(16 24 58 / 0.14);
  --line-strong: rgb(16 24 58 / 0.3);
  --surface: rgb(16 24 58 / 0.04);
  --surface-2: rgb(16 24 58 / 0.04);
  --accent: #ea8ba2;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #ff4f2b;
  color-scheme: light;
}

html[data-page="home"][data-env-bottom="teal"] :is(.tc, .dock) {
  --bg: #2f5e57;
  --fg: rgb(247 241 243);
  --fg-2: #bfe3da;
  --fg-3: #bfe3da;
  --fg-4: rgb(191 227 218 / 0.55);
  --line: rgb(247 241 243 / 0.18);
  --line-strong: rgb(247 241 243 / 0.34);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #e9c452;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #e9c452;
  color-scheme: dark;
}

html[data-page="home"][data-env-bottom="violet"] :is(.tc, .dock) {
  --bg: #26246e;
  --fg: rgb(247 241 243);
  --fg-2: #ccbac8;
  --fg-3: #ccbac8;
  --fg-4: rgb(204 186 200 / 0.55);
  --line: rgb(247 241 243 / 0.16);
  --line-strong: rgb(247 241 243 / 0.32);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #a9a9ff;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #a9a9ff;
  color-scheme: dark;
}

html[data-page="home"][data-env-bottom="night"] :is(.tc, .dock) {
  --bg: #141842;
  --fg: rgb(247 241 243);
  --fg-2: #ccbac8;
  --fg-3: rgb(247 241 243 / 0.66);
  --fg-4: rgb(247 241 243 / 0.36);
  --line: rgb(247 241 243 / 0.13);
  --line-strong: rgb(247 241 243 / 0.3);
  --surface: rgb(247 241 243 / 0.05);
  --surface-2: rgb(247 241 243 / 0.05);
  --accent: #7bd8fd;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg), 0 0 0 6px var(--bg), 0 0 0 8px #7bd8fd;
  color-scheme: dark;
}

/* Blocks paint their own ground (the hero's sky is its own element). */
html[data-page="home"] :is(main > section, .hero__panel)[data-env] {
  background: var(--ground);
}

html[data-page="home"] main {
  overflow-x: clip;
}

/* No content-visibility on home: anchors must not drift and nothing pins. */
html[data-page="home"] main > section {
  content-visibility: visible;
}

/* --- Sky (hero and overture share it) ------------------------------------------ */
html[data-page="home"] .sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--sky);
  pointer-events: none;
}

html[data-page="home"] .sky__sun {
  position: absolute;
  inset: 0;
  background: radial-gradient(34vmax 34vmax at 82% 9%, rgba(255, 247, 227, 0.95), rgba(255, 240, 205, 0.35) 38%, transparent 70%);
}

/* Soft cumulus: CSS ellipses first; sky.js lays a generated cloud texture on top
   (html[style --cloud-img]) and both drift together. 200% wide, repeat-x, so a
   −50% translate loops seamlessly. */
html[data-page="home"] .sky__clouds {
  position: absolute;
  left: 0;
  width: 200%;
  pointer-events: none;
  background-repeat: repeat-x;
  will-change: transform;
}

html[data-page="home"] .sky__clouds--back {
  bottom: 0;
  height: 62%;
  background-image:
    radial-gradient(18% 16% at 10% 88%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 70%),
    radial-gradient(14% 12% at 30% 94%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%),
    radial-gradient(22% 14% at 44% 90%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 70%),
    radial-gradient(30% 3.5% at 22% 30%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%);
  background-size: 50% 100%;
  animation: sky-drift 240s linear infinite;
}

html[data-page="home"] .sky__clouds--front {
  bottom: 4%;
  height: 46%;
  z-index: 1;
  background-image:
    radial-gradient(16% 10% at 18% 70%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%),
    radial-gradient(20% 12% at 38% 84%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%);
  background-size: 50% 100%;
  animation: sky-drift 140s linear infinite;
}

html[data-page="home"] .sky__clouds::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--cloud-img, none);
  background-size: 50% 100%;
  background-repeat: repeat-x;
  opacity: 0;
  transition: opacity 1200ms var(--ease-out);
}

html[data-page="home"].has-clouds .sky__clouds--back::after {
  opacity: 0.85;
}

html[data-page="home"].has-clouds .sky__clouds--front::after {
  opacity: 0.32;
}

@keyframes sky-drift {
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* --- The logotype, as seven glyphs ----------------------------------------------
   rev3rie-logotype-light.webp (2000², white on alpha) filled with currentColor
   through a mask and sliced per glyph, so each glyph can resonate on its own.
   Line A "Rev3rie": x 316–1688, y 807–981. Line B "R<CORDS": x 316–1679, y 1020–1194. */
html[data-page="home"] .wm {
  --u: calc(var(--wm-w, 600px) / 1372);
  display: block;
  width: var(--wm-w, 600px);
  height: calc(387 * var(--u));
  color: var(--fg);
}

html[data-page="home"] .wm__a {
  display: flex;
  height: calc(174 * var(--u));
}

html[data-page="home"] :is(.wm__g, .wm__b) {
  display: block;
  background: currentColor;
  -webkit-mask: url("/assets/rev3rie-logotype-light.webp") no-repeat;
  mask: url("/assets/rev3rie-logotype-light.webp") no-repeat;
  -webkit-mask-size: calc(2000 * var(--u)) calc(2000 * var(--u));
  mask-size: calc(2000 * var(--u)) calc(2000 * var(--u));
}

html[data-page="home"] .wm__g {
  flex: none;
  width: calc((var(--g1) - var(--g0)) * var(--u));
  height: 100%;
  -webkit-mask-position: calc(var(--g0) * var(--u) * -1) calc(-807 * var(--u));
  mask-position: calc(var(--g0) * var(--u) * -1) calc(-807 * var(--u));
  transform-origin: 50% 55%;
}

html[data-page="home"] .wm__b {
  width: calc(1363 * var(--u));
  height: calc(174 * var(--u));
  margin-top: calc(39 * var(--u));
  -webkit-mask-position: calc(-316 * var(--u)) calc(-1020 * var(--u));
  mask-position: calc(-316 * var(--u)) calc(-1020 * var(--u));
}

/* The //< mark (rev3rie-logo.webp 1440², mark box 469/542, 522 × 186). */
html[data-page="home"] .mark {
  --mu: calc(var(--mark-h, 40px) / 186);
  display: block;
  width: calc(522 * var(--mu));
  height: var(--mark-h, 40px);
  background: var(--mark-color, var(--vermilion));
  -webkit-mask: url("/assets/rev3rie-logo.webp") no-repeat;
  mask: url("/assets/rev3rie-logo.webp") no-repeat;
  -webkit-mask-size: calc(1440 * var(--mu)) calc(1440 * var(--mu));
  mask-size: calc(1440 * var(--mu)) calc(1440 * var(--mu));
  -webkit-mask-position: calc(-469 * var(--mu)) calc(-542 * var(--mu));
  mask-position: calc(-469 * var(--mu)) calc(-542 * var(--mu));
}

/* --- Section anatomy ------------------------------------------------------------
   Every section from H2 to H7: a boundary string (mode n) at its top, n − 1
   still node lines across the full width, and its minute as a numeral painted
   on the far wall. */
html[data-page="home"] main > .section {
  padding-top: calc(var(--band) + var(--section) * 0.6);
  isolation: isolate;
}

html[data-page="home"] .edge {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--band);
  z-index: 1;
  pointer-events: none;
}

html[data-page="home"] .edge svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

html[data-page="home"] .edge__fill {
  fill: var(--prev-bg, transparent);
}

html[data-page="home"] .edge__line {
  fill: none;
  stroke: var(--fg);
  stroke-opacity: 0.4;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  transition: stroke 240ms;
}

html[data-page="home"] .edge.is-loud .edge__line {
  stroke: var(--vermilion);
  stroke-opacity: 0.9;
}

html[data-page="home"] .nodes {
  position: absolute;
  inset: var(--band) 0 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(100% / var(--n) - 1px),
    rgb(from var(--fg) r g b / 0.06) calc(100% / var(--n) - 1px),
    rgb(from var(--fg) r g b / 0.06) calc(100% / var(--n))
  );
  clip-path: inset(0 2px 0 0);
}

@supports not (color: rgb(from red r g b)) {
  html[data-page="home"] .nodes {
    background-image: repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(100% / var(--n) - 1px),
      var(--line) calc(100% / var(--n) - 1px),
      var(--line) calc(100% / var(--n))
    );
    opacity: 0.45;
  }
}

html[data-page="home"] .nodes__cap {
  position: absolute;
  top: 24px;
  left: calc(100% / var(--n) + 8px);
  font-family: var(--f-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-4);
  white-space: nowrap;
}

html[data-page="home"] .room {
  --phase: -1;
  position: absolute;
  z-index: -1;
  top: calc(var(--band) + var(--section) * 0.2);
  right: var(--gutter);
  font-family: var(--f-latin);
  font-size: clamp(7rem, 24vw, 26rem);
  font-weight: 300;
  font-variation-settings: "wdth" 62;
  font-stretch: 62%;
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: var(--fg);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* Antiphase: decoration drifts against the scroll — never reading text. */
html[data-page="home"] :is(.room, .nodes__cap, [data-phase]) {
  translate: 0 calc(var(--v, 0) * var(--phase, 1) * 6px);
}

html[data-page="home"] [data-phase="-1"] {
  --phase: -1;
}

html[data-page="home"] [data-phase="1"] {
  --phase: 1;
}

/* --prev-bg: the ground above each boundary string. */
html[data-page="home"] #label {
  --prev-bg: color-mix(in oklab, rgb(var(--art)) 14%, #f8f2d9);
}

html[data-page="home"] #now-playing[hidden] + #label {
  --prev-bg: var(--paper);
}

html[data-page="home"] #imprint {
  --prev-bg: var(--mist);
}

html[data-page="home"] #domains {
  --prev-bg: var(--paper);
}

html[data-page="home"] .staff {
  --prev-bg: var(--brass);
}

html[data-page="home"] #contact {
  --prev-bg: var(--blush);
}

html[data-page="home"] .hero__panel {
  --prev-bg: transparent;
}

/* --- Section type ------------------------------------------------------------------ */
html[data-page="home"] .section-head__title {
  --wdth: 112;
  font-size: clamp(2.5rem, 6.4vw, 7rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  font-synthesis: none;
}

html[data-page="home"]:is([lang="zh-Hans"], [lang="ja-JP"]) .section-head__title {
  font-size: calc(clamp(2.5rem, 6.4vw, 7rem) * 0.8);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

html[data-page="home"] :is(h1, h2, h3, .display) {
  text-wrap: balance;
}

html[data-page="home"]:is([lang="zh-Hans"], [lang="ja-JP"]) body {
  line-break: strict;
}

/* Small red text only in the darker signal ink on light grounds. */
html[data-page="home"] :is([data-env="sky"], [data-env="paper"], [data-env="mist"], [data-env="parchment"], [data-env="blush"], [data-env="brass"]) :is(.section-tc b, .signal-text-keep) {
  color: var(--signal-ink);
}

html[data-page="home"] .tick-rule {
  color: var(--fg);
}

/* --- Shared chrome on home ------------------------------------------------------------ */
html[data-page="home"] :is(.bar, .tc, .dock) {
  transition-property: transform, opacity, --bg, --fg, --fg-2, --line;
  transition-duration: 520ms, 640ms, var(--d-tune), var(--d-tune), var(--d-tune), var(--d-tune);
  transition-timing-function: var(--ease-tape), var(--ease-out), var(--ease-in-out), var(--ease-in-out), var(--ease-in-out), var(--ease-in-out);
}

html[data-page="home"] .bar {
  color: var(--fg);
}

/* The white lockup is filled with the bar's ink on light environments. */
html[data-page="home"] .bar__brand {
  position: relative;
}

html[data-page="home"] .bar__brand::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: min(100%, var(--brand-width));
  aspect-ratio: 2296 / 324;
  translate: 0 -50%;
  background: var(--fg);
  -webkit-mask: url("/assets/rev3rie-full-light.webp") center / contain no-repeat;
  mask: url("/assets/rev3rie-full-light.webp") center / contain no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-2);
}

html[data-page="home"]:is([data-env-top="sky"], [data-env-top="paper"], [data-env-top="mist"], [data-env-top="parchment"], [data-env-top="vermilion"], [data-env-top="brass"], [data-env-top="blush"]) .bar__brand img {
  opacity: 0;
}

html[data-page="home"]:is([data-env-top="sky"], [data-env-top="paper"], [data-env-top="mist"], [data-env-top="parchment"], [data-env-top="vermilion"], [data-env-top="brass"], [data-env-top="blush"]) .bar__brand::after {
  opacity: 1;
}

html[data-page="home"] .bar__brand:hover::after {
  opacity: 0.72;
}

/* The Index overlay always opens onto night. */
html[data-page="home"] .index {
  --bg: #141842;
  --fg: #f7f1f3;
  --fg-2: #ccbac8;
  --fg-3: rgb(var(--bone-rgb) / 0.66);
  --fg-4: rgb(var(--bone-rgb) / 0.36);
  --line: rgb(var(--bone-rgb) / 0.13);
  --line-strong: rgb(var(--bone-rgb) / 0.3);
  --focus: 0 0 0 2px #141842, 0 0 0 4px #f7f1f3, 0 0 0 6px #141842, 0 0 0 8px #7bd8fd;
  color-scheme: dark;
}

html[data-page="home"].index-open .bar {
  --bg: #141842;
  --fg: #f7f1f3;
  --fg-2: #ccbac8;
  --line: rgb(var(--bone-rgb) / 0.13);
}

html[data-page="home"].index-open .bar__brand img {
  opacity: 1;
}

html[data-page="home"].index-open .bar__brand::after {
  opacity: 0;
}

/* Timecode: vermilion REC; 24:60 lights vermilion on light, firefly on night. */
html[data-page="home"] .tc.is-sixty .tc__time {
  color: var(--vermilion);
}

html[data-page="home"]:is([data-env-bottom="night"], [data-env-bottom="teal"], [data-env-bottom="violet"]) .tc.is-sixty .tc__time {
  color: var(--firefly);
}

@media (max-width: 1100px) {
  html[data-page="home"] .dock .index-toggle {
    background: var(--fg);
    color: var(--bg);
    box-shadow: 0 10px 30px rgb(var(--ink-rgb) / 0.22);
  }
}

/* Cursor: a plectrum. It still inverts over every ground and never carries an image. */
html[data-page="home"] .cursor__dot {
  left: -6px;
  top: -7px;
  width: 12px;
  height: 14px;
  border-radius: 40% 40% 50% 50%;
  clip-path: polygon(50% 100%, 0 14%, 16% 0, 84% 0, 100% 14%);
  rotate: var(--tilt, 0deg);
}

html[data-page="home"] .cursor.is-link .cursor__dot {
  clip-path: none;
  border-radius: 50%;
  rotate: 0deg;
}

/* Footer: the night continues after the showcase. */
html[data-page="home"] [data-site-footer] {
  --bg: #141842;
  --fg: #f7f1f3;
  --fg-2: #ccbac8;
  --fg-3: rgb(var(--bone-rgb) / 0.66);
  --fg-4: rgb(var(--bone-rgb) / 0.36);
  --line: rgb(var(--bone-rgb) / 0.13);
  --line-strong: rgb(var(--bone-rgb) / 0.3);
  --focus: 0 0 0 2px #141842, 0 0 0 4px #f7f1f3, 0 0 0 6px #141842, 0 0 0 8px #7bd8fd;
  background: #141842;
  color: var(--fg);
  color-scheme: dark;
}

/* Grain: multiplied into light grounds, soft on the night. */
html[data-page="home"] .grain {
  mix-blend-mode: multiply;
  opacity: 0.05;
}

html[data-page="home"]:is([data-env-top="night"], [data-env-top="teal"], [data-env-top="violet"]) .grain {
  mix-blend-mode: soft-light;
  opacity: 0.08;
}

html[data-page="home"] .ambient {
  display: none;
}

/* --- Reduced motion and the low tier ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html[data-page="home"] .sky__clouds {
    animation: none;
  }
  html[data-page="home"] :is(.room, .nodes__cap, [data-phase]) {
    translate: none;
  }
}

html[data-page="home"][data-tier="low"] :is(.room, .nodes__cap, [data-phase]) {
  translate: none;
}

html[data-page="home"][data-tier="low"] .sky__clouds--front {
  display: none;
}
