@import 'variables.css';

/* --- Landing Page Specifics (Dark Mode) --- */
body.landing-page {
    background-color: var(--bg-dark-deep);
    color: var(--text-white);
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-page-pad) 24px;
    position: relative;
    /* Ensure it sits on top of fixed background if needed */
    z-index: 1;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* Let clicks pass through */
}

.landing-header {
    margin-bottom: 80px;
    text-align: center;
}

.landing-header h1 {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--text-white);
    font-weight: 100;
}

.landing-header p {
    color: var(--text-white);
    /* White Text for Dark Mode */
    font-size: 18px;
    max-width: 600px;
    margin: 16px auto;
}

.landing-header .sub-brand {
    color: var(--brand-secondary);
    /* Neon Cyan for Visibility */
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    display: block;
}

/* --- Segmented Cards (Grid) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

.framework-card {
    background-color: var(--brand-primary);
    /* Dark Card */
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    color: var(--text-white);
    /* Text inside card must be white */
    box-shadow: 0 10px 30px rgba(0, 41, 39, 0.15);
    transition: all 0.3s ease;
}

.framework-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 41, 39, 0.25);
    border-color: var(--brand-secondary);
}

.card-phase-number {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 24px;
    right: 32px;
    font-weight: 100;
}

.framework-card h2 {
    font-size: 28px;
    color: var(--text-white);
    margin-bottom: 16px;
    margin-top: 16px;
}

.framework-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin-bottom: 32px;
    flex-grow: 1;
}

.card-cta {
    color: var(--brand-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Reader Page Specifics (Hybrid) --- */
body.reader-page {
    background-color: var(--bg-light-paper);
    color: var(--text-dark-secondary);
}

.reader-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (Dark) */
.reader-sidebar {
    width: var(--width-sidebar);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    flex-shrink: 0;
    /* padding removed - moved to scroll container */
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Heavy Damped Curve */
    position: sticky;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* Allow button to protrude */
}

.sidebar-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Prevent text squish during transition */
    min-width: var(--width-sidebar);
    width: var(--width-sidebar);
}

.sidebar-scroll-container::-webkit-scrollbar {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-white);
    font-weight: 700;
    margin-bottom: 48px;
    font-size: 14px;
}

.sidebar-nav-group {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* PRO: Smooth fade */
    opacity: 0.5;
    /* Default dimmed state (inactive) */
}

/* "Luxury Focus" - Spotlight Effect */
.sidebar-nav-group.active,
.sidebar-nav-group:hover {
    opacity: 1;
    /* Full visibility for active or hovered */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-header:hover {
    color: var(--text-white);
}

.sidebar-title {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-style: italic;
    transition: color 0.3s ease;
}

/* Active State Styles */
.sidebar-nav-group.active .sidebar-title {
    color: var(--brand-secondary);
}

.sidebar-nav-group.active .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-arrow {
    transition: transform 0.3s ease;
}

/* Accordion Animation (Grid Method - Visually Stunning & Jitter-Free) */
.sidebar-chapter-list {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    /* Elegant easing */
    /* No opacity fade on container - causes pop-in issues */
}

.sidebar-nav-group.active .sidebar-chapter-list {
    grid-template-rows: 1fr;
    /* padding handled in inner wrapper */
}

.chapter-content-wrapper {
    overflow: hidden;
    padding-bottom: 0;
    transition: padding-bottom 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.sidebar-nav-group.active .chapter-content-wrapper {
    padding-bottom: 24px;
}

.sidebar-link {
    display: block;
    padding: 10px 16px;
    /* Slightly larger targets */
    margin: 4px 0;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    /* Prep for border animation */
    position: relative;
    overflow: hidden;
    /* For shine effect if desired, but keeping clean for now */
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Subtle hover */
    color: var(--text-white);
    padding-left: 20px;
    /* Slight movement on hover */
}

/* Active State - "Visually Attractive Highlight" */
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(0, 255, 221, 0.15) 0%, rgba(0, 255, 221, 0) 100%);
    color: var(--brand-secondary);
    border-left-color: var(--brand-secondary);
    padding-left: 24px;
    /* Deep indentation for active */
    font-weight: 500;
    box-shadow: -5px 0 15px rgba(0, 255, 221, 0.1);
    /* Subtle glow from left */
}

