:root {
  --noise-ink: #173d35;
  --noise-paper: #fffdf7;
  --traffic-green: #24d366;
  --traffic-yellow: #ffd447;
  --traffic-red: #ff4b42;
}

.noise-page {
  min-height: 100vh;
  margin: 0;
  background: #f2f8ef;
  color: var(--noise-ink);
  font-family: 'Nunito', 'Noto Sans SC', system-ui, sans-serif;
}

.noise-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.noise-back {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 4;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .86);
  color: var(--noise-ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(23, 61, 53, .12);
}

.noise-stage {
  display: grid;
  grid-template-columns: minmax(280px, .62fr) minmax(360px, 1fr);
  gap: clamp(22px, 5vw, 56px);
  align-items: center;
  width: min(1180px, 100%);
  margin: auto;
}

.noise-copy {
  padding-top: 44px;
}

.noise-eyebrow {
  margin: 0 0 8px;
  color: #4f7e63;
  font-size: .85rem;
  font-weight: 1000;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.noise-copy h1 {
  margin: 0;
  color: #12382f;
  font-family: 'DM Serif Display', 'Noto Sans SC', serif;
  font-size: clamp(3.2rem, 8vw, 6.6rem);
  font-weight: 400;
  line-height: .92;
}

.noise-copy p:last-child {
  max-width: 520px;
  margin: 18px 0 0;
  color: #4c655d;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.35;
}

.traffic-light {
  display: grid;
  min-height: min(70vh, 720px);
  place-items: center;
  align-content: center;
  gap: clamp(14px, 2.2vh, 22px);
  padding: clamp(28px, 4vw, 54px);
  border: 10px solid #172820;
  border-radius: 46px;
  background: linear-gradient(180deg, #23372f, #101f1a);
  color: white;
  box-shadow: 0 28px 70px rgba(23, 61, 53, .24), inset 0 0 0 8px rgba(255, 255, 255, .06);
}

.traffic-light__lamp {
  width: clamp(130px, 18vw, 220px);
  aspect-ratio: 1;
  border: 8px solid rgba(0, 0, 0, .38);
  border-radius: 50%;
  background: #2c3934;
  opacity: .28;
  box-shadow: inset 0 12px 30px rgba(0, 0, 0, .42);
  transition: opacity .16s ease, filter .16s ease, box-shadow .16s ease, transform .16s ease;
}

.traffic-light[data-state="green"] .traffic-light__lamp--green {
  background: var(--traffic-green);
  opacity: 1;
  box-shadow: 0 0 38px rgba(36, 211, 102, .86), inset 0 12px 28px rgba(255, 255, 255, .38);
}

.traffic-light[data-state="yellow"] .traffic-light__lamp--yellow {
  background: var(--traffic-yellow);
  opacity: 1;
  box-shadow: 0 0 38px rgba(255, 212, 71, .86), inset 0 12px 28px rgba(255, 255, 255, .38);
}

.traffic-light[data-state="red"] .traffic-light__lamp--red {
  background: var(--traffic-red);
  opacity: 1;
  animation: redGlow 1s ease-in-out infinite alternate;
}

.noise-state {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  font-weight: 1000;
  text-align: center;
}

#volumeReadout {
  font-size: clamp(3.8rem, 8vw, 7rem);
  line-height: .85;
}

.noise-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid #d6e2ce;
  border-radius: 24px;
  background: var(--noise-paper);
  box-shadow: 0 14px 36px rgba(23, 61, 53, .1);
}

.noise-button {
  min-height: 72px;
  padding: 0 32px;
  border: 0;
  border-radius: 18px;
  background: #174f43;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 1000;
  box-shadow: 0 6px 0 #0f332b;
}

.noise-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0f332b;
}

.threshold-control {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 14px;
  align-items: center;
  color: #31594f;
  font-size: 1.1rem;
  font-weight: 900;
}

.threshold-control strong {
  justify-self: end;
  color: #12382f;
  font-size: 1.4rem;
}

.threshold-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--traffic-red);
}

.monitor-status {
  grid-column: 1 / -1;
  min-height: 1.4em;
  margin: 0;
  color: #5b7169;
  font-size: .95rem;
  font-weight: 800;
}

@keyframes redGlow {
  from {
    transform: scale(1);
    box-shadow: 0 0 36px rgba(255, 75, 66, .8), inset 0 12px 28px rgba(255, 255, 255, .36);
  }
  to {
    transform: scale(1.035);
    box-shadow: 0 0 72px rgba(255, 75, 66, 1), 0 0 130px rgba(255, 75, 66, .34), inset 0 12px 28px rgba(255, 255, 255, .42);
  }
}

@media (max-width: 860px) {
  .noise-shell { padding: 18px; }
  .noise-stage { grid-template-columns: 1fr; }
  .traffic-light { min-height: 520px; border-radius: 32px; }
  .noise-controls { grid-template-columns: 1fr; }
  .noise-button { width: 100%; }
}
