
/* ============================================================
   THEME TOKENS
   ============================================================ */
:root {
    --primary: #ea0400;
    --primary-light: #ff4d6d;
    --primary-soft: #ff7a8a;
    --accent: #1e3a8a;
    --gold: #b8915a;
    --emerald: #10b981;
    --bg: #fdfdfd;
    --bg-soft: #f4f1ee;
    --bg-red: #ea0400;
    --bg-elevated: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-strong: rgba(255, 255, 255, 0.95);
    --text: #1a1a1a;
    --text-soft: #444444;
    --text-muted: #888888;
    --text-light: #ffffff;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.03);
    --tag-green-bg: rgba(16, 185, 129, 0.1);
    --tag-green-text: #047857;
    --tag-amber-bg: rgba(245, 158, 11, 0.1);
    --tag-amber-text: #b45309;
    --tag-red-bg: rgba(239, 68, 68, 0.1);
    --tag-red-text: #b91c1c;
    --bar-track: rgba(0, 0, 0, 0.06);
    --hover-bg: rgba(0, 0, 0, 0.02);

    --display: "Playfair Display", serif;
    --serif: "Merriweather", "Lora", serif;
    --sans: "Inter", "Be Vietnam Pro", sans-serif;

    --radius: 16px;
    --ease: cubic-bezier(0.19, 1, 0.22, 1);
    --transition: cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-w: 300px;
    --navpane-w: 300px;
    --topnav-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-left: var(--sidebar-w);
    padding-right: 0;
    transition: padding-left 0.4s var(--ease), padding-right 0.4s var(--ease);
}
body.sidebar-collapsed { padding-left: 0; }
body.navpane-collapsed { padding-right: 0; }
body:not(.navpane-collapsed) { padding-right: var(--navpane-w); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    position: fixed; top: 0;
    left: var(--sidebar-w); right: 0;
    height: 4px;
    background: var(--primary); width: 0%; z-index: 999;
    box-shadow: 0 0 10px rgba(234, 4, 0, 0.5);
    transition: width 0.1s linear, left 0.4s var(--ease), right 0.4s var(--ease);
}
body.sidebar-collapsed .progress-bar { left: 0; }
body:not(.navpane-collapsed) .progress-bar { right: var(--navpane-w); }

/* ============================================================
   TOPNAV
   ============================================================ */
.topnav {
    position: fixed; top: 0; left: 0; right: 0;
    padding: 0 1.5rem;
    height: var(--topnav-h);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 900;
}

.logo {
    display: flex; align-items: center; gap: 0.7rem;
    font-family: var(--sans); font-weight: 700; font-size: 1rem;
    letter-spacing: -0.3px; color: #fff;
}
.logo span { color: #fff; }

.logo-mark {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.25s var(--ease);
    user-select: none;
}
.logo-mark:hover {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.05);
}
.logo-mark i { transition: transform 0.3s var(--ease); }
body.sidebar-collapsed .logo-mark i { transform: rotate(-90deg); }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.nav-meta {
    display: flex; gap: 1.5rem; align-items: center;
    font-family: var(--sans); font-size: 0.8rem;
    color: rgba(255,255,255,0.8); margin-right: 0.5rem;
}
.nav-meta .dot {
    width: 6px; height: 6px; border-radius: 50%; background: #fff;
    display: inline-block; margin-right: 0.4rem; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.navpane-toggle, .lang-toggle {
    height: 38px; border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s var(--transition);
}
.navpane-toggle { width: 38px; font-size: 0.9rem; }
.lang-toggle { padding: 0 0.85rem; gap: 0.4rem; font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; }
.navpane-toggle:hover, .lang-toggle:hover {
    background: rgba(255,255,255,0.28); border-color: #fff;
}
.navpane-toggle.active { background: #fff; color: var(--primary); }
.lang-toggle .flag { font-size: 0.95rem; line-height: 1; }

/* ============================================================
   SIDEBAR TRÁI — Mục lục chương
   ============================================================ */
.chapter-sidebar {
    position: fixed; top: var(--topnav-h); left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    z-index: 850;
    display: flex; flex-direction: column;
    transform: translateX(0);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
body.sidebar-collapsed .chapter-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
}
body.sidebar-collapsed .chapter-sidebar .chapter-sidebar__head { visibility: hidden; }

.chapter-sidebar__head {
    padding: 1.1rem 1.2rem 0.9rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-soft);
}
.chapter-sidebar__head .title {
    font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted);
}
.chapter-sidebar__close {
    width: 28px; height: 28px; border-radius: 7px;
    border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: all 0.2s;
}
.chapter-sidebar__close:hover { background: var(--bg); color: var(--primary); }

