/* simpleMath: trang giới thiệu. Màu và phông lấy từ app (src/theme.ts, Be Vietnam Pro). */
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url('fonts/be-vietnam-pro-800.woff') format('woff'); font-weight: 800; font-display: swap; }

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #141b2d;
  --muted: #5b6475;
  --line: #e4e7ec;
  --track: #e9ecf2;
  --primary: #3b5bdb;
  --primary-2: #4f7cff;
  --primary-dark: #2f4ac0;
  --primary-soft: #edf1fd;
  --accent: #ff9f1c;
  --accent-soft: #fff1de;
  --accent-text: #a33f00;
  --green: #2b8a3e;
  --green-2: #37b24d;
  --green-soft: #ebfbee;
  --red: #e03131;
  --red-soft: #fff0f0;
  --block: #5b8def;
  --block-hi: #ffb347;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 12px 32px rgba(20, 27, 45, 0.08);
  --shadow-lg: 0 24px 60px rgba(31, 52, 140, 0.18);
  --max: 1140px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hai ngôn ngữ: chữ viết sẵn cả hai bản, chỉ hiện bản đang chọn. */
html[lang='vi'] [data-l='en'],
html[lang='en'] [data-l='vi'] { display: none !important; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
section { padding: 88px 0; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.01em;
}
h1, h2, h3 { line-height: 1.18; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
.lead { color: var(--muted); font-size: 1.125rem; max-width: 640px; margin: 14px 0 0; }
.head { text-align: center; margin-bottom: 48px; }
.head .lead { margin-inline: auto; }

/* Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 14px; border: 0;
  font-weight: 800; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(59, 91, 219, 0.32); }
.btn-primary:hover { transform: translateY(-2px); background: var(--primary-dark); box-shadow: 0 14px 30px rgba(59, 91, 219, 0.38); }
.btn-ghost { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }

/* Thanh trên cùng */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 247, 249, 0.82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, box-shadow 0.3s;
}
.nav.scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(20, 27, 45, 0.05); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand b { color: var(--primary); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 0.95rem; transition: color 0.2s, background 0.2s; }
.nav-links a:hover { color: var(--primary); background: var(--primary-soft); }
.lang { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--track); }
.lang button { border: 0; background: transparent; padding: 6px 10px; border-radius: 9px; font-weight: 800; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.lang button[aria-pressed='true'] { background: var(--card); color: var(--primary); box-shadow: 0 2px 6px rgba(20, 27, 45, 0.1); }
.menu-btn { display: none; border: 0; background: var(--card); width: 44px; height: 44px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }

/* Phần mở đầu */
.hero { padding: 56px 0 72px; overflow: hidden; }
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; z-index: -1;
  animation: drift 18s ease-in-out infinite alternate;
}
.hero::before { width: 520px; height: 520px; background: #cfdcff; top: -160px; right: -120px; }
.hero::after { width: 420px; height: 420px; background: #ffe1b8; bottom: -180px; left: -140px; animation-delay: -6s; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 800; margin: 18px 0 0; }
.hero h1 .word { display: inline-block; opacity: 0; transform: translateY(24px); animation: rise 0.8s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.mark { position: relative; color: var(--primary); white-space: nowrap; }
.mark svg { position: absolute; left: -2%; bottom: -0.18em; width: 104%; height: 0.42em; overflow: visible; }
.mark path { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1s 0.9s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero .lead { font-size: 1.2rem; margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; color: var(--muted); font-size: 0.95rem; }
.hero-note span { display: inline-flex; align-items: center; gap: 8px; }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 0 rgba(55, 178, 77, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(55, 178, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(55, 178, 77, 0); } }

/* Điện thoại */
.stage-hero { position: relative; display: grid; place-items: center; min-height: 600px; }
.phone {
  position: relative; width: 300px; aspect-ratio: 390 / 844; border-radius: 46px; padding: 12px;
  background: linear-gradient(145deg, #23293b, #0e1220); box-shadow: var(--shadow-lg), inset 0 0 0 2px #3a4258;
}
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: var(--bg); }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 0.9s ease, transform 1.4s var(--ease); }
.phone .screen img.on { opacity: 1; transform: none; }
.phone::after { content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #0e1220; }
.hero .phone { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-1deg); } }
.bubble {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font-weight: 800; white-space: nowrap; animation: floaty 5s ease-in-out infinite;
}
.bubble small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.bubble .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.bubble.b1 { top: 70px; left: -6px; animation-delay: -1s; }
.bubble.b2 { bottom: 120px; right: -10px; animation-delay: -2.5s; }
.bubble.b3 { bottom: 34px; left: 18px; animation-delay: -4s; }
@keyframes floaty { 50% { transform: translateY(-10px); } }
.eq { color: var(--primary); }
.eq em { font-style: normal; color: var(--accent-text); }
.wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.wave i { width: 3px; border-radius: 3px; background: var(--primary); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -0.2s; } .wave i:nth-child(3) { animation-delay: -0.4s; } .wave i:nth-child(4) { animation-delay: -0.6s; } .wave i:nth-child(5) { animation-delay: -0.8s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 18px; } }

/* Hình trôi nổi (giống biểu tượng app) */
.shapes { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.shape { position: absolute; transition: transform 0.6s var(--ease); }
.shape > * { animation: spinfloat var(--t, 9s) ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes spinfloat { 50% { transform: translateY(-16px) rotate(18deg); } }
.s-circle { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); }
.s-square { width: 24px; height: 24px; border-radius: 6px; background: var(--green-2); }
.s-tri { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 26px solid var(--green-2); }
.s-plus { width: 30px; height: 30px; position: relative; }
.s-plus::before, .s-plus::after { content: ''; position: absolute; background: var(--primary-2); border-radius: 6px; }
.s-plus::before { left: 10px; top: 0; width: 10px; height: 30px; }
.s-plus::after { top: 10px; left: 0; width: 30px; height: 10px; }

/* Số liệu */
.stats { padding: 0 0 24px; }
.stats .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 20px 18px; box-shadow: var(--shadow); text-align: center; }
.stat b { display: block; font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.92rem; font-weight: 600; }

/* Hiện dần khi cuộn tới */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* Bốn bước */
.steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps .line { position: absolute; top: 44px; left: 10%; right: 10%; height: 4px; z-index: 0; }
.steps .line path { stroke: var(--primary); stroke-width: 3; stroke-dasharray: 8 10; fill: none; opacity: 0.35; }
.step { position: relative; z-index: 1; background: var(--card); border-radius: var(--radius-lg); padding: 26px 22px; box-shadow: var(--shadow); transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.step .num { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; font-weight: 800; font-size: 1.3rem; }
.step:nth-child(2) .num { background: var(--primary); }
.step:nth-child(3) .num { background: var(--accent); }
.step:nth-child(4) .num { background: var(--green-2); }
.step:nth-child(5) .num { background: #9c36b5; }
.step p { color: var(--muted); margin: 10px 0 0; font-size: 0.98rem; }

/* Bài giảng mẫu thử */
.demo-band { background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%); }
.demo { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: start; }
.lesson-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; }
.crumb { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.statement { font-size: 1.15rem; font-weight: 600; margin: 8px 0 14px; white-space: pre-line; }
.statement .big { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--track); position: relative; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: 10px 8px; border-radius: 10px; font-weight: 800; font-size: 0.92rem; color: var(--muted); cursor: pointer; transition: color 0.3s; }
.seg button[aria-pressed='true'] { color: var(--text); }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 10px; background: var(--card); box-shadow: 0 2px 8px rgba(20, 27, 45, 0.12); transition: transform 0.45s var(--ease), width 0.45s var(--ease); }
.svg-stage { margin-top: 14px; border-radius: 18px; background: linear-gradient(180deg, #fbfcfe, #f4f6fb); border: 1px solid var(--line); aspect-ratio: 360 / 210; position: relative; overflow: hidden; }
.svg-stage svg { width: 100%; height: 100%; display: block; }
.narr { margin-top: 14px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; min-height: 132px; }
.narr .spk { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; transition: transform 0.2s; }
.narr .spk:hover { transform: scale(1.08); }
.narr .spk.on { background: var(--primary); color: #fff; }
.narr .label { font-size: 0.78rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.narr p { margin: 4px 0 0; font-size: 1.02rem; }
.narr p.fade { animation: fadein 0.5s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.chip { min-width: 34px; padding: 4px 10px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 800; text-align: center; animation: pop 0.4s var(--ease) backwards; }
.chip.op { background: transparent; color: var(--muted); min-width: 0; padding: 4px 2px; }
.chip.res { background: var(--text); color: #fff; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.controls { display: grid; grid-template-columns: 1fr auto 1.6fr; gap: 10px; margin-top: 16px; }
.controls .btn { min-height: 48px; padding: 0 16px; white-space: nowrap; }
.play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; cursor: pointer; color: var(--text); }
.play.on { background: var(--accent); color: #fff; box-shadow: none; }
.progress { display: flex; gap: 6px; margin-top: 14px; }
.progress i { flex: 1; height: 5px; border-radius: 5px; background: var(--track); transition: background 0.4s; }
.progress i.done { background: var(--primary); }
.demo-side h3 { font-size: 1.5rem; }
.demo-side p { color: var(--muted); }
.demo-side ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.demo-side li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; background: var(--card); padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); }
.demo-side li .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.demo-side li b { display: block; }
.demo-side li span { color: var(--muted); font-size: 0.95rem; }

/* SVG sân khấu */
.cell { fill: #fff; stroke: #c9d2e3; stroke-width: 1.5; }
.frame-box { fill: none; stroke: #8b98b3; stroke-width: 2; }
.frame-box.full { stroke: var(--green-2); stroke-width: 3; }
.dot { transition: transform 0.9s var(--ease), opacity 0.5s, fill 0.4s; transform-box: fill-box; transform-origin: center; }
.dot.blue { fill: var(--block); }
.dot.orange { fill: var(--block-hi); }
.dot.ring { stroke: var(--accent-text); stroke-width: 3; }
.dot.dim { opacity: 0.35; }
.dot.pulse { animation: dotpulse 0.6s var(--ease); }
@keyframes dotpulse { 50% { transform: scale(1.35); } }
.slot { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; transform-box: fill-box; transform-origin: center; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.82); } }
.tag { font-weight: 800; font-size: 15px; fill: var(--accent-text); text-anchor: middle; transition: opacity 0.4s; }
.tag.blue { fill: var(--primary); }
.tag.green { fill: var(--green); }
.axis { stroke: #8b98b3; stroke-width: 2.5; }
.tick { stroke: #8b98b3; stroke-width: 2; }
.tick-label { font-size: 12px; fill: var(--muted); text-anchor: middle; font-weight: 600; }
.tick-label.key { font-size: 15px; fill: var(--text); font-weight: 800; }
.hop { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease); }
.hop.blue { stroke: var(--primary); }
.pin { transition: transform 0.9s var(--ease); }
.final { font-size: 34px; font-weight: 800; fill: var(--text); text-anchor: middle; transition: opacity 0.5s, transform 0.5s var(--ease); transform-box: fill-box; transform-origin: center; }
.hidden { opacity: 0; }

/* Phương pháp */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); transition: transform 0.3s var(--ease), box-shadow 0.3s; overflow: hidden; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card p { color: var(--muted); margin: 8px 0 0; font-size: 0.98rem; }
.mini { height: 96px; border-radius: 16px; background: var(--bg); margin-bottom: 18px; display: grid; place-items: center; position: relative; overflow: hidden; }
.cpa { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.cpa > * { animation: glow 4.5s infinite; }
.cpa > :nth-child(3) { animation-delay: 1.5s; } .cpa > :nth-child(5) { animation-delay: 3s; }
.cpa .arrow { animation: none; color: var(--muted); }
@keyframes glow { 0%, 30% { transform: scale(1.12); opacity: 1; } 34%, 100% { transform: none; opacity: 0.45; } }
.cubes { display: grid; grid-template-columns: repeat(3, 14px); gap: 3px; }
.cubes i { width: 14px; height: 14px; border-radius: 3px; background: var(--block); }
.cubes i:nth-child(n + 4) { background: var(--block-hi); }
.dots5 { display: flex; gap: 4px; }
.dots5 i { width: 12px; height: 12px; border-radius: 50%; background: var(--block); }
.dots5 i:nth-child(n + 4) { background: var(--block-hi); }
.mini .seg { width: 80%; }
.mini .seg span:not(.thumb) { padding: 8px 6px; font-weight: 800; font-size: 0.82rem; text-align: center; color: var(--muted); position: relative; z-index: 1; }
.mini .seg .thumb { width: calc(50% - 6px); animation: slide 3.2s var(--ease) infinite; }
@keyframes slide { 0%, 40% { transform: none; } 50%, 90% { transform: translateX(calc(100% + 4px)); } }
.choices3 { display: flex; gap: 8px; }
.choices3 i { width: 46px; height: 40px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; font-style: normal; font-weight: 800; }
.choices3 i:nth-child(1) { animation: wrong 4s infinite; }
.choices3 i:nth-child(3) { animation: right 4s infinite; }
@keyframes wrong { 10%, 30% { background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red); transform: translateX(0); } 14% { transform: translateX(-4px); } 18% { transform: translateX(4px); } 22% { transform: translateX(-2px); } 40% { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); } }
@keyframes right { 50%, 85% { background: var(--green-2); color: #fff; box-shadow: none; } }
.levels { width: 80%; display: grid; gap: 7px; }
.levels div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.levels b { height: 9px; border-radius: 9px; background: var(--track); overflow: hidden; position: relative; }
.levels b::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); border-radius: 9px; animation: fill 4.5s var(--ease) infinite; }
.levels div:nth-child(1) b::after { background: var(--green-2); }
.levels div:nth-child(2) b::after { background: var(--accent); animation-delay: 0.9s; }
.levels div:nth-child(3) b::after { background: var(--red); animation-delay: 1.8s; }
@keyframes fill { 0% { transform: scaleX(0); } 30%, 80% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
.globe { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--primary); position: relative; }
.globe::before, .globe::after { content: ''; position: absolute; inset: 6px 18px; border-radius: 50%; border: 2px solid var(--primary); opacity: 0.6; }
.globe::after { inset: 18px 6px; }
.orbit { position: absolute; width: 110px; height: 110px; animation: orbit 6s linear infinite; }
.orbit i { position: absolute; top: 0; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
@keyframes orbit { to { transform: rotate(360deg); } }
.big-wave { display: flex; align-items: center; gap: 5px; height: 56px; }
.big-wave i { width: 6px; border-radius: 6px; background: var(--primary); animation: wave2 1.2s ease-in-out infinite; }
.big-wave i:nth-child(odd) { background: var(--accent); }
@keyframes wave2 { 0%, 100% { height: 10px; } 50% { height: 52px; } }

/* Nội dung chương trình */
.curr-tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.grades { display: flex; flex-wrap: wrap; gap: 8px; }
.grades button { border: 0; padding: 9px 16px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; font-size: 0.92rem; color: var(--muted); cursor: pointer; transition: all 0.25s; }
.grades button[aria-pressed='true'] { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(59, 91, 219, 0.3); }
.search { flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 50px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.search input { border: 0; outline: 0; flex: 1; font: inherit; background: transparent; min-width: 0; }
.topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic {
  text-align: left; border: 0; cursor: pointer; background: var(--card); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; transition: transform 0.3s var(--ease), box-shadow 0.3s, opacity 0.3s;
  position: relative; overflow: hidden;
}
.topic::after { content: ''; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.topic:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.topic:hover::after { transform: scaleX(1); }
.topic .emo { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.7rem; background: var(--soft); }
.topic h3 { font-size: 1.08rem; }
.topic p { margin: 4px 0 8px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.topic .meta { font-size: 0.82rem; font-weight: 800; color: var(--c); }
.topic.dim { opacity: 0.35; transform: none; }
.results { display: none; background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 8px; margin-bottom: 18px; max-height: 420px; overflow: auto; }
.results.show { display: block; animation: fadein 0.3s var(--ease); }
.results button { width: 100%; text-align: left; border: 0; background: transparent; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.results button:hover { background: var(--primary-soft); }
.results small { display: block; color: var(--muted); font-size: 0.82rem; }
.results mark { background: var(--accent-soft); color: var(--accent-text); border-radius: 4px; padding: 0 2px; }
.results .empty { padding: 14px; color: var(--muted); }

dialog.topic-dlg { border: 0; padding: 0; border-radius: 28px; width: min(760px, calc(100% - 24px)); max-height: min(86vh, 900px); box-shadow: 0 30px 80px rgba(20, 27, 45, 0.35); color: var(--text); }
dialog.topic-dlg[open] { animation: dlgin 0.45s var(--ease); }
dialog.topic-dlg::backdrop { background: rgba(20, 27, 45, 0.45); backdrop-filter: blur(4px); }
@keyframes dlgin { from { opacity: 0; transform: translateY(30px) scale(0.97); } }
.dlg-head { position: sticky; top: 0; z-index: 1; display: flex; gap: 14px; align-items: center; padding: 22px 24px; background: var(--soft); }
.dlg-head .emo { font-size: 2rem; }
.dlg-head h3 { font-size: 1.35rem; }
.dlg-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.dlg-close { margin-left: auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; font-size: 1.2rem; box-shadow: 0 2px 8px rgba(20, 27, 45, 0.12); }
.dlg-body { padding: 8px 24px 26px; overflow: auto; }
.unit { padding: 16px 0; border-bottom: 1px solid var(--line); }
.unit:last-child { border-bottom: 0; }
.unit h4 { margin: 0 0 10px; font-size: 1.02rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.unit h4 small { font-size: 0.75rem; font-weight: 800; color: var(--c); background: var(--soft); padding: 3px 9px; border-radius: 999px; }
.lessons { display: flex; flex-wrap: wrap; gap: 8px; }
.lessons span { padding: 6px 12px; border-radius: 10px; background: var(--bg); font-size: 0.9rem; animation: pop 0.35s var(--ease) backwards; }
.lessons span.hit { background: var(--accent-soft); color: var(--accent-text); font-weight: 800; box-shadow: inset 0 0 0 2px var(--accent); }
.unit.off { opacity: 0.35; }

/* Luyện tập thử */
.quiz-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 32px; align-items: center; }
.quiz { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; position: relative; overflow: hidden; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.82rem; font-weight: 800; }
.quiz-top .lv { color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.quiz-top .score { color: var(--accent-text); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.quiz .q { font-size: 1.2rem; font-weight: 600; margin: 14px 0 18px; white-space: pre-line; min-height: 3.2em; }
.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.answers button { min-height: 64px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; font-size: 1.25rem; cursor: pointer; transition: transform 0.15s, background 0.25s, box-shadow 0.25s, color 0.25s; }
.answers button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--primary); }
.answers button.ok { background: var(--green); color: #fff; box-shadow: none; animation: bounce 0.5s var(--ease); }
.answers button.no { background: var(--red-soft); color: var(--red); box-shadow: inset 0 0 0 2px var(--red); animation: shake 0.45s; }
@keyframes bounce { 40% { transform: scale(1.08); } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.feedback { min-height: 54px; margin-top: 14px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.feedback.ok { color: var(--green); }
.feedback.no { color: var(--accent-text); }
.quiz .next { margin-top: 8px; width: 100%; }
.confetti { position: absolute; inset: 0; pointer-events: none; }

.plain-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; font-weight: 600; }
.plain-list b { color: var(--primary); }
.svg-stage.instant * { transition: none !important; }

/* Phụ huynh */
.parents { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 48px; align-items: center; }
.demo > *, .quiz-wrap > *, .parents > *, .hero .wrap > * { min-width: 0; }
.phones { position: relative; display: flex; justify-content: center; gap: 0; min-height: 560px; }
.phones .phone { width: 250px; }
.phones .phone:first-child { transform: rotate(-6deg) translateX(30px); z-index: 1; }
.phones .phone:last-child { transform: rotate(5deg) translate(-30px, 40px); }
.feat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 26px; }
.feat div { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.feat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 10px; }
.feat b { display: block; }
.feat span { color: var(--muted); font-size: 0.93rem; }

/* Giá */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 860px; margin-inline: auto; }
.plan { background: var(--card); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.plan.best { background: linear-gradient(150deg, var(--primary), #5a4bdb); color: #fff; box-shadow: var(--shadow-lg); }
.plan.best::before { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); right: -60px; top: -80px; }
.plan .tagline { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
.plan h3 { font-size: 1.6rem; margin: 6px 0 4px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.plan li { position: relative; padding-left: 28px; }
.plan li::before { content: '✓'; position: absolute; left: 0; font-weight: 800; color: var(--green-2); }
.plan.best li::before { color: #ffd8a8; }

/* Hỏi đáp */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 20px 22px; font-weight: 800; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.5rem; color: var(--primary); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--muted); }

/* Kết */
.final-cta { text-align: center; }
.final-box { background: linear-gradient(135deg, var(--primary), #6d4ce0); color: #fff; border-radius: 32px; padding: 64px 24px; position: relative; overflow: hidden; }
.final-box h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.final-box p { opacity: 0.9; margin: 12px auto 26px; max-width: 560px; }
.final-box .btn-primary { background: #fff; color: var(--primary); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18); }
.final-box .shape { opacity: 0.9; }
footer { padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--primary); }

/* Màn hình vừa và nhỏ */
@media (max-width: 1020px) {
  .stats .grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps .line { display: none; }
  .cards, .topics { grid-template-columns: repeat(2, 1fr); }
  .demo, .quiz-wrap, .parents { grid-template-columns: 1fr; }
  .demo-side { order: -1; }
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-cta, .hero-note { justify-content: center; }
  .stage-hero { min-height: 560px; }
  .hero .shape:nth-child(3), .hero .shape:nth-child(4) { display: none; }
  .nav-links { display: none; position: absolute; top: 68px; left: 16px; right: 16px; flex-direction: column; background: var(--card); border-radius: 18px; padding: 10px; box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; animation: fadein 0.25s var(--ease); }
  .nav-links a { padding: 12px 14px; }
  .menu-btn { display: grid; place-items: center; margin-left: auto; }
  .nav .lang { margin-left: 0; }
}
@media (max-width: 620px) {
  body { font-size: 1rem; }
  section { padding: 64px 0; }
  .stats .grid { grid-template-columns: repeat(2, 1fr); }
  .stats .stat:last-child { grid-column: span 2; }
  .steps, .cards, .topics, .feat, .price { grid-template-columns: 1fr; }
  .phone { width: 260px; }
  .phones { min-height: 420px; }
  .phones .phone { width: 165px; padding: 8px; border-radius: 30px; }
  .phones .phone .screen { border-radius: 23px; }
  .phones .phone::after { width: 54px; height: 16px; top: 14px; }
  .phones .phone:first-child { transform: rotate(-6deg) translateX(14px); }
  .phones .phone:last-child { transform: rotate(5deg) translate(-14px, 30px); }
  .bubble.b1 { left: -4px; top: 40px; }
  .bubble.b2 { right: -4px; }
  .controls { grid-template-columns: auto auto 1fr; }
  .controls .btn { padding: 0 12px; font-size: 0.95rem; }
  .lesson-card, .quiz { padding: 18px; }
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .hero h1 .word, .reveal { opacity: 1; transform: none; }
}
