:root {
  --ink: #14213d;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #ffffff;
  --wash: #f6f7fb;
  --violet: #6c63db;
  --violet-dark: #554db9;
  --violet-soft: #eeedff;
  --coral: #ee6b61;
  --green: #14866d;
  --green-soft: #e8f7f2;
  --amber: #ad6300;
  --amber-soft: #fff7e6;
  --shadow: 0 28px 80px rgba(20, 33, 61, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f8f9fc; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 5% 0%, rgba(108, 99, 219, .1), transparent 27rem),
    radial-gradient(circle at 98% 90%, rgba(238, 107, 97, .08), transparent 30rem),
    #f8f9fc;
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button, a.button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(108, 99, 219, .28); outline-offset: 3px; }

.ambient { position: fixed; width: 24rem; height: 24rem; border-radius: 50%; filter: blur(4px); pointer-events: none; z-index: -1; }
.ambient-one { left: -15rem; top: 24%; border: 1px solid rgba(108, 99, 219, .16); box-shadow: 0 0 0 4rem rgba(108, 99, 219, .025), 0 0 0 8rem rgba(108, 99, 219, .018); }
.ambient-two { right: -17rem; bottom: 0; border: 1px solid rgba(238, 107, 97, .14); box-shadow: 0 0 0 5rem rgba(238, 107, 97, .02); }

