/* ============================================
   James McNeil Portfolio - Modern CSS
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-bg: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-card: #16161f;
    --color-bg-card-hover: #1c1c28;
    --color-surface: #1e1e2a;
    --color-border: #2a2a3a;
    --color-border-hover: #3a3a4f;
    --color-text: #e4e4ed;
    --color-text-secondary: #9494aa;
    --color-text-muted: #6a6a80;
    --color-primary: #6c63ff;
    --color-primary-light: #8b83ff;
    --color-primary-dark: #4f47cc;
    --color-accent: #00d4aa;
    --color-accent-secondary: #ff6b6b;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.15);
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    --max-width: 1200px;
}

/* --- Light Mode --- */
[data-theme="light"] {
    --color-bg: #f5f5fa;
    --color-bg-secondary: #eeeef4;
    --color-bg-card: #ffffff;
    --color-bg-card-hover: #f0f0f6;
    --color-surface: #f8f8fc;
    --color-border: #d8d8e4;
    --color-border-hover: #c0c0d0;
    --color-text: #1a1a2e;
    --color-text-secondary: #4a4a6a;
    --color-text-muted: #8888a0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.1);
}

[data-theme="light"] .navbar {
    background: rgba(245, 245, 250, 0.8);
}

[data-theme="light"] .navbar-scrolled {
    background: rgba(245, 245, 250, 0.92);
}

[data-theme="light"] .nav-links {
    background: rgba(245, 245, 250, 0.95);
}

[data-theme="light"] .settings-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle-btn:hover {
    color: var(--color-text);
}

/* --- Color Themes --- */
[data-color="purple"] {
    --color-primary: #6c63ff;
    --color-primary-light: #8b83ff;
    --color-primary-dark: #4f47cc;
    --color-accent: #00d4aa;
    --color-accent-secondary: #ff6b6b;
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.15);
}

[data-color="blue"] {
    --color-primary: #3b82f6;
    --color-primary-light: #60a5fa;
    --color-primary-dark: #2563eb;
    --color-accent: #06b6d4;
    --color-accent-secondary: #f59e0b;
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
}

[data-color="green"] {
    --color-primary: #10b981;
    --color-primary-light: #34d399;
    --color-primary-dark: #059669;
    --color-accent: #8b5cf6;
    --color-accent-secondary: #f43f5e;
    --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.15);
}

[data-color="rose"] {
    --color-primary: #f43f5e;
    --color-primary-light: #fb7185;
    --color-primary-dark: #e11d48;
    --color-accent: #06b6d4;
    --color-accent-secondary: #a855f7;
    --shadow-glow: 0 0 30px rgba(244, 63, 94, 0.15);
}

[data-color="amber"] {
    --color-primary: #f59e0b;
    --color-primary-light: #fbbf24;
    --color-primary-dark: #d97706;
    --color-accent: #6366f1;
    --color-accent-secondary: #14b8a6;
    --shadow-glow: 0 0 30px rgba(245, 158, 11, 0.15);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3 {
    line-height: 1.2;
    font-weight: 700;
}

/* --- Loading Screen --- */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1.5rem;
}

.loader {
    width: 200px;
    height: 3px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.loader-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 3px;
    animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.loader-text {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.25rem 0;
    transition: all var(--transition-normal);
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar-scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
}

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

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--color-primary-light);
    background: rgba(108, 99, 255, 0.1);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Page Layout --- */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    margin-top: 4rem;
}

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Section Header --- */
.section-header {
    margin-bottom: 3rem;
}

.section-header h1,
.section-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* --- Settings Modal --- */
.settings-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.settings-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn var(--transition-fast) ease;
}

.settings-modal {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: modalSlide var(--transition-normal) ease;
}

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

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.settings-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.settings-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    line-height: 1;
}

.settings-close:hover {
    color: var(--color-text);
}

