/* ===========================================================
   VeoGrok Studio — landing + guide
   Inspired by Nuxt UI / TranslaBuddy aesthetic.
   Light + dark mode, Vietnamese-first.
   =========================================================== */

:root {
    /* Brand */
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --brand-900: #312e81;

    --accent-500: #d946ef;   /* fuchsia accent for AI gradient */
    --accent-600: #c026d3;

    /* Semantic — light */
    --bg:           #ffffff;
    --bg-soft:      #f8fafc;
    --bg-elevated:  #ffffff;
    --bg-overlay:   rgba(15, 23, 42, 0.5);
    --surface:      #ffffff;
    --surface-2:    #f1f5f9;
    --surface-hover:#eef2ff;
    --border:       #e2e8f0;
    --border-strong:#cbd5e1;
    --fg:           #0f172a;
    --fg-muted:     #475569;
    --fg-subtle:    #64748b;
    --fg-on-brand:  #ffffff;

    /* Effects */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow:    0 4px 14px -2px rgba(15, 23, 42, .08), 0 2px 6px -2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 18px 40px -16px rgba(15, 23, 42, .18), 0 8px 16px -8px rgba(15, 23, 42, .08);
    --shadow-glow: 0 0 0 1px rgba(99, 102, 241, .25), 0 8px 24px -8px rgba(99, 102, 241, .35);

    /* Typography */
    --font-sans: "Inter", "Be Vietnam Pro", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;

    --container: 1180px;
    --container-narrow: 880px;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #faf5ff 50%, #fdf4ff 100%);
}

html.dark {
    --bg:           #0b1020;
    --bg-soft:      #0f172a;
    --bg-elevated:  #111a33;
    --bg-overlay:   rgba(0, 0, 0, .65);
    --surface:      #131b34;
    --surface-2:    #182142;
    --surface-hover:#1c264e;
    --border:       #1f2a4a;
    --border-strong:#293564;
    --fg:           #f1f5f9;
    --fg-muted:     #cbd5e1;
    --fg-subtle:    #94a3b8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow:    0 6px 20px -4px rgba(0, 0, 0, .55), 0 2px 8px -2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 22px 48px -18px rgba(0, 0, 0, .7), 0 10px 22px -10px rgba(0, 0, 0, .45);

    --gradient-soft: linear-gradient(135deg, #131b34 0%, #1a1437 50%, #2a1146 100%);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

img, video { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; gap: 24px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--fg);
}
.brand-logo {
    height: 38px; width: auto; display: block;
    object-fit: contain;
    transition: transform .2s;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
}
.brand:hover .brand-logo { transform: scale(1.06); }
.brand-name {
    font-weight: 800; font-size: 18px; letter-spacing: .3px;
    background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 50%, #2563eb 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    line-height: 1;
}
html.dark .brand-name {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 50%, #60a5fa 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (max-width: 480px) {
    .brand-name { display: none; }
    .brand-logo { height: 34px; }
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
    padding: 8px 14px; border-radius: var(--radius-sm);
    color: var(--fg-muted); font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--surface-hover); color: var(--fg); }
.nav-links a.active { color: var(--brand-600); background: var(--brand-50); }
html.dark .nav-links a.active { background: rgba(99,102,241,.15); color: var(--brand-300); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius);
    font-weight: 600; font-size: 14px;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .08s ease, background .15s, color .15s, border-color .15s, box-shadow .15s;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); color: var(--fg-on-brand); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: var(--surface-2); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: var(--radius-lg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative; overflow: hidden;
    padding: 80px 0 64px;
    background: var(--gradient-soft);
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(800px 360px at 80% -10%, rgba(217, 70, 239, .18), transparent 60%),
        radial-gradient(720px 360px at 12% 20%, rgba(99, 102, 241, .22), transparent 60%);
    pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: var(--radius-pill);
    background: var(--surface); border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; color: var(--fg-muted);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 4px rgba(99,102,241,.15); }

