:root {
  --bg: #140b33;
  --ink: #fff0fa;
  --muted: #d9abd0;
  --panel: rgba(45, 20, 71, 0.58);
  --panel-line: rgba(255, 178, 235, 0.24);
  --lacquer: #07050c;
  --lacquer-2: #160c24;
  --ivory: #f3d8e9;
  --ivory-edge: #b993c2;
  --ebony: #080611;
  --ebony-edge: #231637;
  --brass: #ffb7df;
  --sodium: #ff69c7;
  --magenta: #ff43bc;
  --violet: #6046d8;
  --blue: #23207a;
  --scarlet: #ff5fa9;
  --shadow: rgba(6, 2, 22, 0.62);
  --white-key-width: 26px;
  --black-key-width: 17px;
  --white-key-height: 238px;
  --black-key-height: 150px;
  --control-radius: 8px;
  color-scheme: dark;
  font-family: "Megrim", sans-serif;
  font-weight: 900;
  font-size: 125%;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 16% 18%,
      rgba(255, 80, 190, 0.55),
      transparent 28%
    ),
    radial-gradient(
      circle at 86% 16%,
      rgba(255, 88, 196, 0.5),
      transparent 26%
    ),
    radial-gradient(
      ellipse at 50% 72%,
      rgba(224, 121, 255, 0.28),
      transparent 46%
    ),
    linear-gradient(180deg, #25208a 0%, #3b2391 32%, #7e31af 68%, #261252 100%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 50% 8%,
      rgba(255, 218, 251, 0.18),
      transparent 31%
    ),
    radial-gradient(
      ellipse at 50% 100%,
      rgba(30, 11, 76, 0.72),
      transparent 58%
    );
  mix-blend-mode: screen;
  opacity: 0.78;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.stage {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 38px;
  position: relative;
}

.headband {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 122px;
  padding: 4px 2px 18px;
  border-bottom: 1px solid var(--panel-line);
}

.identity {
  display: grid;
  gap: 8px;
}

.date-mark,
.fallboard,
.control-panel label span,
.status-strip,
.ignition {
  letter-spacing: 0;
  text-transform: uppercase;
}

.identity div {
  display: flex;
  align-items: center;
}

.date-mark {
  color: #ffb8e4;
  font-size: 0.86rem;
  line-height: 35px;
  margin-right: 15px;
}

.dream-house {
  height: 35px;
  filter: brightness(100);
}

h1 {
  margin: 0 0 -30px 0;
  font-family: "La Belle Aurore", cursive;
  font-weight: 400;
  font-size: 4rem;
  white-space: nowrap;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1),
    0 26px 54px rgba(255, 67, 188, 0.34);
}

