/* Aurora DAW Interactive Stem Explorer (v1)
 * Zero webfonts, zero external requests, obsidian-cosmos glass aesthetic matched to
 * aurora-redesign-2026.css and layered cleanly over #skyweb.
 */

.ase-wrap {
  margin-top: 28px;
  margin-bottom: 10px;
}

.ase-deck {
  position: relative;
  border-radius: 20px;
  padding: 24px 26px 22px;
  border: 1px solid rgba(142, 224, 248, 0.24);
  background: linear-gradient(155deg, rgba(13, 27, 52, 0.68), rgba(5, 11, 25, 0.80));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 28px 66px rgba(1, 5, 16, 0.54),
    0 0 0 1px rgba(100, 244, 200, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--ink, #f7faff);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ase-deck::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(100, 244, 200, 0.45),
    rgba(108, 214, 255, 0.45),
    rgba(184, 156, 255, 0.42),
    transparent
  );
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ase-deck.is-playing {
  border-color: rgba(100, 244, 200, 0.62);
  box-shadow:
    0 32px 76px rgba(1, 5, 16, 0.62),
    0 0 0 1px rgba(100, 244, 200, 0.24),
    0 0 48px rgba(100, 244, 200, 0.14),
    inset 0 1px 0 rgba(164, 255, 232, 0.20);
}

.ase-deck.is-playing::before {
  opacity: 1;
}

/* Header: Title + Track Switcher */
.ase-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(142, 224, 248, 0.14);
}

.ase-head {
  min-width: 0;
  max-width: 580px;
}

