/* Black theme — neutral surfaces, white/gray accents only (no warm / rainbow UI). */

:root {
    --primary-color: #f5f5f5;
    --secondary-color: #a3a3a3;
    --accent-color: #737373;
    --accent-violet: #9ca3af;
    --accent-rose: #a1a1aa;
    --page-bg: #000000;
    --section-bg: #0a0a0a;
    --card-bg: #111111;
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-light: #737373;
    --border-color: rgba(255, 255, 255, 0.08);
    --gradient-1: linear-gradient(90deg, #fafafa 0%, #a3a3a3 100%);
    --gradient-hero: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
    --glow: 0 0 0 1px rgba(255, 255, 255, 0.12);
    --scroll: 0;
    --projects-hscroll: 0;
    --case-hscroll: 0;
    --parallax-glow-1: rgba(255, 255, 255, 0.07);
    --parallax-glow-2: rgba(255, 255, 255, 0.05);
    --parallax-glow-3: rgba(255, 255, 255, 0.06);

    /* Studio-style motion (inspired by premium agency sites; not a copy of any one site) */
    --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-ease-spring: cubic-bezier(0.34, 1.12, 0.64, 1);
    --motion-duration: 0.55s;
    --motion-duration-slow: 0.95s;
}

html {
    scroll-snap-type: none;
    scroll-behavior: auto;
    min-height: 100%;
    background-color: var(--page-bg);
}

html.lenis {
    scroll-behavior: auto !important;
}

html.lenis,
html.lenis body {
    height: auto;
}

html.lenis-smooth {
    scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    html.lenis-smooth {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: transparent;
}

/* Stack main flow above parallax; keep fixed UI layers untouched */
body > *:not(.parallax-bg):not(.scroll-progress):not(.site-menu):not(.experience-modal):not(.media-modal):not(.scroll-top-btn) {
    position: relative;
    z-index: 1;
}

/* Fixed mesh parallax (depth via --scroll from script; see scroll-driven block for scroll() enhancement) */
.parallax-bg {
    position: fixed;
    inset: -14%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.parallax-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(88px);
    opacity: 0.32;
    will-change: transform;
}

.parallax-bg__glow--1 {
    width: min(58vw, 720px);
    height: min(58vw, 720px);
    top: -6%;
    right: -8%;
    background: radial-gradient(circle at 40% 40%, var(--parallax-glow-1) 0%, transparent 68%);
    transform: translate3d(calc(var(--scroll) * 5vw), calc(var(--scroll) * -11vh), 0) scale(calc(1.04 + var(--scroll) * 0.07));
}

.parallax-bg__glow--2 {
    width: min(48vw, 560px);
    height: min(48vw, 560px);
    bottom: 2%;
    left: -12%;
    background: radial-gradient(circle at 55% 45%, var(--parallax-glow-2) 0%, transparent 70%);
    transform: translate3d(calc(var(--scroll) * -4vw), calc(var(--scroll) * -18vh), 0) scale(calc(0.96 + var(--scroll) * 0.06));
}

.parallax-bg__glow--3 {
    width: min(42vw, 480px);
    height: min(42vw, 480px);
    top: 38%;
    left: 28%;
    background: radial-gradient(circle at 50% 50%, var(--parallax-glow-3) 0%, transparent 72%);
    opacity: 0.52;
    transform: translate3d(calc(var(--scroll) * 2vw), calc(var(--scroll) * -26vh), 0) rotate(calc(var(--scroll) * 6deg));
}

@media (prefers-reduced-motion: reduce) {
    .parallax-bg {
        display: none;
    }
}

/* Let the mesh show through slightly (Prismic-style “depth on scroll”) */
#hero {
    background: transparent;
}

#about,
#story,
#education,
footer {
    background: rgba(8, 8, 8, 0.92);
    -webkit-backdrop-filter: blur(12px) saturate(1);
    backdrop-filter: blur(12px) saturate(1);
}

#projects {
    position: relative;
    overflow: visible;
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 50%, #0a0a0a 100%);
    -webkit-backdrop-filter: blur(12px) saturate(1);
    backdrop-filter: blur(12px) saturate(1);
}

#experience {
    background: linear-gradient(180deg, #080808 0%, #000000 50%, #080808 100%);
    -webkit-backdrop-filter: blur(12px) saturate(1);
    backdrop-filter: blur(12px) saturate(1);
}

