/* =============================================
   LIQUID GLASS THEME - Aurora Edition
   Based on: atlaspuplabs.com/blog/liquid-glass-but-in-css
   ============================================= */

:root {
    /* Color Palette - Light Theme */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;

    /* Liquid Glass Variables */
    --glass-bg: rgba(255, 255, 255, 0.35);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow-light: rgba(153, 192, 255, 0.15);
    --glass-shadow-warm: rgba(229, 253, 190, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.8);

    /* Layout */
    --sidebar-width: 280px;
    --border-radius-lg: 1.5rem;
    --border-radius-md: 1rem;
    --border-radius-sm: 0.5rem;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Backward-compatible aliases (legacy pages) */
    --accent: var(--accent-blue);
    --border: rgba(255, 255, 255, 0.6);
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* =============================================
   BASE STYLES
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.7;
    margin: 0;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background: transparent;
}

img,
video {
    max-width: 100%;
    height: auto;
}

/* =============================================
   DYNAMIC AURORA BACKGROUND
   ============================================= */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 50%, #fdf4ff 100%);
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.45;
    /* Softer, more subtle aurora */
    border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
    will-change: transform;
}

/* Blob 1: Soft Lavender */
.aurora-blob-1 {
    top: -15%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle at 30% 30%, #e9d5ff, #d8b4fe);
    animation: aurora-drift-1 12s ease-in-out infinite alternate, hue-shift 8s ease-in-out infinite;
}

/* Blob 2: Soft Cyan - lighter */
.aurora-blob-2 {
    bottom: -15%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle at 70% 70%, #a5f3fc, #99f6e4);
    opacity: 0.35;
    animation: aurora-drift-2 15s ease-in-out infinite alternate, hue-shift 10s ease-in-out infinite reverse;
}

/* Blob 3: Soft Pink - lighter */
.aurora-blob-3 {
    top: 30%;
    left: 25%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle at 50% 50%, #fce7f3, #fbcfe8);
    animation: aurora-drift-3 10s ease-in-out infinite alternate, hue-shift 6s ease-in-out infinite;
}

/* Blob 4: Soft Cream - very light */
.aurora-blob-4 {
    top: 60%;
    right: 20%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle at 40% 60%, #fef9c3, #fef08a);
    opacity: 0.3;
    animation: aurora-drift-4 18s ease-in-out infinite alternate, hue-shift 12s ease-in-out infinite reverse;
}

/* Aurora Animation Keyframes - Large visible movements */
@keyframes aurora-drift-1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(-8%, 12%) scale(1.15) rotate(15deg);
    }

    100% {
        transform: translate(15%, -8%) scale(0.9) rotate(-10deg);
    }
}

@keyframes aurora-drift-2 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(12%, -10%) scale(0.85) rotate(-20deg);
    }

    100% {
        transform: translate(-10%, 15%) scale(1.2) rotate(15deg);
    }
}

@keyframes aurora-drift-3 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(20%, 10%) scale(1.1) rotate(25deg);
    }

    100% {
        transform: translate(-15%, -12%) scale(0.95) rotate(-15deg);
    }
}

@keyframes aurora-drift-4 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(-18%, 8%) scale(1.25) rotate(-12deg);
    }

    100% {
        transform: translate(10%, -15%) scale(0.8) rotate(20deg);
    }
}

/* Hue shift animation for dynamic color changes - faster, non-linear */
@keyframes hue-shift {
    0% {
        filter: blur(60px) hue-rotate(0deg);
    }

    25% {
        filter: blur(60px) hue-rotate(45deg);
    }

    50% {
        filter: blur(60px) hue-rotate(0deg);
    }

    75% {
        filter: blur(60px) hue-rotate(-45deg);
    }

    100% {
        filter: blur(60px) hue-rotate(0deg);
    }
}

/* =============================================
   LIQUID GLASS MIXIN (via class)
   ============================================= */
.liquid-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) contrast(85%) saturate(120%);
    -webkit-backdrop-filter: blur(20px) contrast(85%) saturate(120%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);

    /* Inset shadows for edge refraction effect */
    box-shadow:
        inset 8px 8px 16px var(--glass-shadow-light),
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -8px -8px 16px var(--glass-shadow-warm),
        inset -2px -2px 4px rgba(255, 255, 255, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.06);

    transition: var(--transition-smooth);
}

.liquid-glass:hover {
    box-shadow:
        inset 10px 10px 20px var(--glass-shadow-light),
        inset 3px 3px 6px rgba(255, 255, 255, 0.4),
        inset -10px -10px 20px var(--glass-shadow-warm),
        inset -3px -3px 6px rgba(255, 255, 255, 0.25),
        0 16px 48px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* =============================================
   SIDEBAR NAVIGATION
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;

    /* Liquid Glass Sidebar */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-right: 1px solid var(--glass-border);
    box-shadow:
        inset -8px 0 20px rgba(153, 192, 255, 0.08),
        4px 0 24px rgba(0, 0, 0, 0.04);
}

