/* Ears & Waves — night-first, glass on deep ocean. */

/* Outfit and Nunito (SIL Open Font License), latin subset, variable weight — self-hosted. */
@font-face {
  font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap;
  src: url('/fonts/nunito-latin.woff2') format('woff2');
}

:root {
  --bg: #0A1426;
  --ocean: #0E1B33;
  --navy: #16284A;
  --aqua: #3FD3E6;
  --foam: #9BEBD9;
  --sand: #F6D89A;
  --coral: #FF6B6B;
  --violet: #A78BFA;
  --text: #EEF3F8;
  --muted: #A6B5CC;
  --faint: #6F82A0;
  --ink: #06182B;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --glass: rgba(22, 40, 76, 0.62);
  --r-lg: 28px;
  --r: 20px;
  --display: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font: 'Nunito', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font: 16px/1.6 var(--font); color: var(--text);
  background: radial-gradient(120% 70% at 50% -10%, #17305C 0%, #0E1B33 45%, var(--bg) 100%) fixed, var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg, canvas { display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.fine { font-size: 12.5px; color: var(--faint); line-height: 1.5; }

#ambient { position: fixed; inset: 0; width: 100%; height: 100lvh; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .footer, .topbar { position: relative; z-index: 1; }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; white-space: nowrap; background: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn span[data-icon] { display: contents; }
.btn-glass { background: rgba(255, 255, 255, 0.07); border-color: var(--line-2); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.11); }
.btn-glass.is-on { border-color: color-mix(in srgb, var(--aqua) 70%, transparent); color: var(--aqua); background: rgba(63, 211, 230, 0.1); }
.btn-ghost { border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-aqua { background: var(--aqua); color: var(--ink); box-shadow: 0 10px 30px -10px rgba(63, 211, 230, 0.7); }
.btn-aqua:hover { background: #6BE0EE; }
.btn-coral { background: var(--coral); color: #1A0A12; box-shadow: 0 10px 30px -12px rgba(255, 107, 107, 0.8); }
.btn-coral:hover { background: #FF8585; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn-sm svg { width: 18px; height: 18px; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 38px; }
.btn-plain { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; color: var(--muted); }
.btn-plain:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.btn-plain svg { width: 22px; height: 22px; }
.link { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; padding: 6px; }
.link:hover { color: var(--text); }

input[type=range] {
  --v: 50%; --fill: var(--aqua);
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--fill) 0 var(--v), rgba(255, 255, 255, 0.13) var(--v) 100%);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; border: 0;
  background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 5px color-mix(in srgb, var(--fill) 22%, transparent);
  transition: box-shadow 0.2s;
}
input[type=range]:active::-webkit-slider-thumb { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 9px color-mix(in srgb, var(--fill) 25%, transparent); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.13); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--fill); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 5px color-mix(in srgb, var(--fill) 22%, transparent); }

.vol { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.vol svg { width: 20px; height: 20px; flex: none; }
.vol span[data-icon] { display: contents; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: calc(12px + var(--top)) var(--gutter) 12px;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.is-scrolled .topbar {
  background: rgba(10, 20, 38, 0.72); border-bottom-color: var(--line);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); margin-right: auto; }
.brand:hover { text-decoration: none; }
.mark { width: 34px; height: 34px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.02em; white-space: nowrap; }
.wordmark b { color: var(--aqua); font-weight: 800; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--muted); font-weight: 700; font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.is-app .topbar [data-install] { display: none !important; }

/* ---------- hero ---------- */

.hero {
  max-width: 920px; margin: 0 auto; text-align: center;
  padding: calc(96px + var(--top) + clamp(12px, 6vh, 72px)) var(--gutter) 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04);
  font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--foam);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 12px var(--aqua); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
h1 {
  margin-top: 22px; font-weight: 800; font-size: clamp(52px, 11vw, 118px); line-height: 0.95; letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--aqua) 10%, var(--foam) 60%, #CFFAF0 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 40px rgba(63, 211, 230, 0.35));
}
.lede { max-width: 640px; margin: 22px auto 0; color: var(--muted); font-size: clamp(16px, 2.1vw, 19px); text-wrap: pretty; }