.settings-section {
    margin-bottom: 1.25rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.theme-toggle {
    display: flex;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.theme-toggle-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.theme-toggle-btn:hover {
    color: var(--color-text-secondary);
}

.theme-toggle-btn.active {
    background: var(--color-bg-card);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.color-options {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: var(--color-border-hover);
}

.color-swatch.active {
    border-color: var(--color-text);
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-text);
}

.color-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.swatch-purple { background: #6c63ff; }
.swatch-blue { background: #3b82f6; }
.swatch-green { background: #10b981; }
.swatch-rose { background: #f43f5e; }
.swatch-amber { background: #f59e0b; }

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 50%;
    height: 80%;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.2);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.highlight {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    padding-top: 2rem;
}

.hero-experience-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.15), rgba(0, 212, 170, 0.1));
    border: 1px solid rgba(108, 99, 255, 0.3);
    transition: all var(--transition-normal);
}

.hero-experience-badge:hover {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(0, 212, 170, 0.15));
    border-color: rgba(108, 99, 255, 0.4);
    transform: translateY(-2px);
}

.experience-number {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.experience-label {
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(108, 99, 255, 0.4);
}

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

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-light);
    background: rgba(108, 99, 255, 0.05);
}

/* --- Featured & Projects Section --- */
.featured-section,
.categories-section {
    padding: 6rem 0;
}

.featured-section {
    background: var(--color-bg-secondary);
}

.section-cta {
    text-align: center;
    margin-top: 3rem;
}

/* --- Project Grid --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* --- Project Card --- */
.project-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-category {
    display: inline-block;
    width: fit-content;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    background: rgba(0, 212, 170, 0.1);
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.card-summary {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
}

.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary-light);
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.15);
}

.card-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.featured-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent-secondary);
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

/* --- Category Cards --- */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    padding: 2rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.category-count {
    font-size: 0.8rem;
    color: var(--color-primary-light);
    font-weight: 600;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    font-family: var(--font-sans);
}

.filter-btn:hover {
    border-color: var(--color-border-hover);
    color: var(--color-text);
    background: var(--color-bg-card-hover);
}

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

/* --- Projects Page --- */
.projects-page {
    padding: 4rem 0 4rem;
}

/* --- Project Detail --- */
.project-detail {
    padding: 4rem 0 4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-primary-light);
}

.detail-header {
    margin-bottom: 3rem;
}

.detail-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.detail-category {
    padding: 0.3rem 0.85rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    background: rgba(0, 212, 170, 0.1);
}

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

.detail-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
}

.detail-content p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    padding: 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.sidebar-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-primary-light);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.project-link:hover {
    background: rgba(108, 99, 255, 0.1);
}

/* --- CV CTA Button --- */
.cv-cta {
    margin-top: 2rem;
}

/* --- CV Page --- */
.cv-page {
    padding: 4rem 0 4rem;
}

.cv-embed {
    max-width: 210mm;
    margin: 0 auto;
    aspect-ratio: 210 / 297;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: white;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.3);
}

.cv-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* --- About Page --- */
.about-page {
    padding: 4rem 0 4rem;
}

.about-header {
    margin-bottom: 3rem;
}

.about-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 3rem;
}

.about-lead {
    font-size: 1.3rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    padding: 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.info-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.connect-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.connect-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.connect-link:hover {
    background: rgba(108, 99, 255, 0.1);
    color: var(--color-primary-light);
}

.link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(108, 99, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary-light);
}

.location-text {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* --- Contact Page --- */
.contact-page {
    padding: 4rem 0 4rem;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 800px;
}

.contact-card {
    padding: 2.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.contact-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.contact-icon {
    margin-bottom: 1.25rem;
}

.contact-icon .link-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.contact-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.contact-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* --- Play / Game Page --- */
.play-page {
    padding: 4rem 0 4rem;
}

.play-page.embedded {
    padding: 2rem 0 0 0;
}

/* Game Tabs */
.game-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: var(--color-bg-secondary);
    padding: 0.35rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.game-tab {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    font-family: var(--font-sans);
    position: relative;
    flex: 1;
    text-align: center;
    min-width: 140px;
}

.game-tab:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.03);
}

.game-tab.active {
    background: var(--color-bg-card);
    color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm), 0 0 12px rgba(108, 99, 255, 0.1);
}

.game-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
}

.game-tab-content {
    min-height: 400px;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}

.game-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-hud {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 100px;
}

.hud-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.hud-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-text);
}

.game-start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.game-title-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.game-start-screen h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.game-start-screen p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 500px;
    margin-bottom: 2rem;
}

