/* Sleep Rain Music — ethereal night: deep violet, pearl, aurora cyan, lavender, rose. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-latin-wght-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/jost-latin-wght-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --ink-0: oklch(0.14 0.045 288);
  --ink-1: oklch(0.18 0.05 290);
  --ink-2: oklch(0.24 0.055 292);
  --ink-3: oklch(0.32 0.055 292);
  --paper: oklch(0.96 0.018 300);
  --paper-dim: oklch(0.84 0.03 298);
  --paper-faint: oklch(0.72 0.035 296);
  --candle: oklch(0.84 0.09 300);
  --candle-hot: oklch(0.9 0.08 320);
  --candle-deep: oklch(0.62 0.13 300);
  --moon: oklch(0.86 0.08 200);
  --aurora: linear-gradient(100deg, oklch(0.88 0.09 190), oklch(0.84 0.11 295) 50%, oklch(0.86 0.1 345));
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --mono: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --radius: 22px;
  --dock-h: 76px;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  line-height: 1.7;
  padding-bottom: calc(var(--dock-h) + 32px);
  overflow-x: hidden;
}
a { color: var(--candle); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--candle-hot); }
:focus-visible { outline: 2px solid var(--candle); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--paper); color: var(--ink-0); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; display: block; }
noscript p { position: relative; margin: 0 var(--gutter); }

/* ---------- header ---------- */
.site-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
}
.mark { font-style: italic; font-size: 1.25rem; color: var(--paper); text-decoration: none; letter-spacing: 0.01em; }
.mark span { color: var(--candle); }
.site-head nav ul { list-style: none; display: flex; gap: clamp(12px, 2.5vw, 28px); margin: 0; padding: 0; }
.site-head nav a { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-dim); text-decoration: none; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: clamp(96px, 16vh, 170px) var(--gutter) 0;
  position: relative;
}
.hero-copy { max-width: 37rem; transition: opacity 1.6s ease; }
body.playing .hero-copy { opacity: 0.18; }
body.playing .hero-copy:hover, body.playing .hero-copy:focus-within { opacity: 1; }
.eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--candle); margin: 0 0 18px; }
h1 {
  font-weight: 300; font-size: clamp(2.6rem, 1.3rem + 5.2vw, 5.8rem); line-height: 0.98; letter-spacing: -0.02em;
  margin: 0 0 22px; text-wrap: balance;
}
h1 em { font-style: italic; color: var(--candle-hot); font-weight: 300; }
.lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); color: var(--paper-dim); max-width: 32rem; margin: 0 0 30px; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--candle); color: oklch(0.2 0.06 290);
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  padding: 16px 26px; border-radius: 999px;
  box-shadow: 0 0 0 0 oklch(0.84 0.1 300 / 0.5), 0 10px 40px -10px oklch(0.84 0.1 300 / 0.6);
  transition: transform 0.25s ease, box-shadow 0.4s ease, background 0.3s;
}
.btn:hover { background: var(--candle-hot); transform: translateY(-1px); box-shadow: 0 0 0 8px oklch(0.84 0.1 300 / 0.12), 0 14px 50px -10px oklch(0.84 0.1 300 / 0.8); }
.btn svg { width: 14px; height: 14px; }
.quiet-link { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-dim); }
.fine { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--paper-faint); margin-top: 18px; }
body.started .cta-row .btn { display: none; }
.scroll-hint {
  position: absolute; left: var(--gutter); bottom: calc(var(--dock-h) + 40px);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper-faint); text-decoration: none;
}

