:root {
    /* ── JPL Grand Tour Palette ── */
    --color-cream:   #F4E8D2;
    --color-gold:    #EFA03D;
    --color-amber:   #D4922A;
    --color-rust:    #C1562A;
    --color-red:     #D63F33;
    --color-magenta: #722452;
    --color-plum:    #34263A;
    --color-navy:    #0B1026;
    --color-teal:    #5A9F9A;
    --color-mint:    #9DBEBB;
    --color-sage:    #94B94B;
    --color-blush:   #EBAFA3;

    --bg-deep:       #060914;
    --bg-mid:        #0B1026;
    --card-bg:       rgba(11, 16, 38, 0.80);
    --card-border:   rgba(239, 160, 61, 0.18);
    --text-main:     #F0EAD6;
    --text-muted:    #9DBEBB;
    --accent-orange: #EFA03D;
    --accent-red:    #D63F33;
    --accent-teal:   #5A9F9A;
    --accent-cream:  #F4E8D2;
    --nav-height:    56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
}

body {
    font-family: 'Space Mono', 'Monaco', monospace;
    background: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Starfield canvas ── */
#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Jet-trail canvas behind the rocket ── */
#jet-trail-canvas {
    position: fixed;
    right: 0;
    top: 0;
    width: 80px;
    height: 100vh;
    z-index: 49;
    pointer-events: none;
}

/* ══════════════════ NAV ══════════════════ */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 80px;
    height: var(--nav-height);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 32px;
    background: linear-gradient(180deg, rgba(6,9,20,0.92) 60%, rgba(6,9,20,0.0));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(239,160,61,0.10);
}

.nav-link {
    font-family: 'Bebas Neue', 'Impact', fantasy, sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--accent-cream);
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: color 0.25s, border-color 0.25s, background 0.25s, text-shadow 0.25s;
}
.nav-link:hover, .nav-link.active {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    background: rgba(239, 160, 61, 0.08);
    text-shadow: 0 0 12px rgba(239,160,61,0.5);
}

/* ══════════════════ LAYOUT ══════════════════ */
.layout {
    display: grid;
    grid-template-columns: 35% 1fr 80px;
    min-height: 100vh;
    padding-top: var(--nav-height);
    position: relative;
    z-index: 10;
}

.left-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.right-col {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-right: 10px;
}

/* ══════════════════ NAME CARD ══════════════════ */
.name-group {
    background: linear-gradient(145deg, rgba(11,16,38,0.95), rgba(52,38,58,0.85));
    backdrop-filter: blur(16px);
    border: 2px solid rgba(239,160,61,0.25);
    border-radius: 6px;
    padding: 20px 24px;
    position: fixed;
    top: calc(var(--nav-height) + 24px);
    transform: translateX(40px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
    z-index: 40;
    box-shadow:
        0 0 40px rgba(239,160,61,0.08),
        0 12px 40px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(239,160,61,0.12);
}
.name-group::before {
    content: '★';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(239,160,61,0.6);
}

.name-tag {
    font-family: 'Bebas Neue', 'Impact', fantasy, sans-serif;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    font-weight: 400;
    color: var(--accent-cream);
    line-height: 0.88;
    text-shadow:
        2px 2px 0 var(--color-rust),
        4px 4px 0 rgba(193,86,42,0.3);
    letter-spacing: 0.06em;
}

.name-line { display: block; }

.tagline {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.5rem, 2.5vw, 0.72rem);
    color: var(--accent-orange);
    letter-spacing: 0.28em;
    border-top: 1px solid rgba(239,160,61,0.3);
    padding-top: 8px;
    width: 100%;
}

.planets-svg {
    width: 100%;
    height: auto;
    opacity: 0.55;
    filter: drop-shadow(0 0 30px rgba(239,160,61,0.15))
            drop-shadow(0 0 60px rgba(90,159,154,0.1));
    position: relative;
    z-index: 1;
}

