:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: rgba(19, 23, 28, 0.82);
  --panel-solid: #12161b;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #8c949d;
  --text: #f2f0e9;
  --accent: #d8f36a;
  --accent-soft: rgba(216, 243, 106, 0.12);
  --pass: #8adf9c;
  --warn: #f1c86b;
  --fail: #ff776f;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: var(--sans);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .075;
  pointer-events: none;
}

.ambient-one { top: -18rem; right: -10rem; background: var(--accent); }
.ambient-two { bottom: -26rem; left: -15rem; background: #5e82ff; }

.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 86px 0 72px; }

.hero { max-width: 780px; margin: 0 auto 48px; text-align: center; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  margin-bottom: 22px;
}

.brand-mark span { width: 3px; border-radius: 10px; background: var(--accent); }
.brand-mark span:nth-child(1), .brand-mark span:nth-child(5) { height: 10px; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(4) { height: 21px; }
.brand-mark span:nth-child(3) { height: 30px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .86;
}

h1 em { color: var(--accent); font-weight: 400; }

.hero-copy {
  max-width: 520px;
  margin: 0 auto;
  color: #afb5bb;
  font-size: 17px;
  line-height: 1.65;
}

.upload-panel, .work-panel, .results { width: min(100%, 980px); margin-inline: auto; }

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 310px;
  padding: 42px;
  overflow: hidden;
  border: 1px dashed rgba(216, 243, 106, .42);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(216,243,106,.055), rgba(255,255,255,.018));
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .3;
  background: radial-gradient(circle at 50% 0%, rgba(216,243,106,.18), transparent 43%);
  pointer-events: none;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging {
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(216,243,106,.095), rgba(255,255,255,.025));
  outline: none;
  transform: translateY(-2px);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  border: 1px solid rgba(216, 243, 106, .22);
  border-radius: 50%;
  background: var(--accent-soft);
}

.drop-icon svg { width: 28px; fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.drop-zone h2 { margin-bottom: 8px; font-size: 22px; font-weight: 620; letter-spacing: -.02em; }
.drop-zone p { margin-bottom: 0; color: var(--muted); }
.browse { color: var(--text); border-bottom: 1px solid var(--accent); }
.drop-zone .formats { margin-top: 28px; font-size: 10px; font-weight: 700; letter-spacing: .13em; }

.privacy { margin: 16px 0 0; color: #6f767d; font-size: 12px; text-align: center; }
.privacy span { margin-right: 7px; color: var(--accent); font-size: 8px; }

.work-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
}

.file-row { display: flex; align-items: center; gap: 15px; }
.file-badge { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border-radius: 11px; color: var(--accent); background: var(--accent-soft); }
.file-heading { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 5px; }
.file-heading strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.file-heading span { color: var(--muted); font-size: 12px; }
.text-button { border: 0; background: none; color: #bbc1c6; cursor: pointer; font-size: 12px; }
.text-button:hover { color: var(--accent); }

.progress-region { margin-top: 22px; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 9px; color: #a9b0b6; font-size: 12px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #292e34; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 18px rgba(216,243,106,.42); transition: width .25s ease; }
.error-message { margin: 20px 0 0; padding: 14px 16px; border: 1px solid rgba(255,119,111,.25); border-radius: 10px; color: #ffc2be; background: rgba(255,119,111,.08); font-size: 13px; line-height: 1.5; }

.results { margin-top: 24px; }

.verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 34px 38px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--pass);
  border-radius: 18px;
  background: var(--panel-solid);
}

.verdict.warn { border-left-color: var(--warn); }
.verdict.fail { border-left-color: var(--fail); }
.verdict .eyebrow { margin-bottom: 8px; }
.verdict.warn .eyebrow { color: var(--warn); }
.verdict.fail .eyebrow { color: var(--fail); }
.verdict h2 { margin-bottom: 8px; font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -.025em; }
.verdict p:last-child { margin-bottom: 0; color: var(--muted); font-size: 14px; }

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  font-size: 12px;
}
.copy-button:hover { border-color: rgba(216,243,106,.4); color: var(--accent); }
.copy-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.waveform-panel { margin-top: 16px; padding: 28px 30px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.section-heading, .metrics-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h3, .metrics-heading h3 { margin-bottom: 0; font-family: var(--serif); font-size: 25px; font-weight: 400; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.legend-clip { background: var(--fail); }
.legend-gap { background: #6f747a; }
.legend-range { border: 1px solid var(--accent); }
#waveform { display: block; width: 100%; height: 220px; margin-top: 18px; }
.timeline-labels { display: flex; justify-content: space-between; color: #5f666d; font-size: 10px; }

.metrics-heading { margin: 44px 2px 18px; }
.metrics-heading > p { max-width: 240px; margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.metric-card {
  min-height: 260px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.metric-name { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.metric-index { color: #5f666d; font-variant-numeric: tabular-nums; }
.status-pill { padding: 5px 8px; border-radius: 5px; background: rgba(138,223,156,.11); color: var(--pass); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric-card.warn .status-pill { color: var(--warn); background: rgba(241,200,107,.11); }
.metric-card.fail .status-pill { color: var(--fail); background: rgba(255,119,111,.11); }
.metric-value { margin: 27px 0 6px; font-family: var(--serif); font-size: 44px; letter-spacing: -.035em; line-height: 1; }
.metric-target { margin-bottom: 19px; color: #737b83; font-size: 11px; }
.metric-detail { min-height: 38px; margin-bottom: 18px; color: #aeb4ba; font-size: 12px; line-height: 1.55; }
.metric-fix { margin-bottom: 0; padding-top: 16px; border-top: 1px solid var(--line); color: #c8cdd1; font-size: 12px; line-height: 1.55; }
.metric-fix strong { color: var(--accent); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

footer { padding: 0 20px 36px; color: #555d64; font-size: 11px; text-align: center; }
footer span { margin: 0 7px; color: #747c83; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1160px); padding-top: 52px; }
  .hero { margin-bottom: 34px; }
  .drop-zone { min-height: 270px; padding: 28px 18px; }
  .verdict { align-items: flex-start; flex-direction: column; padding: 26px; }
  .copy-button { width: 100%; justify-content: center; }
  .metric-grid { grid-template-columns: 1fr; }
  .section-heading, .metrics-heading { align-items: flex-start; flex-direction: column; }
  .legend { justify-content: flex-start; }
  .metrics-heading > p { text-align: left; }
  .waveform-panel { padding: 24px 18px 18px; }
  .file-row { flex-wrap: wrap; }
  .text-button { margin-left: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
