:root {
  --bg: #0c1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f8fbff;
  --muted: #aab5ca;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-3: #f97316;
  --success: #34d399;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.4), transparent 34rem),
    radial-gradient(circle at 80% 12%, rgba(6, 182, 212, 0.32), transparent 32rem),
    radial-gradient(circle at 50% 100%, rgba(249, 115, 22, 0.2), transparent 28rem),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -46% 34%;
  height: 300px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(6, 182, 212, 0.2));
  filter: blur(60px);
  transform: rotate(-7deg);
}

.topbar,
.nav,
.hero-grid,
.workspace {
  position: relative;
  z-index: 1;
}

.topbar,
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 18px;
  padding: 0 4px;
}

.topbar .brand span {
  font-size: 0.9rem;
}

.brand,
.nav-pills,
.flow-strip,
.actions,
.metrics,
.script-heading {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  color: white;
  font-weight: 800;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px rgba(6, 182, 212, 0.26);
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.pill,
.section-kicker,
label small {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav-pills {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pill,
.state-dot {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
}

.pill.good {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}

.pill.warn {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 26px;
  padding: 72px 10px 12px;
}

.eyebrow,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.eyebrow {
  color: #c4b5fd;
  margin-bottom: 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.hero-copy p {
  max-width: 660px;
  color: #dbe5f7;
  font-size: 1.08rem;
  line-height: 1.7;
}

.flow-strip {
  width: fit-content;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 16, 32, 0.42);
}

.flow-strip span {
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ecf3ff;
  font-weight: 700;
  font-size: 0.88rem;
}

.flow-strip i {
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.hero-card {
  min-height: 420px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.06);
}

.record {
  position: relative;
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, #fff 0 8px, transparent 9px),
    repeating-radial-gradient(circle, rgba(255,255,255,.22) 0 2px, transparent 3px 16px),
    linear-gradient(135deg, #171b33, #050714);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px rgba(0, 0, 0, 0.42);
  animation: spin 12s linear infinite;
}

.record-ring {
  width: 70px;
  height: 70px;
  border: 18px solid rgba(139, 92, 246, 0.8);
  border-radius: 50%;
}

.record-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(48px, -34px);
  border-radius: 50%;
  background: var(--accent-2);
}

.wave {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 70px;
}

.wave span {
  width: 8px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  animation: bounce 1.1s ease-in-out infinite;
}

.wave span:nth-child(2n) { animation-delay: .1s; height: 44px; }
.wave span:nth-child(3n) { animation-delay: .22s; height: 58px; }
.wave span:nth-child(4n) { animation-delay: .32s; height: 36px; }

.mini-stat {
  width: min(300px, 88%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(12, 16, 32, 0.52);
}

.mini-stat span,
.mini-stat strong {
  display: block;
}

.mini-stat span {
  color: var(--muted);
  margin-bottom: 4px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 20px;
  margin-top: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
  color: #e8eefb;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  outline: none;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(5, 7, 20, 0.48);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: rgba(6, 182, 212, 0.78);
  background: rgba(5, 7, 20, 0.72);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.actions {
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

button {
  border: 0;
  border-radius: 15px;
  padding: 12px 15px;
  color: white;
  font-weight: 800;
  transition: transform 0.18s, filter 0.18s, opacity 0.18s;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 15px 35px rgba(6, 182, 212, 0.2);
}

.publish-button {
  background: linear-gradient(135deg, var(--accent-3), #ec4899);
  box-shadow: 0 15px 35px rgba(249, 115, 22, 0.18);
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid var(--line);
}

.ghost-button.small {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.state-dot {
  color: #dbeafe;
  font-size: 0.84rem;
  font-weight: 800;
}

.state-dot.busy {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.34);
}

.state-dot.done {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.34);
}

.state-dot.error {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.34);
}

.metrics {
  gap: 12px;
  margin-bottom: 16px;
}

.metrics > div {
  flex: 1;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5, 7, 20, 0.38);
}

.metrics span,
.metrics strong {
  display: block;
}

.metrics span {
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.metrics strong {
  font-size: 1.38rem;
  letter-spacing: -0.04em;
}

.audio-card,
.script-card,
.log-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 17px;
  background: rgba(5, 7, 20, 0.38);
  margin-top: 14px;
}

.audio-card h3 {
  margin-bottom: 12px;
}

audio {
  width: 100%;
}

.hidden {
  display: none;
}

.script-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  color: #dbe5f7;
  font-size: 0.9rem;
  line-height: 1.6;
}

.log-card ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.log-card li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbe5f7;
  font-size: 0.9rem;
}

.log-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

@keyframes bounce {
  0%, 100% { transform: scaleY(0.62); opacity: 0.72; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

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

  .hero-grid {
    padding-top: 46px;
  }

  .hero-card {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 9px;
  }

  .hero,
  .panel {
    border-radius: 22px;
    padding: 16px;
  }

  .topbar,
  .nav,
  .panel-heading,
  .metrics {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 3.2rem;
  }

  .flow-strip {
    border-radius: 22px;
  }

  .flow-strip i {
    display: none;
  }
}