/* ---------- dock ---------- */
.dock {
  position: fixed; z-index: 20; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(980px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 10px;
  background: oklch(0.16 0.05 290 / 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid oklch(0.96 0.018 300 / 0.09);
  border-radius: 999px;
  box-shadow: 0 20px 60px -20px rgb(0 0 0 / 0.7);
}
.play {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--candle); color: oklch(0.2 0.06 290);
  display: grid; place-items: center;
  box-shadow: 0 0 30px -4px oklch(0.84 0.1 300 / 0.7);
}
.play svg { width: 20px; height: 20px; }
.play .i-pause { display: none; }
.play[aria-pressed='true'] .i-play { display: none; }
.play[aria-pressed='true'] .i-pause { display: block; }
.np { min-width: 0; flex: 0 1 220px; line-height: 1.25; }
.np-title { font-style: italic; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--paper-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta b { color: var(--candle); font-weight: 500; }
.insts { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.insts::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; cursor: pointer; flex: none;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--paper-dim); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 8px 12px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--paper); border-color: oklch(0.96 0.018 300 / 0.15); }
.chip[aria-pressed='true'] { color: var(--ink-0); background: var(--paper); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }
.slider { display: flex; align-items: center; gap: 8px; flex: none; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-faint); }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 96px; height: 24px; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 2px; background: oklch(0.96 0.018 300 / 0.22); border-radius: 2px; }
input[type='range']::-moz-range-track { height: 2px; background: oklch(0.96 0.018 300 / 0.22); border-radius: 2px; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--paper); border: 0; }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 0; }
.icon-btn {
  flex: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--paper-dim); border: 1px solid oklch(0.96 0.018 300 / 0.14);
  display: grid; place-items: center;
}
.icon-btn:hover, .icon-btn[aria-expanded='true'] { color: var(--paper); border-color: oklch(0.96 0.018 300 / 0.35); }
.icon-btn svg { width: 18px; height: 18px; }

.panel {
  position: fixed; z-index: 21; right: max(12px, calc(50vw - 490px)); bottom: calc(var(--dock-h) + 30px);
  width: min(380px, calc(100vw - 24px));
  background: oklch(0.17 0.05 290 / 0.92);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid oklch(0.96 0.018 300 / 0.1); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8);
}
.panel h2 { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-faint); font-weight: 500; margin: 0 0 10px; }
.panel section + section { margin-top: 18px; padding-top: 16px; border-top: 1px solid oklch(0.96 0.018 300 / 0.08); }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  appearance: none; cursor: pointer; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--paper); background: oklch(0.96 0.018 300 / 0.05); border: 1px solid oklch(0.96 0.018 300 / 0.12);
  border-radius: 999px; padding: 9px 14px;
}
.pill:hover { border-color: oklch(0.96 0.018 300 / 0.35); }
.pill[aria-pressed='true'] { background: var(--candle); color: oklch(0.2 0.06 290); border-color: transparent; }
.pill:disabled { opacity: 0.4; cursor: not-allowed; }
.panel .help { font-size: 0.85rem; color: var(--paper-faint); margin: 8px 0 0; line-height: 1.45; }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; cursor: pointer; }
.check input { accent-color: var(--candle); width: 18px; height: 18px; }
.panel .slider { margin-top: 10px; }
.panel .slider input { flex: 1; }
.only-mobile { display: none; }

.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(var(--dock-h) + 34px); transform: translate(-50%, 10px);
  background: var(--paper); color: var(--ink-0); padding: 10px 18px; border-radius: 999px;
  font-size: 0.95rem; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.dim .site-head, body.dim .hero-copy, body.dim main > :not(.hero) { opacity: 0.25; }
body.dim .dock { filter: sepia(0.6) brightness(0.6); }

@media (max-width: 860px) {
  .dock { border-radius: 26px; flex-wrap: wrap; gap: 8px 10px; padding: 10px; }
  .np { flex: 1 1 0; }
  .insts { order: 5; flex: 1 1 100%; }
  .dock > .slider { display: none; }
  .only-mobile { display: flex; }
  :root { --dock-h: 128px; }
  .panel { right: 12px; }
}

