/* =============================================================================
   Piano — kandabatata.com
   Day is the default palette; night lives one attribute away on <html>.
   ============================================================================= */

:root {
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-ui: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  /* day */
  --paper: #f4ece1;
  --paper-2: #ece1d1;
  --panel: #fffdf8;
  --panel-2: #f9f2e6;
  --ink: #1f1a16;
  --muted: #6b5a4b;
  --muted-2: #93806c;
  --line: rgba(60, 42, 28, .14);
  --line-strong: rgba(60, 42, 28, .26);

  --berry: #b3305c;
  --berry-dark: #8b1e44;
  --amber: #c8852b;
  --brass: #b98b3f;

  --cabinet: #221a14;
  --cabinet-2: #140f0b;
  --cabinet-3: #33251a;
  --felt: #7d1f2c;
  --ivory: #fdfaf3;
  --ivory-2: #f2e9d6;
  --ebony: #191512;

  --shadow: 0 34px 64px -44px rgba(48, 32, 18, .8), 0 2px 6px -2px rgba(48, 32, 18, .12);
  --shadow-sm: 0 14px 28px -22px rgba(48, 32, 18, .8);

  --radius: 20px;
  --radius-sm: 13px;
}

html[data-theme="night"] {
  --paper: #0b1017;
  --paper-2: #080c12;
  --panel: #131b25;
  --panel-2: #17222e;
  --ink: #f1ece3;
  --muted: #a3b0bf;
  --muted-2: #7c8a9a;
  --line: rgba(190, 214, 235, .14);
  --line-strong: rgba(190, 214, 235, .26);

  --berry: #ef6f92;
  --berry-dark: #c74f72;
  --amber: #e6a44d;
  --brass: #d6b06a;

  --cabinet: #0f0d0b;
  --cabinet-2: #070605;
  --cabinet-3: #1d1712;
  --felt: #5c1621;
  --ivory: #e7dfd0;
  --ivory-2: #cec4b0;
  --ebony: #0d0b09;

  --shadow: 0 40px 70px -46px rgba(0, 0, 0, .95), 0 2px 8px -2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 16px 30px -24px rgba(0, 0, 0, .95);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: var(--berry); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ backdrop */

.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-staff { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); opacity: .07; }
html[data-theme="night"] .bg-staff { opacity: .1; }

.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.bg-glow--berry {
  width: 46vw; height: 46vw; top: -14vw; left: -10vw;
  background: radial-gradient(circle, rgba(179, 48, 92, .32), transparent 70%);
}
.bg-glow--amber {
  width: 42vw; height: 42vw; bottom: -14vw; right: -10vw;
  background: radial-gradient(circle, rgba(200, 133, 43, .3), transparent 70%);
}
html[data-theme="night"] .bg-glow { opacity: .34; }

.bg-notes { position: absolute; inset: 0; }
.bg-note {
  position: absolute;
  bottom: -8vh;
  color: var(--ink);
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(26px, -60vh, 0) rotate(9deg); }
  100% { transform: translate3d(-14px, -125vh, 0) rotate(-7deg); }
}

.bg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, transparent 45%, rgba(48, 32, 18, .13) 100%);
}
html[data-theme="night"] .bg-vignette {
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(0, 0, 0, .6) 100%);
}

/* --------------------------------------------------------------------- topbar */

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px) 10px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  color: var(--berry);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 34px; height: 34px; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); font-weight: 600;
}

.topnav { display: flex; align-items: center; gap: 8px; }

.icon-btn, .theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, background .3s ease, color .3s ease;
}
.icon-btn:hover, .theme-toggle:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.icon-btn svg, .theme-toggle svg { width: 18px; height: 18px; }
.icon-btn .sound-off { display: none; }
.icon-btn.is-muted .sound-on { display: none; }
.icon-btn.is-muted .sound-off { display: block; }
.icon-btn.is-muted { color: var(--muted-2); }

.theme-icon--moon { display: none; }
html[data-theme="night"] .theme-icon--sun { display: none; }
html[data-theme="night"] .theme-icon--moon { display: block; }

.topnav-link {
  display: inline-flex; align-items: center; height: 42px; padding: 0 15px;
  border-radius: 999px; border: 1px solid transparent;
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.topnav-link:hover { background: var(--panel); border-color: var(--line); text-decoration: none; }

.topnav-sep { width: 1px; height: 24px; background: var(--line-strong); margin: 0 4px; }

.kanda {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.kanda:hover { text-decoration: none; border-color: var(--line-strong); }
.kanda-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--berry); box-shadow: 0 0 0 3px rgba(179, 48, 92, .16); }