/* Content Well (Light) */

/* Sidebar Toggle Button */
/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--brand-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101;
    /* Heavy/Damped Transition & Elastic Scaling */
    transition:
        right 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s ease-out,
        background-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle-btn:hover {
    background-color: #003835;
    /* Removed scale(1.1) to keep it grounded */
}

.sidebar-toggle-btn:active {
    transform: translateY(-50%) scale(0.9);
    /* Press effect */
}

/* Sidebar Collapsed State */
.reader-sidebar.collapsed {
    width: 20px;
}

/* Hide content when collapsed */
.reader-sidebar.collapsed .sidebar-scroll-container {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s step-end;
}

.reader-sidebar.collapsed .sidebar-toggle-btn {
    right: -20px;
    transform: translateY(-50%);
}

.sidebar-toggle-btn img {
    width: 60%;
    height: auto;
    pointer-events: none;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    /* Match sidebar speed */
}

.reader-sidebar.collapsed .sidebar-toggle-btn img {
    width: 45%;
    /* Shrink slightly in collapsed state */
}

/* Content Well (Light Mode - Modern & Compact) */
.reader-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 40px;
    /* Symmetrical padding */
    background-color: #FFFFFF;
}

.content-container {
    width: 100%;
    max-width: 680px;
    /* 3. Narrow Reading Column */
}

/* Typography & Visual Hierarchy */
.content-container h1 {
    font-family: 'Source Sans 3', sans-serif;
    /* 1. Clean & Modern */
    font-size: 42px;
    color: var(--brand-primary);
    /* 5. Brand Color */
    margin-bottom: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.content-container h2 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 24px;
    text-transform: uppercase;
    /* 4. Stylized Headers */
    letter-spacing: 1px;
    color: var(--brand-primary);
    /* 5. Brand Color */
    margin-top: 48px;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--brand-secondary);
    /* 4. Stylized (Thicker Accent) */
    display: inline-block;
    font-weight: 700;
}

.content-container p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    /* Polish: More breathing room */
    letter-spacing: 0.3px;
    /* Polish: Premium readability */
    margin-bottom: 20px;
    color: #2D3748;
}

.intro-lead {
    font-size: 20px !important;
    font-weight: 300;
    color: var(--text-dark-primary) !important;
    line-height: 1.5 !important;
    border-left: 4px solid var(--brand-secondary);
    padding-left: 24px;
    margin-bottom: 40px !important;
    font-style: normal !important;
    /* Overriding serif italic */
}

/* 6. Quotes (Minimalist) */
blockquote {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 18px;
    font-style: italic;
    color: #4A5568;
    margin: 32px 0;
    padding-left: 24px;
    border-left: 2px solid #CBD5E0;
    /* Minimalist grey line */
}

/* 7. Lists (Mix & Match) */
.content-container ul {
    margin-bottom: 24px;
    padding-left: 20px;
}

.content-container li {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    margin-bottom: 12px;
    color: #2D3748;
    position: relative;
    list-style-type: none;
    /* Custom markers */
}

.content-container li::before {
    content: "";
    /* No text character */
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: -22px;
    /* Pull out into margin */
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%230F766E' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C12 7.52 16.48 12 22 12C16.48 12 12 16.48 12 22C12 16.48 7.52 12 2 12C7.52 12 12 7.52 12 2Z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform: translateY(2px);
    /* Optical alignment with text baseline */
}

/* 8. Callouts */
.callout {
    padding: 24px;
    border-radius: 8px;
    /* Modern Soft Radius */
    margin: 32px 0;
    font-size: 15px;
}

/* Warning (Red Box) */
.callout-warning {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    color: #9B2C2C;
}

.callout-warning strong {
    color: #742A2A;
    text-transform: uppercase;
}

/* Pro-Tip (Attractive Purple/Indigo) */
.callout-tip {
    background-color: #EEF2FF;
    /* Indigo 50 */
    border-left: 4px solid #6366F1;
    /* Indigo 500 */
    color: #3730A3;
}

