/* ============================================================
   Meslingo — home page
   Story: 01 Speak → 02 Remember → 03 Certify (Exam Center) → 04 Connect
   Motion: CSS for first paint, GSAP/ScrollTrigger for scroll (home.js),
   WebGL globe (globe.js, lazy). Everything degrades to static content.
   ============================================================ */

.home { --section-pad: clamp(84px, 11vw, 140px); }
.section { position: relative; padding: var(--section-pad) 0; }

.section-head,
.chapter-head {
    position: relative;
    max-width: 820px;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}
.section-head .section-title,
.chapter-head .section-title { margin: 1.1rem 0 1rem; }
.section-head .section-sub,
.chapter-head .section-sub { max-width: 680px; margin: 0 auto; }

.chapter-ghost {
    position: absolute;
    top: -0.42em;
    left: 0;
    right: 0;
    z-index: -1;
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(8rem, 22vw, 17rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(var(--accent-rgb), 0.13);
    pointer-events: none;
    user-select: none;
}
.eyebrow-num {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.7rem;
    letter-spacing: 0;
}
.pill-new {
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    background: var(--gold-gradient);
    color: #2B1700;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1.25rem;
}
.tags li {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

.step-badge,
.program-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--accent-primary);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* ---------------- Scroll progress ---------------- */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 150; pointer-events: none; }
.scroll-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #E11D63, #8B5CF6, #F5A524);
    transform: scaleX(var(--p, 0));
    transform-origin: 0 50%;
}
[dir="rtl"] .scroll-progress span { transform-origin: 100% 50%; }

/* ---------------- Phone + media ---------------- */
.phone { --w: 260px; position: relative; width: var(--w); aspect-ratio: 480 / 1044; flex-shrink: 0; }
.phone-frame {
    position: relative;
    width: 100%;
    height: 100%;
    padding: calc(var(--w) * 0.034);
    border-radius: calc(var(--w) * 0.155);
    background: linear-gradient(145deg, #3a3442 0%, #15111a 45%, #0b090e 100%);
    box-shadow:
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
        inset 0 0 0 4px rgba(0, 0, 0, 0.6),
        0 30px 60px -18px rgba(26, 26, 46, 0.3),
        0 0 70px rgba(225, 29, 99, 0.22);
}
.phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: calc(var(--w) * 0.125);
    background: #120d16;
    isolation: isolate;
}
.phone-island {
    position: absolute;
    top: calc(var(--w) * 0.055);
    left: 50%;
    width: calc(var(--w) * 0.045);
    height: calc(var(--w) * 0.045);
    border-radius: 50%;
    background: #050406;
    box-shadow: inset 0 0 0 2px #1a1720;
    transform: translateX(-50%);
    z-index: 4;
}
.phone-sm { --w: 230px; }
.phone-xs { --w: 128px; }

.media {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    border-radius: inherit;
}
.media-video { width: 100%; height: 100%; object-fit: cover; }
.media:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.play-badge {
    position: absolute;
    inset-inline-end: 12px;
    bottom: 12px;
    z-index: 3;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(18, 12, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform 0.4s var(--ease-bounce), background-color 0.3s ease;
}
.play-badge svg { margin-inline-start: 2px; }
.media:hover .play-badge,
.media:focus-visible .play-badge { transform: scale(1.12); background: var(--accent-primary); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 118px 0 72px;
    overflow: clip;
}
.hero-aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-aurora i {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    will-change: transform;
}
.hero-aurora i:nth-child(1) { width: 560px; height: 560px; top: -12%; left: -8%; background: radial-gradient(circle, rgba(236, 64, 122, 0.55), transparent 65%); animation: auroraA 18s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(2) { width: 520px; height: 520px; top: 4%; right: -10%; background: radial-gradient(circle, rgba(139, 92, 246, 0.42), transparent 65%); animation: auroraB 22s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(3) { width: 440px; height: 440px; bottom: -14%; left: 38%; background: radial-gradient(circle, rgba(245, 165, 36, 0.38), transparent 65%); animation: auroraA 26s ease-in-out infinite alternate-reverse; }
[data-theme="dark"] .hero-aurora i { opacity: 0.32; }
@keyframes auroraA { to { transform: translate3d(8%, 10%, 0) scale(1.12); } }
@keyframes auroraB { to { transform: translate3d(-10%, 8%, 0) scale(0.9); } }

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.94fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
}
.hero-content { position: relative; z-index: 2; }

.hero-promo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 100%;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid rgba(245, 165, 36, 0.45);
    box-shadow: 0 8px 26px rgba(245, 165, 36, 0.18);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: transform 0.35s var(--ease-bounce), box-shadow 0.3s ease;
}
[dir="rtl"] .hero-promo { padding: 0.35rem 0.35rem 0.35rem 0.85rem; }
.hero-promo:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(245, 165, 36, 0.28); }
.hero-promo-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding: 0.28rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--gold-gradient);
    color: #2B1700;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.hero-promo-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-promo-arrow { flex-shrink: 0; color: #E08A00; transition: transform 0.35s var(--ease-bounce); }
.hero-promo:hover .hero-promo-arrow { transform: translateX(3px); }
[dir="rtl"] .hero-promo-arrow,
[dir="rtl"] .ico-arrow { transform: scaleX(-1); }

.hero-title {
    margin: 1.4rem 0 1.25rem;
    font-family: var(--font-display);
    font-size: clamp(2.35rem, 5.3vw, 4.7rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.045em;
}
/* Room above/below each line so stacked Vietnamese diacritics never clip */
.hero-title .line { display: block; overflow: hidden; padding: 0.16em 0.04em 0.1em; margin: -0.16em -0.04em -0.1em; }
.hero-title .line-inner { display: inline-block; max-width: 100%; text-wrap: balance; }
.hero-ready .hero-title .line { overflow: visible; }
/* Short desktop screens (e.g. 1366×768): keep CTA + stats above the fold */
@media (min-width: 901px) and (max-height: 820px) {
    .hero { padding-top: 104px; }
    .hero-title { margin: 1.1rem 0 1rem; font-size: clamp(2.2rem, 4.4vw, 3.9rem); }
    .hero-actions { margin: 1.5rem 0 1.6rem; }
}

.hero-subtitle {
    max-width: 580px;
    color: var(--text-secondary);
    font-size: clamp(1.02rem, 1.25vw, 1.17rem);
    line-height: 1.7;
    text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 2.2rem; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    gap: 0.5rem 2rem;
    padding: 1rem 1.4rem;
    width: fit-content;
    max-width: 100%;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
}
.stat { min-width: 0; }
.stat dt {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}
.stat dd { margin-top: 0.2rem; color: var(--text-tertiary); font-size: 0.78rem; font-weight: 500; }

/* First-paint entrance (pure CSS, so it starts before any script) */
.motion .hero-title .line-inner { animation: heroLine 1s var(--ease-out) both; animation-delay: calc(var(--d) * 110ms + 80ms); }
.motion .hero-in { animation: heroIn 0.8s var(--ease-out) both; animation-delay: calc(var(--d) * 110ms + 80ms); }
.motion .hero-rise { animation: heroRise 0.9s var(--ease-out) both; animation-delay: calc(var(--d) * 110ms + 80ms); }
.motion .hero-visual { animation: heroVisual 1.3s var(--ease-out) 0.25s both; }
@keyframes heroLine { from { transform: translateY(108%) rotate(2.5deg); } to { transform: none; } }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes heroRise { from { transform: translateY(16px); } to { transform: none; } }
@keyframes heroVisual { from { opacity: 0; transform: translateY(40px) scale(0.94); } to { opacity: 1; transform: none; } }

/* Visual: globe + floating phone */
.hero-visual {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 1;
    justify-self: end;
}
.globe { position: absolute; inset: 0; }
.globe-halo {
    position: absolute;
    inset: 11%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.08) 55%, rgba(var(--accent-rgb), 0.22) 69%, transparent 71%);
    box-shadow: 0 0 120px rgba(var(--accent-rgb), 0.18);
}
[data-theme="dark"] .globe-halo {
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.06), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.06) 55%, rgba(var(--accent-rgb), 0.28) 69%, transparent 71%);
}
.globe-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: pan-y;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.globe.is-live .globe-canvas { opacity: 1; }
.globe-canvas:active { cursor: grabbing; }
.globe-labels { position: absolute; inset: 0; pointer-events: none; }
.globe-label {
    position: absolute;
    left: 0;
    top: 0;
    padding: 0.28rem 0.62rem;
    border-radius: var(--radius-pill);
    background: var(--bg-solid);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.16);
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    will-change: transform, opacity;
}
.globe-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: 0.4rem;
    border-radius: 50%;
    background: var(--accent-primary);
    vertical-align: 1px;
}