/* ---------- content ---------- */
.content {
  position: relative;
  background: linear-gradient(to bottom, oklch(0.135 0.045 288 / 0) 0, oklch(0.135 0.045 288 / 0.92) 140px, var(--ink-0) 320px);
  padding: 140px var(--gutter) 40px;
}
.wrap { max-width: 68rem; margin: 0 auto; }
.section { padding: clamp(48px, 8vw, 96px) 0; border-top: 1px solid oklch(0.96 0.018 300 / 0.07); }
.section:first-child { border-top: 0; }
.kicker { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--candle); margin: 0 0 14px; }
h2 { font-weight: 300; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 22px; text-wrap: balance; }
h2 em { color: var(--candle-hot); }
h3 { font-weight: 400; font-size: 1.35rem; margin: 0 0 8px; }
.answer { font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem); color: var(--paper); max-width: 46rem; text-wrap: pretty; }
.prose { color: var(--paper-dim); max-width: 42rem; }
.prose p { margin: 0 0 1em; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.facts li { padding-left: 28px; position: relative; color: var(--paper-dim); }
.facts li::before { content: ''; position: absolute; left: 4px; top: 0.6em; width: 9px; height: 6px; border-radius: 50%; background: var(--candle); transform: rotate(-20deg); box-shadow: 0 0 12px var(--candle); }
.facts strong { color: var(--paper); font-weight: 500; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 32px; }
.card {
  display: block; text-decoration: none; color: var(--paper);
  background: linear-gradient(160deg, oklch(0.2 0.055 292), oklch(0.16 0.05 290));
  border: 1px solid oklch(0.96 0.018 300 / 0.08); border-radius: var(--radius); padding: 24px 24px 22px;
  position: relative; overflow: hidden; transition: border-color 0.3s, transform 0.3s;
}
.card:hover { color: var(--paper); border-color: oklch(0.84 0.1 300 / 0.45); transform: translateY(-2px); }
.card .staff { height: 34px; margin-bottom: 18px; background: repeating-linear-gradient(to bottom, oklch(0.96 0.018 300 / 0.2) 0 1px, transparent 1px 8px); position: relative; }
.card .staff i { position: absolute; width: 10px; height: 7px; border-radius: 50%; background: var(--candle); transform: rotate(-20deg); box-shadow: 0 0 10px var(--candle); }
.card h3 { font-style: italic; }
.card p { color: var(--paper-dim); font-size: 0.98rem; margin: 0 0 14px; }
.card .meta { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-faint); }

table.specs { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 1rem; }
.specs th, .specs td { text-align: left; padding: 12px 0; border-bottom: 1px solid oklch(0.96 0.018 300 / 0.08); vertical-align: top; }
.specs th { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-faint); font-weight: 500; width: 34%; padding-right: 16px; }
.specs td { color: var(--paper); }

.faq details { border-top: 1px solid oklch(0.96 0.018 300 / 0.08); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid oklch(0.96 0.018 300 / 0.08); }
.faq summary { cursor: pointer; font-size: 1.2rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--candle); }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--paper-dim); margin: 12px 0 0; max-width: 46rem; }

.family { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 28px; }
.family a { display: block; padding: 22px 24px; border-radius: var(--radius); border: 1px solid oklch(0.96 0.018 300 / 0.1); text-decoration: none; color: var(--paper); }
.family a:hover { border-color: oklch(0.82 0.06 250 / 0.6); color: var(--paper); }
.family strong { display: block; font-weight: 400; font-size: 1.2rem; margin-bottom: 6px; }
.family span { color: var(--paper-dim); font-size: 0.98rem; }

.site-foot { padding: 40px var(--gutter) 30px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--paper-faint); background: var(--ink-0); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-foot a { color: var(--paper-dim); }
.site-foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; }

/* plain pages (about, privacy) */
.page { padding: clamp(110px, 16vh, 160px) var(--gutter) 60px; background: linear-gradient(to bottom, oklch(0.135 0.045 288 / 0.55), var(--ink-0) 420px); min-height: 100vh; }
.page h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem); }
.page .prose h2 { font-size: 1.7rem; margin-top: 2em; color: var(--paper); }
.page .prose { max-width: 40rem; }
.updated { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--paper-faint); }