/* 9. Separators (Simple Lines) */
hr {
    border: 0;
    height: 1px;
    background-color: #E2E8F0;
    margin: 48px 0;
}

/* Footer Navigation */
.reader-footer {
    max-width: var(--width-content-max);
    width: 100%;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
}

.nav-btn {
    background-color: var(--text-dark-primary);
    color: #FFFFFF !important;
    /* Force white against container overrides */
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    /* Prep for border transition */
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: var(--text-dark-primary);
    /* Keep background dark */
    color: #FFFFFF !important;
    border-color: var(--brand-secondary);
    /* Neon Cyan border */
    box-shadow: 0 0 15px rgba(0, 255, 221, 0.4);
    /* Light glow */
    transform: translateY(-2px);
}

/* Specific Style for Previous Button (Inverse) */
.reader-footer .nav-btn:first-child {
    background-color: #FFFFFF !important;
    color: var(--brand-primary) !important;
    border: 1px solid #E2E8F0;
}

.reader-footer .nav-btn:first-child:hover {
    background-color: #FFFFFF !important;
    color: var(--brand-primary) !important;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 15px rgba(0, 255, 221, 0.2);
}

/* Responsiveness */
@media (max-width: 900px) {
    .reader-layout {
        flex-direction: column;
    }

    .reader-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .reader-content {
        padding: 40px 24px;
        /* Polish: Mobile-friendly padding */
    }
}

/* --- Paywall Styles (Premium/Stripe-like) --- */
.sidebar-link.locked {
    opacity: 0.6;
    position: relative;
    cursor: default;
}

.sidebar-link.locked::after {
    content: "🔒";
    position: absolute;
    right: 12px;
    font-size: 12px;
    opacity: 0.5;
    filter: grayscale(100%);
}

/* 1. Overlay (Backdrop) - Focus Attention */
.paywall-overlay {
    /* position: fixed;  <-- REMOVED: Caused it to detach from content flow */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* Ensure it takes up vertical space since it replaces content */
    height: 100%;
    min-height: 60vh;
    margin-top: 40px;
    animation: fadeIn 0.4s ease-out;
}

/* 2. The Card (Solid, Opaque, Premium) */
.paywall-card {
    background-color: #001A20;
    /* Darker than Sidebar (#002B36) */
    border-radius: 12px;
    /* Softer rounded corners */
    padding: 48px;
    /* More breathing room */
    max-width: 550px;
    width: 100%;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.2),
        /* Deep shadow for depth */
        0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Subtle inner border */
    text-align: center;
    position: relative;
    z-index: 10;
    /* Ensure it doesn't touch edges on small screens */
    margin: 0 20px;
}

/* 3. Logo */
.paywall-logo {
    height: 60px;
    width: auto;
    margin: 0 auto 24px auto;
    /* Force Center */
    display: block;
    /* Ensure it behaves like a block for margin:auto to work */
}

/* 4. Typography (White & Clean) */
.paywall-card h2 {
    color: #FFFFFF;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 16px auto;
    /* Center and spacing */
    letter-spacing: -0.5px;
    /* Modern tight tracking */
    text-transform: none;
    /* Remove uppercase for cleaner look */
    border: none;
    /* Remove existing underline if inherited */
    padding: 0;
    display: block;
    /* Override inline-block from global h2 */
    width: 100%;
    text-align: center;
}

/* Global text color for card */
.paywall-card p {
    color: #FFFFFF !important;
    /* Force White Override */
    margin-bottom: 24px;
}