/* --------------------------------------------------------------------- layout */

.wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* -------------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn svg { width: 19px; height: 19px; }
.btn--lg { height: 58px; padding: 0 30px; font-size: 16.5px; border-radius: 999px; }
.btn--primary {
  color: #fff5f8;
  border-color: transparent;
  background: linear-gradient(135deg, var(--berry) 0%, #d3496f 48%, var(--amber) 100%);
  box-shadow: 0 20px 40px -22px rgba(179, 48, 92, .75), 0 2px 6px -2px rgba(0, 0, 0, .16);
}
.btn--primary:hover { box-shadow: 0 26px 48px -22px rgba(179, 48, 92, .85); }
.btn--ghost { background: var(--panel); }

/* ---------------------------------------------------------------------- hero */

.home { padding-bottom: 40px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(14px, 3vw, 34px) 0 10px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 11.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(200, 133, 43, .18); }

.hero-title {
  margin: 22px 0 18px;
  font-size: clamp(38px, 4.9vw, 62px);
  line-height: 1.03;
  letter-spacing: -.028em;
}
.hero-title-accent {
  display: inline-block;
  background: linear-gradient(120deg, var(--berry) 0%, #cf5a7f 42%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 52ch;
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--muted);
  line-height: 1.62;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  margin: 0; padding: 0; list-style: none;
  font-size: 13.5px; color: var(--muted-2);
}
.hero-facts strong { color: var(--ink); font-weight: 700; }

/* ---------------------------------------------------------------- the stage */

.stage {
  position: relative;
  perspective: 1400px;
  perspective-origin: 50% 42%;
  padding: 26px 0 44px;
}

.stage-glow {
  position: absolute; left: 8%; right: 8%; top: 6%; height: 60%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(200, 133, 43, .28), transparent 68%);
  filter: blur(30px);
  pointer-events: none;
}

.stage-plate {
  position: relative;
  border-radius: 22px;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, var(--cabinet-3) 0%, var(--cabinet) 46%, var(--cabinet-2) 100%);
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow:
    0 44px 70px -42px rgba(20, 12, 6, .75),
    inset 0 1px 0 rgba(255, 255, 255, .13);
}

.plate-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 12px;
  font-size: 10px; letter-spacing: .26em; text-transform: uppercase;
  color: rgba(240, 226, 202, .5);
}
.plate-brand { font-weight: 700; letter-spacing: .3em; }
.plate-model { color: var(--brass); letter-spacing: .2em; }

.stage-tilt {
  position: relative;
  transform: rotateX(37deg) rotateZ(-1.4deg);
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
}
.stage-tilt::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 100%; height: 22px;
  transform: rotateX(-37deg);
  transform-origin: top center;
  background: linear-gradient(180deg, #1b140f, #0b0806 70%);
  border-radius: 0 0 10px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.stage .stage-kb {
  position: relative;
  height: clamp(150px, 17vw, 208px);
  border-radius: 4px 4px 9px 9px;
  padding: 7px 7px 0;
  background: linear-gradient(180deg, #0d0a08 0%, #1b1511 100%);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, .65);
  overflow: hidden;
}

.stage-shadow {
  position: absolute; left: 6%; right: 6%; bottom: 14px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(30, 18, 8, .38), transparent 72%);
  filter: blur(8px);
  pointer-events: none;
}
html[data-theme="night"] .stage-shadow {
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, .6), transparent 72%);
}


/* floating notes that lift off pressed keys */
.stage-notes { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.float-note {
  position: absolute;
  color: var(--amber);
  font-size: 22px;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 6px 14px rgba(200, 133, 43, .35);
  animation: floatUp 2.4s cubic-bezier(.18, .7, .3, 1) forwards;
}
html[data-theme="night"] .float-note { color: #f0b96a; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.6) rotate(0deg); }
  18%  { opacity: .95; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -130px) scale(1.15) rotate(var(--spin, 0deg)); }
}