.player { display: grid; justify-items: center; gap: 22px; margin-top: clamp(36px, 6vh, 56px); }
.play-wrap { position: relative; width: 116px; height: 116px; display: grid; place-items: center; margin: 22px 0 6px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(63, 211, 230, 0.22); pointer-events: none; }
.r1 { transform: scale(1.32); opacity: 0.7; }
.r2 { transform: scale(1.66); opacity: 0.45; }
.r3 { transform: scale(2.02); opacity: 0.25; }
.is-playing .ring { animation: ripple 4.2s cubic-bezier(0.2, 0.6, 0.35, 1) infinite; opacity: 0; }
.is-playing .r2 { animation-delay: 1.4s; }
.is-playing .r3 { animation-delay: 2.8s; }
@keyframes ripple { 0% { transform: scale(1); opacity: 0.75; } 100% { transform: scale(2.6); opacity: 0; } }

.play {
  display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink);
  background: radial-gradient(circle at 32% 28%, #9AF1FA 0%, var(--aqua) 45%, #22A9C4 100%);
  box-shadow: 0 18px 50px -12px rgba(63, 211, 230, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -8px 20px rgba(6, 24, 43, 0.25);
  transition: transform 0.2s, box-shadow 0.3s;
}
.play:hover { transform: scale(1.04); }
.play:active { transform: scale(0.96); }
.play svg { width: 44%; height: 44%; }
.play-xl { position: relative; width: 116px; height: 116px; }
.play-sm { width: 46px; height: 46px; flex: none; box-shadow: 0 8px 24px -8px rgba(63, 211, 230, 0.7); }
.is-playing .play-xl { box-shadow: 0 18px 70px -8px rgba(63, 211, 230, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -8px 20px rgba(6, 24, 43, 0.25); }

.now { display: grid; gap: 2px; }
.now-label { font-size: 11px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.now-title { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.now-sub { color: var(--muted); font-size: 14.5px; }
.controls { display: grid; gap: 14px; justify-items: center; width: 100%; }
.controls .vol { width: min(340px, 100%); }
.control-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- sections & cards ---------- */

.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--gutter) 0; }
.section-head { display: grid; gap: 10px; margin-bottom: 26px; }
.section-head h2 { font-weight: 800; font-size: clamp(32px, 4.8vw, 52px); }
.section-head p { color: var(--muted); max-width: 600px; }
.sub-head { margin: 52px 0 16px; }
.sub-head h3 { font-weight: 700; font-size: 22px; }
.sub-head p { font-size: 14.5px; }
.kicker { font-size: 12px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; color: var(--aqua); }
.kicker.coral { color: var(--coral); }
.kicker.sand { color: var(--sand); }

.card {
  position: relative; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(31, 53, 94, 0.55), rgba(14, 27, 51, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  padding: clamp(20px, 3.4vw, 36px);
}

/* ---------- mixes ---------- */

.presets {
  display: grid; grid-auto-flow: column; grid-auto-columns: 164px; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 6px var(--gutter) 14px; scroll-padding: 0 var(--gutter);
}
.presets::-webkit-scrollbar { display: none; }
.preset { position: relative; scroll-snap-align: start; }
.preset-main {
  display: grid; gap: 4px; align-content: start; width: 100%; height: 100%; min-height: 150px; text-align: left; padding: 16px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--glass);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.preset-main:hover { transform: translateY(-3px); border-color: var(--line-2); background: rgba(30, 52, 92, 0.6); }
.preset.is-current .preset-main { border-color: color-mix(in srgb, var(--aqua) 60%, transparent); background: rgba(63, 211, 230, 0.08); box-shadow: 0 0 0 1px rgba(63, 211, 230, 0.15), 0 16px 40px -18px rgba(63, 211, 230, 0.5); }
.preset-orb { width: 46px; height: 46px; border-radius: 50%; margin-bottom: 12px; box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 10px 26px -8px rgba(0, 0, 0, 0.6); }
.preset.is-current .preset-orb { animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.preset-name { font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.preset-sub { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preset-del { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 10px; border: 0; background: rgba(0, 0, 0, 0.25); color: var(--muted); display: grid; place-items: center; }
.preset-del svg { width: 16px; height: 16px; }
.preset-del:hover { color: var(--coral); }
@media (min-width: 1000px) {
  .presets { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); overflow: visible; margin: 0; padding: 6px 0 0; }
  .preset-del { opacity: 0; transition: opacity 0.2s; }
  .preset:hover .preset-del, .preset-del:focus-visible { opacity: 1; }
}

/* ---------- now playing bar ---------- */

.nowbar {
  position: sticky; top: calc(66px + var(--top)); z-index: 8; display: grid; gap: 10px;
  margin: 0 calc(-1 * var(--gutter)) 34px; padding: 12px var(--gutter);
  background: rgba(10, 20, 38, 0.82); border-block: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
}
@media (min-width: 900px) { .nowbar { margin-inline: 0; border-radius: 22px; border: 1px solid var(--line-2); padding: 12px 14px; } }
.nowbar-top { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.mode-hint { color: var(--muted); font-size: 13.5px; flex: 1; min-width: 120px; }
.stop-all:disabled { opacity: 0.4; pointer-events: none; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-weight: 800; font-size: 14px; transition: background 0.2s, color 0.2s; }
.seg button[aria-checked=true] { background: var(--aqua); color: var(--ink); }
.now-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-height: 34px; align-items: center; }
.now-chips::-webkit-scrollbar { display: none; }
.now-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none; height: 34px; padding: 0 8px 0 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent);
  font-weight: 800; font-size: 13.5px;
}
.now-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.now-chip svg { width: 16px; height: 16px; color: var(--muted); }
.now-chip:hover svg { color: var(--coral); }
.now-empty { color: var(--faint); font-size: 13.5px; font-weight: 700; }

/* ---------- noise generator ---------- */

.noise { --noise: #C98B5E; }
.noise::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0.5; transition: opacity 0.4s;
  background: radial-gradient(70% 90% at 0% 0%, color-mix(in srgb, var(--noise) 22%, transparent), transparent 70%);
}
.noise.is-on::before { opacity: 1; }
.noise-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.noise-id { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 320px; }
.noise-id > div { display: grid; min-width: 0; }
.noise-swatch {
  width: 52px; height: 52px; border-radius: 50%; flex: none; background: var(--noise);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.05), 0 0 40px color-mix(in srgb, var(--noise) 55%, transparent);
  transition: background 0.3s, box-shadow 0.3s;
}
#noise-name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; }
#noise-note { color: var(--muted); font-size: 14.5px; }
.noise-onoff { display: flex; align-items: center; gap: 16px; }
.vol-compact { width: 170px; }
.switch { position: relative; width: 56px; height: 32px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.14); flex: none; transition: background 0.25s; }
.switch span { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.3, 1.2); }
.switch[aria-checked=true] { background: var(--aqua); }
.switch[aria-checked=true] span { transform: translateX(24px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; position: relative; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); font-weight: 700; font-size: 14px; color: var(--muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.chip i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); }
.chip:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.chip.is-on { color: var(--text); border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }

