:root {
  color-scheme: dark;
  --night-950: #090611;
  --night-900: #140a25;
  --night-800: #23113d;
  --surface: rgba(33, 20, 55, .86);
  --surface-strong: rgba(42, 24, 70, .96);
  --lilac-100: #f1e9ff;
  --lilac-200: #dcc5ff;
  --lilac-300: #c084fc;
  --blue: #78bdf8;
  --gold: #f3c969;
  --green: #66e3a4;
  --text-2: #cabedb;
  --text-3: #9485a8;
  --stroke: rgba(220, 197, 255, .2);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  color: var(--lilac-100);
  background: var(--night-950);
  overflow-x: hidden;
}

button, select, input { font: inherit; }
button, select { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 12%, rgba(120, 77, 202, .26), transparent 35%),
    radial-gradient(circle at 88% 32%, rgba(42, 126, 176, .18), transparent 30%),
    radial-gradient(circle at 55% 86%, rgba(192, 132, 252, .14), transparent 37%),
    linear-gradient(150deg, #090611 0%, #140a25 48%, #0c0917 100%);
}

.shell { width: min(920px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 36px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 52px; margin-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--lilac-100); text-decoration: none; font-weight: 750; letter-spacing: .02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--stroke); border-radius: 11px; background: rgba(192, 132, 252, .1); color: var(--lilac-300); }
.brand-mark img { width: 29px; height: 29px; filter: brightness(2.25) saturate(1.25); }
.top-actions { display: flex; gap: 8px; }

.card {
  position: relative;
  margin-bottom: 16px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--stroke);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(37, 21, 62, .92), rgba(22, 13, 38, .88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 220px; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; right: -110px; top: -130px; border-radius: 50%; background: rgba(120, 189, 248, .09); filter: blur(4px); }
.hero-copy { position: relative; z-index: 1; max-width: 600px; }
.eyebrow { margin: 0 0 8px; color: var(--lilac-300); font-size: .76rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 650px; margin-bottom: 12px; font-size: clamp(2rem, 7vw, 4rem); line-height: .98; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.025em; }
.lead { max-width: 590px; margin-bottom: 0; color: var(--text-2); font-size: clamp(1rem, 2vw, 1.13rem); line-height: 1.6; }

.shield-orb { position: relative; z-index: 2; display: grid; place-items: center; width: clamp(90px, 16vw, 140px); aspect-ratio: 1; margin-left: 18px; border: 1px solid rgba(192, 132, 252, .28); border-radius: 50%; background: radial-gradient(circle, rgba(192, 132, 252, .24), rgba(35, 17, 61, .55) 64%, transparent 65%); transition: .35s ease; }
.shield-icon { width: 82%; height: 82%; object-fit: contain; filter: brightness(2.25) saturate(1.25) drop-shadow(0 0 18px rgba(192,132,252,.5)); }
.pulse { position: absolute; inset: 9%; border: 1px solid rgba(102, 227, 164, 0); border-radius: 50%; pointer-events: none; }
.shield-orb.active { border-color: rgba(102, 227, 164, .7); background: radial-gradient(circle, rgba(102, 227, 164, .25), rgba(35, 17, 61, .58) 64%, transparent 65%); box-shadow: 0 0 42px rgba(102, 227, 164, .23); }
.shield-orb.active .shield-icon { filter: brightness(2.65) saturate(1.55) drop-shadow(0 0 18px rgba(102,227,164,.66)); }
.shield-orb.active .pulse { animation: pulse 2.4s ease-out infinite; border-color: rgba(102, 227, 164, .5); }
.shield-orb.active .pulse-b { animation-delay: 1.2s; }
@keyframes pulse { from { transform: scale(.78); opacity: .85; } to { transform: scale(1.55); opacity: 0; } }

