/* === CSS Variables === */
:root {
    --primary: #0077B6;
    --primary-dark: #005A8C;
    --primary-light: #0096E0;
    --secondary: #90E0EF;
    --secondary-light: #CAF0F8;
    --secondary-dark: #48CAE4;
    --accent: #023E8A;
    --text: #1a1a2e;
    --text-light: #4a5568;
    --text-muted: #718096;
    --bg: #ffffff;
    --bg-alt: #F8FAFC;
    --bg-card: #ffffff;
    --border: #E2E8F0;
    --border-light: #EDF2F7;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }

/* === Typography === */
h1, h2, h3, h4, h5 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 600; }
p { margin-bottom: var(--space-md); color: var(--text-light); }

/* === Layout === */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-lg); }
.container-narrow { max-width: 900px; }
main { min-height: 60vh; }

/* === Header === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) 0;
}
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text);
}
.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    color: white;
}
.logo-icon svg { width: 22px; height: 22px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-size: 1.1rem; color: var(--primary); }
.logo-text small { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}
.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: color var(--transition);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }
.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--text-light);
    transition: all var(--transition);
}
.nav-search-btn:hover { background: var(--primary); color: white; }
.nav-search-btn svg { width: 18px; height: 18px; }
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: var(--space-sm);
}
.mobile-toggle svg { width: 24px; height: 24px; }

/* === Hero === */
.hero {
    position: relative;
    padding: var(--space-4xl) 0 var(--space-3xl);
    background: linear-gradient(135deg, #F0F9FF 0%, var(--secondary-light) 50%, #E0F2FE 100%);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,119,182,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(144,224,239,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}
.hero-text { max-width: 560px; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: rgba(0,119,182,0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}
.hero-badge svg { width: 14px; height: 14px; }
.hero h1 { margin-bottom: var(--space-lg); color: var(--accent); }
.hero h1 span { color: var(--primary); }
.hero-desc { font-size: 1.1rem; color: var(--text-light); margin-bottom: var(--space-xl); line-height: 1.8; }

/* Hero Search */
.hero-search {
    display: flex;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}
.hero-search:focus-within { border-color: var(--primary); }
.hero-search input {
    flex: 1;
    border: none;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-family: var(--font-sans);
    outline: none;
    background: transparent;
    min-width: 0;
}
.hero-search button {
    padding: var(--space-md) var(--space-xl);
    background: var(--primary);
    color: white;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: background var(--transition);
    white-space: nowrap;
}
.hero-search button:hover { background: var(--primary-dark); }
.hero-search button svg { width: 18px; height: 18px; }

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
    margin-top: var(--space-xl);
}
.hero-stat { text-align: left; }
.hero-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); font-family: var(--font-sans); }
.hero-stat-label { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
}
.hero-image-wrapper img {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    height: 400px;
    object-fit: cover;
}
.hero-float-card {
    position: absolute;
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.hero-float-card.top-right {
    top: -20px;
    right: -20px;
}
.hero-float-card.bottom-left {
    bottom: -20px;
    left: -20px;
}
.hero-float-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hero-float-icon.blue { background: rgba(0,119,182,0.1); color: var(--primary); }
.hero-float-icon.green { background: rgba(16,185,129,0.1); color: #10b981; }
.hero-float-icon svg { width: 22px; height: 22px; }
.hero-float-text strong { font-size: 0.85rem; display: block; }
.hero-float-text span { font-size: 0.75rem; color: var(--text-muted); }

/* === Section Styles === */
.section { padding: var(--space-4xl) 0; }
.section-alt { background: var(--bg-alt); }
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.section-header h2 { margin-bottom: var(--space-md); }
.section-header p { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 0; }
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

/* === Chapters Grid === */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}
.chapter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.chapter-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-dark);
    transform: translateY(-2px);
}
.chapter-card:hover::before { transform: scaleX(1); }
.chapter-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.chapter-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}
.chapter-card-header h3 {
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.4;
}
.chapter-plage {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--secondary-light);
    padding: 2px var(--space-sm);
    border-radius: 4px;
    margin-bottom: var(--space-sm);
}
.chapter-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: var(--space-md);
}
.chapter-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
}
.chapter-card-footer svg { width: 16px; height: 16px; }