.hero-stage {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 38%;
    perspective: 1300px;
}
[dir="rtl"] .hero-stage { left: auto; right: 0; }
.phone-hero {
    --w: min(240px, 100%);
    width: 100%;
    max-width: 240px;
    transform: rotateY(calc(-16deg + var(--ry, 0deg))) rotateX(calc(7deg + var(--rx, 0deg))) rotateZ(-2deg);
    transform-style: preserve-3d;
    transition: transform 0.6s var(--ease-out);
}
.float-chip {
    position: absolute;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.9rem 0.55rem 0.55rem;
    border-radius: 18px;
    background: var(--bg-solid);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md), 0 0 30px rgba(var(--accent-rgb), 0.12);
    color: var(--text-primary);
    font-size: 0.84rem;
    white-space: nowrap;
    transform: translate3d(var(--cx, 0), var(--cy, 0), 0);
    transition: transform 0.6s var(--ease-out);
}
.float-chip b { font-family: var(--font-display); }
.chip-ico {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-primary);
}
.chip-ico-gold { background: rgba(245, 165, 36, 0.16); color: #D98200; }
.chip-ico-orange { background: rgba(249, 115, 22, 0.14); color: #EA580C; }
.chip-a { top: -6%; left: 62%; }
.chip-b { top: 58%; left: 88%; }
.chip-c { bottom: 6%; left: 70%; }
.motion .chip-a { animation: chipFloat 6s ease-in-out infinite; }
.motion .chip-b { animation: chipFloat 7s ease-in-out -2s infinite; }
.motion .chip-c { animation: chipFloat 6.5s ease-in-out -4s infinite; }
@keyframes chipFloat { 50% { translate: 0 -10px; } }

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 26px;
    height: 42px;
    border: 2px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 14px;
    transform: translateX(-50%);
}
.scroll-cue span {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 4px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent-primary);
    transform: translateX(-50%);
}
.motion .scroll-cue span { animation: cue 1.8s var(--ease-out) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translate(-50%, 0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 14px); } 100% { opacity: 0; } }

/* ---------------- Tickers ---------------- */
.tickers { display: grid; gap: 6px; padding: 8px 0 0; }
.ticker {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track { display: flex; width: max-content; }
.motion .ticker-track { animation: tick 46s linear infinite; }
.motion .ticker-exams .ticker-track { animation-duration: 34s; animation-direction: reverse; }
.ticker span {
    padding: 0.4rem 1.3rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}
.ticker-exams span {
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-tertiary);
}
.ticker-exams span:nth-child(3n + 1) { color: var(--accent-ink); }
@keyframes tick { to { transform: translateX(-50%); } }
.tickers:hover .ticker-track { animation-play-state: paused; }

/* ============================================================
   JOURNEY
   ============================================================ */
.journey-track {
    position: relative;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.journey-card a {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    height: 100%;
    padding: 1.6rem 1.5rem 1.7rem;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: transform 0.45s var(--ease-bounce), box-shadow 0.35s ease, border-color 0.3s ease;
}
.journey-card a::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
    transition: transform 0.6s var(--ease-out);
}
.journey-card a:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 22%, transparent); }
.journey-card a:hover::after { transform: scale(1.35); }
.journey-num {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
}
.journey-ico {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0.3rem 0 0.6rem;
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--accent);
    transition: transform 0.45s var(--ease-bounce);
}
.journey-card a:hover .journey-ico { transform: rotate(-8deg) scale(1.08); }
.journey-card h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.journey-card p { position: relative; z-index: 1; color: var(--text-secondary); font-size: 0.94rem; line-height: 1.6; }
.journey-card-hot a { border-color: rgba(245, 165, 36, 0.45); box-shadow: 0 12px 34px rgba(245, 165, 36, 0.16); }

/* ============================================================
   CHAPTER 01 — scrollytelling phone
   ============================================================ */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.story-steps { display: flex; flex-direction: column; }
.story-step {
    position: relative;
    min-height: 82vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 2rem;
    padding-inline: 2rem 0;
    border-inline-start: 2px solid var(--hairline);
    transition: border-color 0.5s ease;
}
/* Active step = accent rail + full-strength heading; inactive text keeps AA contrast */
.story-step::before {
    content: '';
    position: absolute;
    inset-inline-start: -2px;
    top: 50%;
    width: 2px;
    height: 0;
    background: var(--accent-gradient);
    transform: translateY(-50%);
    transition: height 0.7s var(--ease-out);
}
.story-step.is-active::before { height: 60%; }
.story-step h3 { color: var(--text-secondary); transition: color 0.5s ease; }
.story-step.is-active h3 { color: var(--text-primary); }
.story-step h3 {
    margin: 0.9rem 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.7vw, 2.45rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
}
.story-step > p { max-width: 540px; color: var(--text-secondary); font-size: 1.05rem; line-height: 1.75; }
.step-media { display: none; }