.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.state-pill { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--stroke); border-radius: 999px; color: var(--text-2); background: rgba(255,255,255,.04); font-size: .83rem; }
.state-pill.active { color: #071f15; background: var(--green); border-color: var(--green); box-shadow: 0 0 22px rgba(102, 227, 164, .28); }
.state-pill.paused { color: var(--night-950); background: var(--gold); border-color: var(--gold); }

.noise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.noise-choice { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 15px; background: rgba(255,255,255,.035); cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.noise-choice:hover { transform: translateY(-1px); background: rgba(255,255,255,.07); }
.noise-choice.selected { border-color: currentColor; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px currentColor; }
.noise-choice.white { color: #e9eeff; }
.noise-choice.pink { color: #ff9dcf; }
.noise-choice.brown { color: #c084fc; }
.noise-choice.yellow { color: #f3c969; }
.noise-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }

.detail-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 16px; padding: 12px 2px; border: 0; color: var(--text-2); background: transparent; text-align: left; cursor: pointer; }
.chevron { font-size: 1.3rem; transition: transform .2s ease; }
.detail-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.theory-panel, .live-panel { margin-top: 4px; padding: 14px; border: 1px solid var(--stroke); border-radius: 18px; background: rgba(5, 3, 10, .35); }
canvas { display: block; width: 100%; height: auto; border-radius: 10px; }
.axis-notes { display: flex; justify-content: space-between; gap: 14px; margin-top: 10px; color: var(--text-3); font-size: .73rem; }
.hidden { display: none !important; }

.slider-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; color: var(--text-2); }
.slider-row output { color: var(--lilac-100); font-weight: 740; }
.range { width: 100%; height: 5px; margin: 14px 0 8px; accent-color: var(--lilac-300); }
.safety-note, .route-hint { margin: 0; color: var(--text-3); font-size: .82rem; line-height: 1.5; }

.transport { display: grid; grid-template-columns: 1.6fr .8fr .8fr; gap: 10px; margin-top: 24px; }
button.primary, button.secondary, button.ghost { border: 1px solid transparent; border-radius: 14px; cursor: pointer; transition: .2s ease; }
button.primary, button.secondary { min-height: 48px; padding: 11px 16px; }
button.primary { display: inline-flex; justify-content: center; align-items: center; gap: 9px; color: #150a22; background: linear-gradient(135deg, var(--lilac-200), var(--lilac-300)); font-weight: 780; box-shadow: 0 12px 30px rgba(192, 132, 252, .18); }
button.primary.active { color: #071f15; background: var(--green); box-shadow: 0 0 28px rgba(102, 227, 164, .3); }
button.secondary, button.ghost { border-color: var(--stroke); background: rgba(255,255,255,.045); }
button.secondary:hover, button.ghost:hover { background: rgba(255,255,255,.09); }
button:disabled { opacity: .43; cursor: not-allowed; }
.compact { min-height: 36px; padding: 7px 11px; }

.route-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; margin-top: 24px; }
.route-row label { color: var(--text-2); font-size: .9rem; }
select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--night-800); }
.route-hint { margin-top: 10px; }

.analysis-card > p { color: var(--text-2); line-height: 1.55; }
.analysis-heading { align-items: center; margin-bottom: 12px; }
.mic-button { display: inline-flex; align-items: center; gap: 8px; }
.mic-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); }
.mic-button.active .mic-dot { background: var(--green); box-shadow: 0 0 12px var(--green); }
.input-row { margin-top: 20px; }
.live-panel { margin-top: 20px; }
.meter-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--text-2); }
.meter-heading strong { color: var(--green); font-variant-numeric: tabular-nums; }

footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 6px 0; color: var(--text-3); font-size: .78rem; }

@media (max-width: 680px) {
  .shell { width: min(100% - 18px, 920px); padding-top: 8px; }
  .card { border-radius: 21px; padding: 20px 17px; }
  .hero { min-height: 200px; }
  .shield-orb { width: 76px; margin-left: 8px; }
  .noise-grid { grid-template-columns: repeat(2, 1fr); }
  .transport { grid-template-columns: 1fr 1fr; }
  .transport .primary { grid-column: 1 / -1; }
  .route-row { grid-template-columns: 1fr; gap: 7px; }
  .analysis-heading { display: block; }
  .mic-button { width: 100%; justify-content: center; margin-top: 18px; }
  .axis-notes { display: grid; }
}

@media (max-width: 420px) {
  h1 { font-size: 2.15rem; }
  .hero { grid-template-columns: 1fr; }
  .shield-orb { display: none; }
  .section-heading { align-items: flex-start; }
  .state-pill { font-size: .73rem; }
  footer { display: grid; }
}

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