:root {
  --ink: #101214;
  --graphite: #171b1f;
  --asphalt: #252b31;
  --muted: #8b97a1;
  --line: rgba(255, 255, 255, 0.12);
  --white: #ffffff;
  --aqua: #24d6c2;
  --aqua-glow: rgba(36, 214, 194, 0.45);
  --v: 0.05;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--white);
  background: radial-gradient(120% 90% at 50% 62%, #1b2126 0%, var(--ink) 58%, #0a0c0e 100%) fixed;
  background-color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#waves {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 24px clamp(16px, 4vw, 48px) 20px;
}

/* Topo */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: block;
  width: auto;
  height: clamp(18px, 2.4vw, 24px);
}

.sound {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: 500 13px/1 Inter, sans-serif;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.sound:hover,
.sound[aria-pressed="true"] {
  color: var(--white);
  border-color: rgba(36, 214, 194, 0.5);
}

.sound:focus-visible,
.button:focus-visible,
.ghost:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
}

.sound-icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound-icon i {
  width: 2px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
}

.sound[aria-pressed="true"] .sound-icon i {
  background: var(--aqua);
  animation: eq 0.9s ease-in-out infinite alternate;
}

.sound[aria-pressed="true"] .sound-icon i:nth-child(2) { animation-delay: -0.3s; }
.sound[aria-pressed="true"] .sound-icon i:nth-child(3) { animation-delay: -0.6s; }

@keyframes eq {
  from { height: 3px; }
  to { height: 12px; }
}

/* Textos */

.stage {
  display: grid;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-top: clamp(40px, 11vh, 120px);
  align-content: start;
}

.stage > section {
  grid-area: 1 / 1;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.9s;
}

.reveal {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
}

.is-tuned .intro {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px);
}

.is-tuned .reveal {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0.35s;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 600;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 em,
h2 em {
  font-style: normal;
  color: var(--muted);
}

.is-tuned h2 em {
  color: var(--aqua);
  transition: color 1.2s 1s;
}

.lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: #b9c2c9;
  font-size: clamp(16px, 1.6vw, 18px);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.ghost {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font: 500 15px/1 Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.button {
  background: var(--aqua);
  color: var(--ink);
  border: 1px solid var(--aqua);
}

.button:hover {
  transform: translateY(-1px);
  background: #3ee6d3;
}

.ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}

.ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.now-playing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s, transform 0.6s;
}

.now-playing strong {
  color: var(--white);
  font-weight: 500;
}

.now-playing .sound-icon i {
  background: var(--aqua);
  animation: eq 0.34s ease-in-out infinite alternate;
}

.now-playing .sound-icon i:nth-child(2) { animation-delay: -0.12s; }
.now-playing .sound-icon i:nth-child(3) { animation-delay: -0.24s; }

.is-playing .now-playing {
  opacity: 1;
  transform: none;
}

/* Dial */

.tuner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.readout {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.freq {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 26px;
  font-weight: 600;
  transition: color 0.4s;
}

.freq small {
  margin-left: 6px;
  color: var(--muted);
  font: 500 12px/1 Inter, sans-serif;
  letter-spacing: 0.08em;
}

.is-tuned .freq {
  color: var(--aqua);
}

/* Medidor de sinal no desenho do H do logo: acende do centro para fora */
.signal {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  align-self: center;
}

.signal i {
  width: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.25s, box-shadow 0.25s;
}

.signal i:nth-child(1),
.signal i:nth-child(5) { height: 100%; }
.signal i:nth-child(2),
.signal i:nth-child(4) { height: 48%; }
.signal i:nth-child(3) { height: 5px; }
.signal i.on { background: var(--aqua); }
.is-tuned .signal i { box-shadow: 0 0 10px var(--aqua-glow); }

.dial {
  position: relative;
  height: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 2px;
}

.dial:focus-within {
  outline: 2px solid var(--aqua);
  outline-offset: 4px;
}

.scale {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.38) 0 1px, transparent 1px 20%) left bottom / calc(100% + 1px) 22px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 2.5%) left bottom / calc(100% + 1px) 12px no-repeat;
}

.scale span {
  width: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
}

.needle {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: calc(var(--v) * 100%);
  width: 2px;
  margin-left: -1px;
  background: var(--aqua);
  border-radius: 2px;
  box-shadow: 0 0 14px var(--aqua-glow);
  pointer-events: none;
}

.needle::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--aqua);
}

.range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
}

.range:disabled {
  cursor: default;
}

.hint {
  margin: 0;
  min-height: 1.5em;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  transition: color 0.3s;
}

.is-close .hint {
  color: var(--white);
}

.is-tuned .hint {
  color: var(--aqua);
}

@media (max-width: 560px) {
  .stage {
    padding-top: 40px;
  }

  .label {
    display: none;
  }

  .dial {
    height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage > section,
  .sound-icon i {
    transition: none;
    animation: none;
  }
}