/* the little "now playing" chip */
.tune-chip {
  position: absolute;
  left: 2px; bottom: 0;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.tune-chip:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tune-eq { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 20px; }
.tune-eq i {
  display: block; width: 3px; height: 6px; border-radius: 2px;
  background: var(--berry);
  opacity: .45;
  transition: height .2s ease;
}
.tune-chip.is-live .tune-eq i { animation: eq 1.05s ease-in-out infinite; opacity: .95; }
.tune-chip.is-live .tune-eq i:nth-child(2) { animation-delay: .18s; background: var(--amber); }
.tune-chip.is-live .tune-eq i:nth-child(3) { animation-delay: .36s; }
.tune-chip.is-live .tune-eq i:nth-child(4) { animation-delay: .54s; background: var(--amber); }
@keyframes eq {
  0%, 100% { height: 5px; }
  50% { height: 19px; }
}
.tune-chip-text { display: grid; line-height: 1.2; text-align: left; }
.tune-chip-title { font-size: 13.5px; font-weight: 700; }
.tune-chip-sub { font-size: 11px; letter-spacing: .04em; color: var(--muted-2); }
.tune-chip.is-idle { animation: chipPulse 2.6s ease-in-out infinite; }
@keyframes chipPulse {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 18px 36px -18px rgba(179, 48, 92, .55), 0 0 0 6px rgba(179, 48, 92, .08); }
}

/* --------------------------------------------------------------------- cards */

.home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  margin-top: clamp(18px, 3vw, 30px);
}
.card {
  padding: 22px 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-num {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: .2em;
  color: var(--berry); margin-bottom: 12px;
}
.card-title { font-size: 19px; margin-bottom: 8px; }
.card-body { font-size: 14px; color: var(--muted); line-height: 1.6; }
.card-body code {
  font-size: 12px; padding: 1px 5px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; color: var(--ink);
}

/* ============================================================== the keyboard */

.keyboard {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.keys-white, .keys-black { position: absolute; inset: 0; }
.keys-black { pointer-events: none; }
.keys-black .key { pointer-events: auto; }

.key {
  position: absolute;
  top: 0;
  cursor: pointer;
  transform-origin: top center;
  will-change: transform;
}

.key-white {
  height: 100%;
  border-radius: 2px 2px 6px 6px;
  background: linear-gradient(180deg, #ffffff 0%, var(--ivory) 34%, var(--ivory-2) 88%, #e6dcc6 100%);
  box-shadow:
    inset -1px 0 0 rgba(60, 44, 28, .28),
    inset 0 -7px 0 rgba(60, 44, 28, .06),
    inset 0 2px 0 rgba(255, 255, 255, .9),
    0 3px 4px rgba(20, 12, 4, .22);
  transition: transform .07s ease, background .1s ease, box-shadow .12s ease, filter .12s ease;
}
.key-white.is-c .key-label { opacity: 1; }

.key-black {
  height: 61%;
  z-index: 3;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(180deg, #3a332d 0%, var(--ebony) 42%, #24201c 100%);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, .07),
    inset -1px 0 0 rgba(0, 0, 0, .5),
    inset 0 -4px 0 rgba(255, 255, 255, .06),
    0 5px 7px rgba(0, 0, 0, .42);
  transition: transform .07s ease, background .1s ease, box-shadow .12s ease;
}

.key-label {
  position: absolute;
  left: 0; right: 0; bottom: 7px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(70, 52, 34, .42);
  pointer-events: none;
  opacity: .85;
}
.keyboard.no-labels .key-label { display: none; }

/* pressed --------------------------------------------------------------- */
.key-white.is-down,
.key-white.is-playing {
  transform: translateY(2px) scaleY(.984);
  background: linear-gradient(180deg, #f7e9cf 0%, #efdcb8 60%, #e4cfa6 100%);
  box-shadow:
    inset -1px 0 0 rgba(60, 44, 28, .26),
    inset 0 6px 14px rgba(90, 62, 30, .18),
    0 1px 2px rgba(20, 12, 4, .2);
}
.key-black.is-down,
.key-black.is-playing {
  transform: translateY(3px) scaleY(.96);
  background: linear-gradient(180deg, #47403a 0%, #211d19 55%, #100d0b 100%);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .05), 0 2px 4px rgba(0, 0, 0, .5);
}

/* the tune playing itself ------------------------------------------------ */
.key.is-melody { animation: keyGlow 1.1s ease-out; }
.key-white.is-melody { background: linear-gradient(180deg, #fff6e2 0%, #ffecc4 46%, #f6dda9 100%); }
.key-black.is-melody { background: linear-gradient(180deg, #6a5636 0%, #35291a 60%, #1a140e 100%); }
@keyframes keyGlow {
  0% { filter: brightness(1.06); }
  100% { filter: brightness(1); }
}

/* ============================================================ play page ===== */

.page-play .play { padding-bottom: 46px; animation: enterPage .62s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes enterPage {
  from { opacity: 0; transform: translateY(16px) scale(.994); }
  to { opacity: 1; transform: none; }
}

.console {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  padding: 14px 18px;
  margin: 8px 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.console-group { display: flex; align-items: center; gap: 12px; }
.console-group--sliders { gap: 20px; margin-left: auto; }
.console-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-2);
}

.pills {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.pill {
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.pill:hover { color: var(--ink); }
.pill.is-on {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 6px 14px -10px rgba(48, 32, 18, .9), inset 0 0 0 1.5px var(--berry);
}

.slider { display: inline-flex; align-items: center; gap: 10px; }
.slider-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2);
}
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: clamp(84px, 9vw, 128px);
  height: 22px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 999px;
  background: linear-gradient(90deg, var(--berry), var(--amber));
  opacity: .85;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  margin-top: -5px;
  background: var(--panel);
  border: 2px solid var(--berry);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
input[type="range"]::-moz-range-track {
  height: 5px; border-radius: 999px;
  background: linear-gradient(90deg, var(--berry), var(--amber));
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--berry);
}

.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .16s ease;
}
.chip-btn svg { width: 15px; height: 15px; }
.chip-btn:hover { color: var(--ink); transform: translateY(-1px); }
.chip-btn.is-on {
  color: #fff6f8;
  border-color: transparent;
  background: linear-gradient(135deg, var(--berry), var(--amber));
  box-shadow: 0 12px 24px -16px rgba(179, 48, 92, .9);
}
.chip-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ----------------------------------------------------------------- desk / deck */

.deck {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}

.deck-top {
  display: flex; align-items: center; gap: 16px;
  padding: 2px 2px 14px;
}
.deck-left { display: inline-flex; align-items: center; gap: 8px; }
.oct-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease;
}
.oct-btn:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.oct-btn svg { width: 17px; height: 17px; }
.oct-readout {
  min-width: 92px; text-align: center;
  font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--muted);
}

.deck-mid { flex: 1; display: flex; justify-content: center; }
.reading {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--muted-2);
  transition: color .18s ease, transform .18s ease;
}
.reading.is-live { color: var(--berry); transform: scale(1.04); }

.deck-right { display: inline-flex; align-items: center; gap: 8px; }

.rec-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--berry);
  box-shadow: 0 0 0 3px rgba(179, 48, 92, .16);
  transition: border-radius .2s ease;
}
.rec-btn.is-recording { color: var(--berry); border-color: var(--berry); }
.rec-btn.is-recording .rec-dot { border-radius: 2px; animation: recPulse 1.1s ease-in-out infinite; }
@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.86); }
}