.brand {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.brand:hover {
    text-decoration: none;
    opacity: 0.85;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.domain-switch-sidebar {
    margin-top: 1rem;
}

.domain-switch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin: 1rem 0 2rem;
}

.domain-switch-row .domain-switch-btn {
    width: auto;
    min-width: 280px;
}

.domain-switch-btn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1rem;
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.28);
    transition: var(--transition-smooth);
}

.domain-switch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(20, 184, 166, 0.34);
    color: #ffffff;
}

.domain-switch-btn.world-model {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.25);
}

.domain-switch-btn.world-model:hover {
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.32);
}

.nav-link {
    display: block;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.6);
    color: var(--accent-blue);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        inset 4px 4px 8px rgba(153, 192, 255, 0.15),
        inset -4px -4px 8px rgba(229, 253, 190, 0.1),
        0 4px 16px rgba(59, 130, 246, 0.12);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 50%;
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 4rem 5rem;
    max-width: 1000px;
    width: 100%;
    margin-right: auto;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 50%, #db2777 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #334155;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #475569;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 70ch;
    line-height: 1.8;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: #2563eb;
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* =============================================
   LAST UPDATED (Unified)
   ============================================= */
.last-updated {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 1.75rem 0 2.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.last-updated strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* =============================================
   INTRO SECTION - matches regular section layout
   ============================================= */
.intro-section {
    text-align: left;
    margin: 2rem 0 3rem 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.intro-section h2 {
    margin-top: 0;
}

.intro-section p {
    text-indent: 2em;
    max-width: 100%;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
    text-align: center;
    padding: 5rem 3rem 4rem;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Liquid Glass Hero */
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px) contrast(90%) saturate(130%);
    -webkit-backdrop-filter: blur(24px) contrast(90%) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 2rem;
    box-shadow:
        inset 12px 12px 24px var(--glass-shadow-light),
        inset 4px 4px 8px rgba(255, 255, 255, 0.4),
        inset -12px -12px 24px var(--glass-shadow-warm),
        inset -4px -4px 8px rgba(255, 255, 255, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.08);
}

.hero h1,
.hero p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================
   MODULE GRID & CARDS
   ============================================= */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.module-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 2rem;

    /* Liquid Glass Card */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px) contrast(88%) saturate(115%);
    -webkit-backdrop-filter: blur(16px) contrast(88%) saturate(115%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow:
        inset 6px 6px 14px var(--glass-shadow-light),
        inset 2px 2px 4px rgba(255, 255, 255, 0.35),
        inset -6px -6px 14px var(--glass-shadow-warm),
        inset -2px -2px 4px rgba(255, 255, 255, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.05);

    transition: var(--transition-smooth);
}

.module-card:hover {
    transform: translateY(-6px) scale(1.01);
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
        inset 8px 8px 18px var(--glass-shadow-light),
        inset 3px 3px 6px rgba(255, 255, 255, 0.45),
        inset -8px -8px 18px var(--glass-shadow-warm),
        inset -3px -3px 6px rgba(255, 255, 255, 0.3),
        0 20px 50px rgba(0, 0, 0, 0.1);
}

.module-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.module-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* =============================================
   MEDIA CARDS / VIDEO LINKS
   ============================================= */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.media-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.media-card h4 {
    margin: 0 0 0.5rem;
}

.video-thumbnail {
    display: block;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 180px;
    text-decoration: none;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.3);
}

.video-thumbnail .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.92);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.video-thumbnail .play-overlay::after {
    content: "▶";
    margin-left: 4px;
}

.video-thumbnail .video-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.9rem 1rem;
    color: #ffffff;
    font-weight: 600;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

/* =============================================
   TAGS
   ============================================= */
.tag {
    align-self: flex-start;
    padding: 0.35rem 0.9rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* =============================================
   TABLES
   ============================================= */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2.5rem 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;

    /* Liquid Glass Table */
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px) saturate(110%);
    -webkit-backdrop-filter: blur(12px) saturate(110%);
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 4px 4px 10px var(--glass-shadow-light),
        inset -4px -4px 10px var(--glass-shadow-warm),
        0 6px 20px rgba(0, 0, 0, 0.04);
}

th,
td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.2);
}

/* =============================================
   CODE BLOCKS
   ============================================= */
