/* ========================================
   Andrew Gui - Portfolio
   Black / Neon Green / Gold Aesthetic
   ======================================== */

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

:root {
    --neon: #00ff87;
    --neon-dim: #00cc6a;
    --gold: #ffd700;
    --gold-dim: #c9a800;
    --bg: #050505;
    --bg-card: #0d0d0d;
    --bg-card-hover: #141414;
    --bg-elevated: #1a1a1a;
    --text: #f0f0f0;
    --text-muted: #999;
    --border: #1f1f1f;
    --glow-neon: 0 0 20px rgba(0, 255, 135, 0.3);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
    --glow-neon-strong: 0 0 40px rgba(0, 255, 135, 0.4), 0 0 80px rgba(0, 255, 135, 0.1);
    --nav-height: 56px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 8px);
    background: var(--bg);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: transparent;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ====== AMBIENT BACKGROUND =======================================
   A single fixed layer between the page background and the content.
   Two sub-layers:
     ::before — faint grid, fading out toward the edges
     ::after  — slow-drifting colour wash (neon + gold), on top
   Both are deliberately near-threshold; they should read as depth,
   not as decoration.

   Two things here are load-bearing:
   - Explicit z-index (0 here, 1 on sections) rather than negative
     values, so paint order can't be second-guessed.
   - The grid fade is a background-colour gradient stacked over the
     grid lines, NOT a CSS mask. A mask on a fixed element promotes it
     onto the compositor above the scrolling content, which greys out
     the whole page in Chrome.
   ================================================================ */
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        /* topmost stop fades the grid back into the page background */
        radial-gradient(ellipse 115% 90% at 50% 14%,
            rgba(5, 5, 5, 0) 0%,
            rgba(5, 5, 5, 0.45) 52%,
            rgba(5, 5, 5, 1) 94%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 68px 68px, 68px 68px;
}

.ambient::after {
    content: '';
    position: absolute;
    inset: -12%;
    background:
        radial-gradient(circle at 18% 12%, rgba(0, 255, 135, 0.055) 0%, transparent 42%),
        radial-gradient(circle at 82% 68%, rgba(255, 215, 0, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 55% 96%, rgba(0, 255, 135, 0.03) 0%, transparent 38%);
    animation: ambientDrift 42s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes ambientDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-1.5%, 1.5%, 0) scale(1.04); }
    100% { transform: translate3d(1.5%, -1%, 0) scale(1.02); }
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--neon);
    text-decoration: none;
    transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

a:hover {
    color: var(--gold);
}

img {
    max-width: 100%;
    height: auto;
}

/* ====== SCROLL PROGRESS BAR ====== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1200;
    pointer-events: none;
}

.scroll-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon), var(--gold));
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
    transform: scaleX(0);
    transform-origin: left;
    will-change: transform;
}

/* ====== NAVIGATION ====== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.6s ease, background 0.6s ease, box-shadow 0.6s ease;
}

/* Once you leave the hero, the nav's bottom edge picks up a whisper of neon */
nav.scrolled {
    background: rgba(5, 5, 5, 0.92);
    border-bottom-color: rgba(0, 255, 135, 0.16);
    box-shadow: 0 1px 24px rgba(0, 255, 135, 0.05);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.25s, background 0.25s;
}

nav a:hover {
    color: var(--neon);
    background: rgba(0, 255, 135, 0.08);
}

nav a.active {
    color: var(--neon);
    background: rgba(0, 255, 135, 0.1);
    text-shadow: 0 0 10px rgba(0, 255, 135, 0.4);
}

/* Hamburger */
nav .nav-toggle {
    display: none;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 1001;
    padding: 6px;
}

nav .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px 0;
    background: var(--neon);
    transition: 0.3s;
    border-radius: 2px;
}

nav.open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

nav.open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ====== HERO ====== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
    will-change: transform;
}

.hero-glow-1 {
    top: 20%;
    left: 50%;
    width: 480px;
    height: 480px;
    /* base value keeps it centred if the animation never applies */
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(0, 255, 135, 0.09) 0%, transparent 70%);
    animation: glowFloat1 26s ease-in-out infinite alternate;
}

