/* chepi.fyi public landing — static port of app/prototype/landing (spec §4.1).
   Palette + faces come from tokens.css (a copy of packages/design-tokens/build/tokens.css);
   monospace is used only for transcript data (timestamps / labels / score). */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }

.stage {
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding: 0 22px 60px;
}
.inner { width: 100%; max-width: 940px; margin: 0 auto; }
button, input { font: inherit; }

.ts {
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--accent-strong); font-variant-numeric: tabular-nums; flex: none;
}

/* ---- topbar ---- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.glyph { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: var(--shadow-accent); }
.betaTag { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.rightTools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill {
  cursor: pointer; font-family: var(--mono); font-weight: 700; font-size: 12px;
  color: var(--text); background: var(--surface); border: 1px solid var(--rule);
  padding: 7px 11px; border-radius: 999px; min-width: 40px; min-height: 32px;
}
.pill:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- hero ---- */
.hero { padding: 30px 0 8px; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--accent-strong); }
.headline {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(38px, 6.2vw, 62px); line-height: 1.0; margin: 14px 0 0;
}
.hMid { color: var(--accent-strong); }
.sub { font-size: 16.5px; line-height: 1.62; color: var(--muted); margin: 20px 0 0; max-width: 520px; }

/* ---- the signature: listen → type → grade storyboard ---- */
.story {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px; align-items: stretch; margin-top: 34px;
}
.panel {
  margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 14px 15px 16px;
}
.panelTag { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--muted); }
.stepNum {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 11px;
}
.arrow { align-self: center; color: var(--accent-strong); font-size: 18px; }

.mini { display: flex; align-items: center; gap: 12px; flex: 1; }
.miniThumb {
  flex: none; width: 72px; height: 50px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--rule-strong));
}
.miniPlay {
  width: 0; height: 0; margin-left: 4px;
  border-left: 13px solid var(--accent-strong); border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.miniInfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wave { display: flex; align-items: flex-end; gap: 3px; height: 18px; opacity: .55; }
.wave span { width: 3px; background: var(--accent); border-radius: 2px; transform-origin: bottom; transform: scaleY(.5); }
.wavePlaying { opacity: 1; }
.wavePlaying span { animation: wave .95s ease-in-out infinite; }

.typeBox {
  flex: 1; min-height: 3.2em; padding: 10px 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.45;
  background: var(--field); border: 1.5px solid var(--rule-strong); border-radius: var(--r-md);
}
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--accent); margin-left: 1px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }

.gradeBox { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gradeWords { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.7; }
.gwordIdle { color: var(--muted); opacity: .35; }
.gword { border-bottom: 2px solid var(--ok); padding-bottom: 1px; animation: gword .3s ease both; }
.gaccent { background: var(--accent-soft); border-radius: 5px; padding: 0 4px 1px; }
.ring {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--rule);
  display: grid; place-items: center; transition: border-color .3s ease;
}
.ring b { font-family: var(--mono); font-weight: 800; font-size: 13px; color: var(--muted); letter-spacing: -.02em; }
.ringOn { border-color: var(--accent); animation: pop .35s ease both; }
.ringOn b { color: var(--accent-strong); }