pre {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    padding: 1.75rem;
    border-radius: var(--border-radius-md);
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

pre code {
    color: #e2e8f0;
}

:not(pre)>code {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    padding: 0.2em 0.5em;
    border-radius: 0.3em;
    font-size: 0.9em;
}

/* =============================================
   BLOCKQUOTES & COMMENTARY
   ============================================= */
blockquote {
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    border: none;
    border-radius: var(--border-radius-lg);

    /* Liquid Glass Blockquote */
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.5), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 4px solid var(--accent-blue);
    box-shadow:
        inset 4px 4px 10px rgba(153, 192, 255, 0.12),
        inset -4px -4px 10px rgba(255, 255, 255, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.04);

    font-style: italic;
    color: #0c4a6e;
    font-size: 1.1rem;
}

.commentary {
    background: linear-gradient(135deg, rgba(253, 242, 248, 0.6), rgba(255, 255, 255, 0.5));
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid rgba(252, 231, 243, 0.6);
    border-left: 4px solid var(--accent-pink);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem 2rem;
    margin: 2rem 0;
    color: #831843;
    font-style: normal;
    box-shadow:
        inset 4px 4px 10px rgba(244, 114, 182, 0.08),
        inset -4px -4px 10px rgba(255, 255, 255, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.04);
}

.commentary p {
    margin: 0;
    font-style: normal;
    line-height: 1.8;
}

.commentary-title {
    color: var(--accent-pink);
    font-weight: 700;
    font-style: normal;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* =============================================
   GOALS SECTION
   ============================================= */
.goals-section {
    margin: 2.5rem 0;
    padding: 2rem;

    /* Liquid Glass */
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.5), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(187, 247, 208, 0.5);
    border-radius: var(--border-radius-lg);
    box-shadow:
        inset 4px 4px 10px rgba(134, 239, 172, 0.1),
        inset -4px -4px 10px rgba(255, 255, 255, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.03);
}

/* =============================================
   MERMAID DIAGRAMS
   ============================================= */
.mermaid {
    padding: 2rem;
    margin: 2.5rem 0;
    border-radius: var(--border-radius-md);

    /* Liquid Glass */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 4px 4px 10px var(--glass-shadow-light),
        inset -4px -4px 10px var(--glass-shadow-warm),
        0 6px 16px rgba(0, 0, 0, 0.04);
}

/* =============================================
   LISTS
   ============================================= */
ul,
ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

li::marker {
    color: var(--accent-blue);
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .main-content {
        padding: 3rem 2.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.25rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        box-shadow:
            inset 0 -8px 20px rgba(153, 192, 255, 0.08),
            0 4px 24px rgba(0, 0, 0, 0.04);
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .nav-link {
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .domain-switch-sidebar {
        margin-top: 0.9rem;
    }

    .domain-switch-row .domain-switch-btn {
        min-width: max-content;
    }

    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem 3rem;
    }

    .module-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
        margin-top: 2.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: 1rem;
    }

    .hero {
        padding: 3rem 1.75rem 2.5rem;
        margin-bottom: 2.5rem;
        border-radius: 1.5rem;
        text-align: left;
    }

    blockquote,
    .commentary,
    .goals-section {
        padding: 1.5rem;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th,
    td {
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 1.75rem 1.25rem 2.5rem;
    }

    .nav-link {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .domain-switch-btn {
        padding: 0.75rem 0.95rem;
        font-size: 0.88rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .module-card {
        padding: 1.5rem;
    }

    blockquote {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .hero {
        padding: 2.5rem 1.5rem 2rem;
    }

    table {
        font-size: 0.9rem;
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow:
        inset 6px 6px 12px var(--glass-shadow-light),
        inset -6px -6px 12px var(--glass-shadow-warm),
        0 8px 24px rgba(0, 0, 0, 0.05);
}

.card {
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow:
        inset 6px 6px 12px var(--glass-shadow-light),
        inset -6px -6px 12px var(--glass-shadow-warm),
        0 8px 24px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 8px 8px 16px var(--glass-shadow-light),
        inset -8px -8px 16px var(--glass-shadow-warm),
        0 16px 40px rgba(0, 0, 0, 0.08);
}

/* =============================================
   CHAPTER NAVIGATION
   ============================================= */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.chapter-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.chapter-nav-link:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.chapter-nav-link.prev {
    align-items: flex-start;
}

.chapter-nav-link.next {
    align-items: flex-end;
    text-align: right;
}

.chapter-nav-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.chapter-nav-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.chapter-nav-link:hover .chapter-nav-title {
    color: #2563eb;
}

/* Empty placeholder when no prev/next */
.chapter-nav-placeholder {
    flex: 1;
}

@media (max-width: 768px) {
    .chapter-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .chapter-nav-link.prev,
    .chapter-nav-link.next {
        align-items: flex-start;
        text-align: left;
    }

    .chapter-nav-link {
        padding: 1.25rem;
    }

    .chapter-nav-title {
        font-size: 1rem;
    }
}