@import url("./tokens.css");

:root {
  --ink: var(--color-ink);
  --quiet: var(--color-muted);
  --paper: var(--color-demo-ground);
  --line: var(--color-hairline);
  --deep: var(--color-navy);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

:focus-visible { outline: var(--focus-ring-width) solid color-mix(in srgb, var(--accent) 55%, var(--color-white)); outline-offset: 3px; }

.checker-shell {
  min-height: 100vh;
  overflow: clip;
  overflow-anchor: none;
  animation: checker-page-fade 900ms cubic-bezier(.16, 1, .3, 1) both;
  background-color: var(--color-demo-ground);
  background-repeat: no-repeat;
  background-image:
    radial-gradient(820px 520px at 14% 4%, rgba(255, 255, 255, 0.98), transparent 70%),
    radial-gradient(560px 340px at 72% 9%, rgba(255, 255, 255, 0.72), transparent 70%),
    radial-gradient(700px 430px at 30% 17%, rgba(255, 255, 255, 0.92), transparent 70%),
    radial-gradient(620px 380px at 86% 23%, rgba(255, 255, 255, 0.8), transparent 70%),
    radial-gradient(760px 470px at 10% 30%, rgba(255, 255, 255, 0.96), transparent 70%),
    radial-gradient(660px 400px at 55% 37%, rgba(255, 255, 255, 0.76), transparent 70%),
    radial-gradient(700px 430px at 88% 44%, rgba(255, 255, 255, 0.88), transparent 70%),
    radial-gradient(780px 480px at 22% 50%, rgba(255, 255, 255, 0.94), transparent 70%),
    radial-gradient(600px 370px at 66% 57%, rgba(255, 255, 255, 0.78), transparent 70%),
    radial-gradient(720px 440px at 12% 64%, rgba(255, 255, 255, 0.86), transparent 70%),
    radial-gradient(680px 420px at 80% 70%, rgba(255, 255, 255, 0.9), transparent 70%),
    radial-gradient(740px 450px at 38% 77%, rgba(255, 255, 255, 0.82), transparent 70%),
    radial-gradient(620px 380px at 90% 84%, rgba(255, 255, 255, 0.76), transparent 70%),
    radial-gradient(700px 430px at 20% 91%, rgba(255, 255, 255, 0.9), transparent 70%),
    radial-gradient(720px 440px at 78% 14%, rgba(197, 231, 255, 0.42), transparent 70%),
    radial-gradient(640px 400px at 20% 25%, rgba(186, 198, 255, 0.22), transparent 70%),
    radial-gradient(700px 430px at 74% 34%, rgba(161, 216, 255, 0.28), transparent 70%),
    radial-gradient(680px 420px at 15% 45%, rgba(197, 231, 255, 0.32), transparent 70%),
    radial-gradient(720px 440px at 60% 62%, rgba(186, 198, 255, 0.24), transparent 70%),
    radial-gradient(700px 430px at 35% 88%, rgba(161, 216, 255, 0.2), transparent 70%),
    linear-gradient(180deg, var(--color-demo-ground) 0%, color-mix(in srgb, var(--color-demo-ground) 65%, var(--color-demo-ground-deep)) 35%, color-mix(in srgb, var(--color-demo-ground) 35%, var(--color-demo-ground-deep)) 70%, var(--color-demo-ground-deep) 100%);
}

.checker-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 116px 0 100px;
  animation: checker-content-float 900ms cubic-bezier(.16, 1, .3, 1) both;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, .88fr);
  align-items: center;
  gap: clamp(44px, 7vw, 110px);
  padding: 44px 0 96px;
}

.hero-copy { max-width: 620px; }

.kicker {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .075em;
}

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

h1 {
  max-width: 14ch;
  margin-bottom: 24px;
  color: var(--deep);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(45px, 5.25vw, 74px);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: .98;
}

.lede {
  max-width: 54ch;
  margin-bottom: 0;
  color: var(--quiet);
  font-size: 17px;
  line-height: 1.68;
}

.analysis-card {
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 30px;
  background: var(--deep);
  box-shadow: 0 24px 58px rgba(18, 36, 49, .18);
  color: var(--color-white);
}

.analysis-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
    radial-gradient(360px 210px at 75% 14%, color-mix(in srgb, var(--accent) 58%, transparent), transparent 70%);
  background-size: 22px 22px, 22px 22px, auto;
  content: '';
}

.analysis-card::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  border-radius: inherit;
  place-items: center;
  background: rgba(221, 228, 232, .88);
  color: var(--color-navy);
  content: '';
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.025em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.analysis-card.is-file-dragging::after {
  content: 'Upload audio';
  opacity: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 0;
  color: rgba(246,250,248,.63);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
}

