:root {
  --paper: #f4f0e9;
  --paper-deep: #e9e2d8;
  --card: rgba(255, 255, 255, .84);
  --ink: #282826;
  --muted: #74716c;
  --line: rgba(40, 40, 38, .12);
  --blue: #168bb2;
  --blue-bright: #00aaff;
  --green: #2ecc71;
  --amber: #ffb020;
  --red: #d9655b;
  --shadow: 0 24px 70px rgba(70, 62, 52, .11);
  --radius: 30px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 9% 12%, rgba(255,255,255,.92), transparent 31rem),
    linear-gradient(135deg, #f7f4ef 0%, var(--paper) 46%, #eee8df 100%);
  color: var(--ink);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(0, 170, 255, .28); outline-offset: 3px; }

.ambient {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(20px);
  opacity: .36;
  pointer-events: none;
}
.ambient-one { top: -10rem; right: -7rem; background: rgba(0, 170, 255, .12); }
.ambient-two { bottom: -13rem; left: -8rem; background: rgba(255, 176, 32, .15); }

.app-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 112px);
  margin: 32px auto 18px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 36px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 38px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 1.05rem;
  font-weight: 750;
  text-decoration: none;
}
.brand-mark { display: flex; align-items: center; gap: 2px; height: 25px; }
.brand-mark i { display: block; width: 3px; border-radius: 99px; background: var(--blue); }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 8px; opacity: .55; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 16px; opacity: .75; }
.brand-mark i:nth-child(3) { height: 24px; }
.step-label { color: var(--muted); font-size: .875rem; }
.progress-track { height: 3px; background: rgba(40,40,38,.055); }
.progress-track span { display: block; width: 12%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-bright)); transition: width .5s cubic-bezier(.2,.8,.2,1); }