h1.headline {
    font-size: clamp(34px, 5vw, 60px);
    font-weight: 800; line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
}
h1.headline .grad {
    background: var(--gradient-hero);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lead {
    font-size: clamp(16px, 1.6vw, 19px);
    color: var(--fg-muted); max-width: 720px; margin: 0 auto 32px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-meta {
    margin-top: 24px;
    display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
    color: var(--fg-subtle); font-size: 13px;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }

.hero-preview {
    margin: 56px auto 0; max-width: 1040px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}
.hero-preview .frame-bar {
    display: flex; gap: 6px; padding: 12px 16px;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.hero-preview .frame-bar i { width: 11px; height: 11px; border-radius: 50%; }
.hero-preview .frame-bar i:nth-child(1) { background: #ef4444; }
.hero-preview .frame-bar i:nth-child(2) { background: #eab308; }
.hero-preview .frame-bar i:nth-child(3) { background: #22c55e; }
.hero-preview .frame-body { aspect-ratio: 16/9; background: var(--bg-soft); }

/* ============================================================
   SECTION
   ============================================================ */
section { padding: 80px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head .kicker {
    display: inline-block; font-size: 12px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--brand-600); margin-bottom: 10px;
}
html.dark .section-head .kicker { color: var(--brand-300); }
.section-head h2 {
    font-size: clamp(28px, 3.4vw, 40px); font-weight: 800;
    margin: 0 0 12px; letter-spacing: -0.01em;
}
.section-head p { color: var(--fg-muted); font-size: 17px; margin: 0; }

/* ============================================================
   FEATURE GRID
   ============================================================ */
.features { background: var(--bg); }
.feature-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.feature-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
    color: var(--brand-700);
    margin-bottom: 16px;
}
html.dark .feature-icon { background: rgba(99,102,241,.15); color: var(--brand-300); }
.feature-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.feature-card p { margin: 0; color: var(--fg-muted); font-size: 14px; }
.feature-card .feature-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: var(--radius-pill);
    background: var(--surface-2); color: var(--fg-muted);
    border: 1px solid var(--border);
}

/* ============================================================
   USE CASES
   ============================================================ */
.usecases { background: var(--bg-soft); }
.usecase-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.usecase-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px;
    display: flex; flex-direction: column; gap: 10px;
}
.usecase-card .num {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--gradient-hero); color: white;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.usecase-card h4 { margin: 0; font-size: 16px; font-weight: 700; }
.usecase-card p { margin: 0; color: var(--fg-muted); font-size: 14px; }

/* ============================================================
   GUIDE PAGE — SIDEBAR + CONTENT
   ============================================================ */
.guide-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 48px 0;
    align-items: start;
}
.guide-side {
    position: sticky; top: 88px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    max-height: calc(100vh - 110px); overflow-y: auto;
}
.guide-side h4 {
    font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--fg-subtle);
    padding: 8px 10px; margin: 0;
}
.guide-side ul { list-style: none; margin: 0; padding: 0; }
.guide-side li a {
    display: block; padding: 10px 12px;
    border-radius: var(--radius-sm); font-size: 14px;
    color: var(--fg-muted); margin-bottom: 2px;
    border-left: 2px solid transparent;
    transition: background .12s, color .12s, border-color .12s;
}
.guide-side li a:hover { background: var(--surface-hover); color: var(--fg); }
.guide-side li a.active {
    background: var(--brand-50); color: var(--brand-700);
    border-left-color: var(--brand-500); font-weight: 600;
}
html.dark .guide-side li a.active { background: rgba(99,102,241,.15); color: var(--brand-300); }

.chapter { padding: 40px 0 80px; scroll-margin-top: 80px; }
.chapter:not(:first-child) { border-top: 1px dashed var(--border); }
.chapter-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.chapter-num {
    flex: 0 0 auto;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--gradient-hero); color: white;
    display: grid; place-items: center; font-weight: 800; font-size: 18px;
    box-shadow: var(--shadow-glow);
}
.chapter-meta h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.chapter-meta .sub { color: var(--fg-muted); font-size: 14px; margin-top: 4px; }

/* Chapter layout: 1 cot full-width (video tren, steps duoi) - dep + de doc */
.chapter-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.chapter-grid > div { width: 100%; }
.chapter-grid .steps {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
}
.chapter-grid .steps h3 { margin: 0 0 16px; font-size: 18px; }
.chapter-grid .step-list {
    margin: 0; padding-left: 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.chapter-grid .step-list li {
    font-size: 15px; line-height: 1.6;
}
.chapter-grid .step-list li b {
    display: block; margin-bottom: 4px; font-size: 16px; color: var(--fg);
}
.chapter-grid .step-list li span {
    display: block; color: var(--fg-muted);
}
@media (max-width: 980px) {
    .guide-shell { grid-template-columns: 1fr; }
    .guide-side { position: static; max-height: none; }
}

.video-shell {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow);
}
.video-shell video {
    width: 100%; aspect-ratio: 16/9;
    background: black; display: block;
}
.thumb-strip {
    display: grid; grid-template-columns: repeat(8, 1fr);
    gap: 4px; padding: 10px; background: var(--surface-2);
    border-top: 1px solid var(--border);
}
.thumb-strip button {
    border: 1px solid transparent; padding: 0; background: transparent;
    cursor: pointer; border-radius: var(--radius-xs); overflow: hidden;
    aspect-ratio: 16/9;
}
.thumb-strip button img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.thumb-strip button:hover { border-color: var(--brand-400); }
.thumb-strip button:hover img { transform: scale(1.05); }