/* scroll-driven reveal, progressive enhancement only */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    @keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
  }
}
.card .staff i:nth-child(1) { left: 8%; top: 22px; }
.card .staff i:nth-child(2) { left: 26%; top: 14px; }
.card .staff i:nth-child(3) { left: 44%; top: 18px; }
.card .staff i:nth-child(4) { left: 62%; top: 6px; }
.card .staff i:nth-child(5) { left: 80%; top: 10px; }
.card:nth-child(2) .staff i:nth-child(2) { top: 26px; } .card:nth-child(2) .staff i:nth-child(4) { top: 14px; }
.card:nth-child(3) .staff i:nth-child(1) { top: 30px; } .card:nth-child(3) .staff i:nth-child(5) { top: 2px; }
.card:nth-child(4) .staff i:nth-child(3) { top: 2px; } .card:nth-child(4) .staff i:nth-child(4) { top: 22px; }
.card:nth-child(5) .staff i:nth-child(2) { top: 6px; } .card:nth-child(5) .staff i:nth-child(5) { top: 26px; }

/* ---------- three-layer mixer ---------- */
.faders { display: flex; align-items: center; justify-content: flex-end; gap: clamp(14px, 2.2vw, 30px); flex: 1 1 auto; min-width: 0; }
.fader { display: flex; flex-direction: column; gap: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-faint); }
.fader span { padding-left: 2px; }
.fader input { width: clamp(84px, 11vw, 140px); }
.fader:focus-within span { color: var(--candle); }
.panel .row + .check { margin-top: 12px; }
.panel { max-height: calc(100vh - var(--dock-h) - 60px); overflow-y: auto; }
.noise-table thead th { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-faint); font-weight: 500; padding-bottom: 10px; }
.noise-table tbody th { font-family: var(--serif); font-style: italic; font-size: 1.1rem; text-transform: none; letter-spacing: 0; color: var(--candle); width: auto; }
.noise-table td { color: var(--paper-dim); }
@media (max-width: 860px) {
  :root { --dock-h: 118px; }
  .faders { order: 5; flex: 1 1 100%; justify-content: space-between; gap: 14px; padding: 0 6px 2px; }
  .fader { flex: 1; }
  .fader input { width: 100%; }
}