.hero-glow-2 {
    bottom: 5%;
    right: 8%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    animation: glowFloat2 34s ease-in-out infinite alternate;
}

@keyframes glowFloat1 {
    0%   { transform: translate(-50%, 0) scale(1); }
    100% { transform: translate(-46%, 4%) scale(1.08); }
}

@keyframes glowFloat2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-6%, -5%) scale(1.12); }
}

.hero-content {
    z-index: 2;
    padding: 2rem;
}

.hero-kicker {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out both;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 5.5rem);
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 0 40px rgba(0, 255, 135, 0.25);
    animation: fadeInUp 0.8s 0.1s ease-out both;
}

.hero h1 .accent {
    background: linear-gradient(120deg, var(--neon), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--neon);
}

.hero .tagline {
    font-size: clamp(0.95rem, 3vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: fadeInUp 0.8s 0.2s ease-out both;
}

.hero .badges {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s 0.3s ease-out both;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.badge:hover {
    border-color: var(--neon);
    color: var(--neon);
    box-shadow: var(--glow-neon);
}

.hero-cta {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.2rem;
    animation: fadeInUp 0.8s 0.4s ease-out both;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: calc(1.8rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 42px;
    border: 2px solid var(--border);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 7px;
    z-index: 2;
    animation: fadeInUp 0.8s 0.6s ease-out both;
}

.scroll-hint:hover {
    border-color: var(--neon);
}

.scroll-hint-dot {
    width: 4px;
    height: 8px;
    border-radius: 4px;
    background: var(--neon);
    animation: scrollHint 1.8s ease-in-out infinite;
}

@keyframes scrollHint {
    0%, 100% { transform: translateY(0); opacity: 1; }
    60% { transform: translateY(12px); opacity: 0.2; }
    61% { opacity: 0; }
}

/* ====== SECTIONS ====== */
section {
    padding: 5rem 1.5rem;
    width: 100%;
    background: transparent;
    position: relative;
    z-index: 1; /* above .ambient */
}

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

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 0.7rem;
    color: var(--neon);
    text-shadow: 0 0 30px rgba(0, 255, 135, 0.2);
    position: relative;
}

/* Hairline under each heading, drawn outward once the title reveals */
.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 56px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), var(--gold), transparent);
    transform: translateX(-50%) scaleX(0);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.section-title.visible::after {
    transform: translateX(-50%) scaleX(1);
}

/* Section divider — draws out from the centre as the section comes into view */
section + section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: min(100%, 900px);
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border) 12%,
        rgba(0, 255, 135, 0.45) 50%,
        var(--border) 88%,
        transparent 100%);
    transform: translateX(-50%) scaleX(0);
    transition: transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}

section + section.divider-in::before {
    transform: translateX(-50%) scaleX(1);
}

/* ====== SCROLL REVEAL ====== */
/* No will-change here on purpose: reveals replay, so an off-screen element
   would hold a compositor layer forever — 30-odd of them on a phone. */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ====== CARD EDGE HAIRLINES ======================================
   A 1px gradient line wipes across the top edge of each card just
   after it reveals. Short, quiet, then it's done.
   ================================================================ */
.research-card,
.work-card,
.skill-card,
.train-card,
.boxing-feature,
.fitness-card {
    position: relative;
    overflow: hidden;
}

.research-card::after,
.work-card::after,
.skill-card::after,
.train-card::after,
.boxing-feature::after,
.fitness-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 135, 0.55), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
    z-index: 1; /* sits over the card's photo */
}

.research-card.visible::after,
.skill-card.visible::after,
.train-card.visible::after,
.boxing-feature.visible::after,
.fitness-card.visible::after,
.reveal.visible .work-card::after {
    transform: scaleX(1);
}

.boxing-feature::after {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), transparent);
}

/* Photo cards run a slightly brighter line — it has to read over the image */
.fitness-card::after {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), var(--gold), transparent);
}

