:root {
  color-scheme: dark;
  --bg: #07111d;
  --bg-soft: #0f1d2f;
  --panel: rgba(14, 26, 42, 0.78);
  --panel-border: rgba(166, 196, 255, 0.16);
  --text: #f4f7fb;
  --muted: #9fb3cb;
  --record: #ff5470;
  --record-deep: #b42541;
  --play: #34d399;
  --play-deep: #147f55;
  --glow: rgba(98, 168, 255, 0.22);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(77, 125, 255, 0.22), transparent 38%),
    radial-gradient(circle at bottom, rgba(52, 211, 153, 0.12), transparent 26%),
    linear-gradient(180deg, #050b14 0%, var(--bg) 45%, #040910 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 46%, transparent 100%);
  opacity: 0.35;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto auto;
  gap: 1.4rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 980px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding-top: 0.5rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 auto 0.85rem;
  padding: 0.55rem 0.95rem 0.55rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 55%),
    rgba(8, 14, 24, 0.55);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.brand-mark {
  width: 2.65rem;
  height: 2.65rem;
  display: block;
  flex: none;
}

.brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.lede {
  max-width: 46rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.tower-stage {
  display: grid;
  place-items: center;
  padding: 1rem 0 0;
}

.history-stage {
  display: grid;
  gap: 0.85rem;
  padding: 0.15rem 0 0.25rem;
}

.history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.history-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-note {
  margin: 0;
  color: rgba(159, 179, 203, 0.88);
  font-size: 0.9rem;
}

.history-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
}

.history-item {
  position: relative;
  min-height: 74px;
  border-radius: 1rem;
  padding: 0.8rem 4.1rem 0.8rem 0.9rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%),
    rgba(9, 16, 27, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.history-item.is-empty {
  border-style: dashed;
  color: var(--muted);
  place-items: center;
  justify-content: center;
  text-align: center;
  min-height: 74px;
}

.history-item-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.history-item-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.68);
}

.tower {
  position: relative;
  width: min(88vw, 560px);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 1.2rem;
  border-radius: 2rem;
  background: linear-gradient(180deg, rgba(12, 22, 36, 0.76), rgba(8, 14, 24, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.tower::before {
  content: '';
  position: absolute;
  inset: auto 8% 0;
  height: 40%;
  background: radial-gradient(circle at bottom, rgba(94, 177, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.recording-block {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 1.3rem;
  padding: 0.9rem 4.1rem 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(135deg, color-mix(in srgb, var(--block-color) 92%, black), rgba(10, 15, 27, 0.92));
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform-origin: center bottom;
  animation: rise 420ms ease-out both;
}

.recording-block::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 32px color-mix(in srgb, var(--block-color) 34%, transparent);
  pointer-events: none;
}

.block-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.block-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: none;
}

.block-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.block-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
}

.block-chip {
  flex: none;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 16, 27, 0.28);
}

.recording-delete-button {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 84, 112, 0.14);
  color: #ffd6dd;
  border-radius: 999px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.36rem 0.7rem;
  z-index: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    background-color 160ms ease;
}

.recording-delete-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  background: rgba(255, 84, 112, 0.22);
}

.recording-delete-button:active {
  transform: translateY(0);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-button {
  appearance: none;
  border: 0;
  min-width: 160px;
  height: 58px;
  border-radius: 999px;
  padding: 0 1.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: white;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.action-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.action-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.record-button {
  background: linear-gradient(180deg, #ff6a80, var(--record-deep));
}

.play-button {
  background: linear-gradient(180deg, #3ee1a4, var(--play-deep));
}

.status {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.4em;
}

.status strong {
  color: var(--text);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 680px) {
  .app-shell {
    gap: 1rem;
  }

  .brand-lockup {
    gap: 0.65rem;
    padding-inline: 0.75rem;
  }

  .brand-mark {
    width: 2.3rem;
    height: 2.3rem;
  }

  .brand-name {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
  }

  .tower {
    width: 100%;
    padding: 0.9rem;
    border-radius: 1.5rem;
  }

  .action-button {
    min-width: min(100%, 220px);
    width: 100%;
  }
}
