:root {
  --bg: #fbf6ef;
  --surface: #fff;
  --ink: #1f1a14;
  --muted: #6b6258;
  --line: #eadfce;
  --caramel: #a8682f;
  --caramel-dark: #7f4c1f;
  --cream: #f0cfa5;
  --blue: #8fd3ff;
  --blue-ink: #1f78b4;
  --pink: #ff5a7a;
  --green: #25d366;
  --halo: 0 0 2px #000, 0 0 4px #000, 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, .55);
  --spring: cubic-bezier(.3, 1.65, .5, 1);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo",
    "Microsoft YaHei", "Yu Gothic", "Malgun Gothic", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; }
a { color: var(--caramel-dark); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 21px; }
kbd { display: inline-block; min-width: 1.7em; padding: .05em .4em; border: 1px solid #cbbfae; border-bottom-width: 3px; border-radius: .35em;
  background: var(--surface); font: 600 .85em/1.3 var(--font); text-align: center; color: var(--ink); }
.blue { color: var(--blue-ink); }
.pink { color: var(--pink); }

/* ---------- en-tête */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100vw - 1140px) / 2)); background: rgba(251, 246, 239, .86); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
.top nav { margin-left: auto; }
.langpick { position: relative; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 14px; cursor: pointer; }
.langpick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: 600 14px var(--font); color: var(--ink);
  padding-right: 2px; cursor: pointer; outline: none; }
.langpick:focus-within { box-shadow: 0 0 0 2px var(--caramel); }
@media (max-width: 640px) { .top nav { display: none; } }

main > section { max-width: 1140px; margin: 0 auto; padding: 72px 16px; }

