:root {
  color-scheme: light;
  --canvas: #efeee9;
  --paper: #fbfaf7;
  --paper-strong: #ffffff;
  --ink: #17191f;
  --muted: #686b73;
  --faint: #92949a;
  --line: #deddd7;
  --line-strong: #c9c8c1;
  --hero: #121722;
  --hero-muted: #aeb5c2;
  --blue: #5365ee;
  --blue-dark: #4050d1;
  --blue-soft: #eceeff;
  --mint: #9de0c2;
  --danger: #b63b4d;
  --danger-soft: #fff0f2;
  --ok: #23724f;
  --ok-soft: #e9f7ef;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 55px rgba(28, 29, 33, .08), 0 2px 8px rgba(28, 29, 33, .04);
  --ease-premium: cubic-bezier(.22, 1, .36, 1);
  --ease-ui: cubic-bezier(.2, .72, .25, 1);
  --font-display: "Book Antiqua", "Palatino Linotype", Palatino, serif;
  --font-body: Candara, "Avenir Next", Avenir, Corbel, sans-serif;
  --font-ui: Bahnschrift, "DIN Alternate", "Arial Narrow", sans-serif;
  --font-mono: "Cascadia Mono", "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 18px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle at 82% 4%, rgba(83, 101, 238, .08), transparent 28rem);
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(520px, .96fr);
  align-items: start;
  gap: clamp(18px, 3vw, 32px);
}

/* Story panel */
.masthead {
  position: sticky;
  top: clamp(20px, 4vw, 48px);
  min-height: min(760px, calc(100vh - 96px));
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background: var(--hero);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  translate: 0 0;
  animation: panel-enter 720ms var(--ease-premium) both;
  transition: translate 280ms var(--ease-premium), box-shadow 280ms var(--ease-premium);
}
.signal {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  background: none;
  border: 0;
  border-radius: inherit;
}
.signal-bars {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 112%;
  height: 112%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: clamp(16px, 3vw, 34px);
  opacity: .11;
  transform: translate(-50%, -50%) rotate(-7deg) scale(.765);
}
/* Decorative simulated voice levels only; this is never connected to MediaStream input. */
.signal span {
  --level-rest: .5;
  --level-peak: 1.18;
  --level-mid: .7;
  --level-high: 1;
  --level-low: .58;
  --level-rebound: .9;
  width: clamp(14px, 2.3vw, 25px);
  height: 36%;
  flex: none;
  background: var(--mint);
  border-radius: 99px;
  transform-origin: center;
  will-change: transform, opacity;
  animation: voice-level 1.7s cubic-bezier(.4, 0, .2, 1) infinite;
}
.signal span:nth-child(1) { animation-delay: -.35s; }
.signal span:nth-child(2) { --level-rest: .62; --level-peak: 1.06; --level-mid: .82; --level-high: 1.14; --level-low: .54; --level-rebound: .94; height: 68%; animation-duration: 2.05s; animation-delay: -1.3s; }
.signal span:nth-child(3) { --level-rest: .78; --level-peak: 1.02; --level-mid: .86; --level-high: 1.08; --level-low: .72; --level-rebound: .96; height: 94%; animation-duration: 2.35s; animation-delay: -.8s; }
.signal span:nth-child(4) { --level-rest: .48; --level-peak: 1.14; --level-mid: .66; --level-high: 1.02; --level-low: .56; --level-rebound: .88; height: 62%; animation-duration: 1.85s; animation-delay: -1.55s; }
.signal span:nth-child(5) { --level-rest: .4; --level-peak: 1.24; --level-mid: .62; --level-high: 1.1; --level-low: .46; --level-rebound: .98; height: 30%; animation-duration: 1.55s; animation-delay: -.95s; }
.signal-bars[data-randomized] span {
  animation: none;
  opacity: var(--voice-opacity, .8);
  transform: scaleY(var(--voice-level, .7));
  transition: transform var(--voice-speed, 180ms) cubic-bezier(.4, 0, .2, 1), opacity var(--voice-speed, 180ms) ease-out;
}
.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-block: auto;
}
.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 1.2rem;
  color: var(--mint);
  font-size: calc(.84rem + 2px);
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--font-ui);
  animation: copy-enter 580ms var(--ease-premium) 120ms both;
}
.masthead h1 {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 4.55vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .94;
}
.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: .06em;
  white-space: nowrap;
}
.hero-line > span {
  display: block;
  animation: headline-enter 680ms var(--ease-premium) 190ms both;
}
.hero-line + .hero-line > span {
  animation-delay: 245ms;
}
.lede {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  margin: 0;
  color: var(--hero-muted);
  font-size: clamp(1.2rem, 1.72vw, 1.5rem);
  line-height: 1.58;
  animation: copy-enter 620ms var(--ease-premium) 330ms both;
}
.assurances {
  position: relative;
  z-index: 1;
  margin: clamp(2.5rem, 5vh, 3.5rem) 0 0;
  padding: 1.3rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: #d5d9e0;
  font-size: calc(.82rem + 2px);
  font-family: var(--font-ui);
  animation: copy-enter 620ms var(--ease-premium) 410ms both;
}
.assurances span { display: inline-flex; align-items: center; gap: .45rem; }
.assurances span::before { width: .45rem; height: .45rem; content: ""; background: var(--mint); border-radius: 50%; }