.steps {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px;
}
.steps h3 { margin: 0 0 14px; font-size: 16px; }
.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list > li {
    position: relative;
    padding: 10px 0 12px 36px; border-bottom: 1px dashed var(--border);
    counter-increment: step;
}
.step-list > li:last-child { border-bottom: none; }
.step-list > li::before {
    content: counter(step);
    position: absolute; left: 0; top: 12px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--brand-50); color: var(--brand-700);
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
html.dark .step-list > li::before { background: rgba(99,102,241,.18); color: var(--brand-300); }
.step-list > li b { display: block; margin-bottom: 2px; }
.step-list > li span { color: var(--fg-muted); font-size: 14px; }

.callout {
    margin: 18px 0; padding: 14px 16px;
    border-radius: var(--radius);
    border-left: 3px solid var(--brand-500);
    background: linear-gradient(90deg, rgba(99,102,241,.08), transparent);
    color: var(--fg-muted); font-size: 14px;
}
.callout b { color: var(--fg); }
.callout.warn { border-left-color: #f59e0b; background: linear-gradient(90deg, rgba(245,158,11,.1), transparent); }
.callout.tip  { border-left-color: #10b981; background: linear-gradient(90deg, rgba(16,185,129,.1), transparent); }

.transcript {
    margin-top: 18px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    font-size: 13.5px; color: var(--fg-muted);
    max-height: 220px; overflow: hidden; position: relative;
    transition: max-height .25s ease;
}
.transcript.expanded { max-height: 2000px; }
.transcript::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0;
    height: 60px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--surface-2));
}
.transcript.expanded::after { display: none; }
.transcript-toggle {
    margin-top: 8px; font-size: 13px; color: var(--brand-600);
    background: none; border: none; cursor: pointer; padding: 4px 0;
}
.transcript-toggle:hover { text-decoration: underline; }
html.dark .transcript-toggle { color: var(--brand-300); }
.transcript .seg { padding: 4px 0; border-bottom: 1px dashed transparent; }
.transcript .seg b { color: var(--brand-600); font-family: var(--font-mono); font-size: 12px; margin-right: 8px; }
html.dark .transcript .seg b { color: var(--brand-300); }

/* ============================================================
   FAQ
   ============================================================ */
.faq { background: var(--bg); }
.faq-list { max-width: 760px; margin: 0 auto; }
details.faq-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px;
    transition: border-color .15s;
}
details.faq-item[open] { border-color: var(--brand-300); }
details.faq-item summary {
    cursor: pointer; font-weight: 600; list-style: none;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
    content: "+"; font-size: 22px; color: var(--fg-subtle);
    transition: transform .2s;
}
details.faq-item[open] summary::after { content: "−"; }
details.faq-item p {
    margin: 12px 0 0; color: var(--fg-muted); font-size: 15px;
}

/* ============================================================
   CTA
   ============================================================ */
.cta-wrap {
    margin: 0 auto; max-width: 920px;
    text-align: center;
    padding: 56px 32px;
    border-radius: var(--radius-xl);
    background: var(--gradient-hero);
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.cta-wrap::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(600px 280px at 100% 0%, rgba(255,255,255,.18), transparent 60%);
}
.cta-wrap h2 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 36px); font-weight: 800; position: relative; }
.cta-wrap p { margin: 0 0 24px; opacity: .9; position: relative; }
.cta-wrap .btn { background: white; color: var(--brand-700); position: relative; }
.cta-wrap .btn:hover { background: var(--brand-50); }
.cta-wrap .btn-outline {
    background: transparent; color: white;
    border-color: rgba(255,255,255,.4);
}
.cta-wrap .btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: 40px 0 56px; background: var(--bg); }
.footer-grid {
    display: grid; gap: 32px;
    grid-template-columns: 2fr 1fr 1fr 1fr;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-size: 13px; font-weight: 700; margin: 0 0 14px; color: var(--fg); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--fg-muted); font-size: 14px; }
