/* styles.css — Coachly base */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #0b0b0b;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { min-height: 100vh; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  gap: 16px;
  position: relative;
  z-index: 5;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -6px var(--accent);
}
.brand-mark svg { width: 17px; height: 17px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ---------- mascot (Pep) ---------- */
.brand-word { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em; }
.pep-badge {
  display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 26%, transparent);
}
.pep { display: block; overflow: visible; }
.pep-bob { animation: pepBob 3.4s ease-in-out infinite; transform-origin: 60px 90px; }
@keyframes pepBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-1.5deg); }
}
.pep-mouth-talk { animation: pepTalk 0.42s ease-in-out infinite; transform-origin: 60px 85px; }
@keyframes pepTalk {
  0%, 100% { transform: scaleY(0.45) scaleX(1.05); }
  50% { transform: scaleY(1) scaleX(0.9); }
}
.pep-wave { animation: pepWave 0.9s ease-in-out infinite; }
@keyframes pepWave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}
.pep-arms { animation: pepCheer 1.6s ease-in-out infinite; transform-origin: 60px 84px; }
@keyframes pepCheer {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(0deg); }
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
  border-radius: 999px;
  padding: 15px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .14s cubic-bezier(.3,.7,.4,1), box-shadow .18s, background .18s, opacity .18s;
  line-height: 1;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 12px 28px -12px var(--accent);
}
.btn-primary:hover { box-shadow: 0 16px 34px -10px var(--accent); transform: translateY(-1px); }
.btn-ink {
  background: var(--ink);
  color: var(--bg);
}
.btn-ink:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  padding: 12px 16px;
  font-weight: 600;
}
.btn-quiet:hover { color: var(--ink); }
.btn-lg { padding: 18px 32px; font-size: 18px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- generic screen frame ---------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px clamp(20px, 5vw, 56px) 64px;
  position: relative;
  z-index: 2;
}
.container {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}
.screen-enter { animation: screenIn .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.title {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--ink);
  margin: 18px 0 0;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  text-wrap: balance;
}
.lead {
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 14px 0 0;
  max-width: 46ch;
  text-wrap: pretty;
}

/* ---------- progress header ---------- */
.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 28px;
}
.progress-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.progress-label b { color: var(--ink); }
.bars { display: flex; gap: 6px; flex: 1; }
.bar {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.bar > i {
  position: absolute; inset: 0;
  background: var(--accent);
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
}
.bar.done > i { transform: scaleX(1); }
.bar.active > i { transform: scaleX(.5); }

/* ---------- hero (landing) ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 56px) 0 40px;
}
.hero-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-size: clamp(2.7rem, 6.2vw, 4.6rem);
  color: var(--ink);
  margin: 22px 0 0;
  text-wrap: balance;
}
.hero-h1 .hl {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hero-lead {
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 22px 0 0;
  max-width: 42ch;
  text-wrap: pretty;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px;
  font-size: 14px; color: var(--ink-faint); font-weight: 600;
}
.hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); }

/* steps strip */
.steps-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 1140px;
  margin: 8px auto 0;
  padding: 0 clamp(20px, 5vw, 56px) 56px;
}
.step-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
  overflow: hidden;
}
.step-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.step-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 20px;
  margin: 12px 0 6px;
  color: var(--ink);
}
.step-card p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.step-ic {
  position: absolute; top: 20px; right: 20px;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center; color: var(--ink-soft);
}
.step-ic svg { width: 18px; height: 18px; }

