/* ==========================================================================
           CMS-Friendly Reset & Core Tokens
           ========================================================================== */
        *, *::before, *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        :root {
            /* Editorial Color Palette */
            --bg-body: #f7f5f0; 
            --bg-surface: #ffffff;
            --bg-dark: #111111;
            
            --text-main: #222222;
            --text-muted: #555555;
            --text-light: #fdfdfd;
            
            --accent-primary: #8b1c1c; 
            --accent-gold: #c5a059;
            --border-subtle: #e6e2d8;
            --border-dark: #333333;

            /* Apple-grade Motion */
            --easing-spring: cubic-bezier(0.25, 1, 0.5, 1);
            --easing-smooth: cubic-bezier(0.65, 0, 0.35, 1);
            --transition-fast: 0.3s var(--easing-spring);
            --transition-medium: 0.6s var(--easing-smooth);
            --transition-slow: 1.2s var(--easing-smooth);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: var(--bg-body);
            color: var(--text-main);
            line-height: 1.8;
            font-size: 1.125rem;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            overflow-x: hidden;
        }

        h1, h2, h3, h4, .serif-text {
            font-family: 'Merriweather', Georgia, serif;
            color: var(--bg-dark);
            line-height: 1.3;
        }

        /* ==========================================================================
           Hero Section (Cinematic Entrance)
           ========================================================================== */
        .hero {
            position: relative;
            height: 100vh;
            min-height: 600px;
            display: flex;
            flex-direction: column;
            justify-content: center; 
            align-items: center;
            text-align: center;
            background: #000 url('https://i.pinimg.com/1200x/8d/76/65/8d7665440ba0410fee078b6b44ee4d1e.jpg') top center / cover no-repeat;
            color: var(--text-light);
            padding: 2rem;
            overflow: hidden;
            cursor: pointer;
        }

        /* Lớp phủ gradient ẩn đi lúc đầu để bức ảnh hiện rõ 100% */
        .hero::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(17,17,17,0.7) 70%, rgba(17,17,17,1) 100%);
            z-index: 1;
            opacity: 0;
            transition: opacity var(--transition-slow);
        }
        
        .hero.active::after {
            opacity: 1;
        }

        /* Text ẩn đi lúc đầu và tụt xuống 30px */
        .hero-content {
            position: relative;
            z-index: 2;
            max-width: 900px;
            opacity: 0;
            transform: translateY(30px);
            transition: opacity 1.2s var(--easing-smooth), transform 1.2s var(--easing-smooth);
            pointer-events: none; /* Không chặn click khi đang ẩn */
        }

        .hero.active .hero-content {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
            transition-delay: 0.2s; /* Delay nhẹ để lớp mờ hiện ra trước */
        }

        /* Nút gợi ý Click */
        .click-hint {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(17, 17, 17, 0.4);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            padding: 12px 28px;
            border-radius: 40px;
            color: var(--text-light);
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 2px;
            animation: pulseHint 2.5s var(--easing-spring) infinite;
            pointer-events: none;
            z-index: 3;
            transition: opacity var(--transition-fast);
        }

        .hero.active .click-hint {
            opacity: 0;
            animation: none;
        }

        @keyframes pulseHint {
            0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
            50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
        }

        .hero-title {
            font-family: 'Merriweather', serif;
            font-size: 4rem;
            font-weight: 700;
            letter-spacing: -0.01em;
            margin-bottom: 1.5rem;
            color: var(--text-light);
            text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
        }

        .hero-subtitle {
            font-family: 'Merriweather', serif;
            font-size: 1.5rem;
            font-weight: 300;
            font-style: italic;
            color: #e2e8f0;
            max-width: 800px;
            margin: 0 auto;
            text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
            line-height: 1.6;
        }

        .scroll-indicator {
            margin-top: 3rem;
            font-family: 'Inter', sans-serif;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 3px;
            color: var(--accent-gold);
            font-weight: 500;
            animation: pulseText 2.5s infinite;
        }

        @keyframes pulseText {
            0%, 100% { opacity: 0.6; }
            50% { opacity: 1; }
        }

        /* ==========================================================================
           Longform Content Layout 
           ========================================================================== */
        .container {
            max-width: 720px; 
            margin: 0 auto;
            padding: 6rem 1.5rem;
        }

        .intro-text {
            font-family: 'Merriweather', serif;
            font-size: 1.25rem;
            line-height: 1.8;
            color: var(--text-main);
            text-align: justify;
            margin-bottom: 5rem;
            position: relative;
        }

        .intro-text::first-letter {
            font-family: 'Merriweather', serif;
            font-size: 4.5rem;
            float: left;
            margin: 0.2rem 0.75rem 0 0;
            line-height: 0.8;
            color: var(--accent-primary);
            font-weight: 900;
        }

        /* Interactive Book / Chapter System */
        .book-wrapper {
            position: relative;
            background: var(--bg-surface);
            border-top: 4px solid var(--accent-primary);
            padding: 4rem;
            box-shadow: 0 20px 40px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.02);
        }

        .book-page {
            display: none;
            opacity: 0;
            transform: translate3d(0, 20px, 0);
            will-change: transform, opacity;
        }

        .book-page.active {
            display: block;
            animation: pageIn 0.8s var(--easing-spring) forwards;
        }

        @keyframes pageIn {
            0% { opacity: 0; transform: translate3d(0, 20px, 0); }
            100% { opacity: 1; transform: translate3d(0, 0, 0); }
        }

        .chapter-header {
            text-align: center;
            margin-bottom: 3.5rem;
            border-bottom: 1px solid var(--border-subtle);
            padding-bottom: 2rem;
        }

        .chapter-number {
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            text-transform: uppercase;
            color: var(--accent-primary);
            letter-spacing: 3px;
            font-weight: 600;
            display: block;
            margin-bottom: 1rem;
        }

        .chapter-title {
            font-size: 2.2rem;
            font-weight: 700;
        }

        p {
            margin-bottom: 1.75rem;
            text-align: justify;
        }

        /* Image Handling */
        .book-img-container {
            margin: 3rem 0;
            text-align: center;
        }

        .book-img-container img {
            width: 100%;
            height: auto;
            max-height: 500px;
            object-fit: cover;
            background-color: var(--border-subtle);
        }

        .img-caption {
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-top: 1rem;
            line-height: 1.5;
            text-align: left;
            font-style: italic;
            border-left: 2px solid var(--border-subtle);
            padding-left: 1rem;
        }

        .img-float-right {
            float: right;
            width: 48%;
            margin: 0.5rem 0 1.5rem 2rem;
        }

        .img-float-left {
            float: left;
            width: 48%;
            margin: 0.5rem 2rem 1.5rem 0;
        }

        .clearfix::after {
            content: "";
            clear: both;
            display: table;
        }

        /* Archive/Quote Blocks */
        .archive-box {
            background-color: #fcfbf9;
            border: 1px solid var(--border-subtle);
            padding: 2.5rem;
            margin: 3.5rem 0;
            position: relative;
        }

        .archive-label {
            position: absolute;
            top: -12px;
            left: 2.5rem;
            background-color: var(--bg-dark);
            color: var(--text-light);
            font-size: 0.7rem;
            padding: 4px 12px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            font-weight: 600;
        }

        .archive-title {
            font-size: 1.4rem;
            margin-bottom: 1rem;
            color: var(--accent-primary);
            font-style: italic;
        }

        .quote-block {
            font-family: 'Merriweather', serif;
            font-style: italic;
            font-size: 1.3rem;
            line-height: 1.6;
            color: var(--accent-primary);
            text-align: center;
            margin: 4rem auto;
            max-width: 85%;
            position: relative;
            padding-top: 2.5rem;
        }
        
        .quote-block::before {
            content: "“";
            font-size: 5rem;
            color: var(--border-subtle);
            position: absolute;
            top: -2.5rem; 
            left: 50%;
            transform: translateX(-50%);
            z-index: 0;
            font-family: Georgia, serif;
            line-height: 1;
        }

        /* Controls */
        .book-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 4rem;
            padding-top: 2rem;
            border-top: 1px solid var(--border-subtle);
        }

        .btn-page {
            background: transparent;
            color: var(--text-main);
            border: 1px solid var(--border-subtle);
            padding: 0.75rem 1.5rem;
            cursor: pointer;
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 1px;
            transition: var(--transition-fast);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .btn-page:hover:not(:disabled) {
            border-color: var(--bg-dark);
            background: var(--bg-dark);
            color: var(--text-light);
        }

        .btn-page:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .page-indicator { 
            font-family: 'Inter', sans-serif; 
            font-size: 0.85rem;
            color: var(--text-muted); 
            letter-spacing: 1px;
        }

        /* ==========================================================================
           Interactive Family Tree 
           ========================================================================== */
        .tree-section {
            background-color: var(--bg-dark);
            color: var(--text-light);
            padding: 8rem 2rem;
            /* Hiệu ứng ẩn ban đầu */
            display: none;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        .tree-header {
            text-align: center;
            margin-bottom: 5rem;
        }

        .tree-header h2 {
            color: var(--bg-surface);
            font-size: 2.5rem;
            margin-bottom: 1rem;
        }

        .tree-subtitle {
            color: #a0a0a0;
            max-width: 600px;
            margin: 0 auto;
            font-size: 1rem;
        }

        .tree-container {
            max-width: 1100px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 4rem;
            position: relative;
        }

        .tree-container::before {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 1px;
            background: var(--border-dark);
            z-index: 0;
        }

        .generation-layer {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }

        .generation-badge {
            background: var(--bg-dark);
            padding: 0.5rem 1rem;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--accent-gold);
            margin-bottom: 2rem;
            font-weight: 600;
            border: 1px solid var(--border-dark);
            border-radius: 20px;
        }

        .nodes-wrapper {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            flex-wrap: wrap;
            width: 100%;
        }

        .tree-node {
            background-color: #1a1a1a;
            border: 1px solid var(--border-dark);
            padding: 1.25rem;
            width: 320px;
            cursor: pointer;
            transition: var(--transition-fast);
            position: relative;
            display: flex;
            align-items: center;
            gap: 1rem;
            text-align: left;
            will-change: transform, border-color;
        }

        .tree-node:hover:not(.no-click) {
            transform: translateY(-4px);
            border-color: var(--accent-gold);
            background-color: #222;
        }

        .tree-node.no-click {
            cursor: default;
            opacity: 0.8;
        }

        .node-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--border-dark);
            flex-shrink: 0;
            background-color: var(--bg-dark);
            transition: var(--transition-fast);
        }

        .tree-node:hover:not(.no-click) .node-avatar {
            border-color: var(--accent-gold);
        }

        .node-info {
            display: flex;
            flex-direction: column;
        }

        .node-name {
            font-family: 'Merriweather', serif;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-light);
            margin-bottom: 0.25rem;
            line-height: 1.2;
        }

        .node-meta {
            font-size: 0.75rem;
            color: #94a3b8;
            line-height: 1.4;
        }

        /* Highlights */
        .node-highlight {
            border-color: var(--accent-primary);
        }
        
        .node-highlight .node-avatar {
            border-color: var(--accent-primary);
        }

        /* ==========================================================================
           Modal 
           ========================================================================== */
        .modal {
            position: fixed;
            inset: 0;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 100;
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity var(--transition-fast);
        }

        .modal.active {
            opacity: 1;
            pointer-events: auto;
        }

        .modal-content {
            background-color: var(--bg-surface);
            color: var(--text-main);
            max-width: 650px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            padding: 3.5rem 3rem;
            position: relative;
            transform: scale(0.95) translateZ(0);
            opacity: 0;
            transition: all var(--transition-fast);
            will-change: transform, opacity;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
        }

        .modal.active .modal-content {
            transform: scale(1) translateZ(0);
            opacity: 1;
        }

        .close-btn {
            position: absolute;
            top: 1.5rem;
            right: 1.5rem;
            width: 32px;
            height: 32px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            color: var(--text-muted);
            border: 1px solid transparent;
            border-radius: 50%;
            transition: var(--transition-fast);
        }

        .close-btn:hover {
            border-color: var(--border-subtle);
            color: var(--bg-dark);
            background: var(--bg-body);
        }

        .close-btn svg {
            width: 16px;
            height: 16px;
            fill: currentColor;
        }

        .modal-header-tag {
            color: var(--accent-primary);
            text-transform: uppercase;
            font-size: 0.8rem;
            font-weight: 600;
            letter-spacing: 1.5px;
            margin-bottom: 1rem;
            font-family: 'Inter', sans-serif;
        }

        .modal-title {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .modal-subtitle {
            font-size: 1rem;
            color: var(--text-muted);
            margin-bottom: 2rem;
            font-style: italic;
        }

        .modal-section-title {
            font-size: 0.95rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--bg-dark);
            margin: 2rem 0 0.75rem 0;
            font-family: 'Inter', sans-serif;
            border-top: 1px solid var(--border-subtle);
            padding-top: 2rem;
        }

        .modal-quote {
            font-family: 'Merriweather', serif;
            font-style: italic;
            color: var(--accent-primary);
            font-size: 1.1rem;
            padding: 1.5rem;
            background: var(--bg-body);
            border-left: 2px solid var(--accent-primary);
            margin: 1.5rem 0;
        }

        /* ==========================================================================
           Footer & Utilities
           ========================================================================== */
        .article-source {
            text-align: right;
            max-width: 1100px;
            margin: 4rem auto 4rem auto;
            padding: 0 2rem;
            font-size: 0.95rem;
            color: #64748b;
            font-style: italic;
        }

        .article-source strong {
            color: #475569;
        }
        
        .article-source a {
            color: var(--bg-dark);
            text-decoration: none;
            border-bottom: 1px dashed #64748b;
            padding-bottom: 2px;
            transition: var(--transition-fast);
        }
        
        .article-source a:hover {
            color: var(--accent-primary);
            border-bottom-color: var(--accent-primary);
        }

        .fade-in-section {
            opacity: 0;
            transform: translate3d(0, 30px, 0);
            transition: opacity 0.8s var(--easing-smooth), transform 0.8s var(--easing-smooth);
            will-change: opacity, transform;
        }

        .fade-in-section.visible {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }

        /* Responsive */
        @media (max-width: 768px) {
            .container { padding: 4rem 1.25rem; }
            .book-wrapper { padding: 2.5rem 1.5rem; border-left-width: 8px; }
            .hero-title { font-size: 2.5rem; }
            .hero-subtitle { font-size: 1.15rem; }
            .img-float-left, .img-float-right { float: none; width: 100%; margin: 1.5rem 0; }
            .tree-container::before { display: none; }
            .tree-node { width: 100%; max-width: 320px; }
            .modal-content { padding: 2.5rem 1.5rem; }
            .chapter-title { font-size: 1.8rem; }
            .quote-block { font-size: 1.2rem; max-width: 100%; padding-top: 3rem; }
            .article-source { text-align: center; }
        }