.screen { display: none; min-height: 610px; padding: clamp(48px, 7vw, 92px); }
.screen.is-active { display: block; animation: screenIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr); align-items: center; gap: 72px; }
.eyebrow { margin: 0 0 16px; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; letter-spacing: -.045em; }
h1 { max-width: 720px; margin-bottom: 24px; font-size: clamp(2.8rem, 5.5vw, 5.6rem); line-height: .97; font-weight: 760; }
h2 { margin-bottom: 18px; font-size: clamp(2.2rem, 4.2vw, 4.35rem); line-height: 1; font-weight: 750; }
h3 { margin-bottom: 10px; font-size: 1.55rem; }
.lead { max-width: 650px; margin: 0 0 32px; color: #605d58; font-size: clamp(1.05rem, 1.5vw, 1.22rem); line-height: 1.65; }
.lead.compact { max-width: 620px; }
.quiet-list { display: grid; gap: 13px; margin: 0 0 38px; padding: 0; list-style: none; color: #4f4d49; }
.quiet-list li { display: flex; align-items: center; gap: 13px; }
.quiet-list span { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: .67rem; font-weight: 800; }

.button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  font-weight: 720;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: white; background: #292a29; box-shadow: 0 10px 24px rgba(40,40,38,.18); }
.button-primary:hover { background: #111; box-shadow: 0 14px 30px rgba(40,40,38,.23); }
.button-primary span { margin-left: 12px; }
.button-secondary { color: var(--ink); background: #ebe7e0; border: 1px solid var(--line); }
.button-ghost { min-height: 48px; color: #56534e; background: transparent; border: 1px solid var(--line); }
.button-row { display: flex; align-items: center; gap: 12px; }
.button-row.centered { justify-content: center; }
.button-row.between { justify-content: space-between; margin-top: 36px; }

.product-visual { width: min(100%, 455px); margin: 0; justify-self: end; }
.product-photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 48% 48% 29% 29% / 19% 19% 13% 13%;
  background: #ede9e2;
  box-shadow: 0 28px 62px rgba(67, 60, 52, .16), inset 0 0 0 1px rgba(255,255,255,.7);
}
.product-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 42px 12px rgba(244,240,233,.42);
}
.product-photo img { display: block; width: 100%; height: auto; }
.speaker-led {
  position: absolute;
  z-index: 2;
  top: 30.6%;
  left: 46.75%;
  width: 1.75%;
  height: 27.9%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8eda 0%, #d9a5ff 20%, #7cc8ff 48%, #30e1ff 70%, #c7a2ff 100%);
  background-size: 100% 260%;
  box-shadow: 0 0 8px rgba(124,200,255,.68), 0 0 18px rgba(217,165,255,.34);
  mix-blend-mode: screen;
  animation: ledFlow 4.2s ease-in-out infinite alternate;
}
.speaker-led::after {
  content: "";
  position: absolute;
  inset: -2px -3px;
  border-radius: inherit;
  background: inherit;
  filter: blur(5px);
  opacity: .44;
}
.product-visual figcaption { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 15px; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.product-visual figcaption span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(46,204,113,.55); }
@keyframes ledFlow {
  0% { background-position: 50% 0%; filter: saturate(.92) brightness(.98); }
  48% { background-position: 50% 54%; filter: saturate(1.16) brightness(1.18); }
  100% { background-position: 50% 100%; filter: saturate(1) brightness(1.05); }
}

.center-card { max-width: 760px; margin: 0 auto; text-align: center; }
.center-card .lead { margin-inline: auto; }
.permission-hint {
  position: relative;
  display: grid;
  gap: 3px;
  width: min(520px, 100%);
  margin: 0 auto 18px;
  padding: 16px 20px;
  border: 1px solid rgba(255,176,32,.32);
  border-radius: 18px;
  background: rgba(255,176,32,.1);
  color: #665127;
}
.permission-hint[hidden] { display: none; }
.permission-hint span:last-child { font-size: .9rem; }
.hint-arrow { position: absolute; top: -30px; right: 18px; font-size: 1.7rem; animation: nudge 1s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateY(-5px); } }
.mic-stage { display: grid; justify-items: center; margin: 34px 0 28px; }
.mic-orb { display: grid; place-items: center; width: 122px; height: 122px; border-radius: 50%; background: #e9e5de; box-shadow: 0 0 0 0 rgba(0,170,255,0); transition: background .3s ease, box-shadow .12s ease, transform .12s ease; }
.mic-orb.is-live { background: #252625; }
.mic-orb svg { width: 38px; fill: none; stroke: #6c6963; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mic-orb.is-live svg { stroke: white; }
.level-meter { width: min(360px, 80%); height: 7px; margin-top: 26px; overflow: hidden; border-radius: 99px; background: #dfd9d1; }
.level-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--green), var(--amber)); transition: width .08s linear; }
.status-line { margin: 16px 0 0; font-weight: 700; }
.advice { min-height: 24px; margin: 6px 0 0; color: var(--muted); font-size: .94rem; }
.advice.is-warning { color: #9a6710; }

.practice-layout { display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 72px; }
.privacy-note { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: 99px; background: rgba(46,204,113,.09); color: #34724d; font-size: .85rem; font-weight: 700; }
.privacy-note span { color: var(--green); font-size: .6rem; }
.practice-card { padding: clamp(28px, 5vw, 54px); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); background: rgba(255,255,255,.58); box-shadow: 0 18px 50px rgba(60,52,44,.08); }
.practice-lines p { margin: 0; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: clamp(1.8rem, 4vw, 3.45rem); font-weight: 720; letter-spacing: -.04em; }
.practice-lines p:last-child { border-bottom: 0; }
.practice-lines span { color: var(--blue); font-size: .9rem; font-weight: 730; letter-spacing: 0; }
.live-bars { display: flex; align-items: center; justify-content: center; gap: 4px; height: 48px; margin-top: 22px; }
.live-bars i { width: 4px; height: 5px; border-radius: 99px; background: var(--blue); transition: height .08s linear; }
.practice-advice { text-align: center; }

.recorder-screen { max-width: 900px; margin: 0 auto; }
.recorder-head, .review-head { display: flex; align-items: start; justify-content: space-between; gap: 28px; }
.icon-button { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #66625d; font-size: 1.8rem; cursor: pointer; }
.phrase-progress { height: 5px; margin: 2px 0 28px; border-radius: 99px; background: #e4ded6; overflow: hidden; }
.phrase-progress span { display: block; width: 5%; height: 100%; border-radius: inherit; background: var(--blue); transition: width .35s ease; }
.recording-card { min-height: 410px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px; border: 1px solid rgba(255,255,255,.92); border-radius: var(--radius); background: rgba(255,255,255,.59); box-shadow: 0 22px 55px rgba(60,52,44,.08); text-align: center; }
.signal-light { display: flex; gap: 7px; margin-bottom: 16px; }
.signal-light i { width: 9px; height: 9px; border-radius: 50%; background: #cac5bd; transition: background .2s, box-shadow .2s; }
.signal-light.is-waiting i { background: var(--amber); box-shadow: 0 0 12px rgba(255,176,32,.55); animation: dotWait .8s ease-in-out infinite alternate; }
.signal-light.is-listening i { background: var(--green); box-shadow: 0 0 15px rgba(46,204,113,.6); animation: dotLive .7s ease-in-out infinite alternate; }
.signal-light i:nth-child(2) { animation-delay: -.25s; }
.signal-light i:nth-child(3) { animation-delay: -.5s; }
@keyframes dotWait { to { opacity: .25; } }
@keyframes dotLive { to { transform: scale(1.38); } }
.recording-state { margin-bottom: 30px; color: var(--muted); font-size: .9rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.cue { margin-bottom: 8px; color: var(--blue); font-size: .95rem; font-weight: 750; }
.phrase { max-width: 100%; font-size: clamp(3.2rem, 8vw, 7rem); font-weight: 770; line-height: 1; letter-spacing: -.07em; }
.recording-bars { width: min(440px, 92%); margin-top: 26px; }
.recording-tip { min-height: 25px; margin: 8px 0 0; color: var(--muted); }
.finish-button { margin-top: 12px; }

.score-badge { flex: 0 0 auto; display: grid; justify-items: center; min-width: 118px; padding: 15px; border: 1px solid var(--line); border-radius: 20px; }
.score-badge strong { font-size: 2rem; line-height: 1; }
.score-badge span { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.review-list { display: grid; gap: 8px; max-height: 390px; margin: 24px 0 34px; padding-right: 8px; overflow: auto; scrollbar-color: #c7c0b7 transparent; }
.review-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.55); }
.review-number { color: var(--muted); font-size: .76rem; font-weight: 800; text-align: center; }
.review-copy { min-width: 0; }
.review-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-copy span { color: var(--muted); font-size: .8rem; }
.review-actions { display: flex; gap: 6px; }
.small-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: #4f4d49; font-size: .8rem; font-weight: 700; cursor: pointer; }
.small-button.is-playing { color: white; background: var(--blue); border-color: var(--blue); }
.thanks-form { padding: clamp(24px, 4vw, 38px); border-radius: 24px; background: #eeebe5; }
.form-copy { display: grid; grid-template-columns: .7fr 1.3fr; gap: 30px; align-items: start; }
.form-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.form-grid label { display: grid; gap: 8px; color: #55524e; font-size: .85rem; font-weight: 700; }
.form-grid input { width: 100%; min-height: 52px; border: 1px solid rgba(40,40,38,.13); border-radius: 13px; padding: 0 15px; background: rgba(255,255,255,.8); color: var(--ink); font-size: 1rem; }
.consent { display: flex; align-items: flex-start; gap: 11px; margin-top: 20px; color: #57544f; font-size: .88rem; line-height: 1.45; cursor: pointer; }
.consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue); }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.submit-status { margin: 0; color: var(--muted); font-size: .9rem; }
.submit-status.is-error { color: #a74138; }

.thanks-card { max-width: 720px; margin: 36px auto 0; text-align: center; }
.success-mark { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 30px; border-radius: 50%; background: var(--green); color: white; box-shadow: 0 0 0 12px rgba(46,204,113,.09); font-size: 2rem; font-weight: 850; }
.thanks-card .lead { margin-inline: auto; }
.thanks-card .button { margin-top: 12px; }
.page-footer { display: flex; justify-content: space-between; width: min(1060px, calc(100% - 48px)); margin: 0 auto 30px; color: #817c75; font-size: .72rem; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 24px); max-width: calc(100% - 32px); padding: 12px 17px; border-radius: 99px; background: #222; color: white; box-shadow: 0 14px 38px rgba(0,0,0,.22); font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: auto 20px 20px; padding: 16px; border-radius: 12px; background: #842f2a; color: white; text-align: center; }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 24px, 720px); margin-top: 12px; min-height: calc(100vh - 60px); border-radius: 26px; }
  .topbar { min-height: 65px; padding: 0 22px; }
  .screen { min-height: 620px; padding: 42px 28px 48px; }
  .welcome-grid, .practice-layout { grid-template-columns: 1fr; gap: 38px; }
  .product-visual { width: min(78vw, 390px); justify-self: center; order: -1; }
  .form-copy { grid-template-columns: 1fr; gap: 4px; }
  .page-footer { display: grid; gap: 5px; text-align: center; justify-content: center; }
}

@media (max-width: 560px) {
  .app-shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .screen { min-height: calc(100vh - 69px); padding: 34px 20px 42px; }
  .step-label { font-size: .75rem; }
  h1 { font-size: clamp(2.55rem, 13vw, 4rem); }
  h2 { font-size: clamp(2.15rem, 10vw, 3.2rem); }
  .product-visual { width: min(84vw, 350px); }
  .button:not(.small-button) { width: 100%; }
  .button-row { width: 100%; flex-direction: column-reverse; }
  .button-row.between { gap: 10px; }
  .practice-card { padding: 24px; }
  .practice-lines p { font-size: 2.25rem; }
  .recorder-head h2 { font-size: 2.35rem; }
  .recording-card { min-height: 390px; padding: 28px 16px; }
  .phrase { font-size: clamp(3.4rem, 19vw, 5.6rem); }
  .review-head { align-items: center; }
  .review-head .lead { font-size: .96rem; }
  .score-badge { min-width: 90px; }
  .review-item { grid-template-columns: 30px minmax(0,1fr); }
  .review-actions { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .submit-status { text-align: center; }
  .page-footer { display: none; }
  .hint-arrow { display: none; }
}

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