/* ---- waitlist ---- */
.startBox { margin-top: 30px; max-width: 520px; }
.urlRow {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1.5px solid var(--rule-strong); border-radius: var(--r-pill);
  padding: 6px 6px 6px 15px; flex-wrap: wrap;
}
.urlRow:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.urlIcon { color: var(--accent-strong); font-size: 13px; flex: none; }
.urlInput { flex: 1 1 160px; min-width: 0; border: none; background: transparent; font-family: var(--font-body); font-size: 15px; color: var(--text); padding: 9px 2px; }
.urlInput::placeholder { color: var(--muted); }
.urlInput:focus { outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px; cursor: pointer; border: none;
  padding: 11px 20px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; white-space: nowrap; transition: transform .12s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btnPrimary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.btnPrimary:disabled { cursor: progress; opacity: .6; box-shadow: none; }
.ki { font-size: 11px; opacity: .85; font-weight: 500; }

.formMsg { margin: 10px 0 0; min-height: 1.2em; font-size: 13px; font-weight: 600; color: var(--danger); }
.formMsg:empty { display: none; }
.heroMeta { margin: 13px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.sentCard {
  display: flex; gap: 13px; align-items: center; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); animation: pop .28s ease both;
}
.sentCard[hidden] { display: none; }
.sentIcon { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 19px; font-weight: 800; }
.sentTitle { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; }
.sentBody { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* ---- try-it demo: real grader, English → French ---- */
.demo { margin-top: 64px; }
.demo[hidden] { display: none; }
.demoHead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.demoProgram {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--accent-strong); background: var(--accent-soft); padding: 3px 9px; border-radius: var(--r-pill);
}
.demoCount { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.demoCard {
  margin-top: 14px; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 20px;
}
.demoListen { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.playBtn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; min-height: 44px;
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px; color: var(--accent-strong);
  background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: var(--r-pill); padding: 9px 18px 9px 12px;
  transition: background .15s ease;
}
.playBtn:hover { background: var(--surface-2); }
.playBtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.playIcon {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 10px;
}
.playBtn.isPlaying .playIcon { animation: pulse 1s ease-in-out infinite; }
.demoHint { margin: 0; font-size: 13px; color: var(--muted); }
.demoForm {
  display: flex; align-items: center; gap: 8px; background: var(--field);
  border: 1.5px solid var(--rule-strong); border-radius: var(--r-md); padding: 6px 6px 6px 14px;
}
.demoForm:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.demoInput {
  flex: 1; min-width: 0; border: none; background: transparent; color: var(--text);
  font-family: var(--font-display); font-weight: 700; font-size: 18px; padding: 8px 0;
}
.demoInput::placeholder { color: var(--muted); font-weight: 500; font-family: var(--font-body); font-size: 15px; }
.demoInput:focus { outline: none; }
.demoResult { display: flex; flex-direction: column; gap: 12px; animation: pop .28s ease both; }
.demoResult[hidden] { display: none; }
.demoScoreRow { display: flex; align-items: center; gap: 14px; }
.demoWords { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.9; }
.dw { padding-bottom: 1px; border-bottom: 2px solid transparent; }
.dwOk { border-bottom-color: var(--ok); }
.dwAccent { border-bottom-color: var(--warn); background: var(--warn-soft); border-radius: 5px; padding: 0 4px 1px; }
.dwWrong { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 2px; font-weight: 600; }
.dwFix { border-bottom-color: var(--accent); color: var(--accent-strong); }
.dwMissing { border-bottom: 2px dashed var(--accent); color: var(--accent-strong); }
.demoMeaning { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.demoMeaningTag {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--rule-strong); border-radius: 5px; padding: 1px 5px; margin-right: 4px;
}
.demoActions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.linkBtn { background: none; border: none; cursor: pointer; color: var(--muted); font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 8px 4px; }
.linkBtn:hover { color: var(--accent-strong); }
.linkBtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---- how it works: caption cues ---- */
.how { margin-top: 64px; }
.sectionMark { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; color: var(--muted); }
.sectionMark::before { content: "— "; color: var(--accent-strong); }
.cueList { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.cueRow { display: flex; gap: 18px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--rule); }
.cueLine { font-size: 16px; line-height: 1.55; color: var(--text); }

/* ---- quiet trust row ---- */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.trustItem { display: flex; flex-direction: column; gap: 5px; }
.trustLabel { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--accent-strong); }
.trustText { font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ---- closing CTA ---- */
.cta {
  margin-top: 56px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 44px 24px; border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--rule);
}
.ctaTitle { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3.4vw, 30px); margin: 4px 0 0; }
.ctaSub { margin: 0 0 8px; font-size: 14.5px; color: var(--muted); }
.ctaBtn { padding: 14px 28px; font-size: 15.5px; }

.footNote { margin: 32px auto 0; font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.7; text-align: center; }
.footNote a { color: var(--accent-strong); text-decoration: none; }
.footNote a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .story { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .arrow { transform: rotate(90deg); justify-self: center; }
  .startBox { max-width: none; }
  .trust { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 420px) {
  .demoForm { flex-wrap: wrap; padding: 8px; }
  .demoForm .btn { width: 100%; justify-content: center; }
  .urlRow { border-radius: var(--r-lg); padding: 8px; }
  .urlRow .btn { width: 100%; justify-content: center; }
}

/* ---- motion ---- */
@keyframes wave { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1.15); } }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes gword { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .ring { transition: none; }
  .wavePlaying span, .caret, .gword, .ringOn, .sentCard, .demoResult, .playBtn.isPlaying .playIcon { animation: none; }
  .wavePlaying span { transform: scaleY(.7); }
}