.footer a:hover { color: var(--fg); }
.footer-bottom {
    margin-top: 32px; padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    color: var(--fg-subtle); font-size: 13px;
}

/* ============================================================
   CTA SECTION (theme-aware)
   ============================================================ */
.cta-wrap {
    text-align: center;
    padding: 56px 24px;
    border-radius: var(--radius-xl);
    position: relative; overflow: hidden;
    /* LIGHT MODE: gradient sáng tươi tím→fuchsia→hồng pastel */
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 35%, #d946ef 70%, #ec4899 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 24px 60px -20px rgba(139,92,246,.5),
                0 0 0 1px rgba(255,255,255,.08) inset;
}
html.dark .cta-wrap {
    /* DARK MODE: deep nebula tím navy → magenta */
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #581c87 65%, #831843 100%);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 24px 60px -20px rgba(99,102,241,.45);
}
.cta-glow {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(600px 240px at 80% 20%, rgba(255,255,255,.18), transparent 60%),
        radial-gradient(500px 240px at 10% 80%, rgba(255,255,255,.12), transparent 60%);
}
html.dark .cta-glow {
    background:
        radial-gradient(600px 240px at 80% 20%, rgba(217,70,239,.25), transparent 60%),
        radial-gradient(500px 240px at 10% 80%, rgba(99,102,241,.3), transparent 60%);
}
.cta-wrap h2 {
    color: #fff !important; font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 12px; position: relative;
    text-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.cta-wrap p {
    color: rgba(255,255,255,.92); font-size: 17px;
    max-width: 600px; margin: 0 auto 24px; position: relative;
}
.cta-buttons {
    display: flex; gap: 12px; justify-content: center;
    flex-wrap: wrap; position: relative;
}
.cta-btn-primary {
    background: #fff !important; color: #4f46e5 !important;
    font-weight: 700; border: none !important;
}
.cta-btn-primary:hover { background: #f5f3ff !important; transform: translateY(-2px); }
.cta-btn-download {
    background: rgba(255,255,255,.15) !important; color: #fff !important;
    border: 2px solid rgba(255,255,255,.4) !important; font-weight: 700;
    backdrop-filter: blur(8px);
}
.cta-btn-download:hover { background: rgba(255,255,255,.25) !important; }
.cta-btn-zalo { background: #0068ff !important; color: #fff !important; border: none !important; }
.cta-btn-zalo:hover { background: #0056d3 !important; transform: translateY(-2px); }
.cta-btn-telegram { background: #229ED9 !important; color: #fff !important; border: none !important; }
.cta-btn-telegram:hover { background: #1c87b8 !important; transform: translateY(-2px); }
btn-primary:hover { background: #f5f3ff !important; transform: translateY(-2px); }
.cta-btn-download {
    background: rgba(255,255,255,.15) !important; color: #fff !important;
    border: 2px solid rgba(255,255,255,.4) !important; font-weight: 700;
    backdrop-filter: blur(8px);
}
.cta-btn-download:hover { background: rgba(255,255,255,.25) !important; }
.cta-btn-zalo { background: #0068ff !important; color: #fff !important; border: none !important; }
.cta-btn-zalo:hover { background: #0056d3 !important; transform: translateY(-2px); }
.cta-btn-telegram { background: #229ED9 !important; color: #fff !important; border: none !important; }
.cta-btn-telegram:hover { background: #1c87b8 !important; transform: translateY(-2px); }

/* ============================================================
   CHAPTER CARDS (7 chương — gradient number badges, INDEX page only)
   ============================================================ */
.chapter-cards-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.chapter-card {
    display: block; text-decoration: none; color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 24px;
    position: relative; overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.chapter-card::before {
    content: ""; position: absolute;
    top: 0; right: 0; width: 120px; height: 120px;
    background: radial-gradient(circle at top right, rgba(99,102,241,.12), transparent 70%);
    pointer-events: none;
    opacity: 0; transition: opacity .25s;
}
.chapter-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-300);
    box-shadow: 0 16px 36px -12px rgba(99,102,241,.25);
}
html.dark .chapter-card:hover {
    border-color: var(--brand-500);
    box-shadow: 0 16px 36px -12px rgba(99,102,241,.4);
}
.chapter-card:hover::before { opacity: 1; }

.chapter-num {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 22px; font-weight: 900;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px -6px rgba(99,102,241,.5);
    position: relative;
}
/* Gradient theo step */
.chapter-card[data-step="1"] .chapter-num { background: linear-gradient(135deg, #a855f7, #6366f1); box-shadow: 0 8px 20px -6px rgba(168,85,247,.5); }
.chapter-card[data-step="2"] .chapter-num { background: linear-gradient(135deg, #3b82f6, #06b6d4); box-shadow: 0 8px 20px -6px rgba(59,130,246,.5); }
.chapter-card[data-step="3"] .chapter-num { background: linear-gradient(135deg, #06b6d4, #10b981); box-shadow: 0 8px 20px -6px rgba(6,182,212,.5); }
.chapter-card[data-step="4"] .chapter-num { background: linear-gradient(135deg, #10b981, #84cc16); box-shadow: 0 8px 20px -6px rgba(16,185,129,.5); }
.chapter-card[data-step="5"] .chapter-num { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 8px 20px -6px rgba(245,158,11,.5); }
.chapter-card[data-step="6"] .chapter-num { background: linear-gradient(135deg, #ef4444, #ec4899); box-shadow: 0 8px 20px -6px rgba(239,68,68,.5); }
.chapter-card[data-step="7"] .chapter-num { background: linear-gradient(135deg, #ec4899, #d946ef); box-shadow: 0 8px 20px -6px rgba(236,72,153,.5); }

.chapter-card h3 {
    margin: 0 0 8px;
    font-size: 17px; font-weight: 700;
    color: var(--fg);
}
.chapter-card p {
    margin: 0; font-size: 14px;
    color: var(--fg-muted); line-height: 1.6;
}
.chapter-card code {
    background: rgba(99,102,241,.12); color: var(--brand-600);
    padding: 2px 6px; border-radius: 4px;
    font-family: var(--font-mono); font-size: 12.5px;
}
html.dark .chapter-card code { color: var(--brand-300); }

/* ============================================================
   HERO 2-COLUMN LAYOUT (left text + right preview)
   ============================================================ */
.hero-2col {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
    align-items: center;
    text-align: left;
}
.hero-2col .headline {
    text-align: left;
    font-size: clamp(32px, 4.5vw, 52px);
    line-height: 1.1;
    margin-bottom: 18px;
}
.hero-2col .lead {
    text-align: left; margin-left: 0;
    font-size: 17px; max-width: 580px;
    line-height: 1.65;
}
.hero-2col .hero-cta {
    justify-content: flex-start;
    margin-top: 24px;
}
.hero-left { position: relative; }
.hero-right { position: relative; }

/* Window-frame pane bên phải */
.hero-2col .hero-preview {
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 30px 70px -20px rgba(99,102,241,.35);
    transform: rotate(-0.5deg);
    transition: transform .35s ease;
}
.hero-2col .hero-preview:hover { transform: rotate(0deg) scale(1.01); }
.hero-2col .frame-bar {
    height: 36px;
    background: var(--surface-2);
    display: flex; align-items: center; gap: 6px;
    padding: 0 14px; position: relative;
    border-bottom: 1px solid var(--border);
}
.hero-2col .frame-bar i {
    width: 11px; height: 11px; border-radius: 50%;
    background: #ef4444; display: block;
}
.hero-2col .frame-bar i:nth-child(2) { background: #f59e0b; }
.hero-2col .frame-bar i:nth-child(3) { background: #10b981; }
.hero-2col .frame-title {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: 12px; color: var(--fg-muted);
    font-weight: 600;
}
.hero-2col .frame-body {
    aspect-ratio: 1/1;
    background: #000;
}

/* Stats badges row dưới CTA */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 32px;
    max-width: 540px;
}
.hero-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    transition: all .2s ease;
}
.hero-stat:hover {
    border-color: var(--brand-300);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(99,102,241,.25);
}
html.dark .hero-stat:hover { border-color: var(--brand-500); }
.hero-stat {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.hero-stat-logo {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--surface-2);
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: transform .2s;
}
.hero-stat:hover .hero-stat-logo { transform: scale(1.08); }
.hero-stat[data-platform="veo"] .hero-stat-logo {
    background: linear-gradient(135deg, rgba(66,133,244,.12), rgba(234,67,53,.12));
}
.hero-stat[data-platform="grok"] .hero-stat-logo {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
}
.hero-stat[data-platform="banana"] .hero-stat-logo {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    color: #92400e;
}
.hero-stat-name {
    font-size: 16px; font-weight: 800;
    color: var(--fg);
    line-height: 1.2;
    letter-spacing: -.2px;
    margin-bottom: 2px;
    display: flex; align-items: center; gap: 6px;
}
.hero-stat-meta {
    font-size: 11.5px;
    color: var(--fg-subtle);
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.vip-tag {
    display: inline-block;
    padding: 1px 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff !important;
    font-size: 9px;
    font-weight: 800;
    border-radius: 4px;
    letter-spacing: .5px;
    vertical-align: middle;
    line-height: 1.4;
}
/* VIP card highlight border */
.hero-stat-vip {
    border-color: rgba(245,158,11,.4) !important;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(245,158,11,.04) 100%) !important;
}
.hero-stat-vip:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 8px 22px -6px rgba(245,158,11,.3) !important;
}

/* Hide old hero-meta bullet line — replaced by hero-stats */
.hero-2col .hero-meta { display: none; }

/* RESPONSIVE: stack on tablet/mobile */
@media (max-width: 960px) {
    .hero-2col {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .hero-2col .headline,
    .hero-2col .lead { text-align: center; }
    .hero-2col .lead { margin: 0 auto 0; }
    .hero-2col .hero-cta { justify-content: center; }
    .hero-stats { margin: 32px auto 0; }
    .hero-2col .hero-preview { transform: none; }
}
@media (max-width: 520px) {
    .hero-stats {
        grid-template-columns: 1fr 1fr;
    }
    .hero-stat-vip { grid-column: 1 / -1; }
}

/* ============================================================
   CHAPTER 8 — ERROR ITEMS (Lỗi thường gặp)
   ============================================================ */
.err-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.err-item:hover {
    border-color: var(--brand-300);
    box-shadow: var(--shadow);
}
html.dark .err-item:hover { border-color: var(--brand-500); }
.err-item summary {
    cursor: pointer; padding: 16px 50px 16px 18px;
    font-weight: 700; font-size: 15px; color: var(--fg);
    list-style: none; position: relative;
    display: flex; align-items: center; gap: 12px;
}
.err-item summary::-webkit-details-marker { display: none; }
.err-item summary::after {
    content: "+"; position: absolute; right: 18px; top: 50%;
    transform: translateY(-50%); font-size: 24px;
    font-weight: 400; color: #ef4444;
    transition: transform .2s;
    line-height: 1;
}
.err-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.err-num {
    flex-shrink: 0;
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff; font-weight: 900; font-size: 13px;
    display: grid; place-items: center;
    box-shadow: 0 4px 10px -2px rgba(239,68,68,.4);
}
.err-body {
    padding: 0 18px 20px 18px;
    border-top: 1px dashed var(--border);
    margin-top: 0;
    color: var(--fg-muted);
    font-size: 14px;
    line-height: 1.65;
}
.err-body p { margin: 12px 0 8px; }
.err-body p b { color: var(--fg); }
.err-body ol {
    margin: 4px 0 8px 18px;
    padding-left: 6px;
}
.err-body ol li { margin-bottom: 6px; }
.err-body ol li b { color: var(--fg); }
.err-body code {
    background: rgba(99,102,241,.12);
    color: var(--brand-600);
    padding: 2px 6px; border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
html.dark .err-body code { color: var(--brand-300); }
.err-body a {
    color: var(--brand-600);
    text-decoration: underline;
}

/* ============================================================
   RESPONSIVE NAV — hamburger menu cho mobile (clean v2)
   ============================================================ */
.nav-toggle {
    display: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--fg);
    width: 40px; height: 40px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
}
.nav-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

@media (max-width: 880px) {
    /* Topbar wrap: brand left, hamburger right; drawer rows stack below */
    .nav-inner {
        flex-wrap: wrap;
        height: auto; min-height: 64px;
        gap: 12px;
        padding-top: 12px; padding-bottom: 12px;
    }
    .brand { order: 1; }
    .nav-toggle { display: flex; order: 2; margin-left: auto; }

    /* Hide drawer content by default */
    .nav-links, .nav-actions {
        display: none;
        order: 3;
        width: 100%;
        flex-basis: 100%;
    }

    /* Open drawer — show stacked */
    .nav.open .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 0 8px;
        margin-top: 4px;
        border-top: 1px solid var(--border);
    }
    .nav.open .nav-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 4px 0 12px;
    }

    .nav-links a {
        display: block;
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 8px;
    }
    .nav-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    .nav-actions .btn-icon {
        width: 100%;
        height: 44px;
    }
}

/* Toggle burger ↔ X icons via visibility */
.nav-toggle .ic-close { display: none; }
.nav.open .nav-toggle .ic-burger { display: none; }
.nav.open .nav-toggle .ic-close { display: block; }
                                                                                                              