/* Right-hand workflow */
.shell > :not(.masthead) { grid-column: 2; }
.panel, .banner, .foot { animation: state-enter 420ms var(--ease-premium) both; }
#screen-form { animation: form-enter 720ms var(--ease-premium) 110ms both; }
.panel {
  padding: clamp(24px, 4vw, 38px);
  background: var(--paper);
  border: 1px solid rgba(23, 25, 31, .08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  translate: 0 0;
  transition: translate 280ms var(--ease-premium), box-shadow 280ms var(--ease-premium);
}
.panel-intro {
  margin-bottom: 1.6rem;
  padding-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  border-bottom: 1px solid var(--line);
}
.step-number {
  width: 2rem;
  height: 2rem;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: calc(.72rem + 2px);
  font-weight: 750;
}
.panel-intro h2, .panel-title { margin: 0; font-size: calc(1.08rem + 4px); font-weight: 720; letter-spacing: -.015em; }
.panel-intro h2, .panel-title { font-family: var(--font-ui); }
.panel-intro p { margin: .16rem 0 0; color: var(--muted); font-size: calc(.84rem + 2px); }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  margin-bottom: .4rem;
  color: #464950;
  font-size: calc(.75rem + 2px);
  font-weight: 720;
  letter-spacing: .055em;
  text-transform: uppercase;
  font-family: var(--font-ui);
}
.field input {
  width: 100%;
  min-height: 3.15rem;
  padding: .75rem .85rem;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: calc(.98rem + 3px);
  transition: border-color 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui), background-color 180ms var(--ease-ui);
}
.field input::placeholder { color: var(--faint); }
.field input:focus-visible, .check input:focus-visible, .btn:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(83, 101, 238, .15); }
.field input:focus-visible { background: #fff; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: .38rem 0 0; color: var(--danger); font-size: calc(.82rem + 2px); }
.field-error:not([hidden]) { animation: message-enter 220ms var(--ease-ui) both; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { margin: 1.3rem 0; padding: 1rem; background: #f4f3ef; border: 1px solid var(--line); border-radius: var(--radius-md); }
.consent-heading { margin: 0 0 .55rem; color: #494b51; font-size: calc(.72rem + 2px); font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.consent-heading { font-family: var(--font-ui); }
.consent-list { margin: 0; padding-left: 1.05rem; color: var(--muted); font-size: calc(.81rem + 2px); line-height: 1.5; }
.consent-list li { margin-bottom: .28rem; }
.consent-list li:last-child { margin-bottom: 0; }
.consent-note { margin: .65rem 0 0; color: var(--faint); font-size: calc(.77rem + 2px); }
.check { margin-top: .8rem; padding-top: .8rem; display: flex; align-items: flex-start; gap: .6rem; color: #45474d; border-top: 1px solid var(--line); font-size: calc(.84rem + 2px); cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; flex: none; margin: .1rem 0 0; accent-color: var(--blue); cursor: pointer; }
.actions { margin-top: 1.15rem; display: flex; flex-wrap: wrap; gap: .65rem; }
.btn {
  min-height: 3.15rem;
  padding: .76rem 1.1rem;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: calc(.9rem + 3px);
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms var(--ease-ui), color 180ms var(--ease-ui), background-color 180ms var(--ease-ui), border-color 180ms var(--ease-ui), box-shadow 180ms var(--ease-ui), opacity 180ms var(--ease-ui);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); transition-duration: 80ms; }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(83, 101, 238, .2); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 9px 21px rgba(83, 101, 238, .23); }
.btn-primary:active:not(:disabled) { box-shadow: 0 4px 12px rgba(83, 101, 238, .18); }
.btn-secondary { background: var(--paper-strong); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: #f7f7f4; border-color: #9a9ba0; }
.btn-quiet { flex: 0 0 auto; color: var(--muted); font-weight: 580; }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: #e9e8e3; }
.btn-small { min-height: 2.3rem; padding: .4rem .8rem; font-size: calc(.8rem + 2px); }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn-icon { width: .55rem; height: .55rem; flex: none; background: currentColor; border-radius: 50%; }

/* Recording and completion states */
.rec-head { display: flex; align-items: center; gap: .55rem; color: var(--danger); font-size: calc(.74rem + 2px); font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.rec-dot { width: .58rem; height: .58rem; background: var(--danger); border-radius: 50%; animation: record-pulse 1.8s ease-in-out infinite; }
.rec-head[data-state="paused"] { color: var(--faint); }
.rec-head[data-state="paused"] .rec-dot { background: var(--faint); animation: none; }
.timer { margin: .65rem 0 1.15rem; color: var(--ink); font-size: clamp(calc(3rem + 6px), calc(8vw + 6px), calc(4.5rem + 6px)); font-weight: 350; letter-spacing: -.06em; font-variant-numeric: tabular-nums; line-height: 1; }
.meter, .progress { overflow: hidden; background: #deded9; border-radius: 99px; }
.meter { height: .42rem; }
.meter-fill, .progress-fill { height: 100%; width: 0%; background: var(--blue); border-radius: inherit; }
.meter-fill { transition: width 140ms var(--ease-ui); }
.meter-label { margin: .45rem 0 0; color: var(--faint); font-size: calc(.8rem + 2px); }
.meter-label[data-warn="true"] { color: var(--danger); }
.stats { margin: 1.25rem 0 0; padding-top: 1rem; display: flex; gap: 2rem; border-top: 1px solid var(--line); }
.stats div { margin: 0; }
.stats dt { color: var(--faint); font-size: calc(.7rem + 2px); letter-spacing: .07em; text-transform: uppercase; }
.stats dd { margin: .18rem 0 0; font-size: calc(.94rem + 3px); font-weight: 680; font-variant-numeric: tabular-nums; }
.progress { height: .5rem; margin: 1.1rem 0 .7rem; }
.progress-fill { transition: width 320ms var(--ease-premium); }
.progress-text { margin: 0; color: var(--muted); font-size: calc(.88rem + 2px); font-variant-numeric: tabular-nums; }
.panel-done, .panel-error { text-align: center; }
.tick { width: 3rem; height: 3rem; margin: 0 auto .9rem; display: grid; place-items: center; color: var(--ok); background: var(--ok-soft); border-radius: 50%; }
.panel-error .panel-title { color: var(--danger); }
.done-text { max-width: 26rem; margin: .5rem auto 0; color: var(--muted); font-size: calc(.92rem + 3px); }
.reference { margin: .9rem 0 0; color: var(--faint); font-size: calc(.82rem + 2px); }
.reference code { padding: .15rem .42rem; color: var(--ink); background: #eeede8; border: 1px solid var(--line); border-radius: 6px; font: calc(.82rem + 2px) var(--font-mono); }
.panel-done .actions, .panel-error .actions { justify-content: center; }
.banner { padding: .9rem 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; background: var(--ok-soft); border: 1px solid #bde2cc; border-radius: var(--radius-md); }
.banner:not([hidden]) { animation: state-enter 360ms var(--ease-premium) both; }
.banner-body { flex: 1 1 14rem; }
.banner-title { display: block; color: var(--ok); font-size: calc(.86rem + 2px); }
.banner-text { margin: .15rem 0 0; color: var(--muted); font-size: calc(.82rem + 2px); }
.banner-actions { display: flex; gap: .4rem; }
.hint { margin: .9rem 0 0; color: var(--faint); font-size: calc(.8rem + 2px); line-height: 1.5; }
.foot { padding: .2rem 0; color: var(--faint); font-size: calc(.77rem + 2px); text-align: center; }
.foot p { margin: 0; }
[hidden] { display: none !important; }

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes form-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes state-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes copy-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes headline-enter {
  from { opacity: 0; transform: translateY(34%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes message-enter {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes voice-level {
  0%, 100% { opacity: .62; transform: scaleY(var(--level-rest)); }
  16% { opacity: 1; transform: scaleY(var(--level-peak)); }
  34% { opacity: .76; transform: scaleY(var(--level-mid)); }
  52% { opacity: .94; transform: scaleY(var(--level-high)); }
  70% { opacity: .68; transform: scaleY(var(--level-low)); }
  86% { opacity: .88; transform: scaleY(var(--level-rebound)); }
}
@keyframes record-pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(182, 59, 77, .22); } 50% { opacity: .65; box-shadow: 0 0 0 7px rgba(182, 59, 77, 0); } }

@media (hover: hover) and (pointer: fine) {
  .masthead:hover { translate: 0 -2px; box-shadow: 0 24px 60px rgba(28, 29, 33, .11), 0 3px 10px rgba(28, 29, 33, .05); }
  .panel:hover { translate: 0 -1px; box-shadow: 0 22px 58px rgba(28, 29, 33, .1), 0 3px 10px rgba(28, 29, 33, .05); }
  .field input:hover:not(:focus-visible) { border-color: #aaa9a2; background: #fff; }
}

@media (max-width: 1160px) {
  .shell { width: min(820px, calc(100% - 32px)); padding: 16px 0 36px; grid-template-columns: 1fr; }
  .shell > :not(.masthead) { grid-column: 1; }
  .masthead { position: relative; top: auto; min-height: 560px; padding: clamp(32px, 6vw, 48px); }
  .signal-bars { width: 116%; height: 116%; opacity: .075; }
  .masthead h1 { font-size: clamp(3.1rem, 7.2vw, 4.2rem); }
  .assurances { margin-top: clamp(2.4rem, 5vw, 3.25rem); }
}
@media (max-width: 680px) {
  .shell { width: min(620px, calc(100% - 28px)); padding-top: 14px; }
  .masthead { min-height: 520px; padding: 30px; }
  .hero-line { white-space: normal; }
  .masthead h1 { font-size: clamp(2.5rem, 10.5vw, 3.25rem); line-height: .97; }
  .lede { max-width: 100%; font-size: clamp(1.08rem, 4.5vw, 1.22rem); line-height: 1.58; }
  .assurances { margin-top: 2.25rem; }
}
@media (max-width: 480px) {
  .masthead, .panel { border-radius: 19px; }
  .masthead { min-height: 520px; padding: 24px; }
  .panel { padding: 22px 18px; }
  .signal-bars { width: 122%; height: 112%; opacity: .065; }
  .stats { gap: 1.25rem; }
  .actions { flex-direction: column; }
  .btn, .btn-quiet { width: 100%; flex-basis: auto; }
  .banner-actions { width: 100%; }
  .banner-actions .btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