.chapter-sidebar__body {
    flex: 1; overflow-y: auto; padding: 1rem 0.75rem;
    scrollbar-width: thin;
}
.chapter-sidebar__body::-webkit-scrollbar { width: 6px; }
.chapter-sidebar__body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }

.chapter-link {
    display: flex; align-items: flex-start; gap: 0.7rem;
    padding: 0.8rem 0.85rem; border-radius: 10px;
    font-family: var(--sans); font-size: 0.83rem;
    color: var(--text-soft); cursor: pointer;
    transition: all 0.25s var(--ease);
    border: 1px solid transparent; margin-bottom: 0.25rem;
    background: transparent; width: 100%; text-align: left;
    line-height: 1.45;
}
.chapter-link:hover { background: var(--hover-bg); color: var(--text); }
.chapter-link.active {
    background: var(--primary); color: #fff;
    box-shadow: 0 6px 18px rgba(234,4,0,0.22);
}
.chapter-link .num {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
    background: var(--bg-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.68rem;
    transition: all 0.25s;
}
.chapter-link.active .num {
    background: rgba(255,255,255,0.25); color: #fff;
}

/* ============================================================
   NAVIGATION PANE PHẢI
   ============================================================ */
.navpane {
    position: fixed; top: var(--topnav-h); right: 0; bottom: 0;
    width: var(--navpane-w);
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    z-index: 850;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    box-shadow: -4px 0 30px rgba(0,0,0,0.06);
}
body.navpane-collapsed .navpane { transform: translateX(100%); }
body:not(.navpane-collapsed) .navpane { transform: translateX(0); }

.navpane__head {
    padding: 1.1rem 1.2rem 0.9rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-soft);
}
.navpane__head span {
    font-family: var(--sans); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted);
}
.navpane__close {
    width: 28px; height: 28px; border-radius: 7px; border: none;
    background: transparent; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
    transition: all 0.2s;
}
.navpane__close:hover { background: var(--bg); color: var(--primary); }
.navpane__body {
    overflow-y: auto; padding: 0.6rem 0.5rem; flex: 1;
    scrollbar-width: thin;
}
.navpane__body::-webkit-scrollbar { width: 5px; }
.navpane__body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }

