/* ============ Аура — ночная сцена ============ */

:root {
  --bg: #07070b;
  --bg-lift: #0d0d14;
  --ink: #e8e2d6;          /* тёплая слоновая кость */
  --ink-dim: #8d8776;
  --ink-faint: #55523f;
  --amber: #d9a441;        /* свет софита */
  --line: rgba(232, 226, 214, 0.12);
  --glow-hue: 38;
  --glow-sat: 70%;
  --glow-strength: 0.35;
  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-ui: "Golos Text", "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  overflow-x: hidden;
}

/* ---------- стартовая завеса ---------- */

.veil {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 90% 60% at 50% 30%, rgba(217, 164, 65, 0.07), transparent 65%),
    var(--bg);
}
.veil-inner { text-align: center; padding: 24px; }
.veil-mark {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 128px);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(217, 164, 65, 0.35);
}
.veil-sub {
  margin-top: 4px;
  color: var(--ink-dim);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 11px;
}
.btn-start {
  margin-top: 48px;
  font-family: var(--font-ui);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(217, 164, 65, 0.55);
  border-radius: 999px;
  padding: 14px 38px;
  cursor: pointer;
  transition: background 0.4s, box-shadow 0.4s;
}
.btn-start:hover {
  background: rgba(217, 164, 65, 0.12);
  box-shadow: 0 0 40px rgba(217, 164, 65, 0.25);
}
.veil-hint { margin-top: 18px; color: var(--ink-faint); font-size: 12px; letter-spacing: 0.06em; }

/* ---------- сцена ---------- */

.stage {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(16px, 4vw, 48px) env(safe-area-inset-bottom);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, var(--bg-lift), transparent 70%),
    var(--bg);
}

/* дышащее свечение сцены */
.glow {
  position: fixed;
  left: 50%; top: 34%;
  width: min(90vw, 900px); height: min(60vh, 520px);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    hsla(var(--glow-hue), var(--glow-sat), 55%, var(--glow-strength)),
    transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  transition: background 2.5s ease;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.07); }
}

/* лёгкое зерно поверх */
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ---------- шапка ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 0;
  position: relative; z-index: 2;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 500; letter-spacing: 0.22em;
  color: var(--ink-dim);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--ink-dim);
  background: rgba(13, 13, 20, 0.6);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6553; transition: background 0.4s, box-shadow 0.4s; }
.dot.on { background: #7fc97a; box-shadow: 0 0 10px rgba(127, 201, 122, 0.8); }
.dot.err { background: #c96a5a; box-shadow: 0 0 10px rgba(201, 106, 90, 0.7); }

/* ---------- центр: сцена и тональность ---------- */

.center {
  position: relative; z-index: 2;
  text-align: center;
  padding: clamp(28px, 6vh, 72px) 0 clamp(16px, 3vh, 36px);
}
.scene-label {
  color: var(--ink-dim);
  font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase;
  min-height: 18px;
}
.scene-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(64px, 13vw, 150px);
  line-height: 1.02;
  letter-spacing: 0.06em;
  text-shadow: 0 0 80px hsla(var(--glow-hue), var(--glow-sat), 60%, 0.45);
  transition: text-shadow 2.5s ease;
}
.key-line {
  margin-top: clamp(10px, 2vh, 22px);
  display: flex; align-items: baseline; justify-content: center; gap: 14px;
}
.key-label {
  color: var(--ink-faint);
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
}
.key-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(24px, 4vw, 40px);
  color: var(--amber);
  transition: color 1s;
}

/* ---------- сцены ---------- */