/* the cabinet ------------------------------------------------------------ */
.cabinet {
  position: relative;
  border-radius: 15px 15px 20px 20px;
  padding: 12px 12px 14px;
  background: linear-gradient(180deg, var(--cabinet-3) 0%, var(--cabinet) 40%, var(--cabinet-2) 100%);
  box-shadow:
    0 26px 46px -34px rgba(20, 12, 6, .8),
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 -3px 0 rgba(0, 0, 0, .4);
}
.cabinet-felt {
  height: 8px;
  margin: 0 3px 9px;
  border-radius: 4px;
  background: linear-gradient(180deg, #8f2434, var(--felt) 55%, #4c1019);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 4px rgba(0, 0, 0, .4);
}
.cabinet-keys {
  position: relative;
  height: clamp(180px, 24vw, 300px);
}
body.is-sustaining .cabinet-felt { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 14px rgba(200, 133, 43, .55); }
body.is-recording .cabinet { box-shadow: 0 0 0 2px rgba(179, 48, 92, .45), 0 26px 46px -34px rgba(20, 12, 6, .8); }

/* try a tune ------------------------------------------------------------- */
.try {
  margin-top: 14px;
  padding: 16px 18px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow-sm);
}
.try-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.try-title { font-size: 17px; }
.try-sub { font-size: 13px; color: var(--muted-2); }