.noise-grid { display: grid; gap: 26px; position: relative; }
@media (min-width: 900px) { .noise-grid { grid-template-columns: 1.15fr 1fr; align-items: stretch; } }
.spectrum { position: relative; min-height: 220px; border-radius: 20px; border: 1px solid var(--line); background: rgba(4, 10, 24, 0.5); overflow: hidden; }
.spectrum canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.spectrum-cap { position: absolute; top: 12px; left: 16px; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.params { display: grid; gap: 12px; align-content: center; }
.param { display: grid; gap: 4px; }
.param-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; }
.param-head output { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.param-color input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #C98B5E, #F4A6C6 25%, #EEF3F8 50%, #6FB6FF 75%, #A78BFA); }
.param-color input[type=range]::-moz-range-track { background: linear-gradient(90deg, #C98B5E, #F4A6C6 25%, #EEF3F8 50%, #6FB6FF 75%, #A78BFA); }
.param-color input[type=range]::-moz-range-progress { background: transparent; }
.param-color input[type=range] { --fill: var(--noise); }

/* ---------- sound tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1040px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile {
  --fill: var(--c);
  position: relative; border-radius: var(--r); border: 1px solid var(--line); background: var(--glass); padding: 14px; overflow: hidden;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
}
.tile::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(90% 80% at 0% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 70%);
}
.tile:hover { border-color: var(--line-2); }
.tile.is-on { border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.tile.is-on::before { opacity: 1; }
.tile-main { position: relative; display: grid; gap: 14px; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.tile-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.tile-icon svg { width: 24px; height: 24px; }
.tile.is-on .tile-icon { background: var(--c); color: var(--ink); box-shadow: 0 8px 26px -6px color-mix(in srgb, var(--c) 80%, transparent); }
.tile-name { font-weight: 800; font-size: 15.5px; line-height: 1.25; padding-right: 30px; }
.tile-tune { position: absolute; top: 12px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity 0.2s, background 0.2s; }
.tile-tune svg { width: 20px; height: 20px; }
.tile.is-on .tile-tune { opacity: 1; pointer-events: auto; }
.tile-tune:hover, .tile.is-open .tile-tune { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.tile-body { display: none; position: relative; gap: 10px; margin-top: 10px; }
.tile.is-on .tile-body { display: grid; }
.tile-params { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tile-row { display: flex; align-items: center; gap: 8px; }
.tile-row .param { flex: 1; }
.tile-solo { display: none; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 800; color: var(--muted); }
.tile-solo:hover { color: var(--text); border-color: var(--c); }
.is-mix .tile-solo { display: inline-block; }
.tile .param-head { font-size: 13px; }
.tile-note { display: block; margin-top: 2px; font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); opacity: 0.85; }

/* ---------- ear test ---------- */

.eartest { display: grid; gap: 28px; }
@media (min-width: 900px) { .eartest { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; } }
.eartest-copy { display: grid; gap: 14px; }
.eartest-copy h2 { font-weight: 800; font-size: clamp(34px, 5vw, 56px); }
.eartest-copy > p { color: var(--muted); }
.checks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; font-weight: 600; }
.checks li::before { content: ''; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 107, 107, 0.16); box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 9px var(--coral); }
.eartest-panel {
  position: relative; display: grid; align-content: center; min-height: 380px; padding: clamp(22px, 4vw, 40px);
  border-radius: 24px; border: 1px solid var(--line); background: rgba(4, 10, 24, 0.5); text-align: center; overflow: hidden;
}
.eartest-panel::before {
  content: ''; position: absolute; left: 50%; top: 42%; width: 340px; height: 340px; margin: -170px 0 0 -170px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.2), transparent 65%); opacity: 0.5; transition: opacity 0.4s, transform 0.6s;
}
.is-sounding .eartest-panel::before { opacity: 1; animation: throb 1s ease-in-out infinite; }
@keyframes throb { 50% { transform: scale(1.12); } }
.eartest-panel > div { position: relative; display: grid; gap: 14px; justify-items: center; }
.big-hz { font-family: var(--display); font-weight: 800; font-size: clamp(58px, 10vw, 96px); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-hz small { font-size: 0.34em; color: var(--muted); letter-spacing: 0; margin-left: 0.2em; font-weight: 700; }
.step-label { font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--coral); }
.test-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.bar { width: min(320px, 100%); height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--coral); border-radius: inherit; transition: width 0.4s; }
.pill { display: inline-block; padding: 7px 16px; border-radius: 999px; font-weight: 900; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.pill.coral { background: var(--coral); color: #1A0A12; }
.scale { position: relative; width: min(340px, 100%); height: 8px; margin: 8px 0 22px; border-radius: 99px; background: linear-gradient(90deg, var(--coral), var(--sand) 55%, var(--foam)); }
.scale i { position: absolute; top: 50%; left: var(--p, 0%); width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.18), 0 4px 12px rgba(0, 0, 0, 0.5); transition: left 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.scale span { position: absolute; top: 16px; font-size: 11px; color: var(--faint); font-weight: 700; transform: translateX(-50%); }
.scale span:nth-of-type(1) { left: 0; transform: none; }
.scale span:nth-of-type(2) { left: 44%; }
.scale span:nth-of-type(3) { left: 75.5%; }
.scale span:nth-of-type(4) { right: 0; transform: none; }

/* ---------- noise colors ---------- */

.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
@media (min-width: 820px) { .colors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 819px) {
  .colors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .color-card { padding: 16px; }
  .color-card h3 { font-size: 19px; }
  .color-card p:last-child { font-size: 13.5px; line-height: 1.5; }
}
.color-card {
  display: grid; align-content: start; gap: 6px; padding: 22px; border-radius: var(--r); border: 1px solid var(--line); background: var(--glass);
}
.color-card svg { width: 100%; height: 44px; margin-bottom: 8px; overflow: visible; }
.color-card path { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 8px var(--c)); }
.color-card { position: relative; transition: border-color 0.3s, background 0.3s, transform 0.2s; }
.color-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.color-card.is-on { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 10%, var(--glass)); }
.cc-play {
  position: absolute; top: 14px; right: 14px; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; border: 0; background: color-mix(in srgb, var(--c) 22%, rgba(255, 255, 255, 0.06)); color: var(--c);
}
.cc-play svg { width: 18px; height: 18px; }
.color-card { cursor: pointer; } /* the whole card plays its color */
.color-card.is-on .cc-play { background: var(--c); color: var(--ink); box-shadow: 0 0 24px color-mix(in srgb, var(--c) 60%, transparent); }
.color-card h3 { font-weight: 700; font-size: 22px; }
.color-card .slope { font-size: 12px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c); }
.color-card p:last-child { color: var(--muted); font-size: 14.5px; }