#skills {
    position: relative;
    overflow: visible;
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
    -webkit-backdrop-filter: blur(12px) saturate(1);
    backdrop-filter: blur(12px) saturate(1);
}

#contact {
    background: rgba(5, 5, 5, 0.94);
    -webkit-backdrop-filter: blur(12px) saturate(1);
    backdrop-filter: blur(12px) saturate(1);
}

h1, h2, h3, h4, h5, h6,
.section-title,
.logo,
.stat-number {
    font-family: 'Fraunces', 'Georgia', serif;
}

/* Section titles — flat light text on black (no rainbow gradients) */
#projects .section-title,
#skills .section-title {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text-primary);
}

/* Editorial split: accent line slightly dimmer gray */
#projects .section-title--editorial {
    position: relative;
    z-index: 3;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text-primary);
}

#projects .section-title--editorial em {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text-secondary);
}

#story .section-title--editorial em {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text-secondary);
}

#experience .section-title {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--text-primary);
}

.header-content {
    position: relative;
}

header {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    border-bottom-color: var(--border-color);
    transition:
        background var(--motion-duration-slow) var(--motion-ease-out),
        box-shadow var(--motion-duration-slow) var(--motion-ease-out),
        border-color 0.35s ease;
}

header.scrolled {
    background: rgba(0, 0, 0, 0.94);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.logo {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity var(--motion-duration) var(--motion-ease-out), transform var(--motion-duration) var(--motion-ease-out);
}

@media (prefers-reduced-motion: no-preference) {
    .logo:hover {
        opacity: 0.88;
        transform: translateY(-1px);
    }
}

.logo::after {
    content: '';
    display: block;
    width: 2rem;
    height: 2px;
    margin-top: 0.35rem;
    background: var(--gradient-1);
    border-radius: 2px;
}

nav a {
    transition: color 0.25s ease;
}

nav a::after {
    transition: width 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

.scroll-progress {
    height: 3px;
    overflow: hidden;
    background: transparent;
    transition: width 0.15s ease-out;
}

.scroll-progress__bar {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    background: var(--gradient-1);
}

.scroll-progress.scroll-progress--sd {
    width: 100% !important;
    transition: none;
}

@supports (animation-timeline: scroll(root)) {
    .scroll-progress.scroll-progress--sd .scroll-progress__bar {
        animation: sd-reading-progress linear forwards;
        animation-timeline: scroll(root);
    }
}

@keyframes sd-reading-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* Hero */
#hero::before {
    background:
        radial-gradient(ellipse 80% 50% at 70% 0%, rgba(255, 255, 255, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 10% 90%, rgba(200, 200, 200, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 35% at 50% 50%, rgba(200, 200, 200, 0.06) 0%, transparent 60%);
    transform: translate3d(calc(var(--scroll) * -2%), calc(var(--scroll) * -3%), 0) scale(calc(1 + var(--scroll) * 0.04));
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    #hero::before {
        transform: none;
        will-change: auto;
    }
}

.hero-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-title {
    font-size: clamp(2.75rem, 7vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: clamp(1.15rem, 2.8vw, 1.65rem);
    letter-spacing: 0.01em;
}

.hero-text > * {
    animation: heroFadeUp 0.95s var(--motion-ease-out) backwards;
}

.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.12s; }
.hero-text > *:nth-child(3) { animation-delay: 0.18s; }
.hero-text > *:nth-child(4) { animation-delay: 0.24s; }
.hero-text > *:nth-child(5) { animation-delay: 0.3s; }
.hero-text > *:nth-child(6) { animation-delay: 0.36s; }

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

.btn-primary {
    background: var(--primary-color);
    color: #0a0a0a;
    transition:
        transform 0.38s var(--motion-ease-out),
        box-shadow 0.38s var(--motion-ease-out),
        background 0.38s var(--motion-ease-out);
}

.btn-primary:hover {
    background: #e5e5e5;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.45);
    color: var(--primary-color);
    transition:
        transform 0.38s var(--motion-ease-out),
        background 0.38s var(--motion-ease-out),
        border-color 0.38s var(--motion-ease-out);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.stat-number {
    color: var(--primary-color);
}

.profile-photo {
    border-radius: 12px;
    border-color: var(--border-color);
}

.image-backdrop {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(180, 180, 180, 0.14));
    opacity: 0.2;
}

/* Section rhythm */
.section-title::after {
    width: 48px;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.reveal-section .section-title::after {
    width: 72px;
}

.section-sub {
    text-align: center;
    max-width: 36rem;
    margin: -1.75rem auto 2.75rem;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* Work: clearer rhythm under editorial title */
#projects .section-sub {
    position: relative;
    z-index: 2;
    margin-top: 0.35rem;
    margin-bottom: 2.25rem;
}

/*
 * Scroll-driven enter transitions.
 * Must beat style.css `section:not(#hero) .section-title` etc., so we use
 * :not(.reveal-section) for "before" and section.reveal-section for "after".
 */
@media (prefers-reduced-motion: no-preference) {
    section:not(#hero):not(.reveal-section) .section-title,
    section:not(#hero):not(.reveal-section) .section-sub,
    section:not(#hero):not(.reveal-section) .about-lead,
    section:not(#hero):not(.reveal-section) .about-text,
    section:not(#hero):not(.reveal-section) .story-eyebrow,
    section:not(#hero):not(.reveal-section) .contact-intro {
        transform: translate3d(0, 36px, 0);
        opacity: 0;
        filter: blur(4px);
        transition:
            transform 1.05s var(--motion-ease-out),
            opacity 0.95s cubic-bezier(0.33, 1, 0.68, 1),
            filter 0.85s var(--motion-ease-out);
    }

    section:not(#hero).reveal-section .section-title,
    section:not(#hero).reveal-section .section-sub,
    section:not(#hero).reveal-section .about-lead,
    section:not(#hero).reveal-section .about-text,
    section:not(#hero).reveal-section .story-eyebrow,
    section:not(#hero).reveal-section .contact-intro {
        transform: translate3d(0, 0, 0);
        opacity: 1;
        filter: blur(0);
    }

    section:not(#hero):not(.reveal-section) .projects-github-wrap,
    section:not(#hero):not(.reveal-section) .certifications {
        transform: translate3d(0, 28px, 0);
        opacity: 0;
        transition:
            transform 0.95s var(--motion-ease-out),
            opacity 0.85s cubic-bezier(0.33, 1, 0.68, 1);
    }

    section:not(#hero).reveal-section .projects-github-wrap,
    section:not(#hero).reveal-section .certifications {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }

    section:not(#hero):not(.reveal-section) .exp-item,
    section:not(#hero):not(.reveal-section) .education-card,
    section:not(#hero):not(.reveal-section) .story-step {
        transform: translate3d(0, 32px, 0);
        opacity: 0;
        transition:
            transform 0.92s var(--motion-ease-out),
            opacity 0.8s cubic-bezier(0.33, 1, 0.68, 1);
    }

    section:not(#hero).reveal-section .exp-item,
    section:not(#hero).reveal-section .education-card,
    section:not(#hero).reveal-section .story-step {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }

    section:not(#hero):not(.reveal-section) .skill-category {
        transform: translate3d(0, 28px, 0);
        opacity: 0;
        transition:
            transform 0.88s var(--motion-ease-out),
            opacity 0.78s cubic-bezier(0.33, 1, 0.68, 1);
    }

    section:not(#hero).reveal-section .skill-category {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }

    section:not(#hero):not(.reveal-section) .project-card {
        transform: translate3d(0, 40px, 0) scale(0.97);
        opacity: 0;
        transition:
            transform 0.95s var(--motion-ease-spring),
            opacity 0.82s cubic-bezier(0.33, 1, 0.68, 1);
    }

    section:not(#hero).reveal-section .project-card {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
}

/* Staggered reveal delays — projects, experience, skills */
@media (prefers-reduced-motion: no-preference) {
    section:not(#hero):not(.reveal-section) .exp-item:nth-child(1) { transition-delay: 0ms; }
    section:not(#hero):not(.reveal-section) .exp-item:nth-child(2) { transition-delay: 55ms; }
    section:not(#hero):not(.reveal-section) .exp-item:nth-child(3) { transition-delay: 110ms; }
    section:not(#hero):not(.reveal-section) .exp-item:nth-child(4) { transition-delay: 165ms; }
    section:not(#hero):not(.reveal-section) .exp-item:nth-child(5) { transition-delay: 220ms; }

    section:not(#hero):not(.reveal-section) .project-card:nth-child(1) { transition-delay: 0ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(2) { transition-delay: 45ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(3) { transition-delay: 90ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(4) { transition-delay: 135ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(5) { transition-delay: 180ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(6) { transition-delay: 225ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(7) { transition-delay: 270ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(8) { transition-delay: 315ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(9) { transition-delay: 360ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(10) { transition-delay: 405ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(11) { transition-delay: 450ms; }
    section:not(#hero):not(.reveal-section) .project-card:nth-child(12) { transition-delay: 495ms; }

    section:not(#hero):not(.reveal-section) .skill-category:nth-child(1) { transition-delay: 0ms; }
    section:not(#hero):not(.reveal-section) .skill-category:nth-child(2) { transition-delay: 60ms; }
    section:not(#hero):not(.reveal-section) .skill-category:nth-child(3) { transition-delay: 120ms; }
    section:not(#hero):not(.reveal-section) .skill-category:nth-child(4) { transition-delay: 180ms; }
    section:not(#hero):not(.reveal-section) .skill-category:nth-child(5) { transition-delay: 240ms; }
    section:not(#hero):not(.reveal-section) .skill-category:nth-child(6) { transition-delay: 300ms; }
    section:not(#hero):not(.reveal-section) .skill-category:nth-child(7) { transition-delay: 360ms; }

    section:not(#hero):not(.reveal-section) .story-step:nth-child(1) { transition-delay: 0ms; }
    section:not(#hero):not(.reveal-section) .story-step:nth-child(2) { transition-delay: 70ms; }
    section:not(#hero):not(.reveal-section) .story-step:nth-child(3) { transition-delay: 140ms; }
}

/* Experience panel — multi-hue border, lift on hover */
.experience-panel {
    max-width: 760px;
    margin: 0 auto;
    border: 1px solid transparent;
    border-radius: 14px;
    overflow: hidden;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(128deg, rgba(80, 80, 80, 0.75), rgba(45, 45, 45, 0.65), rgba(60, 60, 60, 0.7), rgba(100, 100, 100, 0.72)) border-box;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 48px rgba(220, 220, 220, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.45s ease, transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.experience-panel:hover {
    box-shadow:
        0 28px 64px rgba(0, 0, 0, 0.48),
        0 0 48px rgba(255, 255, 255, 0.06),
        0 0 40px rgba(255, 255, 255, 0.04);
    transform: translateY(-3px);
}

.experience-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(95deg, rgba(24, 24, 24, 0.9) 0%, rgba(12, 12, 12, 0.95) 50%, rgba(20, 20, 20, 0.92) 100%);
}

.experience-panel__hint {
    position: relative;
    z-index: 1;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(245, 245, 245, 0.9);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.btn-outline-sm {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.btn-outline-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: #f5f5f5;
}

.btn-outline-sm:active {
    transform: scale(0.98);
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes experience-toolbar-sheen {
        0%,
        100% {
            transform: translate3d(-35%, 0, 0) skewX(-14deg);
            opacity: 0;
        }
        12% {
            opacity: 0.55;
        }
        48% {
            transform: translate3d(135%, 0, 0) skewX(-14deg);
            opacity: 0.45;
        }
        60% {
            opacity: 0;
        }
    }

    .experience-panel__toolbar::after {
        content: '';
        position: absolute;
        inset: -40% -20%;
        z-index: 0;
        background: linear-gradient(
            100deg,
            transparent 0%,
            rgba(255, 255, 255, 0.07) 42%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.06) 58%,
            transparent 100%
        );
        pointer-events: none;
        animation: experience-toolbar-sheen 7.5s ease-in-out infinite;
    }
}

.exp-timeline {
    padding: 1.25rem 1.35rem 1.5rem;
}

.exp-item {
    font-family: 'Inter', sans-serif;
    border-left-color: rgba(255, 255, 255, 0.28);
    transition:
        border-color 0.35s ease,
        background 0.35s ease,
        transform 0.35s cubic-bezier(0.33, 1, 0.68, 1),
        box-shadow 0.35s ease;
}

.exp-item:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(200, 200, 200, 0.04) 55%, transparent 100%);
    box-shadow:
        inset 3px 0 0 rgba(255, 255, 255, 0.45),
        0 8px 32px rgba(0, 0, 0, 0.22),
        0 0 28px rgba(200, 200, 200, 0.08);
}

.exp-date {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.2rem 0.55rem;
    margin: 0 0.35rem 0.15rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fafafa;
    background: linear-gradient(120deg, #2a2a2a 0%, #171717 100%);
    border-radius: 999px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    vertical-align: middle;
}

.exp-company,
.exp-tags {
    font-family: 'Inter', sans-serif;
}

.exp-badge {
    background: rgba(200, 200, 200, 0.22);
    color: var(--accent-color);
}

.exp-more {
    font-family: 'Inter', sans-serif;
}

.exp-points {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

.exp-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* Projects */
.project-card {
    transition:
        transform 0.55s var(--motion-ease-spring),
        box-shadow 0.55s var(--motion-ease-out),
        border-color 0.4s var(--motion-ease-out);
}

.project-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 20px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 12px 40px rgba(180, 180, 180, 0.08);
    border-color: rgba(255, 255, 255, 0.38);
}

.project-badge {
    background: rgba(255, 255, 255, 0.14);
    color: #fafafa;
}

.project-tech-pills span {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(200, 200, 200, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #f5f5f5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-tech-pills span:hover {
    transform: translateY(-2px);
    border-color: rgba(185, 185, 185, 0.45);
    box-shadow: 0 4px 16px rgba(200, 200, 200, 0.18);
}

.projects-github-link {
    background: var(--primary-color);
    color: #0a0a0a;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.projects-github-link:hover {
    background: #d4d4d4;
    color: #0a0a0a;
}

/* Projects: ambient (::before) + horizontal row */
#projects::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 78% 52% at 88% 10%, rgba(255, 255, 255, 0.06), transparent 55%),
        radial-gradient(ellipse 62% 48% at 8% 82%, rgba(255, 255, 255, 0.05), transparent 52%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 255, 255, 0.03), transparent 70%);
    opacity: 0.96;
}

#projects .container {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes projects-ambient {
        0%, 100% { opacity: 0.78; }
        50% { opacity: 1; }
    }

    @keyframes project-media-breathe {
        0%, 100% {
            filter: saturate(1) brightness(1);
            box-shadow:
                inset 0 0 0 1px rgba(255, 255, 255, 0.06),
                0 0 0 rgba(220, 220, 220, 0);
        }
        50% {
            filter: saturate(1.08) brightness(1.04);
            box-shadow:
                inset 0 0 0 1px rgba(255, 255, 255, 0.14),
                0 0 28px rgba(200, 200, 200, 0.14);
        }
    }

    #projects.reveal-section::before {
        animation: projects-ambient 8s ease-in-out infinite;
    }

    #projects .project-media {
        animation: project-media-breathe 5.2s ease-in-out infinite;
    }

    #projects .project-card:hover .project-media {
        animation-play-state: paused;
    }

    #projects .projects-grid {
        mask-image: linear-gradient(90deg, transparent 0%, #000 2rem, #000 calc(100% - 2rem), transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 2rem, #000 calc(100% - 2rem), transparent 100%);
        scroll-snap-type: x proximity;
        background:
            linear-gradient(
                90deg,
                rgba(165, 165, 165, 0.06) 0%,
                transparent 38%,
                transparent 62%,
                rgba(180, 180, 180, 0.07) 100%
            );
        background-size: calc(130% + var(--projects-hscroll, 0) * 50%) 100%;
        background-position: calc(var(--projects-hscroll, 0) * -20%) 0;
        transition: background-position 0.12s ease-out;
    }

    #projects .project-card {
        scroll-snap-align: start;
    }

    #projects .project-card:nth-child(6n + 1) { border-top: 2px solid rgba(255, 255, 255, 0.42); }
    #projects .project-card:nth-child(6n + 2) { border-top: 2px solid rgba(180, 180, 180, 0.42); }
    #projects .project-card:nth-child(6n + 3) { border-top: 2px solid rgba(200, 200, 200, 0.5); }
    #projects .project-card:nth-child(6n + 4) { border-top: 2px solid rgba(165, 165, 165, 0.42); }
    #projects .project-card:nth-child(6n + 5) { border-top: 2px solid rgba(190, 190, 190, 0.45); }
    #projects .project-card:nth-child(6n + 6) { border-top: 2px solid rgba(255, 255, 255, 0.28); }
}

/* Skills: soft backdrop (::before) */
#skills::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 58% 48% at 16% 20%, rgba(200, 200, 200, 0.22), transparent 54%),
        radial-gradient(ellipse 52% 44% at 90% 72%, rgba(255, 255, 255, 0.05), transparent 54%),
        radial-gradient(ellipse 45% 36% at 72% 18%, rgba(255, 255, 255, 0.04), transparent 60%);
    opacity: 0.94;
}

#skills .container {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes skills-glow {
        0%, 100% { opacity: 0.82; }
        50% { opacity: 0.98; }
    }

    #skills.reveal-section::before {
        animation: skills-glow 9s ease-in-out infinite;
    }

    @keyframes skill-category-sheen {
        0% {
            transform: translate3d(-120%, 0, 0) skewX(-16deg);
            opacity: 0;
        }
        8% {
            opacity: 0.85;
        }
        42% {
            transform: translate3d(160%, 0, 0) skewX(-16deg);
            opacity: 0.65;
        }
        55%,
        100% {
            opacity: 0;
        }
    }

    .skill-category::after {
        content: '';
        position: absolute;
        top: -30%;
        left: 0;
        width: 55%;
        height: 160%;
        z-index: 0;
        background: linear-gradient(
            100deg,
            transparent 0%,
            rgba(255, 255, 255, 0.12) 45%,
            rgba(185, 185, 185, 0.1) 52%,
            transparent 100%
        );
        pointer-events: none;
        animation: skill-category-sheen 6.8s ease-in-out infinite;
    }

    .skill-category:nth-child(2n)::after {
        animation-delay: 1.4s;
    }

    .skill-category:nth-child(3n)::after {
        animation-duration: 8.2s;
    }
}

/* Experience timeline: gradient spine */
#experience .exp-timeline {
    position: relative;
}

#experience .exp-timeline::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 3px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--accent-violet), var(--secondary-color), var(--accent-color));
    opacity: 0.55;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes exp-spine-pulse {
        0%, 100% { opacity: 0.48; filter: brightness(1); }
        50% { opacity: 0.72; filter: brightness(1.12); }
    }

    #experience.reveal-section .exp-timeline::before {
        animation: exp-spine-pulse 5.5s ease-in-out infinite;
    }
}

/* Skills: remove terminal $ prefix */
.skill-category h3::before {
    content: none !important;
}

.skill-category:nth-child(4n + 1) {
    border-left-color: rgba(255, 255, 255, 0.55);
}

.skill-category:nth-child(4n + 2) {
    border-left-color: rgba(180, 180, 180, 0.55);
}

.skill-category:nth-child(4n + 3) {
    border-left-color: rgba(200, 200, 200, 0.55);
}

.skill-category:nth-child(4n + 4) {
    border-left-color: rgba(165, 165, 165, 0.55);
}

.skill-category {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
        linear-gradient(210deg, rgba(28, 28, 28, 0.9) 0%, rgba(12, 12, 12, 0.98) 100%),
        var(--card-bg);
    transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.skill-category > * {
    position: relative;
    z-index: 1;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.35),
        0 0 36px rgba(255, 255, 255, 0.1);
}

.skill-tag::before {
    display: none !important;
}

.skill-tag {
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.skill-tag:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.28),
        0 0 20px rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16) 0%, rgba(200, 200, 200, 0.1) 100%);
    color: #fafafa;
    border-color: rgba(255, 255, 255, 0.42);
}

/* Education & certs */
.education-icon {
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
}

.cert-tag:hover i {
    transform: none;
}

/* Contact */
.contact-link {
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

/* Modal */
.experience-modal-title {
    font-family: 'Fraunces', serif;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.experience-txt-content {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
}

.modal-close {
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.25s ease, transform 0.35s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: rotate(90deg);
}

.modal-content {
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* Kill ambient particles if present */
.floating-particles,
.floating-particles .particle {
    display: none !important;
}

.hero-content::after {
    opacity: 0.5;
}

.footer-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Scroll rhythm: soft light line between sections (visual flow, no copy) */
section[id]:not(#hero) {
    position: relative;
}

section[id]:not(#hero)::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: min(72rem, 92vw);
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.22) 20%,
        rgba(180, 180, 180, 0.14) 50%,
        rgba(165, 165, 165, 0.16) 80%,
        transparent 100%
    );
    opacity: 0.85;
    pointer-events: none;
}

/* Scroll-to-top */
.scroll-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.scroll-top-btn:hover {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.09);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .logo::after {
        margin-left: auto;
        margin-right: auto;
    }

    .experience-panel__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-outline-sm {
        justify-content: center;
    }

    .story-steps {
        grid-template-columns: 1fr;
    }
}

/* Scrollytelling-inspired: keyword marquee + stepped narrative (#story) */
.story-marquee {
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden;
    border-block: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.98) 0%, rgba(20, 20, 20, 0.95) 50%, rgba(0, 0, 0, 0.98) 100%);
    padding: 0.7rem 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

.story-marquee__track {
    display: flex;
    width: max-content;
    animation: story-marquee-shift 55s linear infinite;
}

.story-marquee__segment {
    flex-shrink: 0;
    padding: 0 2.5rem;
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(0.8rem, 1.9vw, 0.98rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(230, 238, 255, 0.82);
    white-space: nowrap;
}

.story-marquee:hover .story-marquee__track {
    animation-play-state: paused;
}

@keyframes story-marquee-shift {
    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-marquee__track {
        animation: none;
        transform: none;
    }
}

#story {
    position: relative;
    padding: 5rem 0 5.25rem;
    overflow: hidden;
}

#story::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    background:
        radial-gradient(ellipse 70% 50% at 10% 0%, rgba(200, 200, 200, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 45% at 95% 100%, rgba(255, 255, 255, 0.05), transparent 55%);
}

#story .container {
    position: relative;
    z-index: 1;
}

.story-eyebrow {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 auto 1rem;
}

.section-title--editorial {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.25rem;
    font-size: clamp(1.65rem, 4.2vw, 2.35rem);
    line-height: 1.2;
    font-weight: 600;
}

.section-title--editorial em {
    display: block;
    margin-top: 0.35em;
    font-style: italic;
    font-weight: 500;
    font-size: 0.92em;
    line-height: 1.25;
}

#story .section-title--editorial {
    max-width: 26rem;
}

.story-lead {
    max-width: 40rem;
}

.story-steps {
    list-style: none;
    margin: 2.75rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
}

.story-step {
    position: relative;
    padding: 1.5rem 1.35rem 1.5rem 1.5rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, transparent 45%),
        linear-gradient(210deg, rgba(24, 28, 48, 0.95) 0%, rgba(14, 16, 28, 0.98) 100%);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1), border-color 0.3s ease, box-shadow 0.35s ease;
}

.story-step:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.35),
        0 0 32px rgba(200, 200, 200, 0.08);
}

.story-step__num {
    display: block;
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(2.5rem, 6vw, 3.25rem);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.75rem;
    letter-spacing: -0.04em;
    color: rgba(255, 255, 255, 0.12);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.45);
    text-shadow: 0 0 40px rgba(200, 200, 200, 0.12);
}

.story-step__title {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.story-step__body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

/*
 * Scroll-driven animations (animation-timeline: view / scroll) — progressive enhancement.
 * Inspired by scroll-linked keyframes (Josh Comeau) + subtle depth (Prismic-style parallax context).
 */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        @keyframes sd-view-fade-up {
            from {
                opacity: 0.45;
                transform: translateY(18px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes sd-divider-fade {
            from {
                opacity: 0.18;
            }

            to {
                opacity: 0.88;
            }
        }

        @keyframes sd-photo-settle {
            from {
                opacity: 0.88;
                filter: blur(4px);
            }

            to {
                opacity: 1;
                filter: blur(0);
            }
        }

        footer {
            animation: sd-view-fade-up cubic-bezier(0.22, 1, 0.36, 1) both;
            animation-timeline: view();
            animation-range: entry 0% contain 60%;
        }

        section[id]:not(#hero)::before {
            animation: sd-divider-fade linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 35%;
        }

        #hero .profile-photo {
            animation: sd-photo-settle cubic-bezier(0.33, 1, 0.68, 1) both;
            animation-timeline: view();
            animation-range: entry 0% cover 50%;
        }

        @keyframes hero-stat-scrub {
            from {
                opacity: 0.4;
                transform: translateY(14px) scale(0.97);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        #hero .hero-stats--scrolly .stat {
            animation: hero-stat-scrub cubic-bezier(0.22, 1, 0.36, 1) both;
            animation-timeline: view();
            animation-range: entry 5% cover 45%;
        }

        #hero .hero-stats--scrolly .stat:nth-child(2) {
            animation-range: entry 8% cover 48%;
        }

        #hero .hero-stats--scrolly .stat:nth-child(3) {
            animation-range: entry 11% cover 52%;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-text > * {
        animation: none !important;
    }
}

/* Header: logo + pill menu */
.site-header .header-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-menu-toggle {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: lowercase;
    color: #0a0a0a;
    background: #fafafa;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    padding: 0.55rem 1.1rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-menu-toggle:hover {
    opacity: 0.88;
    transform: scale(1.02);
}

.site-menu-toggle:active {
    transform: scale(0.98);
}

/* Fullscreen menu overlay shell */
.site-menu {
    position: fixed;
    inset: 0;
    z-index: 3500;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.35s ease,
        visibility 0s linear 0.35s;
}

.site-menu.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease;
}

.site-menu__links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

/* Menu panel: light surface like fetched Nuxt overlay (not identical) */
.site-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
}

.site-menu__panel {
    position: relative;
    width: min(100%, 24rem);
    background: #fafafa;
    color: #0a0a0a;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    padding: 2.25rem 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    transform: translateX(100%);
    transition: transform 0.65s var(--motion-ease-out);
    box-shadow: -24px 0 48px rgba(0, 0, 0, 0.12);
}

.site-menu.is-open .site-menu__panel {
    transform: translateX(0);
}

.site-menu__close {
    align-self: flex-end;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #0a0a0a;
    color: #fafafa;
    font-family: 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: lowercase;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-menu__close:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.site-menu__links a {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(1.65rem, 5vw, 2.2rem);
    font-weight: 500;
    color: #0a0a0a;
    text-decoration: none;
    line-height: 1.12;
    letter-spacing: -0.03em;
    transition: opacity 0.35s var(--motion-ease-out), transform 0.35s var(--motion-ease-out);
}

.site-menu__links a:hover {
    opacity: 0.45;
}

.site-menu__email {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: rgba(10, 10, 10, 0.55);
    text-decoration: none;
    word-break: break-all;
}

.site-menu__email:hover {
    color: #0a0a0a;
}

/* Inline nav duplicated in overlay — keep for a11y, hide visually */
.site-header__nav {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* View Transitions API — soft cross-fade on in-page jumps (Chromium; no-op elsewhere) */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.42s;
    animation-timing-function: var(--motion-ease-out);
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* Overlay nav: staggered line-in when menu opens */
@media (prefers-reduced-motion: no-preference) {
    .site-menu.is-open .site-menu__links a {
        animation: studioMenuLinkIn 0.52s var(--motion-ease-out) backwards;
    }

    .site-menu.is-open .site-menu__links a:nth-child(1) { animation-delay: 0.03s; }
    .site-menu.is-open .site-menu__links a:nth-child(2) { animation-delay: 0.07s; }
    .site-menu.is-open .site-menu__links a:nth-child(3) { animation-delay: 0.11s; }
    .site-menu.is-open .site-menu__links a:nth-child(4) { animation-delay: 0.15s; }
    .site-menu.is-open .site-menu__links a:nth-child(5) { animation-delay: 0.19s; }
    .site-menu.is-open .site-menu__links a:nth-child(6) { animation-delay: 0.23s; }
    .site-menu.is-open .site-menu__links a:nth-child(7) { animation-delay: 0.27s; }
    .site-menu.is-open .site-menu__links a:nth-child(8) { animation-delay: 0.31s; }

    .site-menu.is-open .site-menu__email {
        animation: studioMenuLinkIn 0.48s var(--motion-ease-out) 0.34s backwards;
    }
}

@keyframes studioMenuLinkIn {
    from {
        opacity: 0;
        transform: translate3d(14px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}