/* ---------- hero visual: mini sim preview ---------- */
.preview-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.preview-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
  pointer-events: none;
}
.preview-top { display: flex; align-items: center; gap: 10px; position: relative; }
.preview-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 24%, transparent);
  display: grid; place-items: center; overflow: hidden;
}
.preview-top > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.preview-top .who { font-weight: 700; font-size: 15px; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.preview-top .qq { font-size: 12.5px; line-height: 1.2; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.preview-q {
  margin: 22px 0 0; position: relative;
  font-family: var(--font-display); font-weight: 650;
  font-size: 21px; line-height: 1.25; letter-spacing: -0.02em; color: var(--ink);
}
.preview-orbwrap { display: grid; place-items: center; padding: 18px 0 4px; position: relative; }

/* ---------- pep voice stage (simulation) ---------- */
.pep-stage {
  position: relative; display: grid; place-items: center;
  width: 220px; height: 220px;
}
.pep-stage .pep { position: relative; z-index: 2; }
.pep-ring {
  position: absolute; width: 150px; height: 150px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
  opacity: 0; z-index: 1;
}
.pep-stage[data-state="listening"] .pep-ring { animation: orbPulse 1.8s ease-out infinite; }
.pep-stage[data-state="listening"] .pep-ring.r2 { animation-delay: .6s; }
.pep-stage[data-state="listening"] .pep-ring.r3 { animation-delay: 1.2s; }
.pep-stage[data-state="coach"]::after {
  content: ""; position: absolute; width: 168px; height: 168px; border-radius: 50%;
  background: radial-gradient(circle, var(--orb-glow), transparent 68%); opacity: .6; z-index: 0;
}

/* ---------- feedback hero (Pep cheering) ---------- */
.fb-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }

/* ---------- choice cards ---------- */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.choice {
  appearance: none;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  padding: 22px 20px 22px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .15s cubic-bezier(.3,.7,.4,1), box-shadow .18s;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 148px;
  color: var(--ink);
  position: relative;
}
.choice:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, var(--line)), var(--shadow);
}
.choice-ic {
  width: 46px; height: 46px; border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  display: grid; place-items: center;
}
.choice-ic svg { width: 24px; height: 24px; }
.choice h4 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: 18.5px; margin: 0; color: var(--ink);
}
.choice p { margin: -6px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.4; }