/* ---------- app ---------- */

.app-card { display: grid; gap: 30px; overflow: hidden; }
.app-card::after {
  content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(63, 211, 230, 0.18), transparent 65%);
}
@media (min-width: 900px) { .app-card { grid-template-columns: 1.25fr 1fr; align-items: center; gap: 48px; } }
.app-card h2 { font-weight: 800; font-size: clamp(30px, 4.4vw, 48px); margin: 12px 0 14px; }
.app-card > div > p { color: var(--muted); }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.offline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--faint); }
.offline::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.offline.is-ready { color: var(--foam); }
.offline.is-ready::before { box-shadow: 0 0 10px var(--foam); }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; }
.features li { display: grid; gap: 2px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.features strong { font-size: 16px; }
.features span { color: var(--muted); font-size: 14.5px; }

/* ---------- faq ---------- */

.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0;
  font-weight: 800; font-size: 17.5px; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--display); font-weight: 300; font-size: 30px; line-height: 1; color: var(--aqua); transition: transform 0.25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 22px; max-width: 720px; }

/* ---------- footer ---------- */

.footer {
  max-width: var(--maxw); margin: 0 auto; display: grid; gap: 22px;
  padding: clamp(80px, 10vw, 130px) var(--gutter) calc(130px + var(--bottom));
}
.footer-brand p { color: var(--foam); font-weight: 800; margin-top: 4px; }
.footer .wordmark { font-size: 26px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.footer-links a { color: var(--muted); font-weight: 700; }
.footer-links a:hover { color: var(--text); }

/* ---------- dock ---------- */

.dock {
  position: fixed; z-index: 30; left: 50%; bottom: calc(12px + var(--bottom));
  display: flex; align-items: center; gap: 10px; width: min(780px, calc(100% - 20px)); padding: 8px 10px 8px 8px;
  border-radius: 24px; border: 1px solid var(--line-2);
  background: rgba(12, 24, 46, 0.78); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, calc(100% + 30px)); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.show-dock .dock { transform: translate(-50%, 0); }
.dock-now { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.dock-now strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-now span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-vol { width: 150px; }
@media (max-width: 680px) { .dock-vol { display: none; } }
@media (max-width: 420px) { .dock [data-timer-label] { display: none; } .dock .btn[data-open=timer] { width: 38px; padding: 0; } }

/* ---------- sleep screen ---------- */

.sleep {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; cursor: none;
  background: rgba(2, 6, 16, 0.5); opacity: 0; transition: opacity 0.6s, background 0.6s;
  padding: var(--top) 20px var(--bottom);
}
.sleep.is-open { opacity: 1; }
.sleep[data-mode=black] { background: #000; }
.sleep.show-ui { cursor: default; }
.is-sleeping body { overflow: hidden; }
.is-sleeping .topbar, .is-sleeping .dock, .is-sleeping main, .is-sleeping .footer { visibility: hidden; }
.sleep-center { text-align: center; display: grid; gap: 8px; }
.sleep-clock { font-family: var(--display); font-weight: 300; font-size: clamp(76px, 20vw, 190px); letter-spacing: -0.04em; line-height: 1; color: rgba(238, 243, 248, 0.55); font-variant-numeric: tabular-nums; }
.sleep-mix, .sleep-timer { color: rgba(166, 181, 204, 0.55); font-weight: 700; }
.sleep[data-mode=black] .sleep-clock { color: rgba(238, 243, 248, 0.22); }
.sleep[data-mode=black] .sleep-mix, .sleep[data-mode=black] .sleep-timer { color: rgba(166, 181, 204, 0.25); }
.sleep-ui {
  position: absolute; left: 50%; bottom: calc(28px + var(--bottom)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: max-content; max-width: calc(100% - 24px);
  opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.sleep.show-ui .sleep-ui { opacity: 1; pointer-events: auto; }

/* ---------- sheets & toast ---------- */

.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(3, 8, 20, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.25s; }
.scrim.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 60; left: 50%; bottom: 0; width: min(520px, 100%);
  padding: 22px 22px calc(24px + var(--bottom)); border-radius: 28px 28px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
  background: linear-gradient(180deg, #1A2F55, #111F3B); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 105%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: grid; gap: 14px;
}
.sheet.is-open { transform: translate(-50%, 0); }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 28px; border-bottom: 1px solid var(--line-2); transform: translate(-50%, -46%) scale(0.97); opacity: 0; transition: transform 0.25s, opacity 0.25s; }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { font-size: 22px; font-weight: 700; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt { height: 52px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); font-weight: 800; font-size: 15px; transition: all 0.2s; }
.opt:hover { background: rgba(255, 255, 255, 0.1); }
.opt.is-on { border-color: var(--aqua); color: var(--aqua); background: rgba(63, 211, 230, 0.1); }
.save-form { display: flex; gap: 8px; }
.save-form input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.06); font-size: 16px; }
.save-form input:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(63, 211, 230, 0.2); }
.sheet-share { max-height: calc(100dvh - 20px); overflow-y: auto; }
.share-card { width: auto; height: min(52dvh, 520px); aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 18px; background: #0E1B33; box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.7); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.howto { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.howto li::marker { color: var(--aqua); font-weight: 900; }
.ios-share svg { display: inline; width: 18px; height: 18px; vertical-align: -3px; color: var(--aqua); }

.toast {
  position: fixed; z-index: 70; left: 50%; bottom: calc(92px + var(--bottom)); transform: translate(-50%, 12px);
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--text); color: var(--ink);
  font-weight: 800; font-size: 14px; box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 80; padding: 14px; border-radius: 14px; background: var(--coral); color: #1A0A12; font-weight: 800; text-align: center; }

/* ---------- small screens ---------- */

@media (max-width: 860px) { .nav { display: none; } }
@media (max-width: 560px) {
  .topbar { gap: 12px; }
  .wordmark { font-size: 16px; }
  .mark { width: 30px; height: 30px; }
  .play-wrap, .play-xl { width: 100px; height: 100px; }
  .control-row .btn { height: 42px; padding: 0 14px; font-size: 14px; }
  .control-row .btn-icon { width: 42px; padding: 0; }
  .noise-onoff { width: 100%; }
  .noise-onoff .vol { flex: 1; width: auto; }
  .tile { padding: 12px; }
  .tile-icon { width: 42px; height: 42px; }
  .eartest-panel { min-height: 340px; }
}

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