/* ---------- hero */
.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: start; padding-top: 64px !important; }
@media (max-width: 920px) { .hero { grid-template-columns: 1fr; gap: 36px; } }
.hero h1 { font-size: clamp(36px, 5.2vw, 58px); font-weight: 850; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); margin: 22px 0 28px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.cta { display: inline-flex; align-items: center; padding: 14px 22px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; }
.cta.soon { background: var(--caramel); color: #fff; }
.cta.ghost { color: var(--ink); border: 1.5px solid #d9ccb8; }
.cta.ghost:hover { background: var(--surface); }
.platforms { margin-top: 22px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.demo-help { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 15px; min-height: 1.6em; }

.mywords { margin-top: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.mywords-hd { font-weight: 700; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.mywords-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; align-items: center; }
.mywords .empty { color: var(--muted); font-size: 15px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: 999px; background: #f6ece0; font-size: 15px;
  animation: pop-in .45s var(--spring) both; }
.chip b { color: var(--caramel-dark); }
.chip.thinking { color: var(--muted); }
.chip.thinking::after { content: "…"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6) translateY(8px); } }

/* ---------- lecteur (fac-similé de l'extension) */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; container-type: inline-size;
  background: #0e1220; color: #fff; box-shadow: 0 18px 50px rgba(60, 35, 10, .22); user-select: none; outline: none; }
#demo { cursor: pointer; }
#demo:focus-visible { box-shadow: 0 0 0 3px var(--caramel), 0 18px 50px rgba(60, 35, 10, .22); }
.scene { position: absolute; inset: 0; }
.scene svg { width: 100%; height: 100%; display: block; }
.player[data-state="paused"] .scene, .player[data-state="saved"] .scene { filter: brightness(.82); }
.pausebadge { position: absolute; left: 50%; top: 42%; width: 13cqw; height: 13cqw; margin: -6.5cqw; border-radius: 50%;
  background: rgba(0, 0, 0, .45); display: none; align-items: center; justify-content: center; gap: 1.6cqw; }
.pausebadge i { width: 1.5cqw; height: 5cqw; background: #fff; border-radius: .3cqw; }
#demo[data-state="paused"] .pausebadge.flash { display: flex; animation: fade-out .8s ease-out .2s both; }
@keyframes fade-out { to { opacity: 0; transform: scale(1.25); } }

.subs { position: absolute; left: 6%; right: 6%; bottom: 9%; text-align: center; text-shadow: var(--halo); line-height: 1.25; }
.subs p { margin: 0; }
.subs .fr { color: var(--blue); font-weight: 700; font-size: 3.3cqw; margin-bottom: .35em; display: none; }
.subs .en { position: relative; display: inline; font-weight: 600; font-size: 3.6cqw; }
.player[data-state="playing"] .subs .en { font-weight: 500; }
.player:not([data-state="playing"]) .subs .fr { display: block; animation: line-in .42s var(--spring) both; }
.player:not([data-state="playing"]) .subs { bottom: 23%; }
@keyframes line-in { from { opacity: 0; transform: translateY(14px) scale(.86); } }

.lineheart { display: none; position: relative; width: .85em; height: .85em; margin-left: .35em; vertical-align: -.08em;
  filter: drop-shadow(0 0 2px #000) drop-shadow(0 1px 2px #000); }
.player:not([data-state="playing"]) .lineheart { display: inline-block; }
.lineheart svg, .hud .ic svg, .spk svg { display: block; width: 100%; height: 100%; }
.lineheart svg { fill: none; stroke: #fff; stroke-width: 2.2; }
.player[data-state="saved"] .lineheart svg { fill: var(--pink); stroke: var(--pink); }
.lineheart.pop > svg { animation: heart-pop .6s var(--spring); }
@keyframes heart-pop { 0% { transform: scale(.3); } 45% { transform: scale(1.9) rotate(-10deg); } 100% { transform: scale(1); } }

.toast { position: absolute; left: 50%; bottom: calc(100% + .5em); transform: translateX(-50%); white-space: nowrap; padding: .25em .7em;
  border-radius: 999px; background: var(--pink); color: #fff; font-size: .62em; font-weight: 700; text-shadow: none; display: none; }
.step .player[data-state="saved"] .toast { display: block; }
.toast.live { display: block; animation: toast 1.25s ease-out both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, .6em) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  25% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -.5em); } }
.burst { position: absolute; left: 50%; top: 50%; }
.spk { position: absolute; left: -.28em; top: -.28em; width: .56em; height: .56em; animation: spark .7s cubic-bezier(.15, .7, .3, 1) both; }
.spk svg { fill: var(--pink); }
.spk.dot { background: #ffd166; border-radius: 50%; width: .28em; height: .28em; left: -.14em; top: -.14em; }
@keyframes spark { from { opacity: 1; transform: translate(0, 0) scale(.5); } 70% { opacity: 1; }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); } }

.hud { position: absolute; right: 2.5%; bottom: 4%; display: none; align-items: flex-end; gap: 1.6cqw; padding: 1.3cqw 1.4cqw;
  background: rgba(12, 14, 18, .74); border: 1px solid rgba(255, 255, 255, .14); border-radius: 1.6cqw; backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); font: 500 max(9px, 1.55cqw)/1.2 var(--font); text-shadow: var(--halo); }
.player:not([data-state="playing"]) .hud { display: flex; }
.player:not([data-state="playing"]) .subs { right: 30%; left: 4%; }
.hud .k { display: flex; flex-direction: column; align-items: center; gap: .55em; min-width: 3.6em; animation: key-in .45s var(--spring) both; }
.hud .k:nth-child(2) { animation-delay: .05s; } .hud .k:nth-child(3) { animation-delay: .1s; } .hud .k:nth-child(4) { animation-delay: .15s; }
.hud .k.off { opacity: .32; }
.hud .lab { display: flex; align-items: center; gap: .3em; white-space: nowrap; }
.hud .ic { width: 1.05em; height: 1.05em; filter: drop-shadow(0 0 2px #000); }
.hud .ic svg { fill: none; stroke: #fff; stroke-width: 2.2; }
.player[data-state="saved"] .hud .up .ic svg { fill: var(--pink); stroke: var(--pink); }
.hud .cap { width: 2.7em; height: 2.7em; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .8);
  border-bottom-width: 3px; border-radius: .45em; background: rgba(0, 0, 0, .4); font-size: 1.05em; transition: transform .08s, background .08s; }
.hud .k.press .cap { transform: translateY(2px); border-bottom-width: 1px; background: rgba(255, 255, 255, .3); }
.hud .logo { width: 1.9em; height: 1.9em; margin-bottom: .4em; border-radius: 50%; background: #e9edf2; display: flex; align-items: center;
  justify-content: center; opacity: .85; }
.hud .logo img { width: 84%; height: 84%; }
@keyframes key-in { from { opacity: 0; transform: translateY(16px) scale(.6); } }
@container (max-width: 420px) { .hud .lab { display: none; } .hud .logo { display: none; } }

.bar { position: absolute; left: 3%; right: 3%; bottom: 2.2%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.bar i { display: block; height: 100%; width: var(--p, 30%); border-radius: inherit; background: #e50914; transition: width .4s linear; }
.player:not([data-state="playing"]) .bar { display: none; }

/* ---------- étapes */
.steps h2, .science h2, .faq h2 { text-align: center; margin-bottom: 18px; }
.step { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: center; margin-top: 72px; }
.step:nth-of-type(even) .step-text { order: 2; }
@media (max-width: 860px) { .step { grid-template-columns: 1fr; gap: 24px; margin-top: 56px; } .step:nth-of-type(even) .step-text { order: 0; } }
.step-text p { color: var(--muted); margin: 14px 0 0; }
.step-text b { color: var(--ink); }
.num { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; margin-bottom: 14px;
  background: var(--caramel); color: #fff; font-weight: 800; }
.keys-legend { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.aicard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: 0 8px 24px rgba(60, 35, 10, .08); }
.aicard-hd { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.aicard-hd .spark { color: var(--caramel); }
.aicard-src { margin: 8px 0 4px; font-style: italic; }
.aicard mark { background: #dff1ff; color: var(--blue-ink); font-weight: 700; border-radius: 4px; padding: 0 3px; font-style: normal; }
.aicard-word { margin: 0; font-size: 19px; }

/* quiz de fin d'épisode : fac-similé du chat de l'extension */
.chat { background: #0b141a; border: 1px solid #1f2c33; border-radius: 14px; overflow: hidden; color: #e9edef; font-size: 16px; line-height: 1.4;
  max-width: 440px; width: 100%; justify-self: center; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.chat-hd { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #202c33; }
.chat-hd img, .wa-hd img { width: 38px; height: 38px; padding: 4px; border-radius: 50%; background: #e9edf2; }
.chat-hd b, .wa-hd b { display: block; } .chat-hd small, .wa-hd small { display: block; color: #8696a0; font-size: 13px; }
.chat-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.chat .b { background: #202c33; border-radius: 8px; padding: 8px 12px; max-width: 88%; }
.chat .b.me { background: #005c4b; align-self: flex-end; }
.chat .src { display: block; color: #8696a0; font-size: 13px; margin-bottom: 3px; }
.chat .w { color: var(--blue); font-weight: 600; }
.chat .opts { display: flex; flex-direction: column; gap: 5px; max-width: 88%; }
.chat .opt { background: #202c33; color: var(--blue); border-radius: 8px; padding: 8px 12px; text-align: center; }
.chat .opt.picked { background: #2a3942; }
.chat-prog { display: flex; gap: 4px; padding: 0 14px 12px; }
.chat-prog i { flex: 1; height: 3px; border-radius: 2px; background: #2a3942; }
.chat-prog i.ok { background: var(--green); } .chat-prog i.now { background: var(--blue); }

/* WhatsApp */
.phone { justify-self: center; width: min(360px, 100%); border-radius: 34px; padding: 10px; background: #1c1c1e; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.wa-hd { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f0f2f5; border-radius: 26px 26px 0 0; color: #111b21; }
.wa-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px 16px; border-radius: 0 0 26px 26px; font-size: 14.5px; line-height: 1.38;
  background: #efe7dd radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px) 0 0 / 14px 14px; color: #111b21; }
.wa-day { align-self: center; font-size: 11px; background: #fff; color: #54656f; padding: 3px 9px; border-radius: 7px; margin-bottom: 4px; }
.wa-b { position: relative; align-self: flex-start; max-width: 86%; background: #fff; padding: 6px 9px 18px; border-radius: 8px;
  box-shadow: 0 1px .5px rgba(0, 0, 0, .13); }
.wa-b.me { align-self: flex-end; background: #d9fdd3; }
.wa-t { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; color: #667781; }
.wa-btn { display: block; margin: 8px -9px -18px; padding: 8px; border-top: 1px solid #e9edef; text-align: center; color: #027eb5; font-weight: 500; }
.wa-btn + .wa-btn { margin-top: 18px; }
.wa-b .wa-t + .wa-btn { margin-top: 10px; }

.timeline { display: flex; list-style: none; padding: 0; margin: 26px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: linear-gradient(90deg, var(--caramel), var(--green)); }
.timeline li { flex: 1; position: relative; padding-top: 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--caramel); }
.timeline li:last-child { flex: 0 0 auto; }

/* ---------- science */
.section-lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 40px; }
.curve { margin: 0 auto 48px; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 10px; }
.curve svg { width: 100%; height: auto; display: block; }
.curve .axis { stroke: #cbbfae; stroke-width: 1.5; }
.curve .lbl, .curve .ticks text { font: 12px var(--font); fill: var(--muted); }
.curve .ticks text { text-anchor: middle; }
.curve .ticks circle { fill: var(--green); }
.curve .forget { fill: none; stroke: #c9bcab; stroke-width: 3; stroke-dasharray: 7 6; }
.curve .remember { fill: none; stroke: var(--caramel); stroke-width: 3.5; stroke-linejoin: round; }
.curve .tag { font: 700 14px var(--font); }
.curve .forget-tag { fill: #a0937f; } .curve .remember-tag { fill: var(--caramel); }
.curve figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.cards article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.cards article.highlight { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.cards p { margin: 10px 0 0; color: var(--muted); }
.cards .highlight p { color: #fbeee0; }
.cards .ref { font-size: 13px; }
.cards .highlight .ref { color: var(--cream); }

/* ---------- FAQ */
.faq { max-width: 760px !important; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; margin-top: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- pied de page */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 28px max(16px, calc((100vw - 1140px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.foot span { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }

/* ---------- page légale */
.legal { max-width: 760px; margin: 0 auto; padding: 56px 16px 72px; font-size: 16px; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 8px; }
.legal h2 { font-size: 20px; margin: 36px 0 8px; text-align: left; }
:lang(zh) h1, :lang(ja) h1, :lang(ko) h1, :lang(zh) h2, :lang(ja) h2, :lang(ko) h2 { letter-spacing: 0; line-height: 1.3; }
:lang(zh) .hero h1, :lang(ja) .hero h1, :lang(ko) .hero h1 { word-break: keep-all; }
.legal p, .legal li { color: #3d362e; }
.legal ul { padding-left: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