/* ---------- ethereal layer ---------- */
h1, h2, h3, .lede, .answer, .mark, .np-title, .faq summary, .card h3, .family strong, .noise-table tbody th { font-family: var(--serif); }
h1 { font-weight: 300; letter-spacing: -0.01em; line-height: 0.95; }
h2 { font-weight: 300; }
.lede { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); line-height: 1.5; }
.answer { font-size: clamp(1.3rem, 1.15rem + 0.55vw, 1.6rem); line-height: 1.45; font-weight: 400; }
h1 em, h2 em {
  font-style: italic; font-weight: 400;
  background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow, .kicker { letter-spacing: 0.32em; font-weight: 400; }
.site-head nav a, .quiet-link, .fine, .chip, .pill, .fader, .np-meta, .specs th, .meta, .panel h2, .site-foot { font-weight: 400; }
.mark { font-size: 1.45rem; font-weight: 400; }
.mark span { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn, .play, .pill[aria-pressed='true'], .chip[aria-pressed='true'] {
  background: var(--aurora); color: oklch(0.2 0.06 290);
}
.btn { box-shadow: 0 0 0 1px oklch(0.96 0.018 300 / 0.25) inset, 0 10px 44px -10px oklch(0.8 0.12 300 / 0.75); }
.btn:hover { background: var(--aurora); filter: brightness(1.08); box-shadow: 0 0 0 8px oklch(0.84 0.1 300 / 0.12), 0 14px 54px -10px oklch(0.8 0.12 300 / 0.9); }
.play { box-shadow: 0 0 34px -4px oklch(0.8 0.12 300 / 0.8); }

.dock { background: oklch(0.17 0.05 290 / 0.55); border-color: oklch(0.96 0.018 300 / 0.12); box-shadow: 0 20px 70px -20px rgb(0 0 0 / 0.7), 0 0 0 1px oklch(0.84 0.1 300 / 0.06) inset; }
.panel { background: oklch(0.18 0.05 290 / 0.86); }

.facts li::before { width: 9px; height: 9px; top: 0.55em; border-radius: 50%; transform: none; background: radial-gradient(circle, #fff 0 20%, oklch(0.86 0.09 300) 45%, transparent 72%); box-shadow: 0 0 14px oklch(0.84 0.1 300); }
.card { background: linear-gradient(160deg, oklch(0.22 0.06 292 / 0.9), oklch(0.16 0.05 288 / 0.9)); }
.card:hover { border-color: oklch(0.84 0.1 300 / 0.5); }
.card .staff { background: repeating-linear-gradient(to bottom, oklch(0.9 0.06 300 / 0.22) 0 1px, transparent 1px 8px); }
.card .staff i { width: 9px; height: 9px; transform: none; background: radial-gradient(circle, #fff 0 18%, oklch(0.88 0.09 200) 45%, transparent 72%); box-shadow: 0 0 12px oklch(0.88 0.09 200); }
.card .staff i:nth-child(2n) { background: radial-gradient(circle, #fff 0 18%, oklch(0.84 0.11 300) 45%, transparent 72%); box-shadow: 0 0 12px oklch(0.84 0.11 300); }
.card .staff i:nth-child(3n) { background: radial-gradient(circle, #fff 0 18%, oklch(0.86 0.1 345) 45%, transparent 72%); box-shadow: 0 0 12px oklch(0.86 0.1 345); }
.family a:hover { border-color: oklch(0.86 0.09 200 / 0.6); }
.content { background: linear-gradient(to bottom, oklch(0.14 0.045 288 / 0) 0, oklch(0.14 0.045 288 / 0.9) 160px, var(--ink-0) 360px); }
.toast { background: var(--aurora); color: oklch(0.2 0.06 290); }

/* ---------- black ethereal theme ---------- */
:root[data-theme='black'] {
  --ink-0: #000;
  --ink-1: oklch(0.13 0.006 290);
  --ink-2: oklch(0.19 0.008 290);
  --ink-3: oklch(0.27 0.01 290);
  --paper: oklch(0.97 0.004 290);
  --paper-dim: oklch(0.85 0.008 290);
  --paper-faint: oklch(0.72 0.01 290);
  --candle: oklch(0.9 0.03 270);
  --candle-hot: oklch(0.96 0.02 300);
  --aurora: linear-gradient(100deg, oklch(0.94 0.045 190), oklch(0.91 0.045 290) 50%, oklch(0.93 0.045 340));
}
:root[data-theme='black'] body { background: #000; }
:root[data-theme='black'] .content { background: linear-gradient(to bottom, rgb(0 0 0 / 0) 0, rgb(0 0 0 / 0.9) 160px, #000 360px); }
:root[data-theme='black'] .page { background: linear-gradient(to bottom, rgb(0 0 0 / 0.55), #000 420px); }
:root[data-theme='black'] .site-foot { background: #000; }
:root[data-theme='black'] .dock { background: rgb(8 8 12 / 0.6); border-color: oklch(0.97 0.004 290 / 0.12); }
:root[data-theme='black'] .panel { background: rgb(10 10 14 / 0.9); }
:root[data-theme='black'] .card { background: linear-gradient(160deg, oklch(0.16 0.008 290 / 0.92), oklch(0.1 0.005 290 / 0.92)); }
:root[data-theme='black'] .btn, :root[data-theme='black'] .play { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25) inset, 0 10px 44px -12px rgb(220 220 255 / 0.55); }

/* ---------- polish ---------- */
::selection { background: oklch(0.84 0.1 300 / 0.35); color: var(--paper); }
html { scrollbar-color: oklch(0.84 0.05 300 / 0.35) transparent; }

/* Faders fill with the aurora up to the current level (--val is set by the page script). */
input[type='range'] { --val: 50%; height: 28px; }
input[type='range']::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, oklch(0.88 0.08 200) 0, oklch(0.84 0.1 300) var(--val), oklch(0.96 0.018 300 / 0.18) var(--val));
}
input[type='range']::-moz-range-track { height: 3px; border-radius: 3px; background: oklch(0.96 0.018 300 / 0.18); }
input[type='range']::-moz-range-progress { height: 3px; border-radius: 3px; background: linear-gradient(90deg, oklch(0.88 0.08 200), oklch(0.84 0.1 300)); }
input[type='range']::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6.5px; box-shadow: 0 0 0 4px oklch(0.84 0.1 300 / 0.18), 0 0 14px oklch(0.84 0.1 300 / 0.6); transition: box-shadow 0.2s; }
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; box-shadow: 0 0 0 4px oklch(0.84 0.1 300 / 0.18), 0 0 14px oklch(0.84 0.1 300 / 0.6); }
input[type='range']:hover::-webkit-slider-thumb, input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 7px oklch(0.84 0.1 300 / 0.22), 0 0 18px oklch(0.84 0.1 300 / 0.8); }

/* Comfortable targets on touch screens. */
@media (pointer: coarse) {
  .pill, .chip { min-height: 44px; padding-inline: 16px; }
  .icon-btn { width: 46px; height: 46px; }
  input[type='range'] { height: 36px; }
  input[type='range']::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9.5px; }
  input[type='range']::-moz-range-thumb { width: 22px; height: 22px; }
}

.pill { transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.15s; }
.pill:active, .chip:active, .btn:active, .play:active, .icon-btn:active { transform: scale(0.97); }
.pill:focus-visible, .chip:focus-visible, .play:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--candle); outline-offset: 3px; }
.panel section h2 { letter-spacing: 0.24em; }
.dock::before { content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, oklch(0.96 0.018 300 / 0.25), transparent); pointer-events: none; }
#np-timer { color: var(--paper-faint); }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: heroIn 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.28s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.44s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.58s; }
  @keyframes heroIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
  .panel:not([hidden]) { animation: panelIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  @keyframes panelIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
  .toast { transition: opacity 0.4s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
}

/* Tap areas: at least 44px tall without changing how the links look. */
.site-head nav a, .quiet-link { display: inline-flex; align-items: center; min-height: 44px; }
.site-foot a { display: inline-flex; align-items: center; min-height: 32px; }
.check { min-height: 44px; }
.mark { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- live sky ---------- */
#sky { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -2; display: block; background: var(--ink-0); }
html.live-sky body { background: transparent; }
html.live-sky body.dim #scene { opacity: 0.45; }
/* Keep the hero legible over bright cloud. */
.hero-copy h1, .hero-copy .lede, .hero-copy .eyebrow, .hero-copy .fine { text-shadow: 0 1px 2px rgb(4 3 18 / 0.6), 0 2px 28px rgb(4 3 18 / 0.75); }

/* ---------- quick edits on the faders ---------- */
.fader { position: relative; }
.fader-label {
  appearance: none; background: none; border: 0; padding: 4px 2px; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-faint);
  min-height: 28px; border-radius: 6px;
}
.fader-label:hover, .fader-label[aria-expanded='true'] { color: var(--paper); }
.fader-label .chev { width: 10px; height: 10px; transition: transform 0.25s; }
.fader-label[aria-expanded='true'] .chev { transform: rotate(180deg); }
.quick {
  position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%);
  width: min(340px, calc(100vw - 24px)); z-index: 25;
  background: oklch(0.18 0.05 290 / 0.92);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid oklch(0.96 0.018 300 / 0.12); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8);
  text-transform: none; letter-spacing: normal; font-family: var(--sans); color: var(--paper);
}
.quick::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: inherit; border-right: 1px solid oklch(0.96 0.018 300 / 0.12); border-bottom: 1px solid oklch(0.96 0.018 300 / 0.12); }
.quick h2, .panel h3 { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--paper-faint); font-weight: 400; margin: 12px 0 8px; }
.quick h2:first-child { margin-top: 0; }
.quick .row { gap: 6px; }
.quick .help { font-size: 0.82rem; color: var(--paper-faint); margin: 10px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .quick:not([hidden]) { animation: quickIn 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  @keyframes quickIn { from { opacity: 0; transform: translate(-50%, 8px) scale(0.98); } to { opacity: 1; transform: translateX(-50%); } }
}
@media (max-width: 860px) {
  .fader { position: static; }
  .quick { position: fixed; left: 12px; right: 12px; bottom: calc(var(--dock-h) + 28px); transform: none; width: auto; max-height: 60vh; overflow-y: auto; }
  .quick::after { display: none; }
  @keyframes quickIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- settings panel tabs ---------- */
.panel { width: min(420px, calc(100vw - 24px)); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid oklch(0.96 0.018 300 / 0.08); flex: none; }
.tab {
  appearance: none; background: none; border: 0; cursor: pointer; flex: 1;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-faint);
  padding: 12px 6px; border-radius: 10px 10px 0 0; min-height: 44px; position: relative;
}
.tab:hover { color: var(--paper); }
.tab[aria-selected='true'] { color: var(--paper); }
.tab[aria-selected='true']::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--aurora); }
.tabpanel { padding: 18px 20px 20px; overflow-y: auto; }
.tabpanel section + section { margin-top: 18px; padding-top: 16px; border-top: 1px solid oklch(0.96 0.018 300 / 0.08); }
.slider.wide { display: flex; width: 100%; gap: 12px; margin: 4px 0 8px; }
.slider.wide input { flex: 1; width: auto; }
.panel .row + .row { margin-top: 6px; }
.panel .row + h3, .panel input + h3 { margin-top: 14px; }

/* ---------- brightness, backgrounds, hide interface ---------- */
#sky, #scene { filter: brightness(var(--bright, 1)); }
html:not(.live-sky) #sky { display: none; }
body.zen.idle .site-head, body.zen.idle .hero-copy, body.zen.idle .dock, body.zen.idle main > :not(.hero) { opacity: 0; pointer-events: none; }
body.zen .site-head, body.zen .dock { transition: opacity 1.2s ease; }
body.zen.idle { cursor: none; }

/* ---------- blackout: pure black, everything turned right down ---------- */
:root[data-theme='blackout'] {
  --ink-0: #000;
  --ink-1: #050505;
  --ink-2: #0b0b0c;
  --ink-3: #151517;
  --paper: oklch(0.8 0 0);
  --paper-dim: oklch(0.7 0 0);
  --paper-faint: oklch(0.62 0 0);
  --candle: oklch(0.72 0 0);
  --candle-hot: oklch(0.8 0 0);
  --aurora: linear-gradient(100deg, oklch(0.62 0 0), oklch(0.72 0 0));
}
:root[data-theme='blackout'] body, :root[data-theme='blackout'] .site-foot { background: #000; }
:root[data-theme='blackout'] .content { background: #000; }
:root[data-theme='blackout'] .page { background: #000; }
:root[data-theme='blackout'] #scene { opacity: 0.45; }
:root[data-theme='blackout'] .dock, :root[data-theme='blackout'] .panel, :root[data-theme='blackout'] .quick { background: rgb(0 0 0 / 0.92); border-color: rgb(255 255 255 / 0.08); box-shadow: none; }
:root[data-theme='blackout'] .card { background: #050505; border-color: rgb(255 255 255 / 0.06); }
:root[data-theme='blackout'] .btn, :root[data-theme='blackout'] .play, :root[data-theme='blackout'] .pill[aria-pressed='true'] { box-shadow: none; color: #000; }
:root[data-theme='blackout'] .dock::before { display: none; }
:root[data-theme='blackout'] .card .staff i, :root[data-theme='blackout'] .facts li::before { background: radial-gradient(circle, #aaa 0 25%, transparent 70%); box-shadow: none; }
:root[data-theme='blackout'] input[type='range']::-webkit-slider-thumb { box-shadow: none; background: oklch(0.72 0 0); }
:root[data-theme='blackout'] .hero-copy h1, :root[data-theme='blackout'] .hero-copy .lede { text-shadow: none; }
:root[data-theme='black'] .quick { background: rgb(10 10 14 / 0.92); }
.panel[hidden], .quick[hidden], .tabpanel[hidden] { display: none; }
:root[data-theme='blackout'] input[type='range']::-webkit-slider-runnable-track { background: linear-gradient(90deg, oklch(0.5 0 0) 0, oklch(0.6 0 0) var(--val), oklch(1 0 0 / 0.12) var(--val)); }
:root[data-theme='blackout'] input[type='range']::-moz-range-progress { background: oklch(0.55 0 0); }
:root[data-theme='blackout'] .tab[aria-selected='true']::after { background: oklch(0.6 0 0); }
