/**
 * ============================================================================
 * DOTNET-GUIDE.COM - MAIN.CSS (UPDATED)
 * ============================================================================
 * Complete design system with enhanced styling per user specifications
 * Features: Sticky header, improved discla

imer, light mode hero fix, gradient links
 * ============================================================================
 */

/* ========================================================================== */
/* CSS RESET & BASE STYLES                                                    */
/* ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================================================== */
/* CSS CUSTOM PROPERTIES (Design Tokens) - UPDATED                           */
/* ========================================================================== */

:root {
    /* Brand Colors */
    --primary: #5A3AE6;
    --primary-dark: #4227B6;
    --primary-darker: #3B22A1;
    --primary-darkest: #2A1F52;
    --primary-light: #7C5FF0;
    
    /* Accent Colors */
    --accent-text: #035A6A;
    --accent-fill: #06B6D4;
    --accent-hover: #0891B2;
    
    /* Status Colors */
    --success-fill: #10B981;
    --success-text: #065F46;
    --warning-fill: #F59E0B;
    --warning-text: #78350F;
    --danger-fill: #EF4444;
    --danger-text: #7F1D1D;
    --info-fill: #3B82F6;
    --info-text: #1E3A8A;
    
    /* Text Colors - Light Mode */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;
    
    /* Background Colors - Light Mode */
    --bg-page: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-secondary: #F1F5F9;
    --bg-hero-light: linear-gradient(180deg, #EEF2FF 0%, #E8F6FF 60%, #EAF1FF 100%);
    --bg-disclaimer: rgba(90,58,230,0.10);
    
    /* Border Colors - Light Mode */
    --border-light: #E5E7EB;
    --border-medium: #CBD5E1;
    --border-dark: #94A3B8;
    --border-disclaimer: rgba(90,58,230,0.20);
    
    /* Shadows - Light Mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-disclaimer: 0 1px 6px rgba(0,0,0,0.06);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 4px 8px rgba(0,0,0,0.12);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    
    /* Font Sizes - Base (Mobile) */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Header/Footer Text Sizes - Mobile */
    --nav-link-size: 0.9375rem; /* 15px */
    --footer-text-size: 0.875rem; /* 14px */
    --card-heading-size: 1.1875rem; /* 19px */
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    --radius-disclaimer: 10px;
    
    /* Container Widths */
    --container-max: 1200px;
    --container-wide: 1280px;
    
    /* Section Padding - Mobile */
    --section-padding-y: 2.5rem; /* 40px */
}

/* Global text font */
html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Make form controls inherit the text font & size */
button, input, select, textarea {
  font: inherit;            /* font-family, size, weight, line-height */
}

/* Ensure our icon buttons and any SVGs inherit too */
.icon-button, .nav-link svg, svg {
  font-family: inherit;
}

/* Code fonts – inline and blocks */
code, kbd, samp, pre {
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, 'Courier New', monospace !important;
}

/* Inline code that doesn't have Prism language classes */
code:not([class*="language-"]) {
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, 'Courier New', monospace !important;
  font-size: 0.9375rem;
}

/* Buttons: match site size so tools don’t report 13.333px */
button { font-size: 1rem; line-height: 1.25; }

/* Desktop Font Sizes & Spacing */
@media (min-width: 1024px) {
    :root {
        --nav-link-size: 1.03125rem; /* 16.5px */
        --footer-text-size: 0.96875rem; /* 15.5px */
        --card-heading-size: 1.28125rem; /* 20.5px */
        --section-padding-y: 4rem; /* 64px */
    }
}

/* ========================================================================== */
/* DARK MODE VARIABLES                                                        */
/* ========================================================================== */

[data-theme="dark"] {
    /* Text Colors - Dark Mode */
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-inverse: #0F172A;
    
    /* Background Colors - Dark Mode */
    --bg-page: #0B1020;
    --bg-surface: #1E293B;
    --bg-surface-secondary: #334155;
    --bg-hero-light: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    --bg-disclaimer: rgba(90,58,230,0.15);
    
    /* Border Colors - Dark Mode */
    --border-light: #1F2937;
    --border-medium: #374151;
    --border-dark: #4B5563;
    --border-disclaimer: rgba(90,58,230,0.30);
    
    /* Shadows - Dark Mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.25);
    --shadow-disclaimer: 0 1px 6px rgba(0,0,0,0.4);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.35);
    --shadow-card-hover: 0 4px 8px rgba(0,0,0,0.5);
}

/* ========================================================================== */
/* BASE TYPOGRAPHY                                                            */
/* ========================================================================== */

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    line-height: 1.8;
}

a {
    color: var(--accent-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ========================================================================== */
/* SKIP TO CONTENT (Accessibility)                                            */
/* ========================================================================== */

.skip-to-content {
    position: absolute;
    top: -9999px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: var(--space-3) var(--space-6);
    background: var(--primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.skip-to-content:focus {
    top: var(--space-4);
    outline: 3px solid rgba(90, 58, 230, 0.35);
    outline-offset: 3px;
}

/* ========================================================================== */
/* HEADER - STICKY WITH DISCLAIMER                                           */
/* ========================================================================== */

.site-header {
    position: fixed; /* Changed from sticky to fixed */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Header spacer to prevent content jump */
.header-spacer {
  display: block;
  height: 0;    /* JS will set the real height */
}

/* Header scroll state with enhanced shadow */
.site-header.is-scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .site-header.is-scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Independence Disclaimer - UPDATED CENTERING & COLORS */
.independence-disclaimer {
    background: var(--bg-disclaimer);
    border-bottom: 1px solid var(--border-disclaimer);
    border-radius: var(--radius-disclaimer);
    box-shadow: var(--shadow-disclaimer);
    padding: 10px 12px;
    text-align: center; /* CENTERED */
    position: relative;
}

.disclaimer-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center; /* CENTERED */
    gap: var(--space-3);
}

.disclaimer-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.5;
}

[data-theme="dark"] .disclaimer-text {
    color: #E5E7EB;
}

.disclaimer-text strong {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.disclaimer-close {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.disclaimer-close:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .disclaimer-close:hover {
    background: rgba(255,255,255,0.1);
}

.disclaimer-close:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Header Container */
.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

/* Logo Section - UPDATED WITH FAVICON LOGO */
.header-logo {
    display: flex;
    align-items: center;
    gap: 8px; /* 6-8px gap as specified */
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.header-logo:hover {
    opacity: 0.85;
}

.header-logo:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-md);
}

.header-logo-icon {
    width: 30px; /* Render at 28-32px as specified */
    height: 30px;
    flex-shrink: 0;
    border-radius: 12px; /* 12-14px corner radius as specified */
    overflow: hidden;
}

.header-logo-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.header-logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Navigation */
.header-nav {
    display: none;
    align-items: center;
    gap: var(--space-2);
}

@media (min-width: 768px) {
    .header-nav {
        display: flex;
    }
}

.nav-link {
    font-size: var(--nav-link-size); /* Responsive sizing */
    font-weight: 500;
    color: var(--accent-text);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    position: relative;
}

/* GRADIENT LINK HOVER EFFECT */
.nav-link:hover {
    background: linear-gradient(90deg, #06B6D4 0%, #5A3AE6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-4);
    right: var(--space-4);
    height: 2px;
    background: linear-gradient(90deg, #06B6D4 0%, #5A3AE6 100%);
    transform: translateY(2px);
}

.nav-link:active,
.nav-link:focus {
    color: var(--primary-darker);
    outline: 2px solid rgba(90,58,230,0.35);
    outline-offset: 3px;
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-action-btn {
    background: transparent;
    border: none;
    padding: var(--space-2);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-action-btn:hover {
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
}

.header-action-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    background: transparent;
    border: none;
    padding: var(--space-2);
    color: var(--text-primary);
    cursor: pointer;
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* ========================================================================== */
/* HERO SECTION - FIXED LIGHT MODE                                          */
/* ========================================================================== */

.hero {
    background: var(--bg-hero-light); /* UPDATED: Inverted gradient for light mode */
    padding: var(--section-padding-y) var(--space-4);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #0B1020 0%, #1E293B 100%);
}

.hero-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.hero-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.hero-title .highlight {
    background: linear-gradient(90deg, #5A3AE6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto var(--space-8);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-12);
}

/* Hero Stats - UPDATED LABELS */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-8);
    max-width: 600px;
    margin: 0 auto;
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-light);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: clamp(2rem, 4vw, 2.75rem); /* Increased by 10% */
    font-weight: 700;
    color: var(--accent-fill);
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em; /* Added tracking for hierarchy */
    font-weight: 600;
    color: var(--text-muted);
}

/* ========================================================================== */
/* BUTTONS - ENHANCED                                                         */
/* ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* icon gap */
    padding: 12px 18px; /* min-height 44px equivalent */
    min-height: 44px;
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(90,58,230,0.35); /* focus ring */
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-surface-secondary);
    border-color: var(--primary);
}

.btn-large {
    padding: 14px 24px;
    font-size: var(--text-lg);
}

/* ========================================================================== */
/* SECTIONS                                                                   */
/* ========================================================================== */

section {
    padding: var(--section-padding-y) var(--space-4);
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-3);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-muted);
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-12);
}

/* ========================================================================== */
/* WELCOME SECTION                                                            */
/* ========================================================================== */

.welcome-section {
    background: var(--bg-surface);
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
}

.welcome-content p {
    font-size: var(--text-lg);
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* ========================================================================== */
/* CATEGORIES GRID - ENHANCED CARDS                                          */
/* ========================================================================== */

.categories-section {
    background: var(--bg-page);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
    max-width: var(--container-wide); /* Can go wider */
}

/* ENHANCED CATEGORY CARDS */
.category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light); /* Added border */
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card); /* Subtle shadow */
}