.story-stage { position: relative; }
.story-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1400px;
    overflow: clip;
}
.stage-ring {
    position: absolute;
    width: min(520px, 96%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(225, 29, 99, 0.35), rgba(139, 92, 246, 0.3), rgba(245, 165, 36, 0.3), rgba(225, 29, 99, 0.35));
    -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 64.5%, transparent 65.5%);
    mask: radial-gradient(circle, transparent 62%, #000 63%, #000 64.5%, transparent 65.5%);
}
.stage-ring::after {
    content: '';
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 70%);
}
.motion .stage-ring { animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.phone-story {
    /* also capped by viewport height so the sticky phone never runs under the nav on short laptops */
    --w: min(300px, 25vw, calc((100vh - 170px) * 0.46));
    transform: rotateY(var(--sy, -12deg)) rotateX(5deg);
    transition: transform 1s var(--ease-out);
}
@supports (height: 100svh) {
    .phone-story { --w: min(300px, 25vw, calc((100svh - 170px) * 0.46)); }
}
.screen { position: absolute; inset: 0; opacity: 0; transform: scale(1.05); transition: opacity 0.6s ease, transform 0.9s var(--ease-out); }
.screen.is-active { opacity: 1; transform: none; z-index: 1; }
.story-dots {
    position: absolute;
    inset-inline-end: 6%;
    top: 50%;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(-50%);
}
.story-dots li { width: 8px; height: 8px; border-radius: 4px; background: rgba(var(--accent-rgb), 0.25); transition: height 0.45s var(--ease-bounce), background-color 0.3s; }
.story-dots li.is-active { height: 28px; background: var(--accent-primary); }

/* AI chat mock (inside phone) */
.chat-mock { position: absolute; inset: 0; display: flex; flex-direction: column; background: #F7F2F6; color: #1A1A2E; font-size: 13px; }
.chat-head { display: flex; align-items: center; gap: 0.6rem; padding: 2.6rem 0.9rem 0.7rem; background: #fff; border-bottom: 1px solid rgba(26, 26, 46, 0.06); }
.chat-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #E11D63, #8B5CF6); color: #fff; font-weight: 700; }
.chat-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.chat-who b { font-size: 13px; }
.chat-who small { display: inline-flex; align-items: center; gap: 4px; color: #16A34A; font-size: 11px; }
.chat-who small i { width: 6px; height: 6px; border-radius: 50%; background: #22C55E; }
.chat-body { flex: 1; display: flex; flex-direction: column; gap: 0.55rem; padding: 0.9rem 0.75rem; overflow: hidden; }
.bubble { max-width: 86%; padding: 0.55rem 0.75rem; border-radius: 16px; line-height: 1.4; box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05); }
.bubble-in { align-self: flex-start; background: #fff; border-end-start-radius: 4px; }
.bubble-out { align-self: flex-end; background: linear-gradient(135deg, #E11D63, #EC407A); color: #fff; border-end-end-radius: 4px; }
.bubble-tr { display: block; margin-top: 0.3rem; color: #8B6F7E; font-size: 11px; font-style: italic; }
.bubble-fix { align-self: flex-end; max-width: 92%; background: #ECFDF3; border: 1px solid #BBF7D0; color: #14532D; font-size: 12px; }
.bubble-fix s { color: #B91C1C; }
.bubble-fix ins { color: #15803D; font-weight: 700; text-decoration: none; }
.bubble-fix small { display: block; margin-top: 0.25rem; color: #3F6212; font-size: 11px; }
.fix-label { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 0.2rem; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #15803D; }
.typing { display: inline-flex; gap: 4px; align-self: flex-start; padding: 0.6rem 0.75rem; border-radius: 16px; background: #fff; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #C4B5BE; }
.motion .typing i { animation: typing 1.2s ease-in-out infinite; }
.motion .typing i:nth-child(2) { animation-delay: 0.15s; }
.motion .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.motion .screen-chat .chat-body > * { opacity: 0; }
.motion .screen-chat.is-active .chat-body > * { animation: bubbleIn 0.55s var(--ease-bounce) both; }
.motion .screen-chat.is-active .chat-body > :nth-child(1) { animation-delay: 0.2s; }
.motion .screen-chat.is-active .chat-body > :nth-child(2) { animation-delay: 1s; }
.motion .screen-chat.is-active .chat-body > :nth-child(3) { animation-delay: 1.8s; }
.motion .screen-chat.is-active .chat-body > :nth-child(4) { animation-delay: 2.7s; }
.motion .screen-chat.is-active .chat-body > :nth-child(5) { animation-delay: 3.4s; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(12px) scale(0.94); } to { opacity: 1; transform: none; } }

/* ============================================================
   CHAPTER 02 — handwriting + games
   ============================================================ */
.write-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    margin-bottom: clamp(3rem, 6vw, 5rem);
}
.write-visual { position: relative; padding: 2.5rem 2rem 3rem 0; perspective: 1500px; }
[dir="rtl"] .write-visual { padding: 2.5rem 0 3rem 2rem; }
.tablet {
    position: relative;
    aspect-ratio: 16 / 9;
    padding: 12px;
    border-radius: 30px;
    background: linear-gradient(145deg, #3a3442, #0d0b10);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.12), 0 40px 70px -24px rgba(26, 26, 46, 0.35), 0 0 70px rgba(139, 92, 246, 0.2);
    transform: rotateY(var(--ty, 14deg)) rotateX(6deg);
    transition: transform 0.9s var(--ease-out);
}
.tablet .media { border-radius: 20px; }
.flip-card {
    position: absolute;
    inset-inline-end: 0;
    bottom: 0;
    z-index: 3;
    width: clamp(130px, 14vw, 172px);
    aspect-ratio: 0.8;
    perspective: 900px;
}
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.motion .flip-inner { animation: flipCard 7s cubic-bezier(0.7, 0, 0.3, 1) infinite; }
@keyframes flipCard { 0%, 38% { transform: rotateY(0); } 50%, 88% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
.flip-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 22px;
    background: var(--bg-solid);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 50px -16px rgba(26, 26, 46, 0.35), 0 0 40px rgba(var(--accent-rgb), 0.18);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.flip-back { transform: rotateY(180deg); background: var(--accent-gradient); color: #fff; border-color: transparent; }
.flip-glyph { font-size: clamp(3.2rem, 5vw, 4.4rem); font-weight: 700; line-height: 1; color: var(--text-primary); }
.flip-front small { padding: 0.15rem 0.55rem; border-radius: 6px; background: rgba(var(--accent-rgb), 0.1); color: var(--accent-primary); font-size: 0.68rem; font-weight: 700; }
.flip-roman { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.flip-mean { font-size: 1rem; font-weight: 600; opacity: 0.95; }
.flip-ex { margin-top: 0.3rem; font-size: 0.82rem; opacity: 0.85; }
.glyph-orbit span {
    position: absolute;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--bg-solid);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    color: var(--accent-primary);
    font-size: 1.2rem;
    font-weight: 700;
}
.glyph-orbit span:nth-child(1) { top: 0; left: 8%; }
.glyph-orbit span:nth-child(2) { top: 6%; right: 6%; }
.glyph-orbit span:nth-child(3) { bottom: 6%; left: 0; }
.glyph-orbit span:nth-child(4) { top: 42%; left: 0; }
.glyph-orbit span:nth-child(5) { bottom: 0; left: 32%; }
.glyph-orbit span:nth-child(6) { top: -4%; left: 46%; }
.motion .glyph-orbit span { animation: chipFloat 5s ease-in-out infinite; }
.motion .glyph-orbit span:nth-child(2n) { animation-duration: 6.5s; animation-delay: -2s; }
.motion .glyph-orbit span:nth-child(3n) { animation-duration: 7.5s; animation-delay: -3.5s; }

.write-text h3 {
    margin: 0.9rem 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.6vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}
.write-text p { color: var(--text-secondary); font-size: 1.04rem; line-height: 1.75; }
.write-text strong { color: var(--text-primary); }

.mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mini-card {
    padding: 1.5rem;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: transform 0.45s var(--ease-bounce), box-shadow 0.35s ease;
}
.mini-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.mini-ico { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 1rem; border-radius: 14px; background: rgba(139, 92, 246, 0.12); color: var(--violet); }
[data-theme="dark"] .mini-ico { color: #B79CFF; }
.mini-card h3 { margin-bottom: 0.45rem; font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.mini-card p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }

/* Games gallery */
.games { position: relative; padding: clamp(60px, 8vw, 100px) 0 var(--section-pad); }
.games-pin { position: relative; }
.games-head { text-align: center; max-width: 820px; }
.games-head .section-title { margin: 1rem 0 0.9rem; }
.games-head .section-sub { max-width: 640px; margin: 0 auto; }
.games-viewport { margin-top: clamp(2rem, 4vw, 3rem); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.games-viewport::-webkit-scrollbar { display: none; }
.games-track {
    display: flex;
    gap: 20px;
    width: max-content;
    padding: 1rem max(24px, calc((100vw - 1240px) / 2 + 24px)) 2rem;
}
.games-pinned .games-viewport { overflow-x: clip; overflow-y: visible; scroll-snap-type: none; }
.games-pinned .games-track { perspective: 1400px; }
.game-card {
    --mh: clamp(300px, 47vh, 470px);
    width: calc(var(--mh) * 0.46 + 28px);
    flex-shrink: 0;
    padding: 14px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    scroll-snap-align: center;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: box-shadow 0.35s ease, border-color 0.3s ease;
    transform-style: preserve-3d;
}
.game-card:hover { box-shadow: var(--shadow-lg); border-color: rgba(var(--accent-rgb), 0.3); }
.game-media { height: var(--mh); aspect-ratio: 480 / 1044; border-radius: 20px; overflow: hidden; background: #120d16; box-shadow: 0 16px 34px -14px rgba(26, 26, 46, 0.4); }
.game-info { padding: 1rem 0.3rem 0.2rem; }
.game-num { font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; color: var(--accent-ink); }
.game-info h3 { margin: 0.2rem 0 0.35rem; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.game-info p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.55; }

/* ============================================================
   CHAPTER 03 — EXAM CENTER (always a dark, immersive stage)
   ============================================================ */
.exam-center {
    --text-primary: #FBF4FA;
    --text-secondary: #CDBDD2;
    --text-tertiary: #A996AE;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.09);
    --bg-solid: #1C1225;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-primary: #F472B6;
    --accent-rgb: 244, 114, 182;
    --hairline: rgba(255, 255, 255, 0.08);
    position: relative;
    margin: 0 clamp(8px, 1.5vw, 20px);
    padding: var(--section-pad) 0 clamp(70px, 9vw, 120px);
    border-radius: clamp(28px, 4vw, 48px);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
        radial-gradient(900px 500px at 100% 40%, rgba(225, 29, 99, 0.16), transparent 60%),
        radial-gradient(800px 500px at 0% 75%, rgba(245, 165, 36, 0.12), transparent 60%),
        #0E0817;
    color: var(--text-primary);
    overflow: clip;
    isolation: isolate;
    box-shadow: 0 40px 100px -40px rgba(14, 8, 23, 0.6);
}
.exam-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.exam-sky::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 72% 12%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.4px 1.4px at 38% 62%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 88% 72%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1.2px 1.2px at 56% 34%, rgba(255, 220, 160, 0.6), transparent),
        radial-gradient(1px 1px at 22% 86%, rgba(255, 255, 255, 0.5), transparent);
    background-size: 420px 420px;
    opacity: 0.7;
}
.exam-sky::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 30%, #000, transparent 70%);
}
.exam-sky i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.exam-sky i:nth-child(1) { width: 420px; height: 420px; top: 8%; left: 6%; background: rgba(245, 165, 36, 0.25); }
.exam-sky i:nth-child(2) { width: 500px; height: 500px; top: 36%; right: -6%; background: rgba(225, 29, 99, 0.22); }
.exam-sky i:nth-child(3) { width: 460px; height: 460px; bottom: 4%; left: 30%; background: rgba(139, 92, 246, 0.22); }

.exam-head .chapter-ghost { -webkit-text-stroke-color: rgba(245, 165, 36, 0.16); }
.exam-center .eyebrow { background: rgba(245, 165, 36, 0.1); border-color: rgba(245, 165, 36, 0.28); color: #FFC861; }
.exam-center .eyebrow-num { background: var(--gold-gradient); color: #2B1700; }
.exam-title {
    margin: 1.1rem 0 1.1rem;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.6vw, 4.8rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.045em;
    text-wrap: balance;
}
.exam-title > span { display: block; }
.gold-text {
    background: linear-gradient(100deg, #FFE29A 0%, #F5A524 40%, #FF8A5B 70%, #F472B6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.eyebrow-gold { background: rgba(245, 165, 36, 0.1) !important; border-color: rgba(245, 165, 36, 0.28) !important; color: #FFC861 !important; }

/* Showcase: 3D score report + stats */
.exam-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    margin-bottom: clamp(4rem, 8vw, 6.5rem);
}
.cert-stage { position: relative; display: grid; place-items: center; min-height: 380px; perspective: 1400px; }
.cert {
    position: relative;
    width: min(420px, 86vw);
    aspect-ratio: 1.42;
    transform-style: preserve-3d;
    transform: rotateX(calc(12deg + var(--crx, 0deg) + var(--ptx, 0deg))) rotateY(calc(-20deg + var(--cry, 0deg) + var(--pty, 0deg))) rotateZ(2deg);
    transition: transform 0.7s var(--ease-out);
}
.motion .cert { animation: certBob 8s ease-in-out infinite; }
@keyframes certBob { 50% { translate: 0 -14px; } }
.cert-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.6rem;
    border-radius: 22px;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.9), transparent 40%),
        linear-gradient(135deg, #FFFBF2 0%, #F8EBCF 55%, #F1DDB0 100%);
    color: #3A2608;
    box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(245, 165, 36, 0.5), 0 0 80px rgba(245, 165, 36, 0.22);
    overflow: hidden;
}
.cert-face::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(170, 120, 40, 0.38); border-radius: 15px; pointer-events: none; }
.cert-face::after { content: ''; position: absolute; inset: 14px; border: 1px dashed rgba(170, 120, 40, 0.22); border-radius: 12px; pointer-events: none; }
.cert-top { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; color: #8A5A12; }
.cert-logo { width: 26px; height: 26px; border-radius: 8px; overflow: hidden; }
.cert-logo img { width: 100%; height: 100%; }
.cert-name { margin-top: 0.9rem; font-family: var(--font-display); font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 700; letter-spacing: 0.24em; color: #6B430A; }
.cert-exam { font-size: 0.84rem; color: #7A5A2A; }
.cert-score { display: flex; align-items: baseline; gap: 0.6rem; margin-top: auto; }
.cert-score span { font-family: var(--font-display); font-size: clamp(2.8rem, 5vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; background: linear-gradient(135deg, #C77700, #F5A524 50%, #E11D63); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cert-score small { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; color: #8A5A12; }
.cert-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.7rem; }
.cert-row span { padding: 0.18rem 0.5rem; border-radius: 6px; background: rgba(170, 120, 40, 0.12); font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; color: #6B430A; }
.cert-seal {
    position: absolute;
    inset-inline-end: 1.3rem;
    bottom: 1.2rem;
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #fff;
    box-shadow: 0 8px 20px rgba(199, 119, 0, 0.45), inset 0 0 0 4px rgba(255, 255, 255, 0.35);
}
.motion .cert-seal { animation: sealSpin 12s linear infinite; }
@keyframes sealSpin { to { transform: rotate(360deg); } }
.cert-shine {
    position: absolute;
    inset: -40% -60%;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.75) 50%, transparent 58%);
    transform: translateX(-60%);
    pointer-events: none;
}
.motion .cert-shine { animation: shine 5s ease-in-out 1.2s infinite; }
@keyframes shine { 0% { transform: translateX(-60%); } 45%, 100% { transform: translateX(60%); } }
.cert-shadow { position: absolute; bottom: 4%; width: 60%; height: 34px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%); filter: blur(8px); }

.exam-stats { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.exam-stats li {
    padding: 1.4rem 1.5rem;
    border-radius: var(--radius-card);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
}
.exam-stats b {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 4vw, 3.3rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(120deg, #FFE29A, #F5A524 60%, #FF8A5B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}
.exam-stats span { display: block; margin-top: 0.5rem; color: var(--text-secondary); font-size: 0.95rem; }

/* Explorer */
.explorer { margin-bottom: clamp(4rem, 9vw, 7rem); }
.explorer-label { margin-bottom: 1.1rem; text-align: center; color: var(--text-tertiary); font-size: 0.92rem; }
.exam-tabs {
    position: relative;
    display: flex;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 2rem;
    padding: 6px;
    overflow-x: auto;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.exam-tabs::-webkit-scrollbar { display: none; }
/* Scrollable tab strip: fade the edge(s) that still hide tabs (classes set by home.js) */
.exam-tabs.fade-end { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.exam-tabs.fade-start { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%); mask-image: linear-gradient(90deg, transparent, #000 18%); }
.exam-tabs.fade-start.fade-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.exam-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.62rem 1.05rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.3s ease;
}
.exam-tab:hover { color: var(--text-primary); }
.exam-tab.is-active { color: #2B1700; }
.exam-tab small { padding: 0.05rem 0.4rem; border-radius: 6px; background: rgba(255, 255, 255, 0.12); font-size: 0.7rem; }
.exam-tab.is-active small { background: rgba(43, 23, 0, 0.14); }
.exam-tab:focus-visible { outline: 2px solid #FFC861; outline-offset: -2px; }
.exam-tab-pill {
    position: absolute;
    top: 6px;
    left: 0;
    height: calc(100% - 12px);
    width: var(--pw, 0);
    border-radius: var(--radius-pill);
    background: var(--gold-gradient);
    box-shadow: 0 6px 20px rgba(245, 165, 36, 0.35);
    transform: translateX(var(--px, 0));
    transition: transform 0.55s var(--ease-bounce), width 0.55s var(--ease-bounce);
}
.exam-panel { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.exam-panel[hidden] { display: none; }
.exam-card {
    --mx: 50%;
    --my: 0%;
    position: relative;
    flex: 1 1 320px;
    max-width: 400px;
    padding: 1.5rem 1.5rem 1.6rem;
    border-radius: var(--radius-card);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.4s ease;
    transform-style: preserve-3d;
}
.exam-card-wide { max-width: 640px; flex-basis: 520px; }
.exam-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(245, 165, 36, 0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.exam-card:hover { border-color: rgba(245, 165, 36, 0.4); box-shadow: 0 24px 60px -20px rgba(245, 165, 36, 0.3); }
.exam-card:hover::before { opacity: 1; }
.exam-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.exam-level {
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-pill);
    background: rgba(245, 165, 36, 0.12);
    border: 1px solid rgba(245, 165, 36, 0.25);
    color: #FFC861;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
}
.exam-units b {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 0.9;
    color: transparent;
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.22);
}
.exam-card h3 { margin: 0.9rem 0 0.35rem; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.exam-flag { font-size: 1.1rem; }
.exam-native { display: block; margin-top: 0.15rem; color: var(--text-tertiary); font-family: var(--font-body); font-size: 0.85rem; font-weight: 500; letter-spacing: 0; }
.exam-meta { margin-bottom: 0.7rem; color: #FFC861; font-size: 0.86rem; font-weight: 600; }
.exam-card > p:not(.exam-meta) { color: var(--text-secondary); font-size: 0.94rem; line-height: 1.6; }
.level-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.1rem; }
.level-bar span {
    padding: 0.28rem 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.exam-card:hover .level-bar span { background: rgba(245, 165, 36, 0.14); border-color: rgba(245, 165, 36, 0.3); color: #FFD27A; }
.exam-card:hover .level-bar span:nth-child(2) { transition-delay: 0.05s; }
.exam-card:hover .level-bar span:nth-child(3) { transition-delay: 0.1s; }
.exam-card:hover .level-bar span:nth-child(4) { transition-delay: 0.15s; }
.exam-card:hover .level-bar span:nth-child(5) { transition-delay: 0.2s; }
.exam-card:hover .level-bar span:nth-child(6) { transition-delay: 0.25s; }
.motion .exam-panel.is-entering .exam-card { animation: cardIn 0.6s var(--ease-out) both; }
.motion .exam-panel.is-entering .exam-card:nth-child(2) { animation-delay: 0.06s; }
.motion .exam-panel.is-entering .exam-card:nth-child(3) { animation-delay: 0.12s; }
.motion .exam-panel.is-entering .exam-card:nth-child(4) { animation-delay: 0.18s; }
.motion .exam-panel.is-entering .exam-card:nth-child(5) { animation-delay: 0.24s; }
.motion .exam-panel.is-entering .exam-card:nth-child(6) { animation-delay: 0.3s; }
@keyframes cardIn { from { opacity: 0; transform: perspective(900px) rotateX(-18deg) translateY(26px); } to { opacity: 1; transform: none; } }

/* Unit anatomy — isometric exploded stack */
.anatomy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    margin-bottom: clamp(4rem, 9vw, 7rem);
}
.anatomy-title {
    margin: 1rem 0 0.8rem;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.3vw, 2.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.anatomy-sub { color: var(--text-secondary); font-size: 1.04rem; line-height: 1.7; }
.layer-list { list-style: none; counter-reset: layer; display: flex; flex-direction: column; gap: 4px; margin-top: 1.6rem; }
.layer-list li {
    counter-increment: layer;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 12px;
    padding: 0.75rem 0.95rem;
    border-radius: 16px;
    border: 1px solid transparent;
    opacity: 0.5;
    transition: opacity 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}
.layer-list li::before {
    content: counter(layer, decimal-leading-zero);
    grid-row: span 2;
    padding-top: 0.1rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: #FFC861;
}
.layer-list li.is-on { opacity: 1; background: rgba(255, 255, 255, 0.05); border-color: rgba(245, 165, 36, 0.22); }
.layer-list b { color: var(--text-primary); font-family: var(--font-display); font-size: 1.02rem; }
.layer-list span { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

.anatomy-stage { position: relative; display: grid; place-items: center; min-height: 560px; perspective: 1800px; }
.stack {
    --gap: 16px;
    position: relative;
    width: min(330px, 66vw);
    aspect-ratio: 1.3;
    transform-style: preserve-3d;
    transform: rotateX(56deg) rotateZ(calc(-38deg + var(--rz, 0deg))) translateZ(calc(var(--gap) * -2.5));
}
.slab {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 40px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateZ(calc(var(--i) * var(--gap)));
    transition: border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}
.slab.is-on {
    background-color: rgba(245, 165, 36, 0.12);
    border-color: rgba(255, 200, 97, 0.75);
    box-shadow: 0 30px 40px -24px rgba(0, 0, 0, 0.7), 0 0 40px rgba(245, 165, 36, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.slab-tag {
    position: absolute;
    left: 12px;
    bottom: 10px;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    background: rgba(14, 8, 23, 0.55);
    color: #FFE3A8;
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.slab-ui { display: flex; align-items: center; justify-content: center; gap: 12px; color: #fff; }
.ui-lecture .anna { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, #E11D63, #8B5CF6); font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; box-shadow: 0 0 24px rgba(225, 29, 99, 0.5); }
.ui-lecture .wave { display: flex; align-items: center; gap: 4px; height: 40px; }
.ui-lecture .wave i { width: 5px; height: 100%; border-radius: 3px; background: #FFC861; transform: scaleY(0.35); }
.motion .ui-lecture .wave i { animation: wave 1.1s ease-in-out infinite; }
.ui-lecture .wave i:nth-child(2n) { animation-delay: -0.3s; }
.ui-lecture .wave i:nth-child(3n) { animation-delay: -0.6s; }
@keyframes wave { 50% { transform: scaleY(1); } }
.ui-vocab { flex-direction: column; gap: 2px; }
.ui-vocab b { font-family: var(--font-display); font-size: 1.5rem; }
.ui-vocab small { color: #FFC861; font-size: 0.85rem; }
.ui-grammar span { padding: 0.4rem 0.7rem; border-radius: 10px; background: rgba(255, 255, 255, 0.1); font-family: var(--font-display); font-weight: 700; }
.ui-grammar span:first-child { background: rgba(34, 197, 94, 0.25); }
.ui-quiz { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 62%; }
.ui-quiz i { height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); }
.ui-quiz i.ok { background: rgba(34, 197, 94, 0.55); box-shadow: 0 0 16px rgba(34, 197, 94, 0.5); }
.ui-explain .q-ok { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(34, 197, 94, 0.55); font-family: var(--font-display); font-weight: 700; }
.ui-explain .lines { display: flex; flex-direction: column; gap: 7px; width: 140px; }
.ui-explain .lines i { height: 7px; width: calc(var(--w, 1) * 100%); border-radius: 4px; background: rgba(255, 255, 255, 0.3); }
.ui-score .ring { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(#F5A524 0 78%, rgba(255, 255, 255, 0.15) 78% 100%); -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%); mask: radial-gradient(circle, transparent 54%, #000 55%); }
.ui-score { position: relative; }
.ui-score .ring b { display: none; }
.ui-score::before { content: '7.0'; position: absolute; left: 0; width: 64px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: #FFE29A; }
.ui-score .bars { display: flex; flex-direction: column; gap: 7px; width: 110px; }
.ui-score .bars i { height: 7px; width: calc(var(--w) * 100%); border-radius: 4px; background: linear-gradient(90deg, #F5A524, #F472B6); }

/* Short desktop screens: tighten the walk-through so it still fits (and pins) at ~768px tall */
@media (min-width: 901px) and (max-height: 900px) {
    .anatomy-title { margin: 0.7rem 0 0.5rem; font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
    .anatomy-sub { font-size: 0.98rem; }
    .layer-list { gap: 2px; margin-top: 1rem; }
    .layer-list li { padding: 0.5rem 0.85rem; }
    .layer-list span { font-size: 0.85rem; line-height: 1.45; }
    .anatomy-stage { min-height: 480px; }
}

/* AI grading */
.grading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    margin-bottom: clamp(4rem, 9vw, 7rem);
}
.check-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.check-list li { display: flex; gap: 0.7rem; color: var(--text-secondary); line-height: 1.55; }
.check-list svg { flex-shrink: 0; margin-top: 0.2rem; padding: 2px; border-radius: 50%; background: rgba(245, 165, 36, 0.16); color: #FFC861; }
.score-card {
    position: relative;
    padding: 1.6rem;
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6), 0 0 60px rgba(245, 165, 36, 0.08);
}
.score-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.score-tag { padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); font-size: 0.78rem; font-weight: 600; }
.score-main { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 1.3rem; }
.gauge { position: relative; flex-shrink: 0; width: 132px; height: 132px; }
.gauge svg { transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 10; }
.gauge-fill { fill: none; stroke: url(#gaugeGrad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 69.8; }
.gauge-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.score-label small { display: block; color: var(--text-tertiary); font-size: 0.85rem; }
.score-label b { font-family: var(--font-display); font-size: 1.1rem; color: #FFC861; }
.criteria { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.criteria li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; align-items: center; font-size: 0.9rem; color: var(--text-secondary); }
.criteria b { font-family: var(--font-display); color: var(--text-primary); }
.criteria i { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.criteria i::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, #F5A524, #F472B6); transform: scaleX(var(--v)); transform-origin: 0 50%; transition: transform 1.2s var(--ease-out); }
[dir="rtl"] .criteria i::after { transform-origin: 100% 50%; }
.score-card.is-pending .criteria i::after { transform: scaleX(0); }
.score-tip { margin-top: 1.3rem; padding: 0.95rem 1.1rem; border-radius: 18px; background: rgba(245, 165, 36, 0.08); border: 1px solid rgba(245, 165, 36, 0.2); }
.score-tip b { display: block; margin-bottom: 0.25rem; color: #FFC861; font-size: 0.9rem; }
.score-tip p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

/* Roadmap */
.roadmap-head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.roadmap { position: relative; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.roadmap::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: linear-gradient(90deg, #F5A524, #F472B6, #8B5CF6);
    transform: scaleX(var(--draw, 1));
    transform-origin: 0 50%;
}
[dir="rtl"] .roadmap::before { transform-origin: 100% 50%; }
.roadmap li { position: relative; text-align: center; padding: 0 0.5rem; }
.road-num {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(#1C1225, #1C1225) padding-box, var(--gold-gradient) border-box;
    border: 2px solid transparent;
    color: #FFC861;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    box-shadow: 0 0 30px rgba(245, 165, 36, 0.25);
}
.roadmap b { display: block; margin-bottom: 0.35rem; font-family: var(--font-display); font-size: 1.08rem; }
.roadmap p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

.exam-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: clamp(3.5rem, 7vw, 5rem);
    padding: clamp(1.5rem, 3vw, 2.2rem) clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 28px;
    background: linear-gradient(120deg, rgba(245, 165, 36, 0.14), rgba(244, 114, 182, 0.1) 60%, rgba(139, 92, 246, 0.12));
    border: 1px solid rgba(245, 165, 36, 0.3);
}
.exam-cta-text { flex: 1 1 320px; min-width: 0; }
.exam-cta h3 { font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; }
.exam-cta p { margin-top: 0.3rem; color: var(--text-secondary); }
.exam-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   CHAPTER 04 — bento
   ============================================================ */
.bento {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}
.bento-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-radius: 28px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: transform 0.45s var(--ease-bounce), box-shadow 0.35s ease;
}
.bento-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.bento-card h3 { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; }
.bento-card p { margin-top: 0.4rem; color: var(--text-secondary); font-size: 0.93rem; line-height: 1.6; }
.bento-visual { position: relative; flex: 1; min-height: 150px; display: grid; place-items: center; margin-bottom: 1.2rem; }
.b-chat { grid-column: span 3; grid-row: span 2; }
.b-call, .b-partner { grid-column: span 3; }
.b-decks, .b-league, .b-streak { grid-column: span 2; }

.b-chat .bento-visual {
    min-height: 260px;
    gap: 14px;
    align-content: center;
    border-radius: 22px;
    background: radial-gradient(circle at 30% 20%, rgba(var(--accent-rgb), 0.12), transparent 60%), radial-gradient(circle at 80% 90%, rgba(14, 165, 233, 0.12), transparent 55%);
}
.tr-bubble {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 92%;
    padding: 0.8rem 1rem;
    border-radius: 20px;
    background: var(--bg-solid);
    box-shadow: var(--shadow-md);
    font-size: 0.98rem;
    font-weight: 500;
}
.tr-left { justify-self: start; margin-inline-start: 6%; border-end-start-radius: 6px; }
.tr-right { justify-self: end; margin-inline-end: 6%; border-end-end-radius: 6px; background: var(--accent-gradient); color: #fff; }
.tr-flag { font-size: 1.15rem; }
.tr-text { transition: opacity 0.35s ease, filter 0.35s ease; }
.tr-text.is-swapping { opacity: 0; filter: blur(4px); }
.tr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-self: center;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(14, 165, 233, 0.12);
    color: #0284C7;
    font-size: 0.78rem;
    font-weight: 600;
}
[data-theme="dark"] .tr-badge { color: #7DD3FC; }

.call-dual { display: flex; align-items: center; gap: 1rem; }
.call-av {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 24px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}
.av1 { background: linear-gradient(135deg, #E11D63, #F472B6); }
.av2 { background: linear-gradient(135deg, #0EA5E9, #8B5CF6); }
.call-wave { display: flex; align-items: center; gap: 4px; height: 44px; }
.call-wave i { width: 5px; height: 100%; border-radius: 3px; background: var(--accent-primary); transform: scaleY(0.3); }
.motion .call-wave i { animation: wave 1s ease-in-out infinite; }
.call-wave i:nth-child(2) { animation-delay: -0.2s; }
.call-wave i:nth-child(3) { animation-delay: -0.45s; }
.call-wave i:nth-child(4) { animation-delay: -0.7s; }

.orbit { position: relative; width: 150px; height: 150px; border-radius: 50%; border: 1px dashed rgba(var(--accent-rgb), 0.3); }
.orbit-core { position: absolute; inset: 50%; display: grid; place-items: center; width: 56px; height: 56px; margin: -28px; border-radius: 18px; background: var(--accent-gradient); color: #fff; box-shadow: var(--glow-accent); }
.orbit-dot { position: absolute; display: grid; place-items: center; width: 38px; height: 38px; margin: -19px; border-radius: 50%; background: var(--bg-solid); box-shadow: var(--shadow-md); font-size: 1.1rem; }
.o1 { top: 0; left: 50%; } .o2 { top: 50%; left: 100%; } .o3 { top: 100%; left: 50%; } .o4 { top: 50%; left: 0; }
.motion .orbit { animation: spin 18s linear infinite; }
.motion .orbit-dot, .motion .orbit-core { animation: spin 18s linear infinite reverse; }

.deck-fan { position: relative; width: 220px; height: 130px; }
.deck {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: grid;
    place-items: center;
    width: 118px;
    height: 128px;
    margin-left: -59px;
    padding: 0.6rem;
    border-radius: 18px;
    background: var(--bg-solid);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
    transform-origin: 50% 100%;
    transition: transform 0.6s var(--ease-bounce);
}
.d1 { transform: rotate(-12deg) translateX(-34px); color: var(--accent-primary); }
.d2 { transform: rotate(0deg); z-index: 1; background: var(--accent-gradient); color: #fff; }
.d3 { transform: rotate(12deg) translateX(34px); color: var(--violet); }
.b-decks:hover .d1 { transform: rotate(-20deg) translateX(-58px) translateY(-6px); }
.b-decks:hover .d2 { transform: translateY(-12px); }
.b-decks:hover .d3 { transform: rotate(20deg) translateX(58px) translateY(-6px); }

.league { position: relative; list-style: none; width: 100%; max-width: 280px; height: 156px; }
.league li {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    display: grid;
    grid-template-columns: 26px 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    height: 46px;
    padding: 0 0.75rem;
    border-radius: 14px;
    background: var(--bg-solid);
    box-shadow: var(--shadow-sm);
    font-size: 0.88rem;
    transform: translateY(calc(var(--r) * 54px));
    transition: transform 0.8s var(--ease-bounce);
}
.lg-rank { font-family: var(--font-display); font-weight: 700; color: var(--text-tertiary); }
.lg-av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent-primary); font-weight: 700; font-size: 0.8rem; }
.lg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.league b { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.league li[style*="--r:0"] .lg-rank, .league li.is-first .lg-rank { color: #E08A00; }

.streak { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.streak-flame { color: #F97316; filter: drop-shadow(0 6px 14px rgba(249, 115, 22, 0.4)); }
.motion .streak-flame { animation: flame 1.6s ease-in-out infinite; }
@keyframes flame { 50% { transform: scale(1.12) rotate(-4deg); } }
.streak-num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.streak-days { display: flex; gap: 6px; }
.streak-days i { width: 18px; height: 18px; border-radius: 6px; background: rgba(var(--accent-rgb), 0.12); }
.streak-days i.on { background: linear-gradient(135deg, #F97316, #F5A524); }
.streak-days i.today { background: var(--bg-solid); border: 2px dashed #F97316; }

/* ============================================================
   PROGRAMS
   ============================================================ */
.program-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.program-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.25rem 1.6rem;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: box-shadow 0.35s ease;
    transform-style: preserve-3d;
}
.program-card:hover { box-shadow: var(--shadow-lg); }
.program-visual {
    position: relative;
    height: 250px;
    margin-bottom: 1.3rem;
    display: grid;
    place-items: center;
    border-radius: 22px;
    overflow: hidden;
}
.p-kids .program-visual { background: radial-gradient(circle at 30% 30%, rgba(255, 210, 120, 0.5), transparent 60%), linear-gradient(135deg, #FFF3D6, #FFE1EC); }
.p-school .program-visual { background: radial-gradient(circle at 70% 20%, rgba(14, 165, 233, 0.25), transparent 60%), linear-gradient(135deg, #E0F2FE, #EDE9FE); }
.p-class .program-visual { background: radial-gradient(circle at 30% 80%, rgba(34, 197, 94, 0.22), transparent 60%), linear-gradient(135deg, #DCFCE7, #FCE7F3); }
[data-theme="dark"] .p-kids .program-visual { background: radial-gradient(circle at 30% 30%, rgba(255, 190, 90, 0.22), transparent 60%), linear-gradient(135deg, #2C2216, #2B1621); }
[data-theme="dark"] .p-school .program-visual { background: radial-gradient(circle at 70% 20%, rgba(14, 165, 233, 0.22), transparent 60%), linear-gradient(135deg, #0F2130, #1E1735); }
[data-theme="dark"] .p-class .program-visual { background: radial-gradient(circle at 30% 80%, rgba(34, 197, 94, 0.18), transparent 60%), linear-gradient(135deg, #102A1C, #2A1424); }
.p-kids .phone { transform: rotate(-6deg) translateY(22%); }
.kid-bubble {
    position: absolute;
    top: 18%;
    inset-inline-end: 12%;
    padding: 0.45rem 0.8rem;
    border-radius: 16px 16px 16px 4px;
    background: #fff;
    color: #1A1A2E;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}
.motion .kid-bubble { animation: chipFloat 4s ease-in-out infinite; }
.grade-grid { display: grid; grid-template-columns: repeat(4, 46px); gap: 8px; }
.grade-grid span {
    display: grid;
    place-items: center;
    height: 46px;
    border-radius: 14px;
    background: var(--bg-solid);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-secondary);
}
.motion .grade-grid span { animation: gradePulse 6s ease-in-out infinite; animation-delay: calc(var(--n, 0) * 0.5s); }
.grade-grid span:nth-child(1) { --n: 0; } .grade-grid span:nth-child(2) { --n: 1; } .grade-grid span:nth-child(3) { --n: 2; } .grade-grid span:nth-child(4) { --n: 3; }
.grade-grid span:nth-child(5) { --n: 4; } .grade-grid span:nth-child(6) { --n: 5; } .grade-grid span:nth-child(7) { --n: 6; } .grade-grid span:nth-child(8) { --n: 7; }
.grade-grid span:nth-child(9) { --n: 8; } .grade-grid span:nth-child(10) { --n: 9; } .grade-grid span:nth-child(11) { --n: 10; } .grade-grid span:nth-child(12) { --n: 11; }
@keyframes gradePulse { 0%, 12%, 100% { background: var(--bg-solid); color: var(--text-secondary); transform: none; } 4%, 8% { background: #0EA5E9; color: #fff; transform: translateY(-4px); } }
.grade-grid .thpt { background: var(--gold-gradient); color: #2B1700; }
.class-board { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.class-code { padding: 0.7rem 1.2rem; border-radius: 18px; background: var(--bg-solid); box-shadow: var(--shadow-md); text-align: center; }
.class-code small { display: block; color: var(--text-tertiary); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.class-code b { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.08em; }
.class-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.class-bars i { width: 22px; height: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #22C55E, #0EA5E9); transform: scaleY(var(--h)); transform-origin: 50% 100%; }
.motion .class-bars i { animation: bars 3s ease-in-out infinite alternate; }
.class-bars i:nth-child(2) { animation-delay: -0.6s; } .class-bars i:nth-child(3) { animation-delay: -1.2s; } .class-bars i:nth-child(4) { animation-delay: -1.8s; } .class-bars i:nth-child(5) { animation-delay: -2.4s; }
@keyframes bars { from { transform: scaleY(calc(var(--h) * 0.45)); } to { transform: scaleY(var(--h)); } }
.program-card h3 { margin: 0.6rem 0 0.45rem; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.program-card > p:not(.program-badge) { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.65; }
.program-card .tags { margin-top: auto; padding-top: 1.1rem; }

/* ============================================================
   GIFT — 1 month Pro+
   ============================================================ */
.gift-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border-radius: clamp(28px, 4vw, 44px);
    background:
        radial-gradient(circle at 12% 30%, rgba(245, 165, 36, 0.24), transparent 46%),
        radial-gradient(circle at 92% 90%, rgba(225, 29, 99, 0.18), transparent 50%),
        var(--bg-card);
    border: 1px solid rgba(245, 165, 36, 0.35);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(245, 165, 36, 0.12);
    overflow: hidden;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
}
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.gift-visual { position: relative; display: grid; place-items: center; min-height: 380px; perspective: 1000px; }
.gift-glow { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(245, 165, 36, 0.45), transparent 65%); filter: blur(20px); z-index: -1; }
.motion .gift-glow { animation: glowPulse 3.5s ease-in-out infinite; }
@keyframes glowPulse { 50% { transform: scale(1.15); opacity: 0.75; } }

.gift-box {
    --s: 150px;
    --l: calc(var(--s) * 1.12);
    --h: calc(var(--s) * 0.28);
    position: relative;
    width: var(--s);
    height: var(--s);
    margin-top: 60px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-34deg);
}
.motion .gift-box { animation: giftTurn 16s linear infinite; }
@keyframes giftTurn { from { transform: rotateX(-20deg) rotateY(-34deg); } to { transform: rotateX(-20deg) rotateY(326deg); } }
.gb-body, .gb-lid { position: absolute; transform-style: preserve-3d; }
.gb-body { inset: 0; }
.gb-face { position: absolute; display: block; backface-visibility: visible; }
.gb-body .gb-face {
    left: 0;
    top: 0;
    width: var(--s);
    height: var(--s);
    background:
        linear-gradient(90deg, transparent 42%, #FFC861 42%, #F5A524 58%, transparent 58%),
        linear-gradient(160deg, #F0528A, #C8104F);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), inset 0 -20px 40px rgba(0, 0, 0, 0.15);
}
.gb-body .f-front { transform: translateZ(calc(var(--s) / 2)); }
.gb-body .f-back { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.gb-body .f-right { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.85); }
.gb-body .f-left { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.85); }
.gb-lid {
    left: calc((var(--s) - var(--l)) / 2);
    top: calc(var(--h) * -0.85);
    width: var(--l);
    height: var(--h);
    transition: transform 0.9s var(--ease-bounce);
}
.gb-lid .gb-face {
    left: 0;
    top: 0;
    width: var(--l);
    height: var(--h);
    background:
        linear-gradient(90deg, transparent 42%, #FFC861 42%, #F5A524 58%, transparent 58%),
        linear-gradient(160deg, #F7709F, #DD1C60);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.gb-lid .f-front { transform: translateZ(calc(var(--l) / 2)); }
.gb-lid .f-right { transform: rotateY(90deg) translateZ(calc(var(--l) / 2)); filter: brightness(0.88); }
.gb-lid .f-left { transform: rotateY(-90deg) translateZ(calc(var(--l) / 2)); filter: brightness(0.88); }
.gb-lid .f-top {
    top: calc((var(--h) - var(--l)) / 2);
    height: var(--l);
    background:
        linear-gradient(90deg, transparent 42%, #FFC861 42%, #F5A524 58%, transparent 58%),
        linear-gradient(0deg, transparent 42%, #FFC861 42%, #F5A524 58%, transparent 58%),
        linear-gradient(160deg, #FF8AB3, #E2306F);
    transform: rotateX(90deg) translateZ(calc(var(--h) / 2));
}
.gb-bow {
    position: absolute;
    left: 50%;
    top: calc(var(--h) / 2);
    width: 90px;
    height: 46px;
    margin-left: -45px;
    transform: rotateX(90deg) translateZ(calc(var(--h) / 2 + 1px)) ;
}
.gb-bow::before, .gb-bow::after {
    content: '';
    position: absolute;
    top: 6px;
    width: 42px;
    height: 34px;
    border: 9px solid #F5A524;
    border-radius: 50%;
}
.gb-bow::before { left: 0; transform: rotate(-18deg); }
.gb-bow::after { right: 0; transform: rotate(18deg); }
.gb-prize {
    position: absolute;
    left: 50%;
    top: 30%;
    padding: 0.5rem 1rem;
    border-radius: 14px;
    background: var(--gold-gradient);
    color: #2B1700;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 0 40px rgba(245, 165, 36, 0.8);
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
    transition: transform 0.9s var(--ease-bounce) 0.15s, opacity 0.4s ease 0.15s;
}
.gift-visual.is-open .gb-lid { transform: translateY(-90px) translateX(30px) rotateZ(18deg) rotateX(-14deg); }
.gift-visual.is-open .gb-prize { opacity: 1; transform: translate(-50%, -150%) scale(1); }
.gift-visual.is-open .gift-box { animation-play-state: paused; }

.gift-content .eyebrow { background: rgba(245, 165, 36, 0.12); border-color: rgba(245, 165, 36, 0.32); color: #C27400; }
[data-theme="dark"] .gift-content .eyebrow { color: #FFC861; }
.gift-title {
    margin: 1rem 0 0.7rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.04em;
    text-wrap: balance;
}
.gift-sub { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.65; }
.gift-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 1.6rem; }
.gift-step {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: start;
    padding: 0.95rem 1.05rem;
    border-radius: 20px;
    background: var(--bg-solid);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--ease-bounce), box-shadow 0.3s ease;
}
.gift-step:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
[dir="rtl"] .gift-step:hover { transform: translateX(-4px); }
.gs-num {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.3);
}
.gs-num-gold { background: var(--gold-gradient); color: #2B1700; box-shadow: 0 6px 16px rgba(245, 165, 36, 0.35); }
.gs-body { min-width: 0; }
.gs-body b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.gs-body p { margin-top: 0.2rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }
.gs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.7rem; }
.chip-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.35s var(--ease-bounce);
}
.chip-link:hover { transform: translateY(-2px); }
.chip-link:active { transform: scale(0.96); }
/* Store pair: two equal-width buttons; stacks (still equal, full width) when the step is narrow */
.gs-stores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    max-width: 320px;
}
.gs-stores .chip-link { justify-content: center; padding: 0.55rem 1rem; white-space: nowrap; }
.chip-zalo { background: #0068FF; color: #fff; box-shadow: 0 6px 18px rgba(0, 104, 255, 0.3); }
.zalo-word { padding: 0.05rem 0.4rem; border-radius: 6px; background: #fff; color: #0068FF; font-weight: 800; font-size: 0.78rem; }
.gs-qr { width: 104px; margin: 0; text-align: center; }
.gs-qr img { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow-md); }
.gs-qr figcaption { margin-top: 0.35rem; color: var(--text-tertiary); font-size: 0.7rem; line-height: 1.3; }
.gift-review {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(245, 165, 36, 0.08);
    border: 1px dashed rgba(245, 165, 36, 0.4);
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}
.gift-review .stars { display: inline-flex; flex-shrink: 0; gap: 1px; color: #F5A524; padding-top: 0.15rem; }
.gift-review a { color: var(--accent-primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.gift-review a:hover { text-decoration: underline; }
.gift-fine { margin-top: 0.9rem; color: var(--text-tertiary); font-size: 0.78rem; }

/* ============================================================
   PRICING
   ============================================================ */
@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: transform 0.45s var(--ease-bounce), box-shadow 0.35s ease;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.price-card h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.price-desc { margin-top: 0.2rem; color: var(--text-tertiary); font-size: 0.92rem; }
.price-amount { margin: 1.2rem 0 1.3rem; color: var(--text-tertiary); font-size: 0.95rem; }
.price-amount b, .price-amount strong { font-family: var(--font-display); font-size: 2.7rem; font-weight: 700; letter-spacing: -0.04em; color: var(--text-primary); }
.price-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.6rem; }
.price-list li { display: flex; gap: 0.6rem; color: var(--text-secondary); font-size: 0.93rem; line-height: 1.5; }
.price-list svg { flex-shrink: 0; margin-top: 0.15rem; color: var(--accent-primary); }
.price-btn { width: 100%; margin-top: auto; }
.price-featured {
    border: 2px solid transparent;
    background: linear-gradient(var(--bg-solid), var(--bg-solid)) padding-box, conic-gradient(from var(--angle), #E11D63, #F5A524, #8B5CF6, #E11D63) border-box;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(245, 165, 36, 0.16);
}
.motion .price-featured { animation: borderSpin 6s linear infinite; }
@keyframes borderSpin { to { --angle: 360deg; } }
.price-ribbon {
    position: absolute;
    top: -13px;
    inset-inline-start: 50%;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-pill);
    background: var(--gold-gradient);
    color: #2B1700;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
    transform: translateX(-50%);
    box-shadow: 0 6px 18px rgba(245, 165, 36, 0.35);
}
[dir="rtl"] .price-ribbon { transform: translateX(50%); }
.earn-row { margin-top: 3rem; }
.earn-title { margin-bottom: 1rem; text-align: center; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.earn-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.earn-list li {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
}
.earn-ico { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(var(--accent-rgb), 0.1); color: var(--accent-primary); }
.earn-list b { font-family: var(--font-display); font-size: 0.98rem; }
.earn-list li > span:last-child { color: var(--text-tertiary); font-size: 0.85rem; line-height: 1.45; }
.tiers-note { margin-top: 1.6rem; text-align: center; color: var(--text-tertiary); font-size: 0.82rem; }

/* ============================================================
   DOWNLOAD
   ============================================================ */
.cta-card {
    position: relative;
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 4vw, 3rem);
    border-radius: clamp(28px, 4vw, 44px);
    background:
        radial-gradient(circle at 20% 0%, rgba(var(--accent-rgb), 0.18), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(139, 92, 246, 0.16), transparent 50%),
        var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    text-align: center;
    overflow: hidden;
}
.cta-card .section-title { max-width: 760px; margin: 0 auto 1rem; }
.cta-card .section-sub { max-width: 620px; margin: 0 auto; }
.cta-orbit { position: relative; width: 240px; height: 200px; margin: 0 auto 1.5rem; }
.cta-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 96px;
    height: 96px;
    margin: -48px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(var(--accent-rgb), 0.35);
    z-index: 2;
}
.cta-logo img { width: 100%; height: 100%; }
.cta-orbit .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px dashed rgba(var(--accent-rgb), 0.3); transform: translate(-50%, -50%); }
.r1 { width: 140px; height: 140px; } .r2 { width: 190px; height: 190px; border-style: solid !important; border-color: rgba(139, 92, 246, 0.18) !important; } .r3 { width: 240px; height: 240px; }
.motion .r1 { animation: ringSpin 14s linear infinite; }
.motion .r3 { animation: ringSpin 22s linear infinite reverse; }
@keyframes ringSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hello {
    position: absolute;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--bg-solid);
    box-shadow: var(--shadow-sm);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}
.h1 { top: 4%; left: -12%; } .h2 { top: 0; right: -16%; } .h3 { bottom: 10%; right: -14%; } .h4 { bottom: 0; left: -10%; } .h5 { top: 46%; left: -26%; }
.motion .hello { animation: chipFloat 5s ease-in-out infinite; }
.motion .hello:nth-child(2n) { animation-delay: -2.5s; animation-duration: 6s; }
.store-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 2.2rem; }
.store-web { background: var(--bg-solid); color: var(--text-primary); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); }

/* ============================================================
   Chapter rail
   ============================================================ */
.chapter-rail {
    position: fixed;
    inset-inline-start: 18px;
    top: 50%;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-12px, -50%);
    transition: opacity 0.4s ease, transform 0.5s var(--ease-out), visibility 0.4s;
}
.chapter-rail.is-visible { opacity: 1; visibility: visible; transform: translate(0, -50%); }
.chapter-rail a { display: flex; align-items: center; gap: 0.5rem; color: var(--text-tertiary); text-decoration: none; }
.chapter-rail span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.4s var(--ease-bounce);
}
.chapter-rail em {
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    background: var(--bg-solid);
    box-shadow: var(--shadow-sm);
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.chapter-rail a:hover em,
.chapter-rail a.is-active em { opacity: 1; transform: none; }
.chapter-rail a.is-active { color: var(--text-primary); }
.chapter-rail a.is-active span { background: var(--accent-gradient); color: #fff; border-color: transparent; transform: scale(1.08); }
.chapter-rail.on-dark a { color: rgba(255, 255, 255, 0.7); }
.chapter-rail.on-dark a.is-active { color: #fff; }
.chapter-rail.on-dark a.is-active span { background: var(--gold-gradient); color: #2B1700; }
.chapter-rail.on-dark em { background: #1C1225; }
/* Below 1600px the gutter is too narrow for a permanent label next to the content */
@media (max-width: 1599px) {
    .chapter-rail a.is-active:not(:hover):not(:focus-visible) em { opacity: 0; transform: translateX(-6px); }
}
@media (max-width: 1399px) { .chapter-rail { display: none; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .earn-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chip-a { left: 70%; }
    .chip-b { left: 74%; }
}

@media (max-width: 900px) {
    .hero { min-height: 0; padding: 104px 0 64px; }
    .hero-inner { grid-template-columns: minmax(0, 1fr); }
    .hero-content { text-align: center; }
    .hero-subtitle { margin: 0 auto; }
    .hero-actions { justify-content: center; }
    .hero-stats { margin: 0 auto; }
    .hero-visual { justify-self: center; max-width: 520px; margin-top: 1rem; }
    .scroll-cue { display: none; }

    .journey-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .story { grid-template-columns: minmax(0, 1fr); }
    .story-stage { display: none; }
    .story-step { min-height: 0; padding: 1.5rem 0 2.5rem; border-inline-start: 0; }
    .story-step::before { display: none; }
    .story-step h3 { color: var(--text-primary); }
    .story-step + .story-step { border-top: 1px solid var(--hairline); padding-top: 2.5rem; }
    .step-media { display: flex; justify-content: center; margin-top: 2rem; }
    .step-media .phone { transform: rotate(-2deg); }

    .write-feature { grid-template-columns: minmax(0, 1fr); }
    .write-visual { padding: 2rem 1rem 3rem; }

    .exam-showcase { grid-template-columns: minmax(0, 1fr); }
    .cert-stage { min-height: 320px; }
    .anatomy { grid-template-columns: minmax(0, 1fr); }
    .anatomy-stage { order: -1; min-height: 420px; }
    .grading { grid-template-columns: minmax(0, 1fr); }
    .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
    .roadmap::before { display: none; }

    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .b-chat { grid-column: span 2; grid-row: auto; }
    .b-call, .b-partner, .b-decks, .b-league, .b-streak { grid-column: span 1; }
    .b-streak { grid-column: span 2; }

    .program-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
    .gift-card { grid-template-columns: minmax(0, 1fr); }
    .gift-visual { min-height: 300px; }
    .price-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; }
    .price-featured { order: -1; }
}

@media (max-width: 640px) {
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem 1.4rem; text-align: center; }
    .hero-actions .btn { flex: 1 1 100%; }
    .hero-visual { max-width: 400px; }
    .hero-stage { left: 0; width: 42%; }
    .hero-promo { border-radius: 20px; text-align: start; }
    .hero-promo-text { white-space: normal; }
    .float-chip { font-size: 0.74rem; padding: 0.4rem 0.7rem 0.4rem 0.4rem; }
    .chip-ico { width: 24px; height: 24px; }
    .chip-a { left: 58%; top: 2%; }
    .chip-b { display: none; }
    .chip-c { left: 62%; bottom: 4%; }
    .journey-track { grid-template-columns: minmax(0, 1fr); }
    .mini-grid { grid-template-columns: minmax(0, 1fr); }
    .exam-stats li { padding: 1.1rem; }
    .exam-tab { padding: 0.55rem 0.85rem; font-size: 0.86rem; }
    .roadmap { grid-template-columns: minmax(0, 1fr); }
    .bento { grid-template-columns: minmax(0, 1fr); }
    .b-chat, .b-call, .b-partner, .b-decks, .b-league, .b-streak { grid-column: auto; }
    .tr-bubble { font-size: 0.9rem; }
    .gift-step { grid-template-columns: 36px minmax(0, 1fr); }
    .gs-qr { display: none; }
    .gift-review { flex-direction: column; gap: 0.4rem; }
    .earn-list { grid-template-columns: minmax(0, 1fr); }
    .cta-orbit { transform: scale(0.85); }
    .hello.h5 { display: none; }
    .score-main { gap: 1rem; }
    .gauge { width: 112px; height: 112px; }
    .gauge svg { width: 112px; height: 112px; }
    .game-card { --mh: clamp(300px, 56vh, 420px); }
}

@media (max-width: 380px) {
    .hero-promo { font-size: 0.8rem; }
    .float-chip.chip-b { display: none; }
    .grade-grid { grid-template-columns: repeat(4, 40px); }
    .grade-grid span { height: 40px; }
}

/* No-motion: everything is simply there. */
html:not(.motion) .screen-chat .chat-body > * { opacity: 1; }