.paywall-desc {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.paywall-subtext {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 5. List (Clean & Center) */
.paywall-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 32px auto;
    text-align: left;
    display: inline-block;
    min-width: 280px;
}

.paywall-list li {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    font-family: 'Source Sans 3', sans-serif;
    /* Integrated Font */
    font-size: 16px;
    /* Slightly larger */
    font-weight: 500;
    /* More substantial */
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
}

.paywall-list li::before {
    content: "✦";
    /* Premium Sparkle/Star instead of Tick */
    color: var(--neon-cyan);
    margin-right: 16px;
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 0 8px rgba(0, 255, 221, 0.4);
    /* Glowing effect */
}

.paywall-list li:last-child {
    border-bottom: none;
}

/* 6. Buttons (Stripe-like) */
.paywall-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.paywall-card .btn-primary {
    background-color: var(--neon-cyan);
    color: #FFFFFF;
    /* White Text */
    border-radius: 6px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    /* Smoother, consistent glow instead of a dirty drop shadow */
    box-shadow: 0 0 15px rgba(0, 255, 221, 0.3);
    border: none;
    letter-spacing: 0.5px;
}

.paywall-card .btn-primary:hover {
    transform: translateY(-2px);
    /* Intensify the glow on hover */
    box-shadow: 0 0 25px rgba(0, 255, 221, 0.6);
}

.paywall-card .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 6px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.paywall-card .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Content Modules (The "Stripe Press" Editorial Aesthetic) --- */

/* 1. Global Module Wrapper (Flat & Clean) */
.section-module {
    margin: 80px 0;
    /* More whitespace */
    padding: 0;
    border-radius: 6px;
    /* Slightly refined corners (Step 8) */
    background-color: transparent;
    /* No default bg */
    border: none;
    /* Flat (Step 9) */
    position: relative;
}

/* 2. Headers (Editorial "Book" Feel) */
.module-header {
    display: flex;
    align-items: baseline;
    /* Align label with text baseline */
    gap: 16px;
    padding: 0 0 24px 0;
    /* No background, just spacing */
    background-color: transparent;
    border-bottom: 2px solid #111;
    /* Strong editorial divider */
    margin-bottom: 32px;
}

.module-badge {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    /* Tag style (Step 7) */
    background-color: #000;
    color: #FFF;
    min-width: fit-content;
    transform: translateY(-2px);
    /* Optical alignment */
}

.module-title {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #111 !important;
    font-family: 'Source Sans 3', sans-serif;
    /* Keep headers sleek Sans for contrast with Body */
}

/* 3. Content Body (Editorial) */
.module-content {
    padding: 0;
    /* Remove internal padding, let it breathe */
}

/* Typography Overrides for "Book" Feel */
.module-content p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    /* Polish: Matched breathing room */
    letter-spacing: 0.3px;
    /* Polish: Premium readability */
    color: #374151;
    margin-bottom: 24px;
}

.module-content h3 {
    font-family: 'Playfair Display', serif;
    /* Editorial Subheads */
    font-size: 18px;
    font-weight: 700;
    font-style: italic;
    color: #111;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
    /* Very light subtle line */
    display: block;
}

/* --- Specific Module Themes (NEXEA Brand Harmony) --- */

/* Module: PLAYBOOK (The "White Paper") */
.module-playbook .module-header {
    border-bottom-color: #111;
    /* Classic Black Line */
}

.module-playbook .module-badge {
    background-color: #111;
}

/* Module: EXECUTION (The "Teal Field Manual") */
.section-module.module-execution {
    background-color: #F0FDFA;
    /* Teal 50 - Matches Brand */
    padding: 40px;
    border-radius: 8px;
}