/* Photo frames pick up a slow ambient border shimmer as they settle in */
.rso-photo,
.fitness-card {
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.rso-photo.visible,
.fitness-card.visible {
    border-color: rgba(255, 255, 255, 0.08);
}


@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-kicker, .hero h1, .hero .tagline, .hero .badges, .hero-cta, .scroll-hint {
        animation: none;
    }
    .scroll-hint-dot { animation: none; }

    /* Ambient + border motion: show the end state, skip the travel */
    .ambient::after,
    .hero-glow-1,
    .hero-glow-2,
    .rso-card::before,
    .project-card::before,
    .publication-box::before {
        animation: none;
    }

    .hero-glow-1 { transform: translateX(-50%); }

    .section-title::after {
        transform: translateX(-50%) scaleX(1);
        transition: none;
    }

    section + section::before {
        transform: translateX(-50%) scaleX(1);
        transition: none;
    }

    .research-card::after,
    .work-card::after,
    .skill-card::after,
    .train-card::after,
    .boxing-feature::after,
    .fitness-card::after {
        transform: scaleX(1);
        transition: none;
    }

    .timeline::after {
        transform: scaleY(1);
    }

    .project-shot {
        transition: none;
    }

    .timeline-item::before {
        background: var(--neon);
        box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
        transition: none;
    }
}

/* ====== ABOUT ====== */
.about-container {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.about-image-wrapper {
    flex-shrink: 0;
    position: relative;
}

.about-image {
    width: 250px;
    height: 320px;
    object-fit: cover;
    object-position: center top;
    border-radius: 18px;
    border: 2px solid var(--neon);
    box-shadow: var(--glow-neon), 0 20px 50px rgba(0, 0, 0, 0.6);
    display: block;
}

.about-text {
    font-size: 1.02rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.about-text p {
    margin-bottom: 1rem;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.about-tag {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
}

/* ====== RSO / FITNESS TECH ====== */
.rso-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rso-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon), var(--gold));
}

.rso-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 1.2rem;
    border-radius: 16px;
}

.rso-card h3 {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.rso-card p {
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

.rso-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.8rem;
}

.rso-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: start;
}

.rso-photo {
    margin: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.rso-photo:hover {
    border-color: var(--neon);
    box-shadow: 0 0 30px rgba(0, 255, 135, 0.08);
}

.rso-photo img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.rso-photo figcaption {
    padding: 0.8rem 1.1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s, color 0.3s;
    text-decoration: none;
}

.btn-neon {
    background: var(--neon);
    color: #000;
}

.btn-neon:hover {
    box-shadow: var(--glow-neon-strong);
    color: #000;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.btn-gold {
    background: var(--gold);
    color: #000;
}

.btn-gold:hover {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 0 80px rgba(255, 215, 0, 0.1);
    color: #000;
    transform: translateY(-2px);
}

.btn-discord {
    background: #5865F2;
    color: #fff;
}

.btn-discord:hover {
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
    color: #fff;
    transform: translateY(-2px);
}

/* ====== RESEARCH CARDS ====== */
.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.research-card:hover {
    border-color: var(--neon);
    box-shadow: 0 0 30px rgba(0, 255, 135, 0.08);
}

.research-card h3 {
    font-size: 1.2rem;
    color: var(--neon);
    margin-bottom: 0.8rem;
}

.research-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.tech-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 135, 0.2);
    color: var(--neon);
    background: rgba(0, 255, 135, 0.05);
}

/* ====== FITNESS ====== */
.fitness-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fitness-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.fitness-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.08);
}

.fitness-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top center;
}

.fitness-card:nth-child(1) img {
    object-position: center 20%;
}

.fitness-card:nth-child(4) img {
    object-position: center 30%;
}

.fitness-card-content {
    padding: 1.2rem;
}

.fitness-card-content h3 {
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.fitness-card-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.progress-bar {
    background: var(--border);
    height: 4px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.8rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon), var(--gold));
}

/* Boxing feature — compact */
.boxing-feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.8rem;
    margin: 2rem auto 0;
    max-width: 620px;
    text-align: center;
}

