:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #f5f5f5;
    --border-color: #dddddd;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --accent-color: #1a1a1a;
    --border-color: #333333;
    --shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Intro */
header {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.subtitle {
    font-size: 1.25rem;
    color: #666;
    max-width: 600px;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

.stat-card {
    padding: 2rem;
    background: var(--accent-color);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    background: #000;
    color: #fff;
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Project Summary Section */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    text-transform: uppercase;
}

section {
    padding: 8rem 0;
}

.summary-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
}

.summary-content p {
    margin-bottom: 1.5rem;
}

/* Visualization Grid (3x5) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: var(--transition);
}

.gallery-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* Summary Statistics (Text View) */
.raw-stats {
    background: #f9f9f9;
    padding: 3rem;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    overflow-x: auto;
}

/* Footer / Dataset Links */
footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: 1px solid #000;
}

.btn:hover {
    background: #fff;
    color: #000;
}

/* Lightbox */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    place-items: center;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

#lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border: 5px solid #fff;
    display: block;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    font-size: 3rem;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-counter {
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 999;
    background: var(--accent-color);
    border: 1px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    background: var(--text-color);
    color: var(--bg-color);
}

/* ML Section Specific Styles */
.ml-intro {
    background: var(--accent-color);
    padding: 3rem;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.ml-intro h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.ml-visuals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.ml-visual-card {
    border: 1px solid var(--border-color);
    padding: 2rem;
    background: var(--accent-color);
    transition: var(--transition);
}

.ml-visual-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.ml-visual-card img {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

.ml-visual-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.ml-visual-card p {
    color: #666;
    line-height: 1.6;
}

[data-theme="dark"] .ml-visual-card p {
    color: #aaa;
}

[data-theme="dark"] .subtitle {
    color: #999;
}

[data-theme="dark"] .raw-stats {
    background: #1a1a1a;
}

[data-theme="dark"] .stat-card:hover {
    background: #fff;
    color: #000;
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ml-visuals {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}