:root {
  --bg: #fffafd;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --text: #a18abd;
  --heading: #967db7;
  --muted: #b8a8c9;
  --line: rgba(221, 202, 240, 0.72);
  --accent: #c8b6ff;
  --accent-strong: #b7a2f3;
  --mint: #aaf0dd;
  --pink: #ffc4df;
  --peach: #ffd9c1;
  --sky: #c6ebff;
  --lemon: #fff1b5;
  --shadow: 0 22px 60px rgba(222, 203, 239, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 196, 223, 0.68), transparent 28rem),
    radial-gradient(circle at 92% 10%, rgba(198, 235, 255, 0.74), transparent 31rem),
    radial-gradient(circle at 50% 100%, rgba(170, 240, 221, 0.54), transparent 34rem),
    linear-gradient(145deg, #fffafd 0%, #faf7ff 48%, #f2fcff 100%);
}

footer {
    margin-top: -20px;
    display: table;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 20px;
}

footer a {
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(200, 182, 255, 0.68);
  outline-offset: 3px;
}

.app {
  width: min(1240px, calc(100% - 32px));
  margin: auto;
  padding: 46px 0 70px;
}

.hero,
.controls,
.mixer-shell,
.status {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.76)),
    linear-gradient(135deg, rgba(255, 217, 193, 0.38), rgba(200, 182, 255, 0.3));
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 170px;
  height: 170px;
  top: -85px;
  left: 46%;
  background: rgba(255, 241, 181, 0.78);
  filter: blur(2px);
}