.ase-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid rgba(100, 244, 200, 0.30);
  background: rgba(10, 24, 46, 0.62);
  color: var(--low, #64f4c8);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ase-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--low, #64f4c8);
  box-shadow: 0 0 8px var(--low, #64f4c8);
  flex: none;
}

.ase-deck.is-playing .ase-kicker-dot {
  animation: ase-pulse 1.2s ease-in-out infinite;
}

@keyframes ase-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.ase-title {
  font-family: var(--display, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-weight: 780;
  font-stretch: 110%;
  font-size: clamp(1.32rem, 2vw, 1.72rem);
  line-height: 1.12;
  letter-spacing: -0.024em;
  color: var(--ink, #f7faff);
  margin: 0 0 6px;
}

.ase-sub {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-3, #b2c6e0);
  margin: 0;
}

/* Track Switcher Pills */
.ase-tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ase-track-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 44px;
  padding: 7px 14px;
  border-radius: 13px;
  border: 1px solid rgba(142, 224, 248, 0.22);
  background: rgba(10, 22, 44, 0.56);
  color: var(--ink-2, #d0def0);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.ase-track-pill b {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.18;
  color: var(--ink, #f7faff);
}

.ase-track-pill span {
  font-size: 0.70rem;
  font-weight: 560;
  color: var(--ink-3, #b2c6e0);
  line-height: 1.2;
}

.ase-track-pill:hover {
  border-color: rgba(100, 244, 200, 0.54);
  background: rgba(16, 36, 66, 0.72);
  transform: translateY(-1px);
}

.ase-track-pill[aria-selected="true"] {
  background: linear-gradient(135deg, #68f7ca 0%, #68dcff 100%);
  border-color: transparent;
  color: #031715;
  box-shadow: 0 8px 24px rgba(100, 244, 200, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.ase-track-pill[aria-selected="true"] b {
  color: #031715;
}

.ase-track-pill[aria-selected="true"] span {
  color: #07332d;
  font-weight: 640;
}

/* Transport + Presets Bar */
.ase-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 18px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(142, 224, 248, 0.12);
}

.ase-play-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid rgba(100, 244, 200, 0.62);
  background: radial-gradient(circle at 35% 30%, rgba(100, 244, 200, 0.20), rgba(10, 26, 46, 0.74));
  color: var(--low, #64f4c8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.36), 0 0 20px rgba(100, 244, 200, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.ase-play-btn:hover {
  transform: scale(1.05);
  border-color: var(--low, #64f4c8);
  color: #ebfff9;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.42), 0 0 28px rgba(100, 244, 200, 0.34);
}

.ase-play-btn:active {
  transform: scale(0.95);
}

.ase-play-btn.is-playing {
  background: linear-gradient(135deg, #68f7ca 0%, #68dcff 100%);
  border-color: transparent;
  color: #031715;
  box-shadow: 0 0 0 4px rgba(100, 244, 200, 0.18), 0 0 30px rgba(100, 244, 200, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.ase-play-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.ase-play-btn .ase-ic-pause,
.ase-play-btn .ase-ic-spin {
  display: none;
}

.ase-play-btn.is-playing .ase-ic-play {
  display: none;
}

.ase-play-btn.is-playing .ase-ic-pause {
  display: block;
}

.ase-play-btn.is-loading .ase-ic-play,
.ase-play-btn.is-loading .ase-ic-pause {
  display: none;
}

.ase-play-btn.is-loading .ase-ic-spin {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(100, 244, 200, 0.28);
  border-top-color: var(--low, #64f4c8);
  animation: ase-spin 0.75s linear infinite;
}

@keyframes ase-spin {
  to { transform: rotate(360deg); }
}

/* Timeline center block */
.ase-timeline-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ase-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 0.77rem;
  color: var(--ink-2, #d0def0);
}

.ase-song-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ase-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(142, 224, 248, 0.18);
  background: rgba(108, 214, 255, 0.08);
  color: var(--ink-2, #d0def0);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.ase-time-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.ase-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 640;
  color: var(--ink, #f7faff);
  white-space: nowrap;
}

.ase-loop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(142, 224, 248, 0.22);
  background: rgba(10, 22, 44, 0.54);
  color: var(--ink-3, #b2c6e0);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 640;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ase-loop-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ase-loop-btn[aria-pressed="true"] {
  border-color: rgba(100, 244, 200, 0.56);
  background: rgba(100, 244, 200, 0.14);
  color: var(--low, #64f4c8);
}

.ase-scrub-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(3, 8, 20, 0.76);
  border: 1px solid rgba(142, 224, 248, 0.18);
  cursor: pointer;
  overflow: hidden;
  touch-action: none;
}

.ase-scrub-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #64f4c8, #6cd6ff, #b89cff);
  box-shadow: 0 0 12px rgba(100, 244, 200, 0.45);
  pointer-events: none;
}

/* Quick Audition Presets */
.ase-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ase-preset-btn {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(142, 224, 248, 0.22);
  background: rgba(10, 22, 44, 0.54);
  color: var(--ink-2, #d0def0);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 640;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.14s ease;
}

.ase-preset-btn:hover {
  border-color: rgba(100, 244, 200, 0.52);
  background: rgba(16, 36, 66, 0.70);
  color: var(--ink, #f7faff);
  transform: translateY(-1px);
}

.ase-preset-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(100, 244, 200, 0.24), rgba(108, 214, 255, 0.20));
  border-color: rgba(100, 244, 200, 0.72);
  color: #eafff8;
  box-shadow: 0 0 18px rgba(100, 244, 200, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* 5-Stem Channel Strips */
.ase-stems {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.ase-stem {
  --stem-color: #64f4c8;
  display: grid;
  grid-template-columns: minmax(144px, 185px) auto minmax(112px, 152px) minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  padding: 9px 12px;
  border-radius: 13px;
  border: 1px solid rgba(142, 224, 248, 0.14);
  background: rgba(6, 14, 30, 0.58);
  transition: border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.ase-stem:hover {
  border-color: rgba(142, 224, 248, 0.30);
  background: rgba(10, 22, 44, 0.66);
}

.ase-stem.is-solo {
  border-color: rgba(255, 217, 130, 0.55);
  background: linear-gradient(135deg, rgba(24, 36, 56, 0.72), rgba(9, 18, 36, 0.74));
}

.ase-stem.is-muted,
.ase-stem.is-dimmed {
  opacity: 0.48;
  background: rgba(4, 10, 22, 0.42);
}

.ase-stem-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ase-stem-led {
  width: 4px;
  height: 30px;
  border-radius: 4px;
  background: var(--stem-color);
  box-shadow: 0 0 10px var(--stem-color);
  flex: none;
  transition: opacity 0.18s ease, box-shadow 0.18s ease;
}

.ase-stem.is-muted .ase-stem-led,
.ase-stem.is-dimmed .ase-stem-led {
  opacity: 0.25;
  box-shadow: none;
}

.ase-stem-labels {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ase-stem-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink, #f7faff);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ase-stem-detail {
  font-size: 0.71rem;
  color: var(--ink-3, #b2c6e0);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mute + Solo Buttons */
.ase-ms {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ase-btn-m,
.ase-btn-s {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(142, 224, 248, 0.22);
  background: rgba(12, 25, 48, 0.68);
  color: var(--ink-2, #d0def0);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}

.ase-btn-m:hover,
.ase-btn-s:hover {
  border-color: rgba(142, 224, 248, 0.56);
  color: var(--ink, #f7faff);
  transform: translateY(-1px);
}

.ase-btn-m[aria-pressed="true"] {
  background: rgba(255, 98, 134, 0.24);
  border-color: rgba(255, 114, 148, 0.85);
  color: #ffc7d4;
  box-shadow: 0 0 14px rgba(255, 98, 134, 0.28);
}

.ase-btn-s[aria-pressed="true"] {
  background: linear-gradient(135deg, #ffd982, #f5b942);
  border-color: transparent;
  color: #1c1200;
  box-shadow: 0 0 16px rgba(255, 217, 130, 0.36);
}

/* Fader + dB Readout */
.ase-fader-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ase-fader {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 68px;
  height: 6px;
  border-radius: 999px;
  background: rgba(142, 224, 248, 0.16);
  outline: none;
  cursor: pointer;
  margin: 0;
}

.ase-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f7faff;
  border: 2px solid var(--stem-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.55), 0 0 8px var(--stem-color);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.ase-fader::-webkit-slider-thumb:hover {
  transform: scale(1.16);
}

.ase-fader::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f7faff;
  border: 2px solid var(--stem-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.55), 0 0 8px var(--stem-color);
  cursor: pointer;
}

.ase-fader:focus-visible {
  outline: 2px solid var(--focus, #ffd982);
  outline-offset: 4px;
}

.ase-db {
  width: 44px;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 620;
  color: var(--ink-3, #b2c6e0);
}

/* Waveform + Meter Lane */
.ase-viz {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ase-wave-box {
  position: relative;
  height: 40px;
  border-radius: 8px;
  background: rgba(3, 8, 20, 0.66);
  border: 1px solid rgba(142, 224, 248, 0.12);
  overflow: hidden;
  cursor: pointer;
}

.ase-wave-box canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ase-meter-rail {
  width: 8px;
  height: 36px;
  border-radius: 999px;
  background: rgba(3, 8, 20, 0.78);
  border: 1px solid rgba(142, 224, 248, 0.14);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.ase-meter-bar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, var(--stem-color) 42%, rgba(100, 244, 200, 0.45) 100%);
  transform-origin: bottom center;
  transform: scaleY(0.06);
  will-change: transform;
}

/* Footer Hints & Status */
.ase-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(142, 224, 248, 0.10);
  font-size: 0.74rem;
  color: var(--ink-3, #b2c6e0);
}

.ase-status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2, #d0def0);
}

.ase-kbd-hints {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ase-kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(142, 224, 248, 0.24);
  background: rgba(12, 25, 48, 0.68);
  color: var(--ink, #f7faff);
  font-size: 0.69rem;
  font-weight: 700;
  margin-right: 3px;
}

.ase-error {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 114, 148, 0.42);
  background: rgba(66, 16, 30, 0.56);
  color: #ffd8e0;
  font-size: 0.80rem;
}

/* Responsive Breakpoints — Zero Overflow down to 390px */
@media (max-width: 980px) {
  .ase-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ase-presets {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .ase-stem {
    grid-template-columns: minmax(130px, 168px) auto minmax(98px, 134px) minmax(0, 1fr);
    gap: 8px 10px;
  }
}

@media (max-width: 720px) {
  .ase-deck {
    padding: 18px 16px 16px;
    border-radius: 16px;
  }
  .ase-tracks {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .ase-track-pill {
    width: 100%;
    padding: 7px 9px;
    min-width: 0;
  }
  .ase-track-pill b,
  .ase-track-pill span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ase-stem {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 8px 10px;
    padding: 10px 11px;
  }
  .ase-stem-info {
    grid-column: 1;
    grid-row: 1;
  }
  .ase-ms {
    grid-column: 2;
    grid-row: 1;
  }
  .ase-fader-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .ase-viz {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .ase-wave-box {
    height: 34px;
  }
  .ase-meter-rail {
    height: 30px;
  }
  .ase-kbd-hints {
    display: none;
  }
}

@media (max-width: 440px) {
  .ase-tracks {
    grid-template-columns: minmax(0, 1fr);
  }
  .ase-track-pill {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
    padding: 6px 12px;
  }
  .ase-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .ase-preset-btn {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ase-deck.is-playing .ase-kicker-dot,
  .ase-play-btn.is-loading .ase-ic-spin {
    animation: none;
  }
  .ase-track-pill,
  .ase-play-btn,
  .ase-preset-btn,
  .ase-btn-m,
  .ase-btn-s,
  .ase-stem {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ase-deck,
  .ase-stem,
  .ase-track-pill,
  .ase-preset-btn,
  .ase-btn-m,
  .ase-btn-s,
  .ase-play-btn {
    border: 1px solid ButtonText;
  }
  .ase-track-pill[aria-selected="true"],
  .ase-preset-btn[aria-pressed="true"],
  .ase-btn-m[aria-pressed="true"],
  .ase-btn-s[aria-pressed="true"],
  .ase-loop-btn[aria-pressed="true"] {
    border: 2px solid Highlight;
  }
}