/* --- Game Grid --- */
.game-field-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    max-width: 600px;
    outline: none;
}

.grid-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    font-size: 1.4rem;
    transition: background 0.15s ease;
    overflow: hidden;
}

/* Terrain types */
.terrain-grass {
    background: #1a2a1a;
}

.terrain-tallgrass {
    background: #1d2f1d;
}

.terrain-tallgrass::after {
    content: '·';
    position: absolute;
    color: rgba(0, 212, 170, 0.15);
    font-size: 1.5rem;
    pointer-events: none;
}

.terrain-flowers {
    background: #1f2a20;
}

.terrain-flowers::after {
    content: '✿';
    position: absolute;
    color: rgba(108, 99, 255, 0.12);
    font-size: 0.7rem;
    pointer-events: none;
}

.terrain-tree {
    background: #15201a;
}

.terrain-void {
    background: #080810;
}

/* Player */
.player-cell {
    background: rgba(108, 99, 255, 0.15) !important;
    box-shadow: inset 0 0 12px rgba(108, 99, 255, 0.2);
}

.player-sprite {
    font-size: 1.3rem;
    z-index: 2;
    animation: playerBob 1.5s ease-in-out infinite;
}

.tree-sprite {
    font-size: 1.3rem;
    z-index: 1;
}

@keyframes playerBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Creatures on grid */
.creature-cell {
    cursor: default;
}

.creature-cell.rarity-common {
    background: rgba(106, 106, 128, 0.08) !important;
}

.creature-cell.rarity-uncommon {
    background: rgba(76, 175, 80, 0.1) !important;
}

.creature-cell.rarity-rare {
    background: rgba(108, 99, 255, 0.12) !important;
}

.creature-cell.rarity-legendary {
    background: rgba(255, 215, 0, 0.12) !important;
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% { background: rgba(255, 215, 0, 0.08) !important; }
    50% { background: rgba(255, 215, 0, 0.18) !important; }
}

.creature-sprite {
    font-size: 1.3rem;
    z-index: 1;
    animation: creatureBounce 0.4s ease;
}

