/* ── Shared Project Page Styles ── */
/* Matching the index.html theme: Inter + JetBrains Mono, CSS custom properties, light/dark */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

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

/* ── Light theme (default) ── */
:root {
    --bg: #ffffff;
    --bg-surface: #f5f6f8;
    --bg-card: #ffffff;
    --border: #e0e3e8;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-dim: #888;
    --accent: #8C1515;
    --accent-hover: #6f1111;
    --nav-bg: rgba(255,255,255,0.92);
    --card-shadow: rgba(0,0,0,0.06);
    --toggle-bg: #f0f0f0;
}

/* ── Dark theme ── */
[data-theme="dark"] {
    --bg: #0c0c0c;
    --bg-surface: #141414;
    --bg-card: #161616;
    --border: #2a2a2a;
    --text: #e4e4e4;
    --text-secondary: #aaa;
    --text-dim: #666;
    --accent: #d14a52;
    --accent-hover: #e0656c;
    --nav-bg: rgba(12,12,12,0.92);
    --card-shadow: rgba(0,0,0,0.3);
    --toggle-bg: #222;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    transition: background 0.3s, color 0.3s;
}

/* ── Sticky Nav ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    transition: background 0.3s, border-color 0.3s;
}
.nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
}
.nav-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-links a {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78em;
    font-weight: 500;
    padding: 6px 4px;
    margin: 0 8px;
    letter-spacing: 0.02em;
    transition: color 0.15s;
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--accent); }
.nav-dot { color: var(--accent); }

/* shared site footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 32px; display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; font-family: 'JetBrains Mono', monospace; font-size: 0.78em; }
.site-footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.15s; }
.site-footer a:hover { color: var(--accent); }
.site-footer .copy { color: var(--text-dim); }
.nav-cv {
    background: var(--accent) !important;
    color: #fff !important;
    margin-left: 6px;
}
.nav-cv:hover { background: var(--accent-hover) !important; }

/* ── Theme Toggle ── */
.theme-toggle {
    background: var(--toggle-bg);
    border: 1px solid var(--border);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    margin-left: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ── Page container ── */
.page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ── Project Header ── */
.project-header {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s;
}

.project-header h1 {
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-top: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8em;
}

.status-badge {
    background: var(--accent);
    color: #fff;
    padding: 4px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ── Sections ── */
.section,
.page > section {
    padding: 48px 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s;
}
.section:last-child,
.page > section:last-child { border-bottom: none; }

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 24px;
}
.section-title::after {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--accent);
    margin-top: 8px;
}

.description {
    font-size: 0.98em;
    color: var(--text-secondary);
    line-height: 1.8;
}
.description strong { color: var(--text); }
.description p + p { margin-top: 16px; }

/* ── Features list ── */
.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.features-list li {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-left: 3px solid var(--accent);
    color: var(--text-secondary);
    line-height: 1.7;
    transition: background 0.3s, border-color 0.3s;
}

.features-list li strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
    font-size: 0.95em;
}

/* ── Tech tags ── */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    padding: 4px 14px;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78em;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: border-color 0.3s, color 0.3s;
}

/* ── Team grid ── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.team-member {
    background: var(--bg-surface);
    padding: 18px 20px;
    border-left: 3px solid var(--accent);
    transition: background 0.3s, border-color 0.3s;
}

.team-member h3 {
    font-size: 1em;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-member .role {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78em;
    color: var(--accent);
    margin-bottom: 4px;
}

.team-member .affiliation {
    font-size: 0.88em;
    color: var(--text-secondary);
}

/* ── Image Gallery ── */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.gallery-item {
    overflow: visible;
    position: relative;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.gallery-item:hover {
    z-index: 60;
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background: var(--bg-surface);
    display: block;
    cursor: zoom-in;
    position: relative;
    transform-origin: center center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover img {
    transform: scale(1.7);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    z-index: 60;
}

.image-caption {
    padding: 12px 16px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.85em;
    text-align: center;
    transition: background 0.3s;
}

.gallery-item video {
    width: 100%;
    height: 280px;
    object-fit: contain;
    background: #000;
    display: block;
}

/* ── Disclaimer ── */
.disclaimer {
    background: #fffbe6;
    border-left: 3px solid #e6c200;
    padding: 14px 20px;
    color: #7a6400;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 8px;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.disclaimer strong { color: #7a6400; }
[data-theme="dark"] .disclaimer {
    background: #1c1a0e;
    border-left-color: #8a7500;
    color: #c9b23a;
}
[data-theme="dark"] .disclaimer strong { color: #c9b23a; }

/* ── Video ── */
.video-container {
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.3s;
}
.video-container video,
.video-container iframe {
    width: 100%;
    display: block;
}

/* ── References ── */
.footnote {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85em;
    vertical-align: super;
    font-weight: 600;
}
.footnote:hover { text-decoration: underline; }

.references-list {
    list-style: decimal;
    margin-left: 25px;
}

.references-list li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 8px;
}

.references-list li em { color: var(--text-dim); }
.references-list li a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 4px;
}
.references-list li a:hover { text-decoration: underline; }

/* ── Footer ── */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 32px;
    text-align: center;
    transition: background 0.3s, border-color 0.3s;
    margin-top: 20px;
}
.footer a {
    color: var(--text);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82em;
    transition: color 0.2s;
}
.footer a:hover { color: var(--accent); }

/* ── Scroll Animations ── */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .page { padding: 0 16px; }
    nav { padding: 0 16px; }
    .nav-links a { padding: 6px 8px; font-size: 0.72em; }
    .project-header h1 { font-size: 1.7em; }
    .project-meta { flex-direction: column; gap: 8px; }
    .team-grid { grid-template-columns: 1fr; }
    .image-gallery { grid-template-columns: 1fr; }
}


/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
    padding: 40px 24px 64px;
}

.lightbox.open { display: flex; }

.lightbox img {
    max-width: 95vw;
    max-height: 88vh;
    object-fit: contain;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ddd;
    font-size: 0.85em;
    padding: 0 24px;
}