.or-row {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 4px; color: var(--ink-faint); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.or-row::before, .or-row::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* ---------- file preview ---------- */
.filechip {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--success) 40%, var(--line));
  margin-top: 26px;
  animation: screenIn .4s cubic-bezier(.2,.7,.3,1) both;
}
.doc-thumb {
  width: 56px; height: 70px; border-radius: 9px; flex-shrink: 0;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 8%, var(--surface)) 0 6px, transparent 6px 12px),
    var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
  overflow: hidden;
}
.doc-thumb::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 12px; height: 4px;
  border-radius: 2px; background: var(--ink-faint); opacity: .5;
  box-shadow: 0 9px 0 var(--ink-faint), 0 18px 0 var(--ink-faint), 0 27px 0 color-mix(in srgb, var(--ink-faint) 60%, transparent);
}
.filechip .meta { flex: 1; min-width: 0; }
.filechip .meta b { font-weight: 700; font-size: 15.5px; color: var(--ink); display: block; }
.filechip .meta span { font-size: 13px; color: var(--ink-soft); font-family: 'Space Mono', ui-monospace, monospace; }
.filechip .ok {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--success); color: #fff; display: grid; place-items: center; flex-shrink: 0;
}
.filechip .ok svg { width: 15px; height: 15px; }
.filechip .replace {
  background: transparent; border: 0; cursor: pointer; color: var(--ink-soft);
  font-weight: 650; font-size: 13.5px; padding: 8px 12px; border-radius: 999px;
}
.filechip .replace:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- textarea ---------- */
.field-wrap { margin-top: 24px; position: relative; }
.textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  padding: 18px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
  transition: box-shadow .18s;
}
.textarea::placeholder { color: var(--ink-faint); }
.textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.field-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; font-size: 13px; color: var(--ink-faint);
}
.link-btn {
  background: transparent; border: 0; cursor: pointer; color: var(--accent);
  font-weight: 700; font-size: 13.5px; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.seg2 {
  display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px;
  margin-top: 24px; box-shadow: inset 0 0 0 1px var(--line);
}
.seg2 button {
  border: 0; background: transparent; cursor: pointer; font-family: var(--font-body);
  font-weight: 650; font-size: 14.5px; color: var(--ink-soft); white-space: nowrap;
  padding: 9px 18px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  transition: background .16s, color .16s;
}
.seg2 button svg { width: 16px; height: 16px; }
.seg2 button[data-on="1"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 30px; }

/* ---------- analyse ---------- */
.analyse-wrap { max-width: 540px; margin: 0 auto; padding-top: clamp(10px, 4vh, 40px); }
.check-list { display: flex; flex-direction: column; gap: 4px; margin-top: 34px; }
.check-row {
  display: flex; align-items: center; gap: 15px;
  padding: 15px 16px; border-radius: var(--radius);
  font-size: 16.5px; font-weight: 600; color: var(--ink-faint);
  transition: color .3s, background .3s;
}
.check-row.active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.check-row.done { color: var(--ink); }
.check-ic {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-faint);
  transition: background .3s, color .3s;
}
.check-row.done .check-ic { background: var(--success); color: #fff; }
.check-row.active .check-ic { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.check-ic svg { width: 15px; height: 15px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* recap */
.recap { margin-top: 30px; animation: screenIn .5s cubic-bezier(.2,.7,.3,1) both; }
.recap-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  padding: 26px; overflow: hidden; position: relative;
}
.recap-card::before {
  content:""; position:absolute; inset:0;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%);
  pointer-events:none;
}
.recap-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.recap-row + .recap-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.recap-row .k { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); }
.recap-row .v { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chip {
  font-size: 13.5px; font-weight: 650; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
}
.chip.plain { background: var(--surface-2); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- orb / voice ---------- */
.orb {
  position: relative;
  width: var(--orb-size, 150px); height: var(--orb-size, 150px);
  display: grid; place-items: center;
}
.orb-core {
  width: 64%; height: 64%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent) 70%);
  box-shadow: 0 0 44px -6px var(--orb-glow), inset 0 -8px 22px -6px rgba(0,0,0,0.25);
  position: relative; z-index: 2;
  transition: transform .3s;
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
  opacity: 0;
}
.orb[data-state="coach"] .orb-ring { animation: orbPulse 1.8s ease-out infinite; }
.orb[data-state="coach"] .orb-ring.r2 { animation-delay: .6s; }
.orb[data-state="coach"] .orb-ring.r3 { animation-delay: 1.2s; }
.orb[data-state="coach"] .orb-core { animation: orbBreath 1.8s ease-in-out infinite; }
@keyframes orbPulse {
  0% { opacity: .6; transform: scale(.62); }
  100% { opacity: 0; transform: scale(1.08); }
}
@keyframes orbBreath {
  0%,100% { transform: scale(1); } 50% { transform: scale(1.06); }
}
/* equalizer (listening) */
.equalizer {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 3;
  gap: 5px; grid-auto-flow: column;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.orb[data-state="listening"] .equalizer { opacity: 1; }
.orb[data-state="listening"] .orb-core { transform: scale(.5); opacity: .25; }
.equalizer i {
  width: 6px; height: 14px; border-radius: 999px; background: var(--accent);
  animation: eq 0.9s ease-in-out infinite;
}
.equalizer i:nth-child(1){ animation-delay: -.2s } .equalizer i:nth-child(2){ animation-delay: -.5s }
.equalizer i:nth-child(3){ animation-delay: -.1s } .equalizer i:nth-child(4){ animation-delay: -.7s }
.equalizer i:nth-child(5){ animation-delay: -.3s } .equalizer i:nth-child(6){ animation-delay: -.6s }
.equalizer i:nth-child(7){ animation-delay: -.15s }
@keyframes eq { 0%,100% { height: 12px } 50% { height: 46px } }

/* ---------- simulation screen ---------- */
.sim {
  flex: 1; display: flex; flex-direction: column;
  max-width: 720px; margin: 0 auto; width: 100%;
  height: calc(100dvh - 82px); min-height: 0; overflow: hidden;
  padding: 8px clamp(18px, 5vw, 40px) 0;
}
.sim-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 4px 0 8px;
}
.coach-tag { display: flex; align-items: center; gap: 11px; }
.coach-av {
  width: 42px; height: 42px; border-radius: 50%;
  background: transparent; box-shadow: none;
  display: grid; place-items: center;
  position: relative;
}
.coach-av .live {
  position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 3px var(--bg);
}
.coach-tag .nm { font-weight: 750; font-size: 16px; color: var(--ink); font-family: var(--font-display); letter-spacing: -0.01em; }
.coach-tag .sub { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.sim-meta { display: flex; align-items: center; gap: 14px; }
.qcount { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-soft); letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 7px; }
.qcount b { color: var(--ink); }
.qcount .rec { width: 8px; height: 8px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 0 rgba(229,72,77,.5); animation: recPulse 1.6s ease-out infinite; }
@keyframes recPulse { 0%{box-shadow:0 0 0 0 rgba(229,72,77,.5)} 100%{box-shadow:0 0 0 7px rgba(229,72,77,0)} }
.timer {
  font-family: 'Space Mono', ui-monospace, monospace; font-size: 14px; font-weight: 700;
  color: var(--ink-soft); background: var(--surface); padding: 6px 11px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums;
}

