:root {
  color-scheme: dark;
  --bg: #0a0e13;
  --bg-soft: #0f151d;
  --panel: #121a24;
  --panel-2: #16202b;
  --line: #23303f;
  --line-soft: #1b2531;
  --text: #e9eff7;
  --muted: #93a3b8;
  --gold: #f2b95a;
  --gold-soft: #3a2c14;
  --sky: #7cd4fd;
  --green: #6ee7a8;
  --red: #f87171;
  --radius: 16px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(242, 185, 90, 0.12), transparent 60%),
    radial-gradient(900px 480px at 95% 0%, rgba(124, 212, 253, 0.09), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sky);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 212, 253, 0.3);
}

a:hover {
  border-bottom-color: var(--sky);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
}

/* ---------- hero ---------- */

.hero {
  padding: 64px 24px 32px;
}

.hero__inner {
  max-width: 1040px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.lede {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero__links {
  margin: 18px 0 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- layout ---------- */

.layout {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 24px 48px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card--status,
#report-card {
  grid-column: 1 / -1;
}

.card--status {
  padding: 16px 22px;
  gap: 10px;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card__head h2 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.step {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1b1305;
  background: var(--gold);
}

.pill {
  margin-left: auto;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(110, 231, 168, 0.1);
  border: 1px solid rgba(110, 231, 168, 0.35);
}

/* ---------- drop zone ---------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 18px;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop:hover,
.drop:focus-within,
.drop.is-over {
  border-color: var(--gold);
  background: rgba(242, 185, 90, 0.05);
}

.drop__icon {
  font-size: 1.1rem;
  color: var(--gold);
}

.drop__title {
  font-weight: 550;
}

.drop__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.recorder {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.btn.is-recording .dot {
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

/* ---------- reference summary ---------- */

.reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.reference__name {
  margin: 0;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.reference p {
  margin: 0;
}

/* ---------- fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 0;
}

.field--stack {
  gap: 8px;
}

.field span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

select,
textarea,
input[type="range"] {
  font: inherit;
  color: var(--text);
}

select,
textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

textarea {
  resize: vertical;
  min-height: 108px;
  line-height: 1.5;
}

select:focus-visible,
textarea:focus-visible,
input:focus-visible,
.btn:focus-visible,
.drop:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--text);
}

.check input {
  margin-top: 3px;
  accent-color: var(--gold);
}

.check em {
  font-style: normal;
}

.row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 14px;
}

.row--tight {
  grid-template-columns: repeat(auto-fit, minmax(140px, auto));
  justify-content: start;
  gap: 8px;
}

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  border-radius: 10px;
  padding: 11px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(180deg, #f7c974, var(--gold));
  color: #201503;
  border-color: #d59f3f;
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn--ghost {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--gold);
}

.btn--small {
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* ---------- status ---------- */

.status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}

.status__text {
  color: var(--text);
}

.status__text.is-error {
  color: var(--red);
}

.status__pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ffe3a3);
  transition: width 0.2s ease;
}

.progress.is-idle span {
  animation: shimmer 1.4s ease-in-out infinite;
  width: 35%;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* ---------- report ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}

.stats div {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
}

.stats dt {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats dd {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.subhead {
  margin: 4px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.weights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.weights li {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.weights .bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.weights .bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(242, 185, 90, 0.6), var(--gold));
}

.weights .num {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- audio ---------- */

audio {
  width: 100%;
  height: 40px;
}

/* ---------- footer ---------- */

.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 24px 56px;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer p {
  margin: 0 0 6px;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 0.78rem;
}

.noscript {
  padding: 24px;
  text-align: center;
  color: var(--red);
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 44px;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