/* ══════════════════ MAIN ══════════════════ */
main {
    position: relative;
    z-index: 30;
    padding: 32px 40px 90px;
    margin-right: 80px;
}

/* Section divider lines — retro poster style */
.content-section + .content-section,
.connect-section {
    border-top: 1px solid rgba(239,160,61,0.12);
    padding-top: 40px;
}

h1 {
    font-family: 'Bebas Neue', 'Impact', fantasy, sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    letter-spacing: 0.14em;
    color: var(--accent-cream);
    margin-top: 50px;
    margin-bottom: 24px;
    text-shadow: 1px 1px 0 rgba(193,86,42,0.4);
    position: relative;
}
h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-red));
    margin: 10px auto 0;
    border-radius: 2px;
}

h2 {
    font-family: 'Bebas Neue', 'Impact', fantasy, sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    color: var(--accent-orange);
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(239,160,61,0.2);
}

p {
    font-family: 'DM Sans', sans-serif;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.95rem;
    color: var(--text-main);
    opacity: 0.88;
}

a { color: var(--accent-teal); transition: color 0.25s, text-shadow 0.25s; }
a:hover { color: var(--accent-orange); text-shadow: 0 0 8px rgba(239,160,61,0.3); }

/* ══════════════════ HERO ══════════════════ */
.content-hero {
    background: linear-gradient(160deg, rgba(11,16,38,0.85), rgba(52,38,58,0.55));
    backdrop-filter: blur(14px);
    padding: 36px 40px;
    border: 2px solid rgba(239,160,61,0.20);
    border-radius: 6px;
    margin: 20px 0 40px;
    max-width: 1000px;
    box-shadow:
        0 0 60px rgba(239,160,61,0.06),
        0 12px 48px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(239,160,61,0.10);
    position: relative;
    overflow: hidden;
}
/* Retro poster diagonal stripe accent */
.content-hero::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: linear-gradient(135deg, transparent 40%, rgba(239,160,61,0.06) 40%, rgba(239,160,61,0.06) 50%, transparent 50%);
    pointer-events: none;
}

.content-hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    margin-top: 0;
    margin-bottom: 14px;
    min-height: 1.2em;
}
.content-hero h1::after { display: none; }

.cursor {
    animation: blink 0.8s step-end infinite;
    color: var(--accent-orange);
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.content-hero p {
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.7;
}

/* ══════════════════ SKILL CHIPS ══════════════════ */
.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.chip {
    font-family: 'Space Mono', monospace;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 3px;
    border: 1px solid var(--accent-teal);
    color: var(--accent-teal);
    background: rgba(90, 159, 154, 0.06);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    cursor: default;
}
.chip:nth-child(2n) {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(239,160,61,0.05);
}
.chip:nth-child(3n) {
    border-color: var(--color-blush);
    color: var(--color-blush);
    background: rgba(235,175,163,0.05);
}
.chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ══════════════════ SECTION REVEAL ══════════════════ */
.content-section, .connect-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.content-section.visible, .connect-section.visible {
    opacity: 1;
    transform: translateY(0);
}
/* Hero uses its own fadeSlideUp animation, don't hide it */
.content-hero {
    opacity: 0;
    transform: none;
    animation: fadeSlideUp 0.7s ease 0.2s forwards;
}
.content-hero.visible {
    /* animation handles this — just ensure no conflict */
    animation: fadeSlideUp 0.7s ease 0s forwards;
}

/* ══════════════════ PROJECT GRID ══════════════════ */
.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    justify-items: center;
}

.project-item {
    width: 100%;
    max-width: 500px;
    background: linear-gradient(170deg, rgba(11,16,38,0.85), rgba(52,38,58,0.50));
    backdrop-filter: blur(8px);
    padding: 20px;
    border: 1px solid rgba(239,160,61,0.12);
    border-radius: 6px;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
    overflow: hidden;
}
.project-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(239,160,61,0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.project-item:hover {
    transform: translateY(-6px);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.45),
        0 0 0 1px rgba(239,160,61,0.3),
        0 0 30px rgba(239,160,61,0.06);
    border-color: rgba(239,160,61,0.35);
}
.project-item:hover::before { opacity: 1; }
.project-item:hover img { filter: brightness(1.08) saturate(1.1); }

