:root {
  color-scheme: dark;
  --bg: #09111f;
  --bg-elevated: rgba(10, 20, 37, 0.78);
  --panel: rgba(8, 19, 34, 0.82);
  --panel-border: rgba(148, 202, 255, 0.18);
  --text: #eef7ff;
  --muted: #9cb6d2;
  --accent: #6ee7d8;
  --accent-strong: #11c3ad;
  --warm: #f2b15f;
  --danger: #ff8f8f;
  --shadow: 0 32px 90px rgba(2, 10, 20, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(24, 88, 130, 0.46), transparent 38%),
    radial-gradient(circle at bottom right, rgba(15, 158, 143, 0.18), transparent 35%),
    linear-gradient(180deg, #0a1221 0%, #08101d 100%);
  color: var(--text);
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    sans-serif;
  position: relative;
  overflow-x: hidden;
}

.orb {
  position: fixed;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.32;
  pointer-events: none;
}

.orb-left {
  top: -7rem;
  left: -8rem;
  background: rgba(77, 178, 248, 0.35);
}

.orb-right {
  right: -8rem;
  bottom: 2rem;
  background: rgba(54, 215, 176, 0.24);
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.signal-board,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: 36px;
}

.eyebrow,
.panel-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.8rem;
  margin: 0 0 10px;
}

.hero h1,
.panel h2 {
  font-family: "Space Grotesk", "Aptos Display", "Trebuchet MS", sans-serif;
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.7rem, 6vw, 4.9rem);
  max-width: 10ch;
}

.hero-text {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 62ch;
  margin: 18px 0 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-badges span,
.text-card__meta,
.audio-card__badge,
.status-chip {
  border: 1px solid rgba(164, 227, 220, 0.18);
  background: rgba(110, 231, 216, 0.08);
  color: #cbfbf6;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.signal-board {
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  align-items: center;
}

.signal-board__frame {
  width: 100%;
  min-height: 100%;
  border-radius: 24px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(16, 31, 54, 0.92), rgba(9, 18, 31, 0.76)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 18px
    );
  border: 1px solid rgba(242, 177, 95, 0.22);
}

.signal-board__label {
  color: var(--warm);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.signal-lane {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.signal-pill {
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.signal-pill--human {
  background: rgba(138, 197, 255, 0.16);
  color: #c9e5ff;
}

.signal-pill--text {
  background: rgba(242, 177, 95, 0.16);
  color: #ffd7a3;
}

.signal-pill--cant {
  background: rgba(97, 241, 212, 0.16);
  color: #bffef1;
}

.signal-arrow {
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, rgba(156, 182, 210, 0.2), var(--accent));
  position: relative;
}

.signal-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

.signal-wave {
  margin-top: 28px;
  display: flex;
  align-items: end;
  gap: 10px;
  height: 96px;
}

.signal-wave span {
  flex: 1;
  min-width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 177, 95, 0.94), rgba(71, 213, 195, 0.16));
  animation: dance 1.6s ease-in-out infinite;
}

.signal-wave span:nth-child(1) { height: 22%; animation-delay: 0.1s; }
.signal-wave span:nth-child(2) { height: 58%; animation-delay: 0.25s; }
.signal-wave span:nth-child(3) { height: 34%; animation-delay: 0.05s; }
.signal-wave span:nth-child(4) { height: 76%; animation-delay: 0.4s; }
.signal-wave span:nth-child(5) { height: 48%; animation-delay: 0.18s; }
.signal-wave span:nth-child(6) { height: 90%; animation-delay: 0.32s; }
.signal-wave span:nth-child(7) { height: 42%; animation-delay: 0.12s; }
.signal-wave span:nth-child(8) { height: 64%; animation-delay: 0.28s; }

@keyframes dance {
  0%, 100% { transform: scaleY(0.82); opacity: 0.78; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

.panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.top-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.select-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  color: var(--muted);
}

.select-field select {
  appearance: none;
  border: 1px solid rgba(170, 204, 235, 0.22);
  border-radius: 14px;
  background: rgba(7, 17, 30, 0.88);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.panel-note {
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.55;
  margin: 2px 0 0;
}

.text-card,
.audio-card,
.dropzone,
.upload-block {
  border: 1px solid rgba(170, 204, 235, 0.16);
  background: rgba(6, 15, 28, 0.74);
  border-radius: var(--radius-lg);
}

.text-card {
  padding: 20px;
}

.text-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.text-card__label {
  color: #f6dcb5;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.text-card__body {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.78;
  margin: 16px 0 0;
}

.audio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.audio-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.audio-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -20% auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(110, 231, 216, 0.12), transparent 65%);
  pointer-events: none;
}

.audio-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.audio-card__title {
  margin: 0;
  font-size: 1.08rem;
}

.audio-card__description {
  margin: 6px 0 0;
  line-height: 1.55;
  color: var(--muted);
}

.audio-card__button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  color: #04111b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.audio-card__button:hover {
  transform: translateY(-1px);
}

.audio-card__button:disabled {
  opacity: 0.56;
  cursor: default;
}

.audio-card__button--speaker {
  background: linear-gradient(135deg, #f9c77e, #ffb54e);
  box-shadow: 0 14px 34px rgba(255, 181, 78, 0.28);
}

.audio-card__button--robot {
  background: linear-gradient(135deg, #8af3e1, #49d6c2);
  box-shadow: 0 14px 34px rgba(73, 214, 194, 0.26);
}

.audio-card__button img {
  width: 22px;
  height: 22px;
}

.audio-card__status {
  color: var(--muted);
  font-size: 0.92rem;
}

.dropzone {
  position: relative;
  padding: 28px 22px;
  text-align: center;
  border-style: dashed;
}

.dropzone.is-dragover {
  border-color: rgba(110, 231, 216, 0.55);
  background: rgba(7, 19, 34, 0.94);
}

.dropzone__icon {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(110, 231, 216, 0.16), rgba(242, 177, 95, 0.2));
}

.dropzone__icon span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid var(--accent);
}

.dropzone__icon span:nth-child(1) { transform: translateX(-14px); opacity: 0.5; }
.dropzone__icon span:nth-child(2) { transform: translateX(0); }
.dropzone__icon span:nth-child(3) { transform: translateX(14px); opacity: 0.75; }

.dropzone__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.dropzone__hint,
.empty-note,
.status-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.ghost-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.ghost-button {
  margin-top: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.primary-button {
  color: #04111b;
  background: linear-gradient(135deg, #72f3df, #f6c16f);
  box-shadow: 0 20px 44px rgba(74, 214, 194, 0.22);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.46;
  cursor: default;
}

.upload-state {
  margin-top: 18px;
}

.upload-block {
  padding: 18px;
}

.upload-block + .upload-block {
  margin-top: 14px;
}

.upload-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.upload-meta .status-chip {
  background: rgba(242, 177, 95, 0.08);
  color: #ffe3bc;
  border-color: rgba(242, 177, 95, 0.14);
}

.recognized-text {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.7;
  color: #ebf4ff;
  white-space: pre-wrap;
}

.recognized-text--error {
  color: #ffd4d4;
  border: 1px solid rgba(255, 143, 143, 0.2);
  background: rgba(81, 20, 20, 0.24);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.status-text {
  min-height: 1.55em;
}

@media (max-width: 980px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .top-controls,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-note {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 20px;
    padding-bottom: 36px;
  }

  .hero-copy,
  .signal-board,
  .panel {
    padding: 20px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }
}