.scenes {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(8px, 2vh, 20px) 0;
}
.scene-btn {
  position: relative;
  font-family: var(--font-ui);
  background: rgba(13, 13, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  padding: 18px 12px 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.4s, box-shadow 0.4s, background 0.4s;
}
.scene-btn .s-name {
  display: block;
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 0.1em;
}
.scene-btn .s-desc {
  display: block; margin-top: 5px;
  font-size: 11px; color: var(--ink-dim); letter-spacing: 0.05em;
}
.scene-btn .s-tint {
  display: block; height: 2px; border-radius: 2px;
  margin: 12px auto 0; width: 44px;
  background: hsl(var(--h, 38), 65%, 55%);
  opacity: 0.75;
}
.scene-btn:hover { border-color: rgba(232, 226, 214, 0.3); }
.scene-btn.active {
  border-color: hsla(var(--h, 38), 65%, 60%, 0.8);
  box-shadow: 0 0 34px hsla(var(--h, 38), 65%, 55%, 0.22), inset 0 0 24px hsla(var(--h, 38), 65%, 55%, 0.07);
  background: rgba(13, 13, 20, 0.85);
}

/* ---------- пульт ---------- */

.desk {
  position: relative; z-index: 2;
  max-width: 860px; width: 100%;
  margin: 0 auto;
  padding: clamp(8px, 2vh, 18px) 0;
}
.faders { display: flex; gap: clamp(14px, 4vw, 40px); justify-content: center; flex-wrap: wrap; }
.fader { display: flex; align-items: center; gap: 12px; min-width: 220px; flex: 1; max-width: 300px; }
.fader-name {
  width: 84px; text-align: right;
  color: var(--ink-dim); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.fader-val { width: 30px; color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 22px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: var(--line); border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  margin-top: -6px;
  background: var(--ink);
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.55);
  border: none;
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line); border-radius: 2px; }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); border: none;
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.55);
}

/* командная строка */
.command {
  display: flex; gap: 8px;
  margin: 16px auto 0;
  max-width: 640px;
}
#command-input {
  flex: 1;
  font-family: var(--font-ui); font-size: 15px;
  color: var(--ink);
  background: rgba(13, 13, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 22px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
#command-input::placeholder { color: var(--ink-faint); }
#command-input:focus {
  border-color: rgba(217, 164, 65, 0.5);
  box-shadow: 0 0 24px rgba(217, 164, 65, 0.12);
}
.command-go {
  width: 48px; border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13, 13, 20, 0.7);
  color: var(--amber); font-size: 18px; cursor: pointer;
  transition: border-color 0.3s;
}
.command-go:hover { border-color: rgba(217, 164, 65, 0.5); }

.reply {
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
  color: var(--amber);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.6s;
}
.reply.show { opacity: 1; }

/* ---------- демо ---------- */

.demo {
  position: relative; z-index: 2;
  max-width: 860px; width: 100%; margin: 6px auto;
  color: var(--ink-dim);
}
.demo summary {
  cursor: pointer; list-style: none;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  text-align: center; padding: 8px;
  color: var(--ink-faint);
  transition: color 0.3s;
}
.demo summary:hover { color: var(--ink-dim); }
.demo summary::-webkit-details-marker { display: none; }
.demo-body { padding: 10px 0 4px; }
.demo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.btn-ghost {
  font-family: var(--font-ui); font-size: 13px; letter-spacing: 0.08em;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 20px; cursor: pointer;
  transition: border-color 0.3s;
}
.btn-ghost:hover { border-color: rgba(217, 164, 65, 0.5); }
.btn-ghost.playing { border-color: rgba(217, 164, 65, 0.7); color: var(--amber); }
.demo-hint { font-size: 12px; color: var(--ink-faint); }

.keys {
  display: flex; justify-content: center;
  margin-top: 14px;
  position: relative;
  height: 92px;
  user-select: none;
  -webkit-user-select: none;
}
.key-w, .key-b { border-radius: 0 0 5px 5px; cursor: pointer; transition: background 0.12s; }
.key-w {
  width: 34px; height: 92px;
  background: #d8d2c4;
  border: 1px solid #07070b;
}
.key-w.pressed { background: var(--amber); }
.key-b {
  width: 22px; height: 56px;
  background: #1a1a22;
  border: 1px solid #000;
  margin: 0 -11px;
  z-index: 2;
}
.key-b.pressed { background: var(--amber); }

/* ---------- подвал ---------- */

.foot {
  position: relative; z-index: 2;
  margin-top: auto;
  padding: 14px 0 18px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 11px; letter-spacing: 0.05em;
}
.foot code { font-size: 11px; color: var(--ink-dim); }
.foot-sep { margin: 0 8px; }

/* ---------- мобильный ---------- */

@media (max-width: 640px) {
  .scene-name { font-size: clamp(52px, 17vw, 80px); }
  .fader { min-width: 100%; max-width: none; }
  .foot .foot-sep, .foot span:last-child { display: none; }
  .demo-hint { display: none; }
}