/* conversation progress + call layout */
.conv-progress { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 2px 0 4px; flex-shrink: 0; }
.conv-progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transform-origin: left; transition: transform .7s cubic-bezier(.2,.7,.3,1); }

.call-pep { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 4px; flex-shrink: 0; }
.call-pep .sim-state-label { margin-top: 6px; }
.pep-stage.compact { width: 128px; height: 128px; }
.pep-stage.compact .pep-ring { width: 104px; height: 104px; }
.pep-stage.mid { width: 168px; height: 168px; }
.pep-stage.mid .pep-ring { width: 132px; height: 132px; }
.coach-stage .cav { transition: transform .3s cubic-bezier(.2,.7,.3,1); }
.coach-stage[data-state="coach"] .cav.speaking { animation: coachPulse 1.7s ease-in-out infinite; }
@keyframes coachPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* 100% vocal stage: mascot + state + audio wave, centred in the freed space */
.vocal-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 10px 0; }
.vocal-stage .sim-state-label { margin-top: 2px; }
.wave {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; max-width: 520px; height: 84px; margin: 8px auto 0;
}
.wave span {
  width: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 30%, var(--line));
  transform: scaleY(0.16); transform-origin: center;
  transition: transform .4s cubic-bezier(.2,.7,.3,1), background .3s;
}
.wave.on span { background: var(--accent); animation-name: waveB; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.wave.me.on span { background: color-mix(in srgb, var(--ink) 58%, var(--accent)); }
@keyframes waveB { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .wave.on span { animation: none; transform: scaleY(0.6); } }

/* live conversation thread */
.thread {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 600px; margin: 0 auto;
  padding: 14px 4px 8px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 18px);
}
.thread::-webkit-scrollbar { width: 7px; }
.thread::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.skip-btn {
  appearance: none; border: 0; cursor: pointer; background: transparent;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 650; font-size: 13.5px;
  color: var(--ink-faint); padding: 7px 12px; border-radius: 999px; margin-top: 2px;
  transition: color .16s, background .16s;
}
.skip-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.skip-btn svg { width: 15px; height: 15px; }
.sim-state-label[data-end="1"] { color: var(--success); }

.sim-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 12px 0;
}
.sim-state-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
}
.sim-state-label .pd { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.sim-question {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.12; color: var(--ink);
  font-size: clamp(1.55rem, 3.6vw, 2.25rem);
  max-width: 16ch; margin: 8px auto 0; text-wrap: balance;
  min-height: 1.2em;
}
.transcript-live {
  margin: 18px auto 0; max-width: 32ch;
  font-size: 17px; line-height: 1.5; color: var(--ink-soft); min-height: 1.5em;
}
.transcript-live .cursor {
  display: inline-block; width: 2px; height: 1.05em; background: var(--accent);
  margin-left: 2px; vertical-align: -2px; animation: blink .9s steps(1) infinite;
}
.transcript-live.placeholder { color: var(--ink-faint); }

/* mic control */
.sim-foot { padding: 12px 0 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; }
.mic-btn {
  position: relative; appearance: none; border: 0; cursor: pointer;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  box-shadow: 0 14px 34px -10px var(--orb-glow);
  transition: transform .14s, box-shadow .2s, background .2s;
}
.mic-btn:hover { transform: translateY(-2px); }
.mic-btn:active { transform: scale(.95); }
.mic-btn svg { width: 30px; height: 30px; }
.mic-btn[data-on="1"] { background: var(--ink); color: var(--bg); }
.mic-btn[data-on="1"]::before {
  content:""; position:absolute; inset:-7px; border-radius:50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 30%, transparent);
  animation: micPing 1.4s ease-out infinite;
}
@keyframes micPing { 0%{transform:scale(.92);opacity:.7} 100%{transform:scale(1.25);opacity:0} }
.mic-hint { font-size: 14px; font-weight: 600; color: var(--ink-faint); height: 1.3em; }
.mic-row { display: flex; align-items: center; gap: 14px; }