@keyframes creatureBounce {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Particle effects */
.particle-active {
    overflow: visible;
}

.particle-effect {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

.spawn-particle {
    color: var(--color-accent);
    font-size: 1rem;
    animation: spawnBurst 0.8s ease forwards;
}

.catch-particle {
    color: #ffd700;
    font-size: 1.2rem;
    animation: catchBurst 0.9s ease forwards;
}

@keyframes spawnBurst {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    50% { transform: scale(2) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(3) rotate(360deg); opacity: 0; }
}

@keyframes catchBurst {
    0% { transform: scale(1); opacity: 1; text-shadow: 0 0 8px rgba(255, 215, 0, 0.8); }
    40% { transform: scale(2.5); opacity: 1; text-shadow: 0 0 20px rgba(255, 215, 0, 1); }
    100% { transform: scale(0) translateY(-20px); opacity: 0; }
}

/* Mobile controls */
.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.controls-row {
    display: flex;
    gap: 0.25rem;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.control-btn:hover,
.control-btn:active {
    background: var(--color-bg-card-hover);
    border-color: var(--color-primary);
}

/* Minimap */
.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.minimap {
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.minimap h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.minimap-grid {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 1px;
    border-radius: 4px;
    overflow: hidden;
}

.minimap-cell {
    aspect-ratio: 1;
    background: var(--color-bg);
}

.minimap-player {
    background: var(--color-primary-light) !important;
    box-shadow: 0 0 3px var(--color-primary-light);
}

.minimap-creature {
    background: var(--color-text-muted) !important;
}

.minimap-tree {
    background: #1a3a1a !important;
}

.minimap-common {
    background: var(--color-text-muted) !important;
}

.minimap-uncommon {
    background: #4caf50 !important;
}

.minimap-rare {
    background: var(--color-primary-light) !important;
}

.minimap-legendary {
    background: #ffd700 !important;
    animation: minimapGlow 1s ease-in-out infinite;
}

@keyframes minimapGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Collection */
.collection-section {
    padding: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.collection-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.collection-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.collection-item.rarity-uncommon {
    border-color: rgba(76, 175, 80, 0.3);
}

.collection-item.rarity-rare {
    border-color: rgba(108, 99, 255, 0.3);
}

.collection-item.rarity-legendary {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

.collection-item .creature-emoji {
    font-size: 1rem;
}

.creature-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text);
}

/* --- Floppy Bird Game --- */
/* --- Floppy Bird Grid Game --- */
.flappy-field {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 450px;
    aspect-ratio: 15 / 20;
    outline: none;
    cursor: pointer;
}

.flappy-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flappy-sky-cell {
    background: #0d1a2a;
}

.flappy-bird-cell {
    background: #2a3a1a;
    box-shadow: inset 0 0 8px rgba(255, 215, 0, 0.3);
    font-size: 0.8rem;
}

.flappy-bird-cell::after {
    content: '🐦';
    font-size: 0.85rem;
}

.flappy-pipe-cell {
    background: linear-gradient(90deg, #2a6a2a, #3a8a3a, #2a6a2a);
}

.flappy-gap-cell {
    background: #0d1a2a;
}

.flappy-ground-cell {
    background: #2a4a2a;
}

.flap-btn {
    width: auto !important;
    padding: 0.75rem 2rem !important;
}

/* --- Snake Game --- */
.snake-field {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 500px;
    aspect-ratio: 1;
    outline: none;
}

.snake-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #0d1a0d;
    font-size: 0.7rem;
}

.snake-head {
    background: #1a5a1a !important;
    box-shadow: inset 0 0 8px rgba(0, 255, 0, 0.3);
}

.snake-body {
    background: #1a4a1a !important;
    position: relative;
}

.snake-body::after {
    content: '';
    display: block;
    width: 60%;
    height: 60%;
    background: #2a6a2a;
    border-radius: 2px;
}

.snake-food {
    background: rgba(255, 50, 50, 0.08) !important;
    animation: foodPulse 1s ease-in-out infinite;
}

@keyframes foodPulse {
    0%, 100% { background: rgba(255, 50, 50, 0.05) !important; }
    50% { background: rgba(255, 50, 50, 0.12) !important; }
}

/* --- Experiment Pages --- */
.experiment-page {
    padding: 4rem 0;
}

.experiment-page.embedded {
    padding: 2rem 0 0 0;
}

.experiment-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.experiment-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.experiment-controls .control-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.experiment-controls input[type="range"] {
    width: 120px;
    accent-color: var(--color-primary);
}

.experiment-btns {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-sm {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.8rem !important;
}

.particle-canvas {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 500px;
    background: #050510;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: crosshair;
}

.particle-desktop-only {
    display: block;
}

.particle-mobile-message {
    display: none;
}

.mobile-notice {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.mobile-notice-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.mobile-notice h3 {
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.mobile-notice p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    will-change: left, top, opacity;
}

.particle-trail {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.experiment-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-family: monospace;
}

/* --- ShaderLab --- */
.shader-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.shader-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.shader-presets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.shader-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shader-channel {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.channel-label {
    font-weight: 800;
    font-size: 0.85rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.channel-r { color: #ff6b6b; }
.channel-g { color: #00d4aa; }
.channel-b { color: #60a5fa; }

.shader-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.shader-input:focus {
    border-color: var(--color-primary);
}

.shader-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.shader-controls .control-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.shader-controls .control-group label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.shader-controls .control-group span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: monospace;
    min-width: 3rem;
}

.shader-controls input[type="range"] {
    width: 80px;
    accent-color: var(--color-primary);
}

.shader-error {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.25);
    border-radius: var(--radius-sm);
    color: #ff6b6b;
    font-size: 0.78rem;
    font-family: monospace;
}

.shader-canvas {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    background: #000;
}

.pixel-grid {
    display: grid;
    width: 100%;
    height: 100%;
}

.pixel {
    aspect-ratio: 1;
}

/* --- Experiments List Page --- */
.experiments-list-page {
    padding: 4rem 0;
}

.experiment-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.experiment-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.experiment-card:hover {
    border-color: var(--color-border-hover);
    background: var(--color-bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.experiment-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.experiment-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.experiment-card p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 0.75rem;
}

.experiment-card-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* --- Text Compare --- */
.compare-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.compare-input-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.compare-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compare-textarea {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
}

.compare-textarea:focus {
    border-color: var(--color-primary);
}

.compare-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.compare-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: auto;
}

.stat-added { color: #34d399; }
.stat-removed { color: #f87171; }
.stat-unchanged { color: var(--color-text-muted); }

.compare-output {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.compare-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.compare-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-added { background: rgba(52, 211, 153, 0.2); border: 1px solid rgba(52, 211, 153, 0.4); }
.legend-removed { background: rgba(248, 113, 113, 0.2); border: 1px solid rgba(248, 113, 113, 0.4); }
.legend-changed { background: rgba(251, 191, 36, 0.2); border: 1px solid rgba(251, 191, 36, 0.4); }

.compare-diff {
    padding: 0.5rem 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    max-height: 500px;
    overflow-y: auto;
}

.diff-line {
    display: flex;
    padding: 0 1rem;
}

.diff-marker {
    width: 1.5rem;
    flex-shrink: 0;
    text-align: center;
    font-weight: 700;
    user-select: none;
}

.diff-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-unchanged {
    color: var(--color-text-secondary);
}

.diff-added {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
}

.diff-added .diff-marker { color: #34d399; }

.diff-removed {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}

.diff-removed .diff-marker { color: #f87171; }

.diff-changed-removed {
    background: rgba(248, 113, 113, 0.05);
    color: var(--color-text-secondary);
}

.diff-changed-removed .diff-marker { color: #f87171; }

.diff-changed-added {
    background: rgba(52, 211, 153, 0.05);
    color: var(--color-text-secondary);
}

.diff-changed-added .diff-marker { color: #34d399; }

.word-removed {
    background: rgba(248, 113, 113, 0.3);
    color: #f87171;
    border-radius: 2px;
    padding: 0 1px;
}

.word-added {
    background: rgba(52, 211, 153, 0.3);
    color: #34d399;
    border-radius: 2px;
    padding: 0 1px;
}

/* --- Not Found --- */
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 4rem 2rem;
}

.not-found h1 {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.not-found p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 3rem 0;
    background: var(--color-bg-secondary);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

.footer-text {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* --- Blazor Error UI --- */
#blazor-error-ui {
    background: var(--color-accent-secondary);
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    display: none;
    left: 0;
    padding: 0.8rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
    font-size: 0.9rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 0.5rem;
}

.blazor-error-boundary {
    background: var(--color-accent-secondary);
    padding: 1rem;
    color: white;
    border-radius: var(--radius-md);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .detail-body {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .detail-sidebar,
    .about-sidebar {
        order: -1;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .game-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .minimap,
    .collection-section {
        flex: 1;
        min-width: 200px;
    }

    .shader-layout {
        grid-template-columns: 1fr;
    }
}

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

    .mobile-controls {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem 2rem;
        gap: 0.25rem;
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        padding: 3rem 1.5rem 3rem;
        min-height: auto;
    }

    .cv-embed {
        max-width: 100%;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        margin-bottom: 3rem;
    }

    .btn {
        justify-content: center;
    }

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

    .category-cards {
        grid-template-columns: 1fr;
    }

    .section-header h1,
    .section-header h2 {
        font-size: 1.75rem;
    }

    .detail-header h1 {
        font-size: 2rem;
    }

    .about-header h1 {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .featured-section,
    .categories-section {
        padding: 4rem 0;
    }

    .snake-field,
    .flappy-field,
    .game-field-grid {
        max-width: 100%;
    }

    .particle-canvas {
        height: 350px;
    }

    .particle-desktop-only {
        display: none;
    }

    .particle-mobile-message {
        display: block;
    }

    .compare-inputs {
        grid-template-columns: 1fr;
    }

    .experiment-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .experiment-btns {
        margin-left: 0;
    }

    .game-tabs {
        flex-direction: column;
    }

    .game-tab {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        padding-top: 1.5rem;
    }

    .hero-experience-badge {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
        padding: 1rem 1.25rem;
    }

    .experience-number {
        font-size: 2rem;
    }

    .experience-label {
        font-size: 0.75rem;
    }

    .stat {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }

    .filter-bar {
        gap: 0.375rem;
    }

    .filter-btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.8rem;
    }

    .game-tab-content {
        min-height: 300px;
    }

    .grid-cell {
        font-size: 0.9rem;
    }
}