/* === Category List === */
.category-list { display: flex; flex-direction: column; gap: var(--space-lg); }
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition);
}
.category-card:hover { box-shadow: var(--shadow-md); }
.category-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.category-code-badge {
    display: inline-flex;
    padding: var(--space-xs) var(--space-md);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-sans);
    white-space: nowrap;
}
.category-header h3 {
    font-size: 1.1rem;
    font-family: var(--font-sans);
}
.category-card > p { font-size: 0.92rem; margin-bottom: var(--space-lg); }

/* Codes table within category */
.codes-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.code-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}
.code-item:hover {
    background: white;
    border-color: var(--secondary-dark);
    box-shadow: var(--shadow-sm);
}
.code-badge {
    display: inline-flex;
    padding: 2px var(--space-sm);
    background: rgba(0,119,182,0.1);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-sans);
    white-space: nowrap;
    min-width: 50px;
    justify-content: center;
}
.code-item-title { font-size: 0.9rem; font-weight: 500; color: var(--text); flex: 1; }
.code-item-arrow { color: var(--text-muted); flex-shrink: 0; }
.code-item-arrow svg { width: 16px; height: 16px; }

/* === Code Detail Page === */
.code-detail-hero {
    background: linear-gradient(135deg, #F0F9FF 0%, var(--secondary-light) 100%);
    padding: var(--space-3xl) 0;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    font-size: 0.85rem;
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb svg { width: 14px; height: 14px; color: var(--text-muted); }
.code-detail-header { display: flex; align-items: flex-start; gap: var(--space-lg); }
.code-detail-badge {
    display: inline-flex;
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-sans);
}
.code-detail-info h1 { margin-bottom: var(--space-sm); }
.code-detail-chapter-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}
.code-detail-chapter-link a { color: var(--primary); }
.code-detail-body { padding: var(--space-3xl) 0; }
.code-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
}
.info-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}
.info-block h2 {
    font-size: 1.2rem;
    font-family: var(--font-sans);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.info-block h2 svg { width: 20px; height: 20px; color: var(--primary); }
.info-block p { font-size: 0.95rem; line-height: 1.8; }
.info-block ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.info-block ul li {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.info-block ul li::before { content: '•'; color: var(--primary); font-weight: bold; }

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}
.sidebar-card h3 {
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.sidebar-card h3 svg { width: 18px; height: 18px; color: var(--primary); }
.related-codes { display: flex; flex-direction: column; gap: var(--space-sm); }
.related-code-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
    transition: all var(--transition);
}
.related-code-link:hover { background: var(--secondary-light); color: var(--primary); }
.related-code-link .code-badge { font-size: 0.75rem; min-width: 40px; }

/* === Search Page === */
.search-section { padding: var(--space-3xl) 0; }
.search-box {
    display: flex;
    max-width: 700px;
    margin: 0 auto var(--space-2xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
    flex: 1;
    border: none;
    padding: var(--space-lg);
    font-size: 1rem;
    font-family: var(--font-sans);
    outline: none;
}
.search-box button {
    padding: var(--space-md) var(--space-xl);
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.search-box button:hover { background: var(--primary-dark); }
.search-results { max-width: 800px; margin: 0 auto; }
.search-results-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}
.search-result-item {
    display: block;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}
.search-result-item:hover { box-shadow: var(--shadow-md); border-color: var(--secondary-dark); }
.search-result-item h3 {
    font-size: 1rem;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.search-result-item p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* === About Page === */
.about-hero {
    background: linear-gradient(135deg, #F0F9FF, var(--secondary-light));
    padding: var(--space-4xl) 0 var(--space-3xl);
}
.about-content { padding: var(--space-3xl) 0; }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    margin-bottom: var(--space-3xl);
}
.about-grid.reverse { direction: rtl; }
.about-grid.reverse > * { direction: ltr; }
.about-grid img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    height: 350px;
    object-fit: cover;
}
.about-text h2 { margin-bottom: var(--space-lg); }
.about-text p { font-size: 0.95rem; line-height: 1.8; }

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--secondary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}
.feature-icon svg { width: 26px; height: 26px; }
.feature-card h3 { font-size: 1.05rem; font-family: var(--font-sans); margin-bottom: var(--space-sm); }
.feature-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* === FAQ === */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    overflow: hidden;
    background: var(--bg-card);
}
.faq-question {
    width: 100%;
    padding: var(--space-lg);
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    transition: color var(--transition);
}
.faq-question:hover { color: var(--primary); }
.faq-question svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform var(--transition); }
.faq-item.active .faq-question svg { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.faq-answer-inner { padding: 0 var(--space-lg) var(--space-lg); }
.faq-answer-inner p { font-size: 0.92rem; line-height: 1.8; color: var(--text-light); margin: 0; }
.faq-item.active .faq-answer { max-height: 500px; }

/* === CTA Banner === */
.cta-banner {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: var(--space-3xl) 0;
    text-align: center;
    color: white;
}
.cta-banner h2 { color: white; margin-bottom: var(--space-md); }
.cta-banner p { color: rgba(255,255,255,0.85); font-size: 1.05rem; max-width: 600px; margin: 0 auto var(--space-xl); }
.btn-white {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: white;
    color: var(--primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--primary-dark); }
.btn-white svg { width: 18px; height: 18px; }

/* === Chapitres Page (listing) === */
.chapitres-hero {
    background: linear-gradient(135deg, #F0F9FF 0%, var(--secondary-light) 100%);
    padding: var(--space-3xl) 0;
    text-align: center;
}

/* === 404 === */
.error-page {
    text-align: center;
    padding: var(--space-4xl) 0;
}
.error-page h1 { font-size: 6rem; color: var(--primary); margin-bottom: var(--space-md); }
.error-page h2 { margin-bottom: var(--space-lg); }
.error-page p { max-width: 500px; margin: 0 auto var(--space-xl); }
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); color: white; }