.project-img {
    width: 100%;
    max-width: 400px;
    border-radius: 4px;
    display: block;
    margin: 10px auto;
    transition: filter 0.25s;
    border: 1px solid rgba(239,160,61,0.08);
}
.project-img-link { display: inline-block; }

/* ══════════════════ CONNECT ══════════════════ */
.connect-container {
    display: flex;
    gap: 28px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px 0;
}
.connect-item {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(239,160,61,0.15);
    background: linear-gradient(145deg, rgba(11,16,38,0.8), rgba(52,38,58,0.5));
    backdrop-filter: blur(8px);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    margin-bottom: 24px;
}
.connect-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 20px rgba(239,160,61,0.1);
    border-color: var(--accent-orange);
}
.connect-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    transition: filter 0.25s;
    /* Make dark logos visible on dark bg: invert to white, then desaturate */
    filter: invert(1) grayscale(1) brightness(1.8);
    opacity: 0.85;
}
.connect-item:hover .connect-icon {
    /* On hover: tint toward warm orange/gold to match the theme */
    filter: invert(1) grayscale(0) brightness(1.4) sepia(0.6) hue-rotate(-10deg) saturate(2.5);
    opacity: 1;
}

/* ══════════════════ ROCKET & JET TRAIL ══════════════════ */
#rocket-path-svg {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}
#scroll-rocket-container {
    position: fixed;
    right: 20px; top: 0;
    height: 100vh; width: 40px;
    pointer-events: none;
    z-index: 50;
}
#rocket {
    position: absolute;
    left: 5px; width: 30px;
    transition: transform 0.08s linear;
    z-index: 100;
    transform: translateY(0);
    will-change: transform;
    filter: drop-shadow(0 0 10px rgba(239,160,61,0.7))
            drop-shadow(0 0 20px rgba(214,63,51,0.3));
}

/* Rocket glow pulse */
@keyframes rocketGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(239,160,61,0.7)) drop-shadow(0 0 20px rgba(214,63,51,0.3)); }
    50%      { filter: drop-shadow(0 0 16px rgba(239,160,61,0.9)) drop-shadow(0 0 30px rgba(214,63,51,0.5)); }
}
#rocket {
    animation: rocketGlow 2s ease-in-out infinite;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════ MOBILE ══════════════════ */
@media (max-width: 768px) {
    .site-nav {
        right: 40px;
        gap: 4px;
        padding: 0 10px;
        justify-content: center;
    }
    .nav-link { font-size: 0.7rem; padding: 5px 8px; }

    .name-group {
        position: absolute;
        top: calc(var(--nav-height) + 12px);
        left: 50%;
        transform: translateX(-50%);
        gap: 4px;
        z-index: 20;
    }
    .name-group::before { display: none; }
    .name-tag { font-size: clamp(2rem, 7vw, 3.2rem); }
    .tagline  { font-size: clamp(0.7rem, 4vw, 0.85rem); }

    .layout {
        padding-top: calc(var(--nav-height) + 100px);
        grid-template-columns: 18% 1fr 40px;
    }
    .content-hero { margin: 0 auto 32px; padding: 18px; }
    .content-hero h1 { font-size: 1.8rem; }
    .content-hero p  { font-size: 0.9rem; }
    .planets { display: none; }

    #scroll-rocket-container { right: 4px; width: 24px; }
    #rocket { width: 22px; left: 1px; }
    #rocket-path-svg { width: 24px; }
    .right-col { width: 32px; padding: 0; }
    main { margin-right: 32px; padding: 16px; }

    #jet-trail-canvas { width: 50px; }
}