/* ===================================
   PROJECT 4: NEURAL RADIANCE FIELDS
   Color Theme: Clean & Professional
   Minimal, focused design
   =================================== */

:root {
    /* Clean Neutral Palette */
    --bg: #fafafa;                  /* Light gray background */
    --bg-card: #ffffff;             /* White cards */
    --bg-code: #f5f5f5;             /* Light code background */

    --text: #1a1a1a;                /* Dark text */
    --text-muted: #666666;          /* Muted text */
    --text-light: #999999;          /* Light text */

    --accent: #2563eb;              /* Clean blue accent */
    --accent-light: #3b82f6;        /* Lighter blue */
    --accent-dark: #1e40af;         /* Darker blue */

    --border: #e5e5e5;              /* Light border */
    --border-dark: #d4d4d4;         /* Darker border */

    --success: #10b981;             /* Green */
    --warning: #f59e0b;             /* Amber */
    --error: #ef4444;               /* Red */

    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* ===================================
   GLOBAL STYLES
   =================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-dark);
}

h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
}

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

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

/* ===================================
   HEADER
   =================================== */

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0;
    margin-bottom: 0;
    box-shadow: 0 1px 3px var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-info {
    text-align: center;
    margin-bottom: 3rem;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
    transform: translateX(-3px);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

/* ===================================
   OVERVIEW GRID
   =================================== */

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.75rem;
    transition: all 0.2s ease;
}

.overview-card:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
    border-color: var(--accent);
}

.overview-card h3 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.overview-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.part-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.part-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.part-nav-item:hover {
    background: var(--bg-card);
    border-color: var(--accent);
}

.part-nav-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.part-nav-title {
    color: var(--text);
    flex: 1;
}

/* ===================================
   NAVIGATION (TOC)
   =================================== */

.toc {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.toc a {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toc a:hover {
    color: var(--accent);
    background: var(--bg-card);
    border-color: var(--accent);
}

/* ===================================
   MAIN CONTENT
   =================================== */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.info-section {
    margin-bottom: 4rem;
}

.content-centered {
    max-width: 900px;
    margin: 0 auto;
}

/* ===================================
   CODE BLOCKS
   =================================== */

.code-block {
    margin: 1.5rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.code-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: var(--bg-code);
    cursor: pointer;
    user-select: none;
    margin: 0;
    transition: background 0.2s ease;
}

.code-toggle:hover {
    background: var(--bg);
}

.toggle-icon {
    color: var(--accent);
    font-size: 0.8rem;
}

.code-content {
    border-top: 1px solid var(--border);
}

.code-content pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
    background: #1e1e1e;
}

.code-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

code.code-inline {
    background: var(--bg-code);
    color: var(--accent-dark);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

/* ===================================
   BOXES
   =================================== */

.result-box {
    background: var(--bg-code);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: 0.75rem 0;
    border-radius: 4px;
}

.result-box h4 {
    color: var(--accent-dark);
    margin-top: 0;
}

.observation-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.observation-box h4 {
    color: var(--text);
    margin-top: 0;
}

.observation-box ul {
    margin-left: 1.5rem;
    color: var(--text-muted);
}

.observation-box ul li {
    margin-bottom: 0.5rem;
}

/* ===================================
   FIGURES & IMAGES
   =================================== */

figure {
    margin: 2rem 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

figure img.clickable {
    cursor: pointer;
}

figure img.clickable:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
}

figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===================================
   LIGHTBOX
   =================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 4px;
}

.lightbox .close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
}

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

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }

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

    .part-nav-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 2rem 1rem;
    }
}