/* === Footer === */
.site-footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: var(--space-3xl) 0 var(--space-lg);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}
.footer-brand .logo { margin-bottom: var(--space-md); }
.footer-brand .logo-icon { background: rgba(0,119,182,0.3); }
.footer-brand .logo-text strong { color: white; }
.footer-brand .logo-text small { color: rgba(255,255,255,0.5); }
.footer-brand p { font-size: 0.88rem; color: rgba(255,255,255,0.6); line-height: 1.7; }
.footer-links h4 { color: white; font-size: 0.95rem; margin-bottom: var(--space-md); }
.footer-links ul li { margin-bottom: var(--space-sm); }
.footer-links ul li a {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    transition: color var(--transition);
}
.footer-links ul li a:hover { color: var(--secondary); }
.footer-disclaimer { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-top: var(--space-md); line-height: 1.5; }
.footer-bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}
.footer-bottom p { font-size: 0.82rem; color: rgba(255,255,255,0.4); margin: 0; }

/* === Reveal on Scroll === */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .code-detail-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .about-grid.reverse { direction: ltr; }
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--space-lg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        gap: var(--space-md);
    }
    .nav-links.active { display: flex; }
    .nav-search-btn { display: none; }

    .hero { padding: var(--space-2xl) 0; }
    .hero-stats { gap: var(--space-lg); }
    .hero-search { flex-direction: column; }
    .hero-search button { justify-content: center; padding: var(--space-md); }

    .section { padding: var(--space-2xl) 0; }
    .chapters-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    .features-grid { grid-template-columns: 1fr; }

    .code-detail-header { flex-direction: column; }
    .code-detail-badge { font-size: 1.2rem; }

    .search-box { flex-direction: column; }
    .search-box button { justify-content: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 var(--space-md); }
    .hero-stats { flex-direction: column; gap: var(--space-md); }
    .hero-stat { text-align: center; }
}