:root {
    --dark:       #0a1020;
    --dark-blue:  #0f1932;
    --mid-blue:   #1a2a50;
    --purple:     #4b2870;
    --gold:       #daa520;
    --gold-light: #ffd764;
    --crimson:    #8b0000;
    --text:       #e8dfc8;
    --text-dim:   #9a8f78;
    --border:     rgba(218,165,32,0.3);
    --glow:       rgba(218,165,32,0.15);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 18px;
    overflow-x: hidden;
}

#starfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ─── NAV ─────────────────────────────────────────────── */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 48px;
    background: rgba(10,16,32,0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.nav-logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: var(--text);
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 36px;
}

.nav-links a {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold);
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animated X state */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO ────────────────────────────────────────────── */

.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    text-align: center;
}

.hero-inner {
    max-width: 820px;
    position: relative;
}

.pixel-border-top,
.pixel-border-bottom {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 24px 0;
}

.hero-sub {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(52px, 8vw, 96px);
    font-weight: 900;
    line-height: 1.1;
    color: var(--text);
    text-shadow: 0 0 60px rgba(218,165,32,0.2);
    margin-bottom: 12px;
}

.hero-title .of {
    color: var(--gold);
}

.pixel-word {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(28px, 5vw, 56px);
    color: var(--gold-light);
    text-shadow: 0 0 30px rgba(255,215,100,0.4), 3px 3px 0 rgba(0,0,0,0.5);
    display: inline-block;
}

.hero-desc {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-dim);
    max-width: 600px;
    margin: 24px auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ─── BUTTONS ─────────────────────────────────────────── */

.btn {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 2px;
    text-decoration: none;
    padding: 14px 32px;
    border: 2px solid;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--dark);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    box-shadow: 0 0 24px rgba(218,165,32,0.4);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 16px rgba(218,165,32,0.15);
}

/* Disabled state for Screencast button */
.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── DAY/NIGHT BAR ───────────────────────────────────── */

.day-night-bar {
    position: relative;
    margin-top: 60px;
    width: 320px;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: visible;
}

.day-night-inner {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--gold), #ffd764);
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(218,165,32,0.5);
    animation: dayNightSlide 8s ease-in-out infinite alternate;
}

@keyframes dayNightSlide {
    0%   { width: 10%; background: linear-gradient(90deg, #1a2a6c, #4b2870); }
    40%  { width: 50%; background: linear-gradient(90deg, var(--gold), #ffd764); }
    100% { width: 95%; background: linear-gradient(90deg, #ff7700, var(--crimson)); }
}

.day-label, .night-label {
    position: absolute;
    top: 14px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--text-dim);
}

.day-label { left: 0; }
.night-label { right: 0; }

/* ─── STATS STRIP ─────────────────────────────────────── */

.stats-strip {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(15,25,50,0.9);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 40px 24px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 0 48px;
}

.stat-num {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(24px, 4vw, 42px);
    color: var(--gold);
    text-shadow: 0 0 20px rgba(218,165,32,0.4);
    margin-bottom: 8px;
}

.stat-label {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.stat-divider {
    color: var(--border);
    font-size: 20px;
}

/* ─── SECTIONS ────────────────────────────────────────── */

section {
    position: relative;
    z-index: 1;
    padding: 100px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 64px;
}

.section-header h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: 2px;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border));
}

.section-header .section-line:first-child {
    background: linear-gradient(270deg, transparent, var(--border));
}

/* ─── ABOUT ME ────────────────────────────────────────── */

.about-me {
    max-width: 1100px;
    margin: 0 auto;
    padding: 100px 24px;
}

.about-me-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 64px;
    align-items: start;
}

.about-me-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.about-photo-frame {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 8px;
}

.about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
    position: relative;
    z-index: 1;
}

.about-photo-placeholder {
    position: absolute;
    inset: 0;
    background: var(--mid-blue);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 28px;
    color: var(--gold);
    z-index: 0;
}

.about-name {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 1px;
}

.about-course {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 1px;
}

.about-college {
    font-family: 'Crimson Text', serif;
    font-size: 15px;
    color: var(--text-dim);
}

.about-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 1px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.social-btn i { font-size: 16px; }

.social-btn.linkedin {
    color: #0a66c2;
    border-color: rgba(10,102,194,0.4);
}

.social-btn.linkedin:hover {
    background: rgba(10,102,194,0.15);
    border-color: #0a66c2;
    box-shadow: 0 0 16px rgba(10,102,194,0.2);
}

.social-btn.github {
    color: var(--text);
    border-color: rgba(255,255,255,0.15);
}

.social-btn.github:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.4);
}

.about-me-right {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.about-bio-title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.about-bio-text {
    color: var(--text-dim);
    line-height: 1.9;
    font-size: 18px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    background: rgba(15,25,50,0.6);
    transition: all 0.2s;
    cursor: default;
}

.skill-tag:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--glow);
}