.navpane-item {
    display: block; padding: 0.38rem 0.65rem; border-radius: 6px;
    font-family: var(--sans); font-size: 0.76rem; color: var(--text-soft);
    cursor: pointer; text-decoration: none; line-height: 1.4;
    border-left: 3px solid transparent; margin-bottom: 1px;
    transition: all 0.2s;
}
.navpane-item:hover { background: var(--hover-bg); color: var(--text); }
.navpane-item.active {
    background: rgba(234,4,0,0.08); color: var(--primary);
    border-left-color: var(--primary); font-weight: 600;
}
.navpane-item.lvl-1 { font-weight: 600; color: var(--text); font-size: 0.78rem; }
.navpane-item.lvl-2 { padding-left: 1rem; font-size: 0.74rem; }
.navpane-item.lvl-3 { padding-left: 1.6rem; font-size: 0.72rem; color: var(--text-muted); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--topnav-h));
    min-height: 600px;
    overflow: hidden;
    margin-top: var(--topnav-h);
    display: flex;
}
.hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; z-index: 1;
    transform: scale(1.05);
    transition: transform 8s var(--ease);
}
.hero-left-overlay {
    position: absolute; top: 0; left: 0; bottom: 0; width: 50%;
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.hero-content {
    position: relative; z-index: 3;
    width: 50%;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 6vw;
}

.hero-kicker {
    display: inline-block;
    font-family: var(--sans); font-size: 0.8rem; letter-spacing: 4px;
    text-transform: uppercase; color: #090880; font-weight: 700;
    margin-bottom: 2rem; border-bottom: 2px solid #090880; padding-bottom: 6px;
    align-self: flex-start;
}

.hero-title {
    font-family: var(--display); font-size: clamp(2.2rem, 4vw, 3.8rem);
    font-weight: 800; line-height: 1.1; letter-spacing: -1px; margin-bottom: 2rem;
    color: #090880;
}
.hero-title em { font-style: italic; color: #090880; text-decoration: none; }
.hero-sub {
    font-family: var(--serif); font-size: 1.1rem; color: var(--text);
    max-width: 95%; line-height: 1.7; font-weight: 500;
}
html.js .hero-bg { opacity: 0; transform: scale(1.15); }
html.js .hero.is-on .hero-bg { opacity: 1; transform: scale(1.05); }

/* ============================================================
   SAPO & MAIN CONTENT
   ============================================================ */
.sapo { padding: 80px 20px 60px; text-align: center; }
.sapo p {
    max-width: 900px; margin: 0 auto;
    font-family: var(--display); font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    font-style: italic; line-height: 1.6; color: var(--text);
}
.prose { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.prose p {
    font-size: clamp(16px, 1.2vw, 18px); line-height: 1.9;
    margin-bottom: 2rem; color: var(--text-soft); text-align: justify;
}
.prose p.dropcap::first-letter {
    float: left; font-family: var(--display); font-size: 5.5em;
    line-height: 0.8; color: var(--primary); margin: 0.1em 0.15em 0 0;
}
.block { margin-top: 80px; margin-bottom: 80px; }

/* ============================================================
   CHAPTER HEADINGS — 3 CẤP ĐỒNG NHẤT FONT
   ============================================================ */
.chapter-header { text-align: center; margin-bottom: 3rem; }
.chapter-kicker {
    font-family: var(--sans); font-size: 0.8rem; letter-spacing: 3px;
    text-transform: uppercase; color: var(--primary); font-weight: 700;
    margin-bottom: 1rem; display: block;
}
.chapter-title {
    font-family: var(--display); font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800; line-height: 1.2;
}
.chapter-title em { color: var(--primary); font-style: italic; }

/* HEADING 1 — to nhất, đỏ đậm, font display */
.heading-1 {
    font-family: var(--display);
    font-size: clamp(1.5rem, 3.0vw, 2.3rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--primary);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}
.heading-1 em { font-style: italic; color: var(--primary); }

/* HEADING 2 — vừa, đỏ nhạt, font display */
.heading-2 {
    font-family: var(--display);
    font-size: clamp(1.3rem, 2.3vw, 1.8rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-light);
    margin-top: 2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.heading-2 em { font-style: italic; color: var(--primary-light); }
/* .heading-2::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 2px;
    background: var(--primary-light);
    flex-shrink: 0;
} */

/* HEADING 3 — nhỏ nhất, đen, font display */
.heading-3 {
    font-family: var(--display);
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    margin-top: 1.8rem;
    margin-bottom: 1rem;
}
.heading-3 em { font-style: italic; color: var(--text); }

/* ============================================================
   SCROLLYTELLING
   ============================================================ */
.scrolly {
    max-width: 1200px; margin: 0 auto; padding: 5rem 2rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; position: relative;
}
.scrolly-visual {
    position: sticky; top: calc(var(--topnav-h) + 40px);
    height: calc(100vh - var(--topnav-h) - 80px);
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius); overflow: hidden;
    background: var(--bg-glass); border: 1px solid var(--border);
    backdrop-filter: blur(20px); box-shadow: var(--shadow-card);
}
.scrolly-steps { padding: 10vh 0; display: flex; flex-direction: column; gap: 40vh; }

.step {
    min-height: 50vh; display: flex; flex-direction: column; justify-content: center;
    opacity: 0.25; transform: translateY(30px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.step.active { opacity: 1; transform: translateY(0); }
.step.passed { opacity: 0.5; transform: translateY(-15px); }

.step-num {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-family: var(--sans); font-size: 0.75rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--primary); margin-bottom: 1rem;
}
.step-num::before { content: ''; width: 32px; height: 2px; background: var(--primary); }
.step h2 {
    font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 700;
    line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 1.5rem; color: var(--text);
}
.step h2 em { font-style: italic; color: var(--primary); }
.step p {
    font-family: var(--serif); font-size: 1.05rem; line-height: 1.8;
    color: var(--text-soft); margin-bottom: 1.2rem;
}
.step p strong { color: var(--text); font-weight: 700; }
.step-list { list-style: none; padding: 0; margin: 1rem 0; }
.step-list li {
    display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.6rem 0;
    font-family: var(--sans); font-size: 0.95rem; color: var(--text-soft);
    opacity: 0; transform: translateX(-15px); transition: all 0.5s var(--ease);
}
.step.active .step-list li { opacity: 1; transform: translateX(0); }
.step.active .step-list li:nth-child(1) { transition-delay: 0.15s; }
.step.active .step-list li:nth-child(2) { transition-delay: 0.25s; }
.step.active .step-list li:nth-child(3) { transition-delay: 0.35s; }
.step.active .step-list li:nth-child(4) { transition-delay: 0.45s; }
.step-list li i { color: var(--primary); margin-top: 0.35rem; font-size: 0.9rem; flex-shrink: 0; }

.pull-quote {
    margin: 40px 0; padding: 30px 0;
    border-top: 2px solid var(--primary); border-bottom: 2px solid var(--primary);
    text-align: center;
}
.pull-quote-text {
    font-family: var(--display); font-size: 1.6rem; font-weight: 700; font-style: italic;
    color: var(--primary); line-height: 1.4;
}
.pull-quote-attrib {
    font-family: var(--sans); font-size: 0.75rem; letter-spacing: 2px;
    color: var(--text-muted); margin-top: 15px; text-transform: uppercase;
}

.stat-row { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.stat-pill {
    padding: 1rem 1.2rem; border-radius: 12px; background: var(--bg-elevated);
    border: 1px solid var(--border); box-shadow: var(--shadow-soft);
    flex: 1; min-width: 120px;
    opacity: 0; transform: translateY(15px); transition: all 0.4s var(--ease);
}
.step.active .stat-pill { opacity: 1; transform: translateY(0); }
.step.active .stat-pill:nth-child(1) { transition-delay: 0.3s; }
.step.active .stat-pill:nth-child(2) { transition-delay: 0.45s; }
.step.active .stat-pill:nth-child(3) { transition-delay: 0.6s; }
.stat-pill .num {
    font-family: var(--display); font-size: 2rem; font-weight: 800; color: var(--primary);
    line-height: 1; display: block; margin-bottom: 0.4rem;
}
.stat-pill .label {
    font-family: var(--sans); font-size: 0.75rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

/* ============================================================
   VISUAL PANELS
   ============================================================ */
.visual-panel {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 2rem; opacity: 0; transform: scale(0.94);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    pointer-events: none;
}
.visual-panel.active { opacity: 1; transform: scale(1); pointer-events: auto; }
.visual-card {
    width: 100%; max-width: 480px;
    background: var(--bg-glass-strong); border: 1px solid var(--border);
    border-radius: 20px; padding: 2rem; backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}

/* ============================================================
   PINNED ZOOM
   ============================================================ */
.pinned-zoom {
    height: 250vh; position: relative;
    background: var(--bg-red);
    margin: 80px 0;

    /* THÊM: kỹ thuật full-bleed */
    width: 100vw;
    margin-left: calc(-1 * var(--sidebar-w));   /* bù padding trái của body */
    margin-right: calc(-1 * var(--navpane-w));  /* bù padding phải của body (khi navpane mở) */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.pinned-zoom__sticky {
    position: sticky; top: var(--topnav-h); height: calc(100vh - var(--topnav-h));
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.pinned-zoom__img {
    width: 100%; height: 100%; object-fit: cover;
    transform: scale(1);
    filter: brightness(0.85) contrast(1.05);
    will-change: transform;
}
.pinned-zoom__caption {
    position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%);
    color: #fff; font-family: var(--serif); font-size: 1.5rem; font-style: italic;
    text-align: center; width: 80%; max-width: 800px;
    opacity: 0; transition: opacity 0.5s ease, transform 0.5s ease;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.pinned-zoom__caption.is-visible { opacity: 1; transform: translate(-50%, -20px); }

/* ============================================================
   DI PTYCH & SPLIT QUOTE
   ============================================================ */
.diptych {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; width: 100%; padding: 0 5vw;
    margin: 80px auto; max-width: 1400px;

    /* THÊM: full-bleed */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;  /* ghi đè max-width cũ nếu muốn tràn hết */
}
.diptych__img {
    width: 100%; height: 80vh; object-fit: cover;
    border-radius: 4px; box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.split-quote {
    width: 100%; display: grid; grid-template-columns: 1fr 1fr;
    min-height: 80vh; margin: 80px 0;
    background: var(--bg-red); overflow: hidden;

      /* THÊM: full-bleed */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.split-image-wrap { overflow: hidden; position: relative; }
.split-image {
    width: 90%; height: 90%; object-fit: contain;
    filter: brightness(1.05) contrast(1.05); position: relative;
    cursor: pointer;
    display: block;
    margin: auto;
}
.split-content {
    display: flex; flex-direction: column; justify-content: center;
    padding: 10% 12%; color: var(--text-light); position: relative; z-index: 2;
}
.split-content::before {
    content: '"'; font-family: var(--display); font-size: 150px;
    color: #ffffff; position: absolute; top: 30px; left: 10%;
    line-height: 1; opacity: 0.4;
}
.split-quote-text {
    font-family: var(--display); font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    font-weight: 400; font-style: italic; line-height: 1.4; position: relative; z-index: 2;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-section { max-width: 1100px; margin: 0 auto; padding: 6rem 2rem; }
.data-header { text-align: center; margin-bottom: 3rem; }
.data-header h1 {
    font-family: var(--display); font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700; margin-bottom: 1rem;
}
.data-header h2 { font-family: var(--display); font-size: 1.8rem; font-weight: 700; margin-bottom: 1rem; }
.data-header h2 em { color: var(--primary); font-style: italic; }
.data-header p { font-family: var(--sans); color: var(--text-soft); }
.data-card {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-card);
}

.table-controls { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.table-controls input, .table-controls select {
    padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 8px;
    font-family: var(--sans); font-size: 0.9rem;
    background: var(--bg); color: var(--text); outline: none;
    transition: all 0.3s;
}
.table-controls input:focus, .table-controls select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(234,4,0,0.1);
}
.table-controls input { flex: 1; min-width: 200px; }
.table-controls select { min-width: 150px; }

.table-wrapper { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; }
thead { background: var(--bg-soft); position: sticky; top: 0; z-index: 2; }
th { text-align: left; padding: 1rem; font-weight: 700; color: var(--text); border-bottom: 2px solid var(--border); cursor: pointer; user-select: none; }
th:hover { color: var(--primary); }
th i { margin-left: 4px; font-size: 0.8em; opacity: 0.5; }
td { padding: 1rem; border-bottom: 1px solid var(--border); color: var(--text-soft); }
tbody tr:hover td { background: var(--hover-bg); color: var(--text); }
.tag { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.tag-green { background: var(--tag-green-bg); color: var(--tag-green-text); }
.tag-amber { background: var(--tag-amber-bg); color: var(--tag-amber-text); }
.tag-red { background: var(--tag-red-bg); color: var(--tag-red-text); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    border-top: 1px solid var(--border); padding: 3rem 2rem;
    text-align: center; font-family: var(--sans); font-size: 0.85rem;
    color: var(--text-muted); background: var(--bg-soft);
}
.footer strong { color: var(--text); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
html.js [data-reveal] {
    opacity: 0; transform: translateY(40px); filter: blur(8px);
    transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
}
html.js [data-reveal].is-in { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion-block {
    margin: 30px 0;
    border-left: 3px solid var(--border-strong);
    background: var(--bg-soft);
    border-radius: 0 8px 8px 0;
    overflow: hidden;
    transition: all 0.3s var(--ease);
}
.accordion-block:hover {
    border-left-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}
.accordion-header {
    padding: 1rem 1.5rem; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
    color: var(--text-soft); user-select: none; transition: color 0.3s;
}
.accordion-header:hover { color: var(--primary); }
.accordion-header i {
    transition: transform 0.4s var(--ease);
    font-size: 0.8rem; color: var(--text-muted);
}
.accordion-block.active .accordion-header {
    color: var(--primary); border-bottom: 1px solid var(--border);
}
.accordion-block.active .accordion-header i {
    transform: rotate(180deg); color: var(--primary);
}
.accordion-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.5s var(--ease), padding 0.5s var(--ease);
    padding: 0 1.5rem; font-size: 0.9rem; color: var(--text-soft); line-height: 1.7;
}
.accordion-block.active .accordion-body {
    max-height: 5000px; padding: 1.2rem 1.5rem;
}

/* ============================================================
   FOOTNOTE
   ============================================================ */
.footnote-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
    font-family: var(--sans);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    margin-left: 4px;
    vertical-align: super;
    transition: all 0.3s var(--ease);
}
.footnote-ref:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.1);
}
.footnote-ref .tooltip-text {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text);
    color: var(--bg);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: var(--serif);
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
    width: max-content;
    max-width: 350px;
    white-space: normal;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ease);
    z-index: 10;
}
.footnote-ref .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--text) transparent transparent transparent;
}
.footnote-ref:hover .tooltip-text {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1400px) {
    :root { --navpane-w: 260px; --sidebar-w: 270px; }
}
@media (max-width: 1200px) {
    :root { --sidebar-w: 250px; --navpane-w: 240px; }
    body { padding-right: 0; }
    .navpane {
        transform: translateX(100%);
        box-shadow: -4px 0 30px rgba(0,0,0,0.08);
    }
    .progress-bar { right: 0; }
}
@media (max-width: 1024px) {
    body { padding-left: 0; padding-right: 0; }
    .chapter-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 30px rgba(0,0,0,0.1);
    }
    body:not(.sidebar-collapsed) .chapter-sidebar { transform: translateX(0); }
    .navpane {
        transform: translateX(100%);
        width: 85vw; max-width: 320px;
        box-shadow: -4px 0 30px rgba(0,0,0,0.1);
    }
    .progress-bar { left: 0; right: 0; }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 85vw; --navpane-w: 85vw; }
    .nav-meta { display: none; }
    .hero { flex-direction: column; height: auto; min-height: 100vh; }
    .hero-left-overlay { width: 100%; height: 60%; bottom: auto; backdrop-filter: blur(8px); }
    .hero-content { width: 100%; padding: 120px 24px 60px; }
    .hero-title { font-size: 2.2rem; }
    .scrolly { grid-template-columns: 1fr; padding: 3rem 1rem; gap: 2rem; }
    .scrolly-visual { position: sticky; top: 80px; height: 50vh; order: -1; z-index: 5; }
    .scrolly-steps { padding: 2vh 0; gap: 20vh; }
    .step { min-height: auto; padding: 2rem; background: var(--bg-elevated); border-radius: 16px; border: 1px solid var(--border); }
    .diptych { grid-template-columns: 1fr; }
    .diptych__img { height: 50vh; }
    .split-quote { grid-template-columns: 1fr; }
    .split-image-wrap { height: 50vh; }
    .table-controls select { width: 100%; }
}