/* transcript log (chat) */
.log {
  width: 100%; display: flex; flex-direction: column; gap: 12px;
  margin: 0 auto; max-width: 560px;
}
.bubble {
  max-width: 84%; padding: 13px 16px; border-radius: 16px;
  font-size: 15px; line-height: 1.45;
  animation: screenIn .35s cubic-bezier(.2,.7,.3,1) both;
}
.bubble.coach {
  align-self: flex-start; background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 5px;
}
.bubble.me {
  align-self: flex-end; background: var(--accent); color: var(--accent-ink);
  border-bottom-right-radius: 5px;
}
.bubble .who { font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; opacity: .6; margin-bottom: 3px; }

/* ---------- feedback ---------- */
.fb { max-width: 620px; margin: 0 auto; }
.gauge-wrap { display: flex; align-items: center; gap: 26px; margin-top: 28px; flex-wrap: wrap; }
.gauge { position: relative; width: 156px; height: 156px; flex-shrink: 0; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--line); stroke-width: 13; }
.gauge .val { fill: none; stroke: var(--accent); stroke-width: 13; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.3,1); }
.gauge-num {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-num b { font-family: var(--font-display); font-weight: 800; font-size: 44px; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.gauge-num span { font-size: 12.5px; font-weight: 700; color: var(--ink-faint); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }
.gauge-side { flex: 1; min-width: 200px; }
.gauge-side .verdict { font-family: var(--font-display); font-weight: 750; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 12px; text-wrap: balance; }
.metric { margin-top: 13px; }
.metric .ml { display: flex; justify-content: space-between; font-size: 14px; font-weight: 650; color: var(--ink-soft); margin-bottom: 6px; }
.metric .ml b { color: var(--ink); font-variant-numeric: tabular-nums; }
.metric .mt { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.metric .mt > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 1s cubic-bezier(.2,.7,.3,1); }

.fb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.fb-panel {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.fb-panel h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  margin: 0 0 16px; display: flex; align-items: center; gap: 9px; color: var(--ink);
}
.fb-panel h3 .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.fb-panel h3 .ic svg { width: 15px; height: 15px; }
.fb-panel.good h3 .ic { background: color-mix(in srgb, var(--success) 16%, var(--surface)); color: var(--success); }
.fb-panel.grow h3 .ic { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.fb-list li { display: flex; gap: 11px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.fb-list li .dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  display: grid; place-items: center;
}
.fb-list li .dot svg { width: 12px; height: 12px; }
.fb-panel.good .dot { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.fb-panel.grow .dot { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.fb-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Pep speech bubble ---------- */
.pep-bubble {
  position: relative; background: var(--surface); color: var(--ink);
  border-radius: 16px; padding: 13px 17px; font-weight: 600; font-size: 15.5px;
  line-height: 1.42; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  max-width: 34ch; text-wrap: pretty;
  animation: bubblePop .4s cubic-bezier(.2,.8,.3,1.2) both;
}
@keyframes bubblePop { from { opacity: 0; transform: scale(.9) translateY(4px); } to { opacity: 1; transform: none; } }
.pep-bubble.tail-up::before {
  content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 10px solid var(--surface);
}
.pep-bubble.tail-down::after {
  content: ""; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 10px solid var(--surface);
}
.pep-bubble.tail-left::before {
  content: ""; position: absolute; left: -9px; top: 22px;
  border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-right: 10px solid var(--surface);
}

/* ---------- confetti ---------- */
.confetti { position: absolute; inset: 0 0 auto 0; height: 360px; overflow: hidden; pointer-events: none; z-index: 6; }
.confetti span {
  position: absolute; top: -14px; opacity: 0;
  animation-name: confettiFall; animation-timing-function: cubic-bezier(.35,.25,.55,1); animation-fill-mode: forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate(0, -10px) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--tx), 360px) rotate(var(--rot)); }
}

/* ---------- débrief celebratory header ---------- */
.debrief-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; position: relative; z-index: 2; }
.dh-pep { flex-shrink: 0; }
.dh-text { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.dh-bubble { font-family: var(--font-display); font-weight: 650; font-size: 18px; letter-spacing: -0.01em; }
.peptalk {
  display: flex; align-items: flex-start; gap: 14px; margin-top: 24px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-radius: var(--radius); padding: 18px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, var(--line));
}
.peptalk .pep { flex-shrink: 0; }
.peptalk .pep-bubble { box-shadow: none; background: var(--surface); }
@media (max-width: 560px) {
  .debrief-hero { flex-direction: column; align-items: flex-start; }
  .dh-bubble { font-size: 16px; }
}

/* ---------- coach selection + avatars ---------- */
.cav {
  display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  flex-shrink: 0;
}
.cav-empathique { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 42%, transparent); }
.cav-neutre { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong); }
.cav-severe { background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 2px var(--ink); }