.module-execution .module-header {
    border-bottom-color: #14B8A6;
    /* Teal 500 */
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.module-execution .module-badge {
    background-color: #0F766E;
    /* Teal 700 */
}

/* Module: PULSE (The "NEXEA Deep Slate" Card) */
.section-module.module-pulse {
    background-color: #002B36;
    /* NEXEA Dark Slate */
    padding: 40px;
    color: #FFF;
    border-radius: 8px;
}

.module-pulse .module-header {
    border-bottom-color: #004d55;
    /* Slightly lighter teal/slate line */
}

.module-pulse .module-title {
    color: #FFF !important;
}

.module-pulse .module-badge {
    background-color: #00FFDD;
    /* NEXEA Neon Cyan */
    color: #002B36;
    /* Dark Text on Neon Badge */
}

.module-pulse .module-content p,
.module-pulse .module-content li {
    color: #94A3B8 !important;
    /* Slate 400 */
}

.module-pulse .module-content h3 {
    color: #FFF;
    border-bottom-color: #004d55;
}

/* Module: LOCAL (The "Context" - Cool Grey) */
.section-module.module-local {
    background-color: #F8FAFC;
    /* Slate 50 (Cool Grey) */
    padding: 40px;
    border-radius: 8px;
}

.module-local .module-header {
    border-bottom-color: #64748B;
    /* Slate 500 */
}

.module-local .module-badge {
    background-color: #475569;
    /* Slate 600 */
}

/* Module: VALIDATION (The "Warning" - Muted Clay) */
.section-module.module-validation {
    background-color: #FFF1F2;
    /* Rose 50 */
    padding: 40px;
    border-radius: 8px;
}

.module-validation .module-header {
    border-bottom-color: #E11D48;
    /* Rose 600 */
}

.module-validation .module-badge {
    background-color: #9F1239;
    /* Rose 800 - Darker/Serious */
}

/* Module: VAULT (The "Premium") */
.section-module.module-vault {
    background-color: #F8FAFC;
    /* Slate 50 */
    padding: 40px;
    border: 1px solid #E2E8F0;
    /* Subtle border */
}

.module-vault .module-header {
    border-bottom-color: #7C3AED;
    /* Violet 600 */
}

.module-vault .module-badge {
    background-color: #7C3AED;
}

/* --- Polish: Clean Link Behavior --- */
.content-container a,
.module-content a {
    color: #0F766E;
    /* Dark Teal */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.content-container a:hover,
.module-content a:hover {
    color: #134E4A;
    /* Deeper Teal */
    border-bottom-color: #0F766E;
}

/* --- Polish: Branded Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #0F766E;
    /* Dark Teal */
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #134E4A;
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #0F766E transparent;
}

/* --- Polish: Reading Progress Bar --- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0F766E, #14B8A6);
    /* Dark Teal -> Teal */
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* --- Polish: Floating Mini-TOC --- */
.floating-toc {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 160px;
}

.floating-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 0;
    position: relative;
    flex-direction: row-reverse;
    /* Label left, dot right */
}

/* The Dot */
.floating-toc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #CBD5E1;
    /* Slate 300 */
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

/* The Label (hidden by default, shown on hover) */
.floating-toc-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    /* Slate 500 */
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* Vertical connector line between dots */
.floating-toc-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 3.5px;
    /* Center on dot (8px/2 - 0.5px) */
    top: 50%;
    width: 1px;
    height: 100%;
    background-color: #E2E8F0;
    /* Slate 200 */
    z-index: 1;
}

/* Hover: Show label */
.floating-toc-item:hover .floating-toc-label {
    opacity: 1;
    transform: translateX(0);
}

.floating-toc-item:hover .floating-toc-dot {
    background-color: #0F766E;
    transform: scale(1.3);
}

/* Active state */
.floating-toc-item.active .floating-toc-dot {
    background-color: #0F766E;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
    transform: scale(1.3);
}

.floating-toc-item.active .floating-toc-label {
    opacity: 1;
    transform: translateX(0);
    color: #0F766E;
    font-weight: 700;
}

/* Hide TOC on small screens */
@media (max-width: 1200px) {
    .floating-toc {
        display: none;
    }
}

/* ===================================================================
   CONTENT PRESENTATION ENHANCEMENTS (REFINED)
   =================================================================== */

/* --- 1. Pull Quotes (Refined) --- */
.pull-quote {
    position: relative;
    margin: 56px 0;
    padding: 16px 32px;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-dark-primary);
    border-left: 5px solid #002927;
    /* Dark Teal Bar */
    background: transparent;
    border-radius: 0 4px 4px 0;
    max-width: 800px;
    width: 110%;
    /* Extend beyond container */
    margin-left: -5%;
}

@media (max-width: 900px) {
    .pull-quote {
        width: 100%;
        margin-left: 0;
        font-size: 20px;
    }
}

/* Pull quote inside dark modules */
.module-pulse .pull-quote {
    color: #E2E8F0;
    border-left-color: var(--brand-secondary);
}

/* --- 2. Key-Term Badges (REMOVED per user request) --- */
/* Relying on standard bold typography */