/* ─── FEATURES ────────────────────────────────────────── */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    background: rgba(15,25,50,0.7);
    border: 1px solid var(--border);
    padding: 36px 32px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(218,165,32,0.5);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px var(--glow);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
}

.feature-icon i {
    font-size: 36px;
    color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(218,165,32,0.4));
    transition: transform 0.2s;
}

.feature-card:hover .feature-icon i {
    transform: scale(1.2);
}

.feature-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.feature-card p {
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Fixed: was var(--purple) = #4b2870 — near-invisible on dark bg */
.feature-tag {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: rgba(160, 110, 220, 0.85);
    letter-spacing: 1px;
    line-height: 1.8;
}

/* ─── TECH ────────────────────────────────────────────── */

.tech { background: rgba(5,10,20,0.5); max-width: 100%; padding: 100px 24px; }

.tech > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto 48px;
}

.tech-item {
    background: rgba(15,25,50,0.8);
    border: 1px solid var(--border);
    padding: 36px 28px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tech-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.tech-logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 20px;
    margin-bottom: 20px;
    display: block;
    line-height: 1.2;
}

.tech-logo span {
    display: block;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}

.cpp  { color: #659bd3; }
.sfml { color: #8bc34a; }
.aws  { color: #ff9900; }
.udp  { color: var(--gold); }

.tech-item p {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.7;
}

.tech-details {
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid var(--border);
    background: rgba(15,25,50,0.6);
}

.tech-detail-row {
    display: flex;
    gap: 24px;
    padding: 18px 32px;
    border-bottom: 1px solid rgba(218,165,32,0.08);
    align-items: baseline;
}

.tech-detail-row:last-child { border-bottom: none; }

.td-label {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 1px;
    min-width: 120px;
}

.td-val {
    color: var(--text-dim);
    font-size: 16px;
}

/* ─── GALLERY ─────────────────────────────────────────── */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 320px);
    gap: 16px;
}

.gallery-slot {
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    cursor: pointer;
}

.gallery-slot:hover {
    border-color: rgba(218,165,32,0.5);
    box-shadow: 0 0 20px var(--glow);
}

/* Images are visible by default */
.gallery-slot img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Dim image slightly on hover so the caption reads clearly */
.gallery-slot:hover img {
    opacity: 0.5;
}

/* Placeholder is now a caption overlay — hidden by default */
.gallery-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: rgba(5, 12, 28, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-slot:hover .gallery-placeholder {
    opacity: 1;
}

.gallery-icon { font-size: 36px; }

.gallery-placeholder p {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 1px;
}

.gallery-note {
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 15px;
    text-align: center;
}

.gallery-note code {
    font-family: monospace;
    color: var(--gold);
    background: rgba(218,165,32,0.08);
    padding: 2px 6px;
}

/* ─── ABOUT PROJECT ───────────────────────────────────── */

.about { text-align: center; }

.about-inner { max-width: 760px; margin: 0 auto; }

.about-text {
    color: var(--text-dim);
    line-height: 1.9;
    margin-bottom: 20px;
    font-size: 18px;
}

.about-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

/* ─── FOOTER ──────────────────────────────────────────── */

.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px;
    border-top: 1px solid var(--border);
}

.footer-line {
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 32px;
}

.footer-title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.footer-sub {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.footer-copy {
    color: rgba(218,165,32,0.4);
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    margin-top: 16px;
}

.gold { color: var(--gold); }

/* ─── REVEAL ANIMATIONS ───────────────────────────────── */

.reveal, .reveal-card, .reveal-stat {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible, .reveal-card.visible, .reveal-stat.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── LIGHTBOX ────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.open {
    opacity: 1;
    pointer-events: auto; /* Fixed: was 'all', which is not a valid value */
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.lightbox-img {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    image-rendering: pixelated;
    border: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.open .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 2;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 18px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-close:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ─── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 900px) {
    .about-me-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-me-left {
        margin: 0 auto;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .nav { padding: 14px 20px; }
    .nav-links { gap: 20px; }
    .stat { padding: 16px 24px; }
    .stat-divider { display: none; }
    .gallery-grid { grid-template-columns: 1fr 1fr; }
    .gallery-slot.large { grid-column: span 2; }
    .tech-detail-row { flex-direction: column; gap: 6px; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-slot.large { grid-column: span 1; }

    /* Show hamburger, hide flat nav links */
    .nav-hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 57px;
        left: 0; right: 0;
        flex-direction: column;
        background: rgba(10,16,32,0.97);
        border-bottom: 1px solid var(--border);
        padding: 20px 24px;
        gap: 16px;
        transform: translateY(-110%);
        transition: transform 0.3s ease;
        z-index: 99;
        /* Override the desktop 'display: flex' — still flex but hidden via transform */
    }

    .nav-links.open {
        transform: translateY(0);
    }
}