.try-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.try-btn {
  display: grid; gap: 2px; text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.try-btn:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.try-btn.is-playing {
  border-color: transparent;
  background: linear-gradient(135deg, var(--berry), var(--amber));
  color: #fff6f8;
  box-shadow: 0 16px 30px -20px rgba(179, 48, 92, .95);
}
.try-btn.is-playing .try-meta { color: rgba(255, 246, 248, .78); }
.try-name { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.try-meta { font-size: 11px; color: var(--muted-2); letter-spacing: .02em; }

/* legend ----------------------------------------------------------------- */
.legend {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  padding: 14px 4px 0;
  font-size: 12.5px; color: var(--muted-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-keys { display: inline-flex; gap: 3px; }
kbd {
  display: inline-grid; place-items: center;
  min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px; font-weight: 700;
}
kbd.kbd-wide { min-width: 46px; }
.legend-item--hint { margin-left: auto; font-style: italic; }

.play-note {
  margin: 18px 2px 0;
  font-size: 13px; color: var(--muted-2);
}

/* --------------------------------------------------------------------- footer */

.foot {
  position: relative; z-index: 2;
  padding: 26px clamp(16px, 4vw, 48px) 30px;
}
.foot-line {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px;
  max-width: 1280px; margin: 0 auto;
  font-size: 12.5px; color: var(--muted-2);
}
.foot-brand a { font-weight: 700; color: var(--berry); }
.foot-note { color: var(--muted-2); }

/* ------------------------------------------------------------------ leaving */

body.is-leaving { overflow: hidden; }
body.is-leaving .home,
body.is-leaving .topbar,
body.is-leaving .foot {
  animation: leavePage .52s cubic-bezier(.4, 0, .7, .2) forwards;
}
@keyframes leavePage {
  from { opacity: 1; transform: none; filter: blur(0); }
  to { opacity: 0; transform: translateY(-18px) scale(1.02); filter: blur(6px); }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .hero-copy { max-width: 640px; }
  .stage { max-width: 640px; margin: 0 auto; width: 100%; }
  .home-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .console-group--sliders { margin-left: 0; }
}

@media (max-width: 900px) {
  .home-cards { grid-template-columns: 1fr 1fr; }
  .try-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console { gap: 12px 18px; }
  .deck-mid { order: 2; width: auto; margin-left: auto; justify-content: flex-end; }
  .reading { font-size: 19px; }
  .deck-top { flex-wrap: wrap; }
  .deck-right { margin-left: auto; }
}

@media (max-width: 560px) {
  .kanda { display: none; }
  .topnav { gap: 6px; }
}

@media (max-width: 700px) {
  .topbar { padding: 14px 16px 6px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-name { font-size: 19px; }
  .brand-sub { display: none; }
  .icon-btn-label, .theme-toggle-label { display: none; }
  .icon-btn, .theme-toggle { padding: 0 12px; }
  .topnav-link { display: none; }
  .topnav-sep { display: none; }
  .kanda { padding: 0 13px; font-size: 12.5px; }

  .hero { padding-top: 6px; }
  .hero-title { font-size: clamp(34px, 9vw, 46px); }
  .hero-facts { gap: 6px 18px; font-size: 12.5px; }
  .btn--lg { height: 52px; padding: 0 22px; font-size: 15px; }
  .hero-actions .btn { flex: 1 1 auto; }

  .stage { padding: 16px 0 40px; }
  .stage-tilt { transform: rotateX(26deg) rotateZ(-1deg); }
  .stage .stage-kb { height: clamp(120px, 30vw, 156px); }
  .tune-chip { left: 0; bottom: -4px; padding: 8px 14px 8px 12px; }
  .tune-chip-title { font-size: 12.5px; }

  .home-cards { grid-template-columns: 1fr; }
  .card { padding: 18px 18px 20px; }
  .try { padding: 14px; }
  .try-list { grid-template-columns: 1fr 1fr; gap: 8px; }
  .try-btn { padding: 9px 11px; }
  .try-name { font-size: 13px; }

  .console { padding: 12px; }
  .console-group { width: 100%; }
  .console-group--toggles { justify-content: flex-start; }
  .pills {
    width: 100%;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    border-radius: 16px;
  }
  .pill { padding: 9px 8px; font-size: 12.5px; text-align: center; border-radius: 12px; }
  .console-group--sliders { flex-wrap: wrap; }
  .slider { flex: 1 1 140px; }
  input[type="range"] { width: 100%; }

  .deck { padding: 10px 10px 12px; }
  .cabinet { padding: 8px 7px 10px; border-radius: 12px 12px 16px 16px; }
  .cabinet-keys { height: clamp(150px, 40vw, 210px); }
  .legend { font-size: 11.5px; gap: 6px 14px; }
  .legend-item--hint { margin-left: 0; width: 100%; }
  .oct-readout { min-width: 78px; font-size: 11.5px; }
  .rec-btn { padding: 0 12px; }
  .chip-btn { padding: 0 12px; }
  .foot-line { flex-direction: column; }
}

@media (max-width: 420px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .deck-right { gap: 6px; width: 100%; }
  .deck-right .rec-btn, .deck-right .chip-btn { flex: 1; justify-content: center; }
  .oct-btn { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bg-note { display: none; }
}