.transport {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.ignition {
  border: 1px solid rgba(255, 196, 240, 0.25);
  background: rgba(22, 10, 54, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 16px 34px rgba(17, 5, 43, 0.32);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.ignition {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--control-radius);
  color: var(--ink);
}

.ignition:hover {
  border-color: rgba(255, 105, 199, 0.72);
}

.ignition:active {
  border-color: rgba(255, 216, 242, 0.78);
}

.ignition.is-active {
  color: #190823;
  border-color: rgba(255, 216, 242, 0.9);
  background: #ea52f3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 0 30px rgba(255, 67, 188, 0.38),
    0 16px 34px rgba(17, 5, 43, 0.34);
}

.ignition-icon {
  color: var(--scarlet);
  text-shadow: 0 0 18px var(--magenta);
}

.ignition.is-active .ignition-icon {
  color: #5c00aa;
  text-shadow: 0px 0px 5px #b00084;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-strip span {
  padding: 4px 9px;
  border: 1px solid rgba(255, 196, 240, 0.18);
  border-radius: var(--control-radius);
  background: rgba(22, 10, 54, 0.42);
}

.console-grid {
  display: grid;
  grid-template-columns: 1fr;
  padding: 24px 0 18px;
}

.control-panel {
  min-height: 120px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
  backdrop-filter: blur(18px);
  display: grid;
  padding: 18px;
  grid-template-columns: repeat(3, minmax(180px, 280px));
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 12px;
}

.control-panel label {
  display: grid;
  grid-template-columns: 54px minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px solid rgba(255, 196, 240, 0.12);
  border-radius: var(--control-radius);
  background: rgba(20, 8, 45, 0.22);
  cursor: pointer;
}

.control-panel label span {
  color: rgba(255, 216, 242, 0.78);
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(90deg, #7060ff, var(--magenta), #ffd1ef);
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: -6px;
  background: var(--ink);
  border: 2px solid var(--lacquer);
  box-shadow: 0 0 16px rgba(255, 67, 188, 0.4);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  background: linear-gradient(90deg, #7060ff, var(--magenta), #ffd1ef);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--lacquer);
}

.piano-shell {
  border: 1px solid rgba(255, 196, 240, 0.2);
  background:
    radial-gradient(
      ellipse at 18% 0%,
      rgba(255, 94, 198, 0.23),
      transparent 38%
    ),
    radial-gradient(
      ellipse at 84% 0%,
      rgba(98, 74, 226, 0.21),
      transparent 42%
    ),
    var(--lacquer);
  box-shadow:
    0 32px 100px rgba(6, 2, 22, 0.64),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.fallboard {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  align-items: center;
  padding: 0 18px;
  color: var(--brass);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    var(--lacquer-2);
  border-bottom: 1px solid rgba(255, 183, 223, 0.28);
  font-size: 0.88rem;
}

.keyboard-window {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 16px 14px;
  scrollbar-color: var(--magenta) rgba(255, 216, 242, 0.09);
}

.piano {
  position: relative;
  height: var(--white-key-height);
  margin: 0 auto;
  user-select: none;
  touch-action: manipulation;
  transition:
    filter 180ms ease,
    opacity 180ms ease;
}

.keyboard-window.is-sample-blocked .piano {
  filter: grayscale(1) brightness(0.12);
  opacity: 0.62;
  pointer-events: none;
}

.sample-overlay {
  appearance: none;
  position: absolute;
  inset: 0 16px 14px;
  z-index: 10;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: var(--white-key-height);
  padding: 24px;
  color: var(--ink);
  background: rgba(2, 1, 5, 0.74);
  border: 1px solid rgba(255, 196, 240, 0.18);
  cursor: pointer;
  pointer-events: auto;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}

.sample-overlay span:first-child {
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sample-overlay span:last-child {
  max-width: 440px;
  color: rgba(255, 240, 250, 0.68);
  font-size: 0.84rem;
  line-height: 1.4;
}

.keyboard-window:not(.is-sample-blocked) .sample-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.key {
  position: absolute;
  top: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: grid;
  align-content: end;
  justify-items: center;
  transition:
    filter 80ms ease,
    transform 80ms ease,
    box-shadow 80ms ease;
}

.key.white {
  width: var(--white-key-width);
  height: var(--white-key-height);
  z-index: 1;
  color: #3b3027;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.42),
      rgba(255, 255, 255, 0.03) 44%,
      rgba(40, 15, 55, 0.06) 96%
    ),
    linear-gradient(180deg, #fff2fb 0%, var(--ivory) 64%, #c9a9cf 100%);
  border-left: 1px solid rgba(84, 42, 87, 0.28);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 8px solid var(--ivory-edge);
  box-shadow: inset 0 -14px 18px rgba(80, 55, 22, 0.15);
}

.key.black {
  width: var(--black-key-width);
  height: var(--black-key-height);
  z-index: 4;
  color: rgba(247, 234, 216, 0.78);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.09),
      transparent 32%,
      rgba(255, 255, 255, 0.04) 74%,
      transparent
    ),
    linear-gradient(180deg, #171022 0%, var(--ebony) 72%, #020105 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 8px solid var(--ebony-edge);
  border-radius: 0 0 5px 5px;
  box-shadow:
    0 7px 9px rgba(0, 0, 0, 0.54),
    inset 0 -10px 12px rgba(0, 0, 0, 0.54);
}

.key.white.is-down {
  transform: translateY(5px);
  filter: saturate(1.18) brightness(1.05);
  box-shadow:
    inset 0 -6px 12px rgba(76, 32, 83, 0.3),
    0 0 26px rgba(255, 105, 199, 0.28);
}

.key.black.is-down {
  transform: translateY(4px);
  filter: brightness(1.25);
  box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(255, 67, 188, 0.3);
}

.pedal-rail {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr 88px 1fr;
  align-items: start;
  gap: 18px;
  padding: 12px 20px 0;
  background:
    linear-gradient(180deg, rgba(255, 105, 199, 0.14), transparent), #030303;
}

.pedal-rail span:first-child,
.pedal-rail span:last-child {
  height: 1px;
  margin-top: 9px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 183, 223, 0.48),
    transparent
  );
}

.pedal-plate {
  height: 28px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(180deg, #ffd8f2, #9e4284);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.42);
}

.sample-credit,
.artistic-credit {
  margin: 12px auto 0;
  max-width: 780px;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.4;
}

.sample-credit a,
.artistic-credit a {
  color: rgb(255, 209, 239);
  text-decoration-color: rgba(255, 105, 199, 0.42);
  text-underline-offset: 3px;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 720ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
  animation-delay: 90ms;
}

.delay-2 {
  animation-delay: 180ms;
}

.delay-3 {
  animation-delay: 270ms;
}

.delay-4 {
  animation-delay: 360ms;
}

.sample-overlay,
.sample-credit,
.artistic-credit,
.home-planet {
  text-align: center;
}

footer {
  padding: 0 0 25px;

  .home-planet {
    font-size: 20px;
    display: inherit;
    font-family: "Inter", sans-serif;
    font-weight: 300;
    color: var(--bone);
    text-align: center;
    text-decoration: none;
  }
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  :root {
    --white-key-width: 23px;
    --black-key-width: 15px;
    --white-key-height: 220px;
    --black-key-height: 138px;
  }

  .console-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    align-items: center;
  }
}

@media (max-width: 720px) {
  :root {
    --white-key-width: 20px;
    --black-key-width: 13px;
    --white-key-height: 204px;
    --black-key-height: 128px;
  }

  .stage {
    width: min(100% - 18px, 680px);
    padding-top: 18px;
  }

  .headband {
    align-items: start;
    flex-direction: column;
    min-height: 0;
  }

  h1 {
    font-size: 2.45rem;
  }

  .transport {
    justify-items: start;
    width: 100%;
  }

  .status-strip {
    justify-content: start;
  }

  .console-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .fallboard {
    align-items: start;
    flex-direction: column;
    justify-content: center;
    padding: 9px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .key,
  .ignition {
    transition: none;
  }
}