/* --- 3. Step Headings (Refined - Typography Only) --- */
.step-number {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.2em;
    color: #0F766E;
    margin-right: 12px;
}

.module-pulse .step-number {
    color: var(--brand-secondary);
}

/* --- 4. Stat Cards --- */
.stat-card-row {
    display: flex;
    gap: 16px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 140px;
    padding: 24px 20px;
    text-align: center;
    background-color: #F0FDFA;
    border: 1px solid rgba(15, 118, 110, 0.15);
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 41, 39, 0.1);
}

.stat-card-value {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.2;
    margin-bottom: 6px;
}

.stat-card-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
}

/* Stat cards inside dark modules */
.module-pulse .stat-card {
    background-color: rgba(0, 255, 221, 0.06);
    border-color: rgba(0, 255, 221, 0.15);
}

.module-pulse .stat-card-value {
    color: var(--brand-secondary);
}

.module-pulse .stat-card-label {
    color: #94A3B8;
}

/* --- 5. Clickable Checklists (Refined) --- */
.checklist {
    list-style: none;
    padding: 0;
    margin: 32px 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    /* Aligns checkbox with top line of text */
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 6px;
}

.checklist-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #CBD5E0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    /* Visual adjustment for optical centering with text */
    transition: all 0.2s ease;
    background-color: #FFF;
}

/* Checked State Details */
.checklist-item.checked .checklist-checkbox {
    background-color: #002927;
    /* Solid Dark Teal */
    border-color: #002927;
}

.checklist-item.checked .checklist-checkbox::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid #FFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.checklist-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2D3748;
    transition: color 0.2s ease;
}

.checklist-item.checked .checklist-text {
    text-decoration: line-through;
    color: #94A3B8;
    /* Muted grey */
    text-decoration-color: rgba(0, 0, 0, 0.2);
}

/* Checklists inside dark modules */
.module-pulse .checklist-checkbox {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: transparent;
}

.module-pulse .checklist-item.checked .checklist-checkbox {
    background-color: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

.module-pulse .checklist-item.checked .checklist-checkbox::after {
    border-color: #002927;
    /* Dark check on bright box */
}

.module-pulse .checklist-text {
    color: #CBD5E0;
}

.module-pulse .checklist-item.checked .checklist-text {
    color: #64748B;
    text-decoration-color: rgba(255, 255, 255, 0.2);
}

/* --- 6. Alternating Sub-Section Backgrounds --- */
.subsection-block {
    padding: 32px 0;
    border-radius: 0;
}

.subsection-block.alt-bg {
    background-color: rgba(15, 118, 110, 0.025);
    padding: 32px 28px;
    margin-left: -28px;
    margin-right: -28px;
    border-radius: 8px;
}

/* Alt-bg inside dark modules */
.module-pulse .subsection-block.alt-bg {
    background-color: rgba(255, 255, 255, 0.03);
}

/* --- 7. Branded Section Dividers --- */
.branded-divider {
    border: 0;
    height: 1px;
    margin: 56px 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(15, 118, 110, 0.3) 20%,
            rgba(15, 118, 110, 0.5) 50%,
            rgba(15, 118, 110, 0.3) 80%,
            transparent 100%);
}

/* Branded dividers inside dark modules */
.module-pulse .branded-divider {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 255, 221, 0.15) 20%,
            rgba(0, 255, 221, 0.3) 50%,
            rgba(0, 255, 221, 0.15) 80%,
            transparent 100%);
}

/* --- 8. Scroll-Triggered Fade-In Animations --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for sequential elements */
.fade-in-section:nth-child(2) {
    transition-delay: 0.05s;
}

.fade-in-section:nth-child(3) {
    transition-delay: 0.1s;
}

.fade-in-section:nth-child(4) {
    transition-delay: 0.15s;
}

.fade-in-section:nth-child(5) {
    transition-delay: 0.2s;
}

/* --- Override: Remove default li::before for checklists --- */
.checklist .checklist-item::before {
    display: none;
}

/* --- Reading Progress Bar (Enhanced) --- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    background-size: 100vw 100%;
    box-shadow: 0 0 10px rgba(0, 255, 221, 0.5);
    z-index: 9999;
}