:root {
    --ink: #17232c;
    --muted: #5c6b76;
    --paper: #f3eee6;
    --card: #fffdf9;
    --line: #e3d7c6;
    --terra: #d4532b;
    --terra-dark: #a33c1c;
    --navy: #1b3a4b;
    --pine: #1d6b4a;
    --gold: #a8843e;
    --danger: #9c2f2f;
    --shadow: 0 18px 40px rgba(23, 35, 44, 0.08);
    --sans: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 0 0, rgba(212, 83, 43, 0.08), transparent 28%),
        var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; }
h1 { font-size: clamp(34px, 5vw, 60px); margin: 0 0 12px; }
h2 { font-size: clamp(26px, 3vw, 36px); margin: 0 0 10px; }
h3 { margin: 0 0 8px; font-size: 20px; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
.skip {
    position: absolute;
    left: -999px;
    top: 8px;
    background: white;
    padding: 8px 12px;
    z-index: 5;
}
.skip:focus { left: 8px; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.narrow { max-width: 640px; }
.page { padding: 36px 0 72px; }
.lede { font-size: 18px; color: var(--muted); max-width: 46rem; }
.kicker {
    margin: 0 0 8px;
    color: var(--terra);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.fine, .meta-line { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.code { margin: 0; color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    background: rgba(243, 238, 230, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner, .row-between, .hero-actions, .lesson-actions, .pager, .top-actions, .inline-form {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.topbar-inner { min-height: 74px; justify-content: space-between; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; }
.mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--navy);
    color: #f4efe6;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.top-nav { display: flex; gap: 18px; }
.top-nav a { text-decoration: none; font-weight: 600; }
.top-nav a[aria-current="page"] { color: var(--terra); }
.text-link { font-weight: 600; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--terra);
    color: white;
    text-decoration: none;
    font-weight: 650;
    cursor: pointer;
}
.btn:hover { background: var(--terra-dark); }
.btn.secondary { background: var(--navy); }
.btn.secondary:hover { background: #102733; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: white; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 2px solid var(--terra);
    outline-offset: 2px;
}

.hero { display: grid; grid-template-columns: 1.3fr 0.8fr; gap: 42px; align-items: end; padding: 54px 0 18px; }
.dossier { background: var(--navy); color: #f6f1e8; border-radius: 24px; padding: 22px 22px 8px; box-shadow: var(--shadow); }
.dossier-label { letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; color: #e7c27a; }
.dossier ol { margin: 0; padding-left: 18px; display: grid; gap: 10px; }

.band { padding-bottom: 10px; }
.stat-row, .course-grid, .advantage-grid, .split, .form-grid {
    display: grid;
    gap: 14px;
}
.stat-row { grid-template-columns: repeat(4, 1fr); }
.stat-row article, .panel, .course-card, .path-list li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.stat-row article { padding: 16px; }
.pipeline article { padding: 0; }
.pipeline a { display: block; padding: 16px; color: inherit; text-decoration: none; }
.stat-row strong { display: block; font-size: 28px; letter-spacing: -0.04em; }
.section { padding: 28px 0; }
.section-head { margin-bottom: 18px; max-width: 40rem; }
.course-grid { grid-template-columns: repeat(3, 1fr); }
.course-card { padding: 18px; min-height: 250px; display: flex; flex-direction: column; }
.course-card .price, .buy-card .price { margin-top: auto; font-size: 28px; font-weight: 700; letter-spacing: -0.04em; }
.tone-foundation { border-top: 6px solid #1f4e5f; }
.tone-affiliate { border-top: 6px solid #d4532b; }
.tone-live { border-top: 6px solid #8c3a4b; }
.tone-pro { border-top: 6px solid #1f6b4a; }
.tone-community { border-top: 6px solid #a8843e; }
.advantage-grid { grid-template-columns: repeat(3, 1fr); }
.advantage-grid article { padding: 8px 8px 12px; }
.advantage-grid span { color: var(--gold); font-weight: 700; }
.split { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
.plain-list, .task-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.cta-band {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background: var(--navy);
    color: #f6f1e8;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 28px;
}
.cta-band h2, .cta-band p { color: #f6f1e8; }
.path-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.path-list li { display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 16px 18px; }
.path-list li > span { font-size: 28px; font-weight: 700; }
.buy-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.buy-card { position: sticky; top: 92px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.curriculum { display: grid; gap: 12px; }
.curriculum section, .callout { background: white; border-radius: 16px; padding: 14px 16px; }
.curriculum ul { list-style: none; padding: 0; margin: 0; }
.curriculum li, .link-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.callout { border-left: 4px solid var(--gold); background: #fff6ea; }
.site-footer { background: var(--navy); color: #f4efe6; padding: 36px 0 18px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }
.site-footer a { color: #f4efe6; display: block; text-decoration: none; }
.brand-line { font-weight: 700; }
.site-footer .fine { color: #d5c7b4; }

.stack { display: grid; gap: 14px; }
form.panel { margin-top: 16px; }
.top-actions { margin-top: 16px; }
.panel { padding: 16px; }
.page-head { margin-bottom: 18px; }
.flash { padding: 12px 14px; border-radius: 12px; }
.flash.ok { background: #e5f4ec; color: #145c3a; }
.flash.bad { background: #fde8e4; color: #8d2c16; }
.empty { padding: 16px; background: white; border-radius: 16px; border: 1px dashed var(--line); }
.field { display: grid; gap: 6px; font-weight: 650; }
.field input, .field textarea, .field select, .inline-form input, .inline-form select {
    width: 100%;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 400;
}
.inline-form input, .inline-form select { width: auto; }
.form-grid { grid-template-columns: 1fr 1fr; align-items: end; }
.form-grid > * { min-width: 0; }
.form-grid > h2, .form-grid > .fine, .form-grid > .btn { grid-column: 1 / -1; }
.form-grid > h2 { margin: 0; }
.form-grid > .btn { justify-self: start; }
.span-2 { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; background: white; border-radius: 16px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; min-width: 680px; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); }
.badge { display: inline-flex; border-radius: 999px; padding: 2px 8px; background: #eee6db; font-size: 12px; font-weight: 700; }
.badge.ok { background: #e5f4ec; color: #145c3a; }
.badge.wait { background: #fff1d6; color: #8a5a10; }
.badge.bad { background: #fde8e4; color: #8d2c16; }
.bar { height: 8px; background: #eadfce; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--pine); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { text-decoration: none; background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.filters a[aria-current="page"] { background: var(--navy); color: white; }
.link-list { list-style: none; padding: 0; margin: 0; }
.prose h3 { margin-top: 18px; }
.pay-box dl { margin: 0; }
.pay-box dl > div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay-box dt { color: var(--muted); }
details { padding: 8px 0; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--navy);
    color: #f4efe6;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.sidebar .brand small, .sidebar .side-user span { color: #d7c8b2; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { color: #f4efe6; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.sidebar nav a[aria-current="page"], .sidebar nav a:hover { background: rgba(255, 255, 255, 0.1); }
.side-user { margin-top: auto; display: grid; gap: 6px; padding: 10px; }
.side-user .btn { justify-self: start; color: #f4efe6; border-color: rgba(255,255,255,.3); }
.app-main { min-width: 0; }
.app-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; }
.app-content { padding: 4px 22px 56px; }
.nav-toggle { display: none; }
.shell-gate { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.gate { width: min(440px, 100%); }
.gate .brand { margin-bottom: 18px; }
.gate-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px 22px 18px;
    box-shadow: var(--shadow);
}
.gate-card h1 { font-size: 36px; }
.player { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.syllabus, .lesson { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.syllabus { position: sticky; top: 12px; }
.syllabus ul { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.syllabus a { text-decoration: none; }
.syllabus a[aria-current="page"] { color: var(--terra); font-weight: 700; }
.lesson-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 980px) {
    .hero, .buy-layout, .split, .footer-grid, .player, .app-shell { grid-template-columns: 1fr; }
    .course-grid, .advantage-grid, .stat-row, .form-grid { grid-template-columns: 1fr 1fr; }
    .buy-card, .syllabus { position: static; }
    .app-shell { display: block; }
    .sidebar { display: none; min-height: 0; }
    .sidebar.open { display: flex; }
    .nav-toggle { display: inline-flex; }
}
@media (max-width: 720px) {
    .course-grid, .advantage-grid, .stat-row, .form-grid, .path-list li, .pay-box dl > div { grid-template-columns: 1fr; }
    .top-nav { display: none; }
    .cta-band { display: grid; }
    .app-content { padding-inline: 14px; }
}