.boxing-feature h3 {
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

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

.boxing-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    max-width: 480px;
    margin: 1.2rem auto 0;
}

.boxing-photos img {
    width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--gold);
    box-shadow: var(--glow-gold);
}

/* Training grid */
.training-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.train-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.3s;
}

.train-card:hover {
    border-color: var(--neon);
}

.train-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.train-card h4 {
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.train-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ====== WORK EXPERIENCE ====== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

/* Dim track */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

/* Live fill — scaleY is driven by --timeline-progress from app.js,
   so the line literally draws itself as you scroll the section */
.timeline::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--neon), var(--gold));
    box-shadow: 0 0 12px rgba(0, 255, 135, 0.25);
    transform: scaleY(var(--timeline-progress, 0));
    transform-origin: top;
    will-change: transform;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    box-shadow: 0 0 0 rgba(0, 255, 135, 0);
    transition: background 0.6s ease, box-shadow 0.6s ease;
}

/* Each node lights up as its card arrives */
.timeline-item.visible::before {
    background: var(--neon);
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
}

.work-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.work-card:hover {
    border-color: var(--neon);
}

.work-card h3 {
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.work-date {
    color: var(--neon);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.work-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ====== SKILLS ====== */
.skills-grid {
    display: grid;
    /* Wide enough that six cards settle into 3 × 2 on desktop, not 4 + 2 */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

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

.skill-card h3 {
    color: var(--neon);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.skill-card ul {
    list-style: none;
    padding: 0;
}

.skill-card li {
    color: var(--text-muted);
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

/* ====== PROJECTS ====== */
.section-lead {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 46ch;
    margin: -1rem auto 2.2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 820px;
    margin: 0 auto;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon), var(--gold));
}

.project-card:hover {
    border-color: var(--neon);
    box-shadow: 0 10px 40px rgba(0, 255, 135, 0.1);
}

/* App screenshot beside the copy. The shot is a fixed width so the copy
   column takes whatever is left; under 768px the two stack and the shot
   centres itself. */
.project-showcase {
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
}

.project-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* Cards with no links or notes end on their tags — drop the trailing gap */
.project-body > :last-child {
    margin-bottom: 0;
}

/* Phone bezel: a black pad + rounded corners is enough to read as a device
   without drawing an actual frame. */
.project-shot {
    flex: 0 0 auto;
    width: 190px;
    padding: 7px;
    border-radius: 26px;
    background: #000;
    border: 1px solid #262626;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.project-shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
}

.project-card:hover .project-shot {
    transform: translateY(-4px);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 255, 135, 0.1);
}

.project-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.project-mark {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 12px;
}

.project-mark-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    background: rgba(0, 255, 135, 0.08);
    border: 1px solid rgba(0, 255, 135, 0.25);
}

.project-card h3 {
    color: var(--text);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-head h3 {
    margin-bottom: 0.15rem;
}

.project-card .subtitle {
    color: var(--neon);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.project-head .subtitle {
    margin-bottom: 0;
}

.project-card .desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
}

.project-tags span {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.project-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Short "where it's at" lines for projects that don't have a link to give */
.project-notes {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.project-notes li {
    position: relative;
    padding-left: 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.project-notes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--neon);
}

.release-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon);
    margin-left: 6px;
    background: rgba(0, 255, 135, 0.1);
    padding: 2px 8px;
    border-radius: 100px;
    vertical-align: middle;
}

.release-label-gold {
    color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

/* Hardware shots, sitting under a project's main row rather than inside it.
   The source photos are near-square, so a 4/3 crop keeps the device whole
   instead of slicing it into a letterbox strip. */
.project-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    /* Supporting detail shots, not the main event — keep them well under the
       width of the copy above so they read as a footnote to the card. */
    max-width: 460px;
    margin: 1.6rem 0 0;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
}

.project-gallery figure {
    margin: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.project-gallery figure:hover {
    border-color: var(--neon);
}

.project-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.project-gallery figcaption {
    padding: 0.7rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
    border-top: 1px solid var(--border);
}

/* ====== PUBLICATION ====== */
.publication-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    margin-top: 1.5rem;
}

.publication-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--neon));
}