.category-card:hover {
    transform: translateY(-1px); /* Subtle lift */
    box-shadow: var(--shadow-card-hover); /* Shadow bump */
    border-color: var(--primary);
}

[data-theme="dark"] .category-card {
    border-color: var(--border-light);
    box-shadow: var(--shadow-card);
}

[data-theme="dark"] .category-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.category-icon {
    margin-bottom: var(--space-4);
}

.category-title {
    font-size: var(--card-heading-size); /* Responsive */
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.category-link {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.2s ease;
}

/* GRADIENT LINK HOVER FOR CATEGORIES */
.category-link:hover {
    background: linear-gradient(90deg, #06B6D4 0%, #5A3AE6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-link .link-arrow {
    transition: transform 0.2s ease;
    color: var(--accent-fill);
}

.category-link:hover .link-arrow {
    transform: translateX(4px);
}

.category-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.category-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* REMOVED TUTORIAL COUNTS */
.category-count {
    display: none; /* Hide tutorial counts */
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-updated {
    background: rgba(90, 58, 230, 0.1);
    color: var(--primary);
}

.badge-popular {
    background: rgba(6, 182, 212, 0.1);
    color: #035A6A;
}

.badge-recently {
    background: rgba(16, 185, 129, 0.1);
    color: #065F46;
}

.badge-trending {
    background: rgba(139, 92, 246, 0.1);
    color: #5B21B6;
}

.badge-essential {
    background: rgba(245, 158, 11, 0.1);
    color: #78350F;
}

.badge-new {
    background: rgba(239, 68, 68, 0.1);
    color: #7F1D1D;
}

.badge-cloud {
    background: rgba(14, 165, 233, 0.1);
    color: #075985;
}

.badge-archived {
    background: rgba(100, 116, 139, 0.1);
    color: #334155;
}

/* ========================================================================== */
/* CTA SECTION - UPDATED BACKGROUND                                          */
/* ========================================================================== */

.cta-section {
    background: linear-gradient(135deg, #5A3AE6 0%, #3B22A1 60%, #2A1F52 100%);
    padding: var(--space-16) var(--space-4);
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-4);
}

.cta-description {
    font-size: var(--text-xl);
    color: rgba(255,255,255,0.9);
    margin-bottom: var(--space-8);
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

/* CTA Button Variants */
.cta-section .btn-primary {
    background: white;
    color: var(--primary);
}

.cta-section .btn-primary:hover {
    background: #F1F5F9;
    transform: translateY(-1px);
}

.cta-section .btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

.cta-section .btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: white;
}

/* ========================================================================== */
/* FOOTER - ENHANCED WITH GRADIENT LINKS                                     */
/* ========================================================================== */

.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    padding: var(--space-16) var(--space-4) var(--space-8);
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.footer-column h3 {
    font-size: var(--footer-text-size); /* Responsive */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    font-size: var(--footer-text-size); /* Responsive */
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: inline-block;
}

/* GRADIENT FOOTER LINKS */
.footer-links a:hover {
    background: linear-gradient(90deg, #06B6D4 0%, #5A3AE6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(2px);
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-6);
    text-align: center;
}

.footer-legal {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer-disclaimer-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 800px;
    margin: var(--space-4) auto 0;
    line-height: 1.6;
}

/* ========================================================================== */
/* ANIMATIONS                                                                 */
/* ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================================================== */
/* MOBILE RESPONSIVE                                                          */
/* ========================================================================== */

@media (max-width: 640px) {
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-title {
        font-size: var(--text-2xl);
    }
    
    .cta-description {
        font-size: var(--text-base);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================== */
/* UTILITY CLASSES                                                            */
/* ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================================================== */
/* PRINT STYLES                                                               */
/* ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .hero-actions,
    .cta-section,
    .skip-to-content,
    .independence-disclaimer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* ========================================================================== */
/* MOBILE NAVIGATION                                                          */
/* ========================================================================== */

.mobile-nav {
    position: fixed;
    top: var(--header-height, 60px); /* Position below header */
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    padding: var(--space-4) 0;
    max-height: calc(100vh - var(--header-height, 60px));
    overflow-y: auto;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none !important;
    }
}

.mobile-nav .nav-link {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    display: block;
    width: 100%;
}

.mobile-nav .nav-link:hover {
    background: var(--bg-surface-secondary);
}

/* ========================================================================== */
/* SEARCH MODAL                                                               */
/* ========================================================================== */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
}

.search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s ease-out;
}

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.search-modal-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.search-modal-close {
    background: transparent;
    border: none;
    padding: var(--space-2);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-close:hover {
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
}

.search-modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

/* ========================================================================== */
/* BACK TO TOP BUTTON                                                         */
/* ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.back-to-top:focus {
    outline: 3px solid rgba(90,58,230,0.35);
    outline-offset: 3px;
}

/* ===== Tutorial readability & spacing fixes (2025-01-xx) ===== */

/* Slightly wider readable width */
.tutorial-container { max-width: 960px; }

/* More breathing room between sections and inside cards */
.tutorial-section {
  padding: var(--space-10) var(--space-8);
  margin-bottom: var(--space-10);
  border-color: rgba(0,0,0,.08);
}

/* Vertical rhythm: add space between any adjacent elements in a section */
.tutorial-section > * + * { margin-top: var(--space-4); }

/* Headings get crisper separation */
.tutorial-section h2 {
  border-bottom-color: var(--border-medium);
  margin-bottom: var(--space-6);
}
.tutorial-section h3 { margin-top: var(--space-8); }

/* Paragraphs scale a touch for readability */
.tutorial-section p {
  font-size: 1.0625rem;       /* ~17px */
  line-height: 1.85;
}

/* Lists: proper indent, air between items */
.tutorial-section ul,
.tutorial-section ol {
  margin: var(--space-5) 0 var(--space-6) var(--space-6);
  padding: 0;
  list-style-position: outside;
}
.tutorial-section li { line-height: 1.8; }
.tutorial-section li + li { margin-top: 0.5rem; }

/* Callouts (tip/info/warning) sit on their own lines */
.tutorial-section .tip-box,
.tutorial-section .info-box,
.tutorial-section .warning-box { margin-top: var(--space-6); }

/* Code blocks: extra air around, keep shadow from feeling heavy */
.code-block-wrapper {
  margin-top: var(--space-6);
  margin-bottom: var(--space-8);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

/* TOC: tighter row gap but more inner padding so it feels balanced */
.toc-block { padding: var(--space-8) var(--space-8); }
.toc-list li { margin-bottom: var(--space-2); }

/* Meta row: loosen the spacing a bit */
.tutorial-meta { gap: var(--space-6); }

/* Section headings color tweak for better contrast in light mode */
.tutorial-section h2 { color: #1a202c; }

/* --- Dark mode mirrors --- */
[data-theme="dark"] .tutorial-section {
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .tutorial-section h2 {
  border-bottom-color: rgba(255,255,255,.12);
}

/* Ad containers */
.ad-slot {
  margin: 24px auto 12px auto; /* Reduced bottom margin for tighter post-ad spacing */
  box-sizing: border-box;      /* Ensures consistent sizing with any padding/borders */
}

.ad-slot[role="complementary"] { 
  contain: layout paint;       /* tiny perf win */
}

.ad-slot iframe { 
  display: block; 
  width: 100%; 
  border: 0; 
  margin: 0;                   /* Explicitly zero out any iframe margins */
  padding: 0;                  /* Prevent padding bleed */
}

/* smaller default heights on narrow screens if you don't set data-ad-height-sm/md */
@media (max-width: 480px) {
  .ad-slot:not([data-ad-aspect]) { 
    min-height: 200px; 
  }
  .ad-slot {
    margin: 16px auto 8px auto; /* Even tighter on mobile for better flow */
  }
}

@media (max-width: 640px) {
    .back-to-top {
        bottom: var(--space-4);
        right: var(--space-4);
        width: 44px;
        height: 44px;
    }
}