.site-header, footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header { min-height: 82px; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand b { color: var(--violet); }
.brand-mark { width: 28px; height: 28px; display: flex; gap: 2px; align-items: center; justify-content: center; border-radius: 8px; background: var(--violet); box-shadow: 0 6px 16px rgba(108, 99, 219, .26); }
.brand-mark i { display: block; width: 2px; border-radius: 3px; background: white; }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 7px; opacity: .8; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 13px; }
.brand-mark i:nth-child(3) { height: 19px; }
.session-chip { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.8); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; min-height: calc(100vh - 150px); display: grid; align-items: center; padding: 42px 0 72px; }
.view { width: 100%; }
.hidden { display: none !important; }
.centered-view { text-align: center; color: var(--muted); }
.narrow-view { width: min(760px, 100%); margin: 0 auto; text-align: center; }
.loader { width: 38px; height: 38px; margin: 0 auto 16px; border: 3px solid var(--violet-soft); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.intro-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(48px, 8vw, 110px); align-items: center; }
.eyebrow, .section-kicker { display: block; color: var(--violet); font-size: 11px; line-height: 1.4; letter-spacing: .14em; font-weight: 800; }
.intro-copy h1 { max-width: 650px; margin: 16px 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 5vw, 70px); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
.lede { max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.feature-row > div { padding-top: 15px; border-top: 1px solid var(--line); }
.feature-row span { color: var(--violet); font: italic 17px Georgia, serif; }
.feature-row p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.feature-row b { color: var(--ink); font-size: 13px; }

.panel, .prompt-card { background: rgba(255, 255, 255, .96); border: 1px solid rgba(228, 231, 236, .9); box-shadow: var(--shadow); border-radius: 24px; }
.form-panel { padding: 34px; }
.panel-heading { margin-bottom: 26px; }
.panel-heading h2 { margin: 13px 0 8px; font: 500 27px/1.15 Georgia, serif; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.step-pill { display: inline-block; padding: 5px 9px; border-radius: 7px; background: var(--violet-soft); color: var(--violet); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 800; }
label { display: block; text-align: left; margin-bottom: 17px; }
label > span:first-child { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
label em, label small { color: #98a2b3; font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
input, select { width: 100%; height: 44px; border: 1px solid #d7dce4; border-radius: 9px; color: var(--ink); background: white; padding: 0 12px; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(108, 99, 219, .1); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 22px 0; }
.check-label input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--violet); flex: 0 0 auto; }
.check-label span { color: var(--muted); font-size: 11px; line-height: 1.5; font-weight: 500; }

.button { display: inline-flex; min-height: 44px; padding: 0 18px; align-items: center; justify-content: center; gap: 11px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; cursor: pointer; font-weight: 700; font-size: 13px; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .56; cursor: wait; transform: none; }
.button.primary { background: var(--violet); color: white; box-shadow: 0 8px 24px rgba(108, 99, 219, .2); }
.button.primary:hover { background: var(--violet-dark); }
.button.secondary { color: var(--ink); border-color: var(--line); background: white; }
.button.secondary:hover { background: var(--wash); }
.button.wide { width: 100%; }
.text-button { width: 100%; margin-top: 13px; padding: 8px; color: var(--violet); background: transparent; border: 0; cursor: pointer; font-weight: 700; font-size: 12px; }
.inline-error { padding: 10px 12px; margin: 12px 0; color: #a23b34; background: #fff0ee; border-radius: 8px; text-align: left; font-size: 12px; }

.stage-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.stage-label span { display: grid; place-items: center; width: 24px; height: 24px; color: white; background: var(--violet); border-radius: 50%; }
.mic-panel { padding: 48px 62px 38px; }
.mic-panel h1, .complete-panel h1 { margin: 12px 0 10px; font: 500 clamp(34px, 5vw, 48px)/1.1 Georgia, serif; letter-spacing: -.025em; }
.mic-panel > p { max-width: 500px; margin: 0 auto; color: var(--muted); line-height: 1.6; font-size: 14px; }
.mic-orbit { position: relative; display: grid; place-items: center; width: 96px; height: 96px; margin: 0 auto 24px; }
.mic-icon { position: relative; z-index: 2; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: white; background: var(--violet); font-size: 0; box-shadow: 0 10px 30px rgba(108, 99, 219, .3); }
.mic-icon::before { content: ""; width: 12px; height: 21px; border: 2px solid white; border-radius: 9px; }
.mic-icon::after { content: ""; position: absolute; width: 22px; height: 14px; border: solid white; border-width: 0 2px 2px; border-radius: 0 0 13px 13px; bottom: 12px; }
.sound-ring { position: absolute; inset: 10px; border: 1px solid rgba(108, 99, 219, .22); border-radius: 50%; }
.ring-two { inset: 0; opacity: .55; }
.mic-orbit.active .sound-ring { animation: pulse 1.25s ease-out infinite; }
.mic-orbit.active .ring-two { animation-delay: .35s; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.meter { height: 6px; width: min(380px, 100%); margin: 28px auto 20px; background: #edf0f4; border-radius: 99px; overflow: hidden; }
.meter i { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), #9d93ff, var(--coral)); transition: width 80ms linear; }
.record-controls { display: flex; justify-content: center; gap: 15px; align-items: center; }
.record-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; color: white; background: var(--coral); border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 10px 25px rgba(238, 107, 97, .23); }
.record-button:disabled { opacity: .6; cursor: wait; }
.record-button.recording { background: #cf4037; }
.record-dot { width: 11px; height: 11px; background: white; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
.recording .record-dot { border-radius: 2px; box-shadow: none; }
.timer { min-width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.privacy-note { margin-top: 26px !important; font-size: 10px !important; }

.review-box { width: min(520px, 100%); margin: 25px auto 0; padding: 18px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: var(--wash); }
.review-box audio { display: block; width: 100%; height: 36px; }
.review-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }
.quality-note { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.quality-note.good { color: var(--green); }
.quality-note.warning { color: var(--amber); }

.recording-view { max-width: 940px; margin: 0 auto; }
.progress-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 17px; }
.progress-header h2 { margin: 7px 0 0; font: 500 22px Georgia, serif; }
.progress-side { display: flex; align-items: center; gap: 22px; }
.autoplay-toggle { white-space: nowrap; }
.progress-count { display: flex; align-items: baseline; gap: 5px; }
.progress-count strong { font: 500 30px Georgia, serif; color: var(--violet); }
.progress-count span { color: var(--muted); font-size: 11px; }
.progress-track { height: 5px; background: #e5e7ee; border-radius: 99px; margin-bottom: 23px; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--violet), #9f96ff); transition: width .45s ease; }
.prompt-card { overflow: hidden; }
.prompt-meta { display: flex; align-items: center; gap: 9px; min-height: 58px; padding: 0 34px; border-bottom: 1px solid var(--line); }
.level-badge, .expectation-badge { display: inline-flex; padding: 5px 9px; border-radius: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.level-badge { color: var(--violet); background: var(--violet-soft); }
.expectation-badge { color: var(--green); background: var(--green-soft); }
.expectation-badge.error { color: var(--amber); background: var(--amber-soft); }
.prompt-number { margin-left: auto; color: #98a2b3; font-size: 11px; }
.instruction-block, .reference-block, .say-block { padding: 24px 34px; }
.instruction-block { border-bottom: 1px solid var(--line); }
.instruction-block p { margin: 8px 0 0; color: #465168; font-size: 14px; line-height: 1.6; }
.reference-block { display: flex; align-items: center; justify-content: space-between; background: #fafaff; border-bottom: 1px solid var(--line); }
.reference-block p { margin: 7px 0 0; font: 500 clamp(26px, 4vw, 38px)/1.2 Georgia, serif; letter-spacing: -.02em; }
.reference-actions { display: flex; align-items: center; gap: 16px; margin-left: 20px; }
.listen-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; color: var(--violet); background: white; border: 1px solid #dcd9ff; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 11px; }
.listen-button.playing { background: var(--violet); color: white; }
.speaker-icon { font-size: 17px; }
.slow-toggle { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 10px; cursor: pointer; }
.slow-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.slow-toggle span { display: block; position: relative; width: 28px; height: 16px; margin: 0; background: #d6dae2; border-radius: 99px; }
.slow-toggle span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: white; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.slow-toggle input:checked + span { background: var(--violet); }
.slow-toggle input:checked + span::after { transform: translateX(12px); }
.say-block { text-align: center; padding-top: 31px; padding-bottom: 26px; }
.say-block p { margin: 10px auto 5px; max-width: 780px; font: 500 clamp(33px, 5vw, 54px)/1.18 Georgia, serif; letter-spacing: -.035em; }
.say-block small { color: var(--muted); font-size: 11px; }
.recording-console { display: flex; flex-direction: column; align-items: center; padding: 20px 34px 27px; border-top: 1px solid var(--line); background: #fcfcfd; }
.large-meter { margin: 0 0 12px; width: 280px; }
.record-status { margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.record-button.large { min-width: 190px; }
.recording-console .timer { margin-top: 9px; text-align: center; }
.keyboard-hint { margin-top: 5px; color: #a3a9b5; font-size: 9px; }
kbd { padding: 1px 5px; border: 1px solid #d8dce3; border-bottom-width: 2px; border-radius: 4px; background: white; }
.prompt-nav { display: flex; justify-content: space-between; min-height: 49px; padding: 0 22px; align-items: center; border-top: 1px solid var(--line); background: white; }
.nav-button { width: auto; margin: 0; }
.nav-button:disabled { opacity: .35; cursor: default; }
.prompt-review { margin: 0; width: 100%; max-width: none; padding: 22px 34px 27px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--green-soft); }
.prompt-review audio { margin-top: 14px; }
.review-title { display: flex; align-items: center; gap: 11px; }
.review-title > span { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--green); border-radius: 50%; }
.review-title div { display: flex; flex-direction: column; gap: 3px; }
.review-title small { color: #55786f; }

.complete-panel { padding: 62px; }
.success-mark { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 22px; border-radius: 50%; color: white; background: var(--green); box-shadow: 0 10px 28px rgba(20, 134, 109, .22); font-size: 28px; }
.complete-panel > p { max-width: 520px; margin: 0 auto; color: var(--muted); line-height: 1.6; font-size: 14px; }
.completion-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 38px 0 30px; border: solid var(--line); border-width: 1px 0; }
.completion-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 20px 8px; }
.completion-stats > div + div { border-left: 1px solid var(--line); }
.completion-stats strong { font: 500 24px Georgia, serif; }
.completion-stats span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.completion-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.session-code { margin-top: 23px !important; font-size: 10px !important; }
.session-code code { color: var(--violet); }

footer { min-height: 68px; padding: 18px 0; border-top: 1px solid rgba(228,231,236,.8); color: #98a2b3; font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); padding: 11px 16px; color: white; background: #252b3a; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.2); font-size: 12px; }

@media (max-width: 820px) {
  .intro-grid { grid-template-columns: 1fr; gap: 40px; }
  .intro-copy { text-align: center; }
  .intro-copy .lede { margin-left: auto; margin-right: auto; }
  .intro-copy h1 { margin-left: auto; margin-right: auto; }
  .feature-row { text-align: left; }
  main { align-items: start; }
}
@media (max-width: 620px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 68px; }
  main { padding-top: 24px; }
  .session-chip { display: none; }
  .intro-copy h1 { font-size: 42px; }
  .feature-row { grid-template-columns: 1fr; gap: 5px; margin-top: 30px; }
  .feature-row > div { display: grid; grid-template-columns: 28px 1fr; gap: 8px; }
  .feature-row p { margin-top: 0; }
  .form-panel, .mic-panel, .complete-panel { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .progress-header h2 { font-size: 17px; }
  .progress-header { align-items: flex-start; }
  .progress-side { flex-direction: column-reverse; align-items: flex-end; gap: 7px; }
  .autoplay-toggle { font-size: 9px; }
  .progress-count strong { font-size: 24px; }
  .prompt-meta, .instruction-block, .reference-block, .say-block, .recording-console, .prompt-review { padding-left: 20px; padding-right: 20px; }
  .prompt-meta { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .reference-block { flex-direction: column; align-items: flex-start; gap: 18px; }
  .reference-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .review-actions { flex-direction: column-reverse; }
  .prompt-nav { padding: 0 8px; }
  .review-actions .button { width: 100%; }
  .completion-stats strong { font-size: 19px; }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
}

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