.publication-box h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.publication-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.publication-box .publication-link {
    margin-top: 0.8rem;
}

.publication-box a {
    color: var(--neon);
    font-weight: 600;
}

/* ====== CONTACT ====== */
.contact {
    text-align: center;
}

.contact-sub {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-links a {
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.7rem 1.3rem;
    background: var(--bg-card);
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--border);
    font-weight: 500;
    transition: border-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.contact-links a:hover {
    border-color: var(--neon);
    color: var(--neon);
    box-shadow: var(--glow-neon);
    transform: translateY(-2px);
}

.footer-note {
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ====== ACCENT BAR DRIFT ========================================
   The 3px bars on top of the feature cards cycle their gradient
   instead of sitting static. The colour stops are mirrored
   (A -> B -> A) so the loop has no visible seam.
   =============================================================== */
.rso-card::before,
.project-card::before {
    background: linear-gradient(90deg, var(--neon), var(--gold), var(--neon));
    background-size: 200% 100%;
    animation: accentDrift 18s linear infinite;
}

.publication-box::before {
    background: linear-gradient(90deg, var(--gold), var(--neon), var(--gold));
    background-size: 200% 100%;
    animation: accentDrift 18s linear infinite;
}

@keyframes accentDrift {
    from { background-position: 0 0; }
    to   { background-position: 200% 0; }
}

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== RESPONSIVE - MOBILE FIRST ====== */

/* Phone (iPhone default) */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(5, 5, 5, 0.98);
        position: absolute;
        top: 100%;
        left: 0;
        text-align: center;
        gap: 0.2rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }

    nav.open ul {
        display: flex;
    }

    nav .nav-toggle {
        display: block;
    }

    section {
        padding: 3.5rem 1.2rem;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .hero-cta .btn {
        width: auto;
        min-width: 160px;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .about-image {
        width: 210px;
        height: 270px;
    }

    .about-tags {
        justify-content: center;
    }

    .rso-gallery {
        grid-template-columns: 1fr;
    }

    .rso-photo img {
        height: 240px;
    }

    .fitness-gallery {
        grid-template-columns: 1fr;
    }

    .fitness-card img {
        aspect-ratio: 4 / 5;
        object-position: top center;
    }

    .boxing-feature {
        padding: 1.5rem 1rem;
    }

    .boxing-photos {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }

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

    .train-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        padding: 1rem 1.2rem;
    }

    .train-card .icon {
        font-size: 1.8rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: -1.85rem;
        width: 10px;
        height: 10px;
    }

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

    .rso-card {
        padding: 2rem 1.5rem;
    }

    .project-card {
        padding: 1.6rem 1.3rem;
    }

    .project-showcase {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .project-shot {
        width: 170px;
    }

    .project-head {
        flex-direction: column;
        gap: 0.6rem;
    }

    .project-tags,
    .project-actions {
        justify-content: center;
    }

    .project-notes {
        max-width: 32ch;
        margin: 0 auto;
        text-align: left;
    }

    /* Two-up at this width leaves thumbnails smaller than their own captions,
       so stack them and keep the pair narrow instead. */
    .project-gallery {
        grid-template-columns: 1fr;
        max-width: 260px;
        gap: 0.8rem;
        margin: 1.3rem auto 0;
        padding-top: 1.3rem;
    }

    .project-gallery figcaption {
        text-align: center;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-links a {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .rso-links {
        flex-direction: column;
        align-items: center;
    }

    .rso-links .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    section {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .boxing-photos {
        grid-template-columns: 1fr;
    }

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

    .hero-cta .btn {
        width: 100%;
        max-width: 260px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .fitness-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screens */
@media (min-width: 1025px) {
    .section-content {
        max-width: 960px;
    }

    .fitness-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch device optimization */
@media (hover: none) {
    .btn:hover,
    .contact-links a:hover,
    .project-card:hover .project-shot {
        transform: none;
    }
}

/* Safe area for notch phones */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .contact {
        padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    }
}