.hero::after {
  right: -90px;
  bottom: -145px;
  width: 350px;
  aspect-ratio: 1;
  background: conic-gradient(
    from 90deg,
    rgba(255, 196, 223, 0.38),
    rgba(170, 240, 221, 0.84),
    rgba(200, 182, 255, 0.72),
    rgba(198, 235, 255, 0.76),
    rgba(255, 196, 223, 0.38)
  );
  opacity: 0.78;
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: #b39bdd;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--accent));
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0;
  color: var(--heading);
  font-size: clamp(2.65rem, 7vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

h2,
h3 {
  color: var(--heading);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.75;
}

.controls {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(380px, 1.55fr) minmax(220px, 0.9fr);
  gap: 24px;
  margin-top: 22px;
  padding: 26px;
  border-radius: 22px;
}

.control-section {
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.control-section:nth-child(1) {
  background: linear-gradient(145deg, rgba(198, 235, 255, 0.48), rgba(255, 255, 255, 0.84));
}

.control-section:nth-child(2) {
  background: linear-gradient(145deg, rgba(200, 182, 255, 0.38), rgba(255, 196, 223, 0.34), rgba(255, 255, 255, 0.84));
}

.control-section:nth-child(3) {
  background: linear-gradient(145deg, rgba(170, 240, 221, 0.42), rgba(255, 241, 181, 0.38), rgba(255, 255, 255, 0.84));
}

.control-section h2 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: #aa95c5;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.master-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.master-row input {
  flex: 1;
}

output,
.pill {
  min-width: 58px;
  padding: 7px 9px;
  border: 1px solid rgba(200, 182, 255, 0.48);
  border-radius: 999px;
  color: #a58bc8;
  background: linear-gradient(135deg, rgba(200, 182, 255, 0.38), rgba(170, 240, 221, 0.36));
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.harmony-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(218, 198, 237, 0.62);
  border-radius: 13px;
  color: #9c83bb;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(224, 205, 241, 0.5);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.02);
  box-shadow: 0 12px 24px rgba(218, 197, 237, 0.62);
}

.button.primary {
  background: linear-gradient(135deg, #b0f2df, #ddf9f0);
}

.button.accent {
  background: linear-gradient(135deg, #cdbfff, #ffd1e5);
}

.button.secondary {
  background: linear-gradient(135deg, #fff4c2, #ffe0ca);
}

.button.active {
  box-shadow: 0 0 0 4px rgba(200, 182, 255, 0.32), 0 13px 30px rgba(216, 194, 238, 0.58);
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: 16px;
  color: var(--muted);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(239, 251, 255, 0.92));
}

.status-left,
.status-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.status-item strong {
  color: #a68bc6;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd2eb;
  box-shadow: 0 0 0 6px rgba(221, 210, 235, 0.42);
}

.dot.active {
  background: #9ee8d4;
  box-shadow: 0 0 0 6px rgba(170, 240, 221, 0.4), 0 0 22px rgba(170, 240, 221, 0.72);
}

.mixer-shell {
  margin-top: 22px;
  padding: 24px;
  border-radius: 24px;
  overflow-x: auto;
}

.mixer-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.mixer-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.mixer-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.mixer {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  min-width: 920px;
}

.channel {
  --hue: 260;
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  min-width: 88px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 17px 10px;
  border: 1px solid hsla(var(--hue), 72%, 84%, 0.72);
  border-radius: 18px;
  background: linear-gradient(180deg, hsla(var(--hue), 94%, 93%, 0.82), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.channel:hover {
  transform: translateY(-3px);
}

.channel.active {
  border-color: hsla(var(--hue), 84%, 76%, 0.88);
  background: linear-gradient(180deg, hsla(var(--hue), 96%, 89%, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow: 0 12px 30px hsla(var(--hue), 78%, 82%, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.channel.random-active::after {
  content: "AUTO";
  position: absolute;
  top: 10px;
  right: -25px;
  width: 88px;
  padding: 3px 0;
  transform: rotate(42deg);
  color: #aa95c5;
  background: linear-gradient(90deg, #c3f6e8, #fff5c7);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
}

.frequency {
  margin: 0;
  color: #a18abc;
  font-size: 1.15rem;
  letter-spacing: -0.035em;
  text-align: center;
}

.tone-name {
  min-height: 34px;
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
}

.toggle {
  width: 42px;
  height: 42px;
  border: 1px solid hsla(var(--hue), 72%, 82%, 0.72);
  border-radius: 50%;
  color: #ab99c5;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 14px rgba(224, 205, 241, 0.54);
}

.channel.active .toggle {
  color: #a087bd;
  background: hsl(var(--hue), 92%, 88%);
  box-shadow: 0 8px 20px hsla(var(--hue), 80%, 82%, 0.62);
}

.pause-icon {
  display: none;
}

.channel.active .play-icon {
  display: none;
}

.channel.active .pause-icon {
  display: inline;
}

.vertical-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
}

.vertical-slider {
  --fill: 45%;
  width: 225px;
  height: 10px;
  margin: 0;
  appearance: none;
  transform: rotate(-90deg);
  border: 1px solid rgba(225, 208, 241, 0.66);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    hsl(var(--hue), 90%, 80%) var(--fill),
    rgba(235, 223, 246, 0.84) var(--fill)
  );
  box-shadow: inset 0 1px 3px rgba(224, 205, 241, 0.52);
  cursor: pointer;
}

.vertical-slider::-webkit-slider-thumb,
#master::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  appearance: none;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: hsl(var(--hue, 165), 86%, 79%);
  box-shadow: 0 4px 14px rgba(218, 196, 238, 0.62);
}

.vertical-slider::-moz-range-thumb,
#master::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: hsl(var(--hue, 165), 86%, 79%);
  box-shadow: 0 4px 14px rgba(218, 196, 238, 0.62);
}

#master {
  --fill: 30%;
  width: 100%;
  height: 9px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) var(--fill), rgba(235, 223, 246, 0.84) var(--fill));
  box-shadow: inset 0 1px 3px rgba(224, 205, 241, 0.52);
  cursor: pointer;
}

.channel-value {
  color: hsl(var(--hue), 56%, 68%);
  font-size: 0.82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.notice {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
  text-align: center;
}

.notice strong {
  color: #a18abc;
}

@media (max-width: 980px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .control-section:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .hero {
    padding: 28px 22px 34px;
  }

  .controls {
    grid-template-columns: 1fr;
    padding: 21px;
  }

  .control-section:last-child {
    grid-column: auto;
  }

  .harmony-selects {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .status {
    flex-direction: column;
  }

  .mixer-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .mixer-shell {
    padding: 18px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