.microphone-status {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.live-dot {
  --status-ring: rgba(143,230,187,.12);
  --status-glow: rgba(143,230,187,.6);
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 4px var(--status-ring), 0 0 8px var(--status-glow);
  animation: microphone-status-pulse 1.8s ease-in-out infinite;
}

.microphone-status[data-available="unknown"] .live-dot {
  --status-ring: rgba(190,202,213,.12);
  --status-glow: rgba(190,202,213,.4);
  background: var(--color-line);
  animation: none;
}

.microphone-status[data-available="false"] .live-dot {
  --status-ring: rgba(255,113,113,.14);
  --status-glow: rgba(255,113,113,.68);
  background: var(--color-danger);
}

.drop-zone {
  display: grid;
  min-height: 330px;
  padding: 28px;
  place-items: center;
}

.input-state { width: 100%; text-align: center; }

.mic-disc {
  display: grid;
  width: 104px;
  height: 104px;
  margin: 0 auto 24px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  background: rgba(255,255,255,.075);
  color: var(--color-white);
  transition: background-color 180ms ease, transform 180ms ease;
}

.mic-disc svg { width: 37px; height: 37px; fill: currentColor; }
.mic-disc:hover { transform: scale(1.035); background: rgba(255,255,255,.13); }

.input-state h2 { margin-bottom: 9px; font-size: 20px; letter-spacing: -.035em; }

.input-note {
  max-width: 31ch;
  margin: 0 auto 22px;
  color: rgba(246,250,248,.69);
  font-size: 13px;
  line-height: 1.6;
}

.record-button,
.upload-button,
.result-cta,
.try-again {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.record-button {
  min-width: 194px;
  padding: 13px 20px;
  background: var(--color-surface);
  color: var(--color-navy);
}

.record-button:hover { background: var(--color-white); }

.or { display: block; margin: 15px 0 10px; color: rgba(246,250,248,.48); font-size: 11px; }

.upload-button {
  padding: 5px 2px;
  border-bottom: 1px solid rgba(246,250,248,.55);
  border-radius: 0;
  background: transparent;
  color: rgba(246,250,248,.86);
  font-size: 12px;
}

.upload-button:hover { color: var(--color-white); }

.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.meter { display: flex; height: 42px; align-items: center; justify-content: center; gap: 4px; margin: 0 auto 22px; }
.meter span { width: 5px; height: 8px; border-radius: 999px; background: var(--accent); animation: meter .9s ease-in-out infinite alternate; }
.meter span:nth-child(2) { height: 18px; animation-delay: .12s; }
.meter span:nth-child(3) { height: 30px; animation-delay: .28s; }
.meter span:nth-child(4) { height: 20px; animation-delay: .42s; }
.meter span:nth-child(5) { height: 12px; animation-delay: .54s; }

.recording-time { margin: 0 0 8px; font-variant-numeric: tabular-nums; font-size: 36px; font-weight: 750; letter-spacing: -.055em; }
.recording-prompt { margin: 0 0 21px; color: rgba(246,250,248,.72); font-size: 13px; }

.record-stop {
  padding: 12px 20px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  background: transparent;
  color: var(--color-white);
  font-weight: 750;
}

.record-stop:hover { background: rgba(255,255,255,.1); }

.loading-ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.processing-copy { margin: 0; color: rgba(246,250,248,.66); font-size: 13px; }

.result-state { padding: 8px 2px 2px; }

.result-label { margin: 0 0 12px; color: rgba(246,250,248,.64); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.result-value { margin: 0; color: var(--color-white); font-family: 'Playfair Display', Georgia, serif; font-size: clamp(58px, 7vw, 84px); font-weight: 600; letter-spacing: -.07em; line-height: .95; }
.result-state.has-gauge .result-value {
  margin-bottom: 13px;
  font-size: clamp(38px, 5.3vw, 58px);
  letter-spacing: -.055em;
  line-height: 1;
}

.result-gauge {
  width: min(100%, 334px);
  margin: 0 auto;
}

.gauge-dial {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.gauge-arc {
  stroke: rgba(10,30,45,.84);
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.gauge-needle {
  stroke: var(--color-white);
  stroke-linecap: round;
  stroke-width: 3.2;
}

.gauge-hub {
  fill: var(--color-white);
  stroke: var(--color-navy);
  stroke-width: 3;
}

.gauge-legend {
  display: grid;
  grid-template-columns: repeat(var(--gauge-segment-count), minmax(0, 1fr));
  gap: 7px;
  margin-top: -2px;
  color: rgba(246,250,248,.61);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1.25;
}

.gauge-legend-item {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.gauge-legend-item:first-child { justify-content: flex-start; text-align: left; }
.gauge-legend-item:last-child { justify-content: flex-end; text-align: right; }

.gauge-legend-swatch {
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 2px;
  border-radius: 50%;
}

.result-state.has-gauge .result-context {
  margin-top: 14px;
}
.result-context { min-height: 44px; max-width: 31ch; margin: 16px auto 25px; color: rgba(246,250,248,.72); font-size: 13px; line-height: 1.55; }

.result-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 19px;
  background: var(--accent);
  color: var(--color-white);
  font-size: 13px;
}

.result-cta:hover { filter: brightness(1.1); color: var(--color-white); }
.try-again { display: block; margin: 15px auto 0; padding: 2px; background: transparent; color: rgba(246,250,248,.7); font-size: 12px; }
.try-again:hover { color: var(--color-white); }

.error-state h2 { margin-bottom: 12px; font-size: 22px; }
.error-state p { max-width: 35ch; margin: 0 auto 20px; color: rgba(246,250,248,.7); font-size: 13px; line-height: 1.58; }
.error-state button { padding: 11px 18px; background: var(--color-surface); color: var(--deep); }

.card-privacy {
  margin: 0;
  padding: 0 28px 24px;
  color: rgba(246,250,248,.49);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.card-privacy strong { color: rgba(246,250,248,.73); font-weight: 700; }

.privacy-lock {
  width: 11px;
  height: 11px;
  margin-left: 4px;
  vertical-align: -1px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.how-it-works {
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: clamp(32px, 7vw, 110px);
  padding: 72px 0 86px;
  border-top: 1px solid var(--line);
}

.how-it-works h2,
.body-copy h2,
.faq h2 {
  color: var(--deep);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(31px, 3.5vw, 47px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.07;
}

.how-it-works h2 { max-width: 10ch; margin-bottom: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.step { padding-top: 16px; border-top: 3px solid var(--accent); }
.step-number { display: block; margin-bottom: 26px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.step h3 { margin-bottom: 8px; font-size: 15px; letter-spacing: -.025em; }
.step p { margin-bottom: 0; color: var(--quiet); font-size: 13px; line-height: 1.62; }

.body-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: clamp(44px, 8vw, 140px);
  padding: 86px 0;
}

.body-copy h2 { max-width: 14ch; margin-bottom: 22px; }
.body-copy p { max-width: 59ch; margin-bottom: 16px; color: var(--quiet); font-size: 15px; line-height: 1.72; }

.practice-guide {
  max-width: 59ch;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.practice-guide h3 {
  margin: 0 0 9px;
  color: var(--deep);
  font-size: 16px;
  letter-spacing: -.025em;
}

.practice-guide p { margin-bottom: 0; }

.technical-note {
  align-self: start;
  padding: 28px;
  border-left: 3px solid var(--accent);
  background: rgba(255,255,255,.62);
}

.technical-note p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.62; }
.technical-note strong { color: var(--deep); }

.faq {
  padding: 86px 0 0;
  border-top: 1px solid var(--line);
}

.faq h2 { margin-bottom: 30px; }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.faq-item { min-height: 185px; padding: 29px 30px; background: var(--paper); }
.faq-item h3 { margin-bottom: 11px; color: var(--deep); font-size: 16px; letter-spacing: -.03em; }
.faq-item p { max-width: 47ch; margin: 0; color: var(--quiet); font-size: 13px; line-height: 1.66; }

[hidden] { display: none !important; }

@keyframes checker-page-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes checker-content-float {
  from { transform: translateY(14px); }
  to { transform: translateY(0); }
}
@keyframes microphone-status-pulse {
  0%, 100% { opacity: .82; transform: scale(1); box-shadow: 0 0 0 3px var(--status-ring), 0 0 6px var(--status-glow); }
  50% { opacity: 1; transform: scale(1.12); box-shadow: 0 0 0 7px var(--status-ring), 0 0 12px var(--status-glow); }
}
@keyframes meter { from { transform: scaleY(.55); opacity: .68; } to { transform: scaleY(1.13); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .checker-main { width: min(100% - 32px, 1180px); padding-top: 96px; }
  .hero { grid-template-columns: 1fr; gap: 38px; padding: 34px 0 64px; }
  h1 { max-width: 11ch; }
  .analysis-card { border-radius: 24px; }
  .drop-zone { min-height: 305px; }
  .how-it-works, .body-copy { grid-template-columns: 1fr; gap: 32px; padding: 58px 0; }
  .how-it-works h2 { max-width: 13ch; }
  .steps { gap: 22px; }
  .faq { padding-top: 58px; }
}

@media (max-width: 580px) {
  .hero { padding-top: 25px; }
  h1 { font-size: 44px; }
  .lede { font-size: 15px; }
  .card-topline { padding: 20px 21px 0; }
  .drop-zone { padding: 24px 18px; }
  .card-privacy { padding: 0 20px 20px; }
  .steps, .faq-grid { grid-template-columns: 1fr; }
  .step-number { margin-bottom: 15px; }
  .faq-item { min-height: auto; padding: 25px 22px; }
  .technical-note { padding: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
