:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #3b82f6;
    --accent-color: #f59e0b;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --max-width: 1100px;
    --radius: 16px;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #f1f5f9;
    --border-color: #cbd5e1;
}

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

html {
    scroll-behavior: smooth;
}

/* Accessibility - Visually hidden but available to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion preference */
@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;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-light);
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #e0f2fe 0%, transparent 40%); /* Subtle top highlight */
}

/* Typography */
h1, h2, h3 {
    line-height: 1.2;
    font-weight: 800; /* Bolder headings */
    letter-spacing: -0.02em; /* Tight tracking for modern look */
    color: var(--text-main);
}

h1 { font-size: 3.5rem; margin-bottom: 1rem; }
h2 { font-size: 2.25rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 1.1rem; line-height: 1.75; }

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1.5rem;
    border-radius: 9999px;
    transition: all 0.2s;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-disabled {
    background-color: #e2e8f0;
    color: #64748b !important;
    padding: 0.6rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    cursor: not-allowed;
    opacity: 0.8;
    align-self: flex-start;
    display: inline-block;
    border: 1px dashed #cbd5e1;
}

/* Sections */
section {
    padding: 4rem 3rem;
    max-width: var(--max-width);
    margin: 3rem auto;
    background-color: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Remove old zebra striping */
section:nth-of-type(2n+3) {
    background-color: var(--bg-white);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-header span {
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.75rem;
}

/* Grids */
.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem; /* Larger gap for vertical stacking */
}

/* For the 4 sidebars */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards & Images */
.img-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--bg-white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.img-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary-color);
}

.img-wrapper {
    width: 100%;
    background: linear-gradient(110deg, #f1f5f9 8%, #e2e8f0 18%, #f1f5f9 33%);
    background-size: 200% 100%;
    overflow: hidden;
    position: relative;
    line-height: 0;
    border-bottom: 1px solid var(--border-color);
}

.img-wrapper.loading {
    animation: shimmer 1.5s infinite linear;
}

.img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Caption below image */
.card-caption {
    padding: 1.5rem;
    background: var(--bg-white);
    flex-grow: 1;
}

.card-caption h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.card-caption p {
    font-size: 1rem;
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding-top: 8rem; /* More space for sticky nav */
    padding-bottom: 4rem;
    max-width: 1280px;
    background-color: transparent;
    box-shadow: none;
    border: none;
    margin-top: 0;
    margin-bottom: 0;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

/* Download Group */
.download-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.download-sources {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.download-source-label {
    font-weight: 500;
}

.download-source-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
}

.download-source-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.download-source-link.active {
    font-weight: 600;
}

.download-source-separator {
    color: var(--border-color);
}

.hero-image {
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 4px solid var(--border-color);
    max-width: 1000px;
    margin: 0 auto;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #dbeafe;
    color: #1e40af;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem;
    margin-top: 4rem;
    text-align: center;
}

/* Arrow separator */
.arrow-separator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    width: 15%;
    flex-shrink: 0;
}

.arrow-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
    line-height: 1.3;
}

.arrow-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    animation: bounceRight 2s ease-in-out 3;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 2rem;
    margin-bottom: 0;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:last-child .timeline-marker::after {
    display: none;
}

.timeline-left {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    padding-top: 0.25rem;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
}

.timeline-marker::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 12px;
    width: 2px;
    height: calc(100% + 2rem - 12px);
    border-left: 2px dashed var(--border-color);
}

.timeline-version {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline-right {
    flex: 1;
    min-width: 0;
}

.timeline-note {
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

@keyframes bounceRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 99;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .hero-btns { 
        flex-direction: column; 
        align-items: center;
        gap: 1rem;
    }
    
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 0.75rem;
        padding-left: 1.5rem;
    }
    
    .timeline-left {
        width: auto;
        display: flex;
        align-items: baseline;
        gap: 0.75rem;
    }
    
    .timeline-marker {
        left: -1.5rem;
    }
    
    .timeline-version {
        margin-bottom: 0;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    section {
        padding: 2rem 1.5rem;
        margin: 1.5rem auto;
    }
}