.coach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.coach-card {
  appearance: none; cursor: pointer; text-align: center; color: var(--ink);
  background: var(--surface); border: 0; border-radius: var(--radius);
  padding: 26px 18px 24px; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .15s cubic-bezier(.3,.7,.4,1), box-shadow .18s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.coach-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, var(--line)), var(--shadow); }
.coach-card.on { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.cc-name { font-family: var(--font-display); font-weight: 750; font-size: 19px; letter-spacing: -0.02em; margin-top: 8px; }
.cc-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.cc-blurb { margin: 7px 0 0; font-size: 13.5px; line-height: 1.42; color: var(--ink-soft); text-wrap: pretty; }
@media (max-width: 620px) { .coach-grid { grid-template-columns: 1fr; } .coach-card { flex-direction: row; text-align: left; gap: 16px; align-items: center; } .coach-card .cc-blurb { margin-top: 2px; } .coach-card > div, .coach-card > p { align-self: flex-start; } }

/* ---------- embedded (inside a phone frame) ---------- */
.app.embedded { min-height: 100%; padding-bottom: 28px; }
.app.embedded .topbar { padding-top: 54px; padding-left: 20px; padding-right: 18px; }
.app.embedded .ambient { position: absolute; }
.app.embedded .screen { padding-left: 20px; padding-right: 20px; padding-bottom: 40px; }
.app.embedded .hero { padding-top: 4px; padding-bottom: 24px; }
.app.embedded .sim { padding-left: 18px; padding-right: 18px; }

/* ---------- transcript modal ---------- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in srgb, var(--ink) 38%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px;
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 560px; max-height: 82vh;
  background: var(--bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  animation: screenIn .3s cubic-bezier(.2,.7,.3,1) both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.modal-head b { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }
.modal-x {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center;
}
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; }

/* ---------- camera capture ---------- */
.cam-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cam-video {
  width: 100%; max-height: 58vh; border-radius: var(--radius);
  background: #000; display: block; object-fit: cover;
  box-shadow: inset 0 0 0 1px var(--line);
}
.cam-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cam-shutter {
  width: 66px; height: 66px; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--accent);
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px var(--orb-glow), inset 0 0 0 4px var(--surface);
  transition: transform .12s, box-shadow .18s;
}
.cam-shutter > span { width: 46px; height: 46px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); display: block; }
.cam-shutter:hover { transform: translateY(-2px); }
.cam-shutter:active { transform: scale(.94); }
.cam-shutter:disabled { opacity: .5; cursor: default; }
.cam-err { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cam-err p { color: var(--ink-soft); font-size: 15px; line-height: 1.45; margin: 0; }

/* ---------- ambient background blobs ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.ambient .b1 { width: 480px; height: 480px; background: color-mix(in srgb, var(--accent) 26%, transparent); top: -180px; right: -120px; }
.ambient .b2 { width: 380px; height: 380px; background: color-mix(in srgb, var(--pop) 22%, transparent); bottom: -160px; left: -120px; opacity: .35; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 8px; }
  /* accroche (titre) en premier, puis la carte de Pep, en plus compact */
  .hero-copy { order: 0; }
  .hero-visual { order: 1; }
  .preview-card { max-width: 320px; margin: 0 auto; padding: 18px; border-radius: var(--radius); }
  .preview-q { font-size: 18px; margin-top: 16px; }
  .preview-orbwrap { padding: 10px 0 2px; }
  .preview-orbwrap .pep { width: 96px; height: 96px; }
  .steps-strip { grid-template-columns: repeat(2, 1fr); }
  .fb-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .choice-grid { grid-template-columns: 1fr; }
  .gauge-wrap { flex-direction: column; align-items: flex-start; }
}

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