/* ============================================================
   Kevin Ehrichs — cinematic personal site
   Phase 1: foundation + hero
   ============================================================ */

:root {
    --app-vh: 1vh;

    /* Stage palette */
    --bg-stage: #07070d;
    --bg-deep: #04040a;
    --bg-elev: #0e0e18;
    --bg-card: rgba(18, 18, 28, 0.72);
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-warm: rgba(255, 180, 138, 0.18);

    /* Text */
    --fg: #ecedf2;
    --fg-soft: #b8bac6;
    --fg-mute: #7d7f8c;
    --fg-faint: rgba(236, 237, 242, 0.42);

    /* Accents */
    --accent: #ff6f3f;
    --accent-warm: #ffb48a;
    --accent-deep: #d04812;
    --accent-cool: #7d58ff;

    /* Type */
    --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Space Grotesk', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Motion */
    --ease-out-quart: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* Layout */
    --stage-max: 1040px;
    --scene-pad-y: clamp(40px, 7vh, 104px);
    --scene-pad-x: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
}

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

body {
    margin: 0;
    padding: 0;
    background: var(--bg-stage);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }

a {
    color: inherit;
    text-decoration: none;
}

/* ------------------------------------------------------------
   Backdrop layers — particles, grain, vignette
   ------------------------------------------------------------ */

#particles-js {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(255, 111, 63, 0.08), transparent 55%),
        radial-gradient(80% 60% at 90% 110%, rgba(125, 88, 255, 0.07), transparent 60%),
        var(--bg-stage);
}

#grain {
    position: fixed;
    inset: 0;
    z-index: 7;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 240px 240px;
}

#vignette {
    position: fixed;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Cursor follow halo — desktop only, eases toward the pointer. */
#cursorGlow {
    position: fixed;
    top: 0;
    left: 0;
    width: 480px;
    height: 480px;
    margin-left: -240px;
    margin-top: -240px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 111, 63, 0.22) 0%, rgba(255, 111, 63, 0.05) 30%, transparent 70%);
    filter: blur(28px);
    mix-blend-mode: screen;
    z-index: 999;
    opacity: 0;
    transform: translate3d(-1000px, -1000px, 0);
    transition: opacity 0.8s ease;
    will-change: transform, opacity;
}

#cursorGlow.is-ready { opacity: 1; }

@media (max-width: 1024px), (any-pointer: coarse), (prefers-reduced-motion: reduce) {
    #cursorGlow { display: none; }
}

/* ------------------------------------------------------------
   Scroll progress + return to top
   ------------------------------------------------------------ */

#scrollProgress {
    position: fixed;
    top: 10%;
    left: calc(18px + env(safe-area-inset-left, 0px));
    width: 2px;
    height: 80%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    z-index: 1000;
    overflow: hidden;
}

#scrollProgress > div {
    width: 100%;
    height: 0;
    background: linear-gradient(180deg, var(--accent-warm), var(--accent));
    box-shadow: 0 0 18px rgba(255, 111, 63, 0.4);
    border-radius: 2px;
}

@media (max-width: 800px) {
    #scrollProgress {
        left: 10px;
        width: 2px;
    }
}

#returnToTop {
    position: fixed;
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 111, 63, 0.42);
    border-radius: 999px;
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 180, 138, 0.24), transparent 55%),
        linear-gradient(180deg, rgba(31, 31, 49, 0.96), rgba(14, 14, 24, 0.96));
    color: var(--accent-warm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.44);
    cursor: pointer;
    z-index: 1100;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.28s var(--ease-out-quart), transform 0.28s var(--ease-out-quart);
}

#returnToTop.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#returnToTop:hover {
    border-color: rgba(255, 180, 138, 0.76);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.54), 0 0 0 1px rgba(255, 111, 63, 0.22) inset;
}

#returnToTop:focus-visible {
    outline: 2px solid rgba(255, 180, 138, 0.95);
    outline-offset: 3px;
}

/* ------------------------------------------------------------
   Cinema container + scene base
   ------------------------------------------------------------ */

.cinema {
    position: relative;
    z-index: 1;
}

.scene {
    position: sticky;
    top: 0;
    height: calc(var(--app-vh, 1vh) * 100);
    height: 100svh;
    padding: var(--scene-pad-y) var(--scene-pad-x);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-stage);
}

/* Z-stacking: each section slides over the previous one */
.scene-hero      { z-index: 1; }
.scene-expertise { z-index: 2; }
.scene-github    { z-index: 3; }
.scene-career    { z-index: 4; }
.scene-contact   { z-index: 5; }

.scene + .scene::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(60%, 480px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hairline-warm), transparent);
    opacity: 0.6;
}

.scene-stage {
    width: min(100%, var(--stage-max));
    margin: 0 auto;
    perspective: 1400px;
    transform-style: preserve-3d;
}

.scene-kicker {
    margin: 0 0 18px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--accent-warm);
    opacity: 0;
}

.scene-kicker::before {
    content: "—";
    margin-right: 12px;
    color: var(--accent);
    opacity: 0.7;
}

.scene-title {
    margin: 0 0 28px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--fg);
    text-wrap: balance;
    opacity: 0;
}

/* Until JS runs, scenes are "pre-render" — content visible but flat. */
.scene.is-entered .scene-kicker,
.scene.is-entered .scene-title { opacity: 1; }

html:not(.js-enabled) .scene-kicker,
html:not(.js-enabled) .scene-title,
html:not(.js-enabled) .hero-title,
html:not(.js-enabled) .hero-lead,
html:not(.js-enabled) .hero-bio p,
html:not(.js-enabled) .hero-lead-bullet,
html:not(.js-enabled) .hero-social,
html:not(.js-enabled) .hero-photo,
html:not(.js-enabled) .expertise-item,
html:not(.js-enabled) .tech-marquee li,
html:not(.js-enabled) .career-item,
html:not(.js-enabled) .contact-video,
html:not(.js-enabled) .contact-cta,
html:not(.js-enabled) .contact-credit,
html:not(.js-enabled) .hero-scroll-cue { opacity: 1 !important; }

/* ------------------------------------------------------------
   Scene: HERO
   ------------------------------------------------------------ */

.scene-hero {
    text-align: center;
    padding-bottom: clamp(52px, 8vh, 104px);
}

.scene-hero .scene-stage { text-align: center; }
.scene-hero .scene-kicker {
    display: inline-block;
}

.hero-title {
    margin: 8px 0 24px;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6.5vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 0.95;
    background: linear-gradient(180deg, #ffffff 0%, #ffe6d4 45%, #ff8a52 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
    opacity: 0;
    /* splitText wrap: 'clip' keeps each char clipped on its own line. */
}

.scene.is-entered .hero-title { opacity: 1; }

.hero-title .anime-text-char {
    display: inline-block;
    will-change: transform, opacity;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 3vw, 28px);
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.hero-top .scene-kicker {
    margin: 0;
}

.hero-top .hero-social {
    margin: 0;
}

.hero-lead {
    margin: 0 auto 40px;
    max-width: 720px;
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.7vw, 1.28rem);
    font-weight: 500;
    line-height: 1.4;
    color: var(--fg-soft);
    text-align: left;
    text-wrap: balance;
    opacity: 0;
}

.hero-lead-line {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 0.6em;
}

.hero-lead-line:last-child {
    margin-bottom: 0;
}

.hero-lead-bullet {
    flex-shrink: 0;
    display: inline-block;
    color: var(--accent);
    font-size: 0.55em;
    line-height: 1;
    transform-origin: center;
    opacity: 0;
    text-shadow: 0 0 8px rgba(255, 111, 63, 0.55), 0 0 18px rgba(255, 111, 63, 0.25);
    will-change: transform, opacity;
}

.hero-lead-text {
    flex: 1;
    min-width: 0;
}

.hero-bio {
    max-width: 680px;
    margin: 0 auto 36px;
    text-align: left;
}

.hero-bio p {
    margin: 16px 0;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    line-height: 1.7;
    color: var(--fg-soft);
    opacity: 0;
}

.hero-socials {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 12px;
}

.hero-social {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 0 0 56px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--fg-soft);
    border: 1px solid var(--hairline-warm);
    background: rgba(255, 180, 138, 0.04);
    transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out-quart);
    opacity: 0;
    will-change: transform, opacity;
}

.hero-top .hero-socials .hero-social { margin: 0; }

.hero-social i {
    color: var(--accent-warm);
    font-size: 1.1rem;
}

.hero-social:hover {
    color: var(--fg);
    border-color: rgba(255, 111, 63, 0.5);
    background: rgba(255, 111, 63, 0.08);
    transform: translateY(-1px);
}

.hero-photos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.hero-photo {
    --enter-y: 0px;
    --enter-scale: 1;
    --parallax-y: 0px;
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 5;
    max-height: clamp(200px, 26vh, 290px);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--hairline-warm);
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 111, 63, 0.05) inset;
    background: var(--bg-elev);
    opacity: 0;
    transform-origin: center bottom;
    transform: translate3d(0, calc(var(--enter-y) + var(--parallax-y)), 0) scale(var(--enter-scale));
    transition: box-shadow 0.6s var(--ease-out-quart);
    will-change: transform, opacity;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
    transition: transform 0.8s var(--ease-out-quart), filter 0.6s var(--ease-out-quart);
}

.hero-photo:hover {
    box-shadow: 0 36px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 111, 63, 0.18) inset;
}

.hero-photo:hover img {
    transform: scale(1.05);
    filter: saturate(1.15) contrast(1.08);
}

.hero-photo figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 18px 16px 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-align: left;
    color: var(--accent-warm);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.hero-scroll-cue {
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--fg-mute);
    opacity: 0;
}

.hero-scroll-cue span {
    position: relative;
    display: inline-block;
    padding-bottom: 28px;
}

.hero-scroll-cue span::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 1px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent-warm), transparent);
    transform: translateX(-50%);
    animation: scrollCueDrift 2.2s var(--ease-in-out) infinite;
}

@keyframes scrollCueDrift {
    0%, 100% { transform: translate(-50%, -4px); opacity: 0.3; }
    50%      { transform: translate(-50%, 4px); opacity: 1; }
}

/* Hero boot scanline — single thin warm line that sweeps top-to-bottom once
   on first hero entry. Pairs with the title decoder for a "firmware boot"
   first-impression. JS sets --scan-distance to the hero's pixel height. */
.hero-scanline {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 4;
}

.hero-scanline::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 180, 138, 0.55) 25%,
        rgba(255, 111, 63, 0.95) 50%,
        rgba(255, 180, 138, 0.55) 75%,
        transparent 100%);
    box-shadow: 0 0 14px rgba(255, 180, 138, 0.65), 0 0 28px rgba(255, 111, 63, 0.32);
    transform: translateY(-2px);
    opacity: 0;
    animation: heroScanlineSweep 1100ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes heroScanlineSweep {
    0%   { transform: translateY(-2px); opacity: 0; }
    8%   { opacity: 0.92; }
    92%  { opacity: 0.92; }
    100% { transform: translateY(var(--scan-distance, 100vh)); opacity: 0; }
}

/* Hero title glitch — periodic RGB channel split + char jitter */
@keyframes heroGlitch {
    0%   { text-shadow: none; }
    12%  { text-shadow: -4px 0 rgba(255, 0, 60, 0.7), 4px 0 rgba(0, 240, 220, 0.7); transform: translateX(-3px) skewX(-0.4deg); }
    24%  { text-shadow:  3px 0 rgba(255, 0, 60, 0.7), -3px 0 rgba(0, 240, 220, 0.7); transform: translateX( 3px) skewX( 0.4deg); }
    36%  { text-shadow: none; transform: translateX(0); }
    48%  { text-shadow: -2px 0 rgba(255, 0, 60, 0.7),  2px 0 rgba(0, 240, 220, 0.7); transform: translateX(-2px); }
    60%  { text-shadow:  2px 0 rgba(255, 0, 60, 0.7), -2px 0 rgba(0, 240, 220, 0.7); transform: translateX( 2px); }
    72%  { text-shadow: none; transform: translateX(0); }
    84%  { text-shadow: -1px 0 rgba(255, 0, 60, 0.4),  1px 0 rgba(0, 240, 220, 0.4); transform: translateX(-1px); }
    100% { text-shadow: none; transform: none; }
}

.hero-title.is-glitching {
    animation: heroGlitch 420ms linear forwards;
}

/* Narrow phones: trim the gap so the 3-up cinematic strip still breathes,
   but keep desktop's grid + aspect-ratio so mobile reads the same. */
@media (max-width: 480px) {
    .hero-photos {
        gap: 10px;
        margin-top: 12px;
    }

    .hero-photo {
        max-height: clamp(150px, 30vw, 220px);
        border-radius: 14px;
    }

    .hero-photo figcaption {
        padding: 14px 10px 10px;
        font-size: 0.6rem;
        letter-spacing: 0.14em;
    }
}

/* ------------------------------------------------------------
   Scene: EXPERTISE  (Phase 1 styling — animations get fancier in Phase 2)
   ------------------------------------------------------------ */

.expertise-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    transform-style: preserve-3d;
}

.expertise-item {
    position: relative;
    padding: 28px 24px 26px;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    opacity: 0;
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transition: border-color 0.4s, box-shadow 0.4s;
}

.expertise-item::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.expertise-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 111, 63, 0.32);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.55);
}

.expertise-item:hover::before { opacity: 1; }

.expertise-item i {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    color: var(--accent-warm);
    background: rgba(255, 111, 63, 0.1);
    border: 1px solid rgba(255, 111, 63, 0.18);
}

.expertise-item h3 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--fg);
    letter-spacing: -0.005em;
}

.expertise-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--fg-soft);
}

/* Keep desktop's 2x2 grid; just tighten the cards on phones. */
@media (max-width: 540px) {
    .expertise-grid { gap: 12px; }
    .expertise-item { padding: 18px 14px 16px; border-radius: 16px; }
    .expertise-item i { width: 36px; height: 36px; margin-bottom: 10px; font-size: 0.95rem; }
    .expertise-item h3 { font-size: 0.95rem; margin-bottom: 8px; }
    .expertise-item p { font-size: 0.78rem; line-height: 1.45; }
}

/* Tech stack — chip-marquee */
.tech-marquee {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.tech-marquee li {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 16px 24px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--fg-soft);
    background: rgba(20, 20, 32, 0.7);
    border: 1px solid var(--hairline);
    transition: border-color 0.3s, color 0.3s, background 0.3s;
    opacity: 0;
    will-change: transform, opacity;
}

.tech-marquee li i {
    color: var(--accent-warm);
    font-size: 1.1rem;
}

.tech-marquee li:hover {
    color: var(--fg);
    border-color: rgba(255, 111, 63, 0.4);
    background: rgba(28, 22, 38, 0.86);
}

/* Compact horizontal chip row when tech-marquee is paired with the
   GitHub heatmap — chips wrap into 2-3 rows, smaller padding, centered. */
.tech-marquee.github-stack {
    justify-content: center;
    gap: 8px 10px;
    margin: 6px auto 22px;
    max-width: 760px;
}

.tech-marquee.github-stack li {
    padding: 8px 14px;
    font-size: 0.82rem;
    gap: 8px;
}

.tech-marquee.github-stack li i {
    font-size: 0.95rem;
}

/* ------------------------------------------------------------
   Scene: GITHUB — contribution heatmap with scanline sweep
   ------------------------------------------------------------ */

.scene-github .scene-stage { text-align: center; }

.github-heatmap-wrap {
    position: relative;
    margin: 0 auto 28px;
    max-width: 920px;
    padding: clamp(16px, 2.5vw, 26px);
    background: var(--bg-card);
    border: 1px solid var(--hairline-warm);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.6);
}

.github-heatmap {
    position: relative;
    width: 100%;
    min-height: 96px;
}

.github-heatmap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Cells start invisible; choreography fades them in left-to-right. */
.github-heatmap.is-pre svg rect { opacity: 0; }

.github-scanline {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 16px rgba(255, 111, 63, 0.65), 0 0 32px rgba(255, 111, 63, 0.35);
    opacity: 0;
    transform: translateX(0);
}

.github-caption {
    margin: 0 0 22px;
    color: var(--fg-mute);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.8;
}

.github-stack-label {
    margin: 6px 0 4px;
    color: var(--fg-mute);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    opacity: 0.6;
}

.github-cta { margin: 0; }

/* ------------------------------------------------------------
   Scene: CAREER — oscilloscope timeline
   ------------------------------------------------------------ */

/* Faint grid backdrop, masked toward the center */
.scene-career::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 111, 63, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 111, 63, 0.06) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    opacity: 0.55;
    -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
    mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
    z-index: 0;
}

/* Scanline sweep when scene first activates */
.scene-career::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: 220px;
    background: linear-gradient(180deg, transparent, rgba(255, 180, 138, 0.18), rgba(255, 111, 63, 0.05), transparent);
    pointer-events: none;
    opacity: 0;
    z-index: 0;
    transform: translateY(0);
}

.scene-career.is-entered::after {
    animation: careerScanSweep 1.8s cubic-bezier(0.25, 0.8, 0.4, 1) 1 forwards;
}

@keyframes careerScanSweep {
    0%   { transform: translateY(0); opacity: 0; }
    18%  { opacity: 0.65; }
    100% { transform: translateY(120vh); opacity: 0; }
}

.scene-career .scene-stage {
    position: relative;
    z-index: 1;
}

/* Track + beam + list */
.career-track {
    position: relative;
    padding-left: 56px;
    opacity: 0;
}

.career-track-rail {
    position: absolute;
    left: 22px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    z-index: 0;
}

.career-track-rail::before,
.career-track-rail::after {
    content: "";
    position: absolute;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 111, 63, 0.4);
    box-shadow: 0 0 12px rgba(255, 111, 63, 0.42);
}

.career-track-rail::before { top: -10px; }
.career-track-rail::after  { bottom: -10px; opacity: 0.4; }

.career-track-beam {
    position: absolute;
    left: 22px;
    top: 8px;
    width: 2px;
    height: var(--career-progress, 0px);
    background: linear-gradient(180deg, var(--accent-warm), var(--accent));
    box-shadow: 0 0 18px rgba(255, 111, 63, 0.55), 0 0 4px rgba(255, 220, 200, 0.6);
    border-radius: 2px;
    z-index: 1;
    pointer-events: none;
    will-change: height;
    transition: height 0.45s var(--ease-out-quart);
}

.career-track-beam::after {
    content: "";
    position: absolute;
    left: -5px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--accent-warm) 38%, transparent 70%);
    box-shadow: 0 0 16px rgba(255, 200, 160, 0.85);
    animation: probePulse 1.4s ease-in-out infinite;
}

@keyframes probePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.45); opacity: 0.7; }
}

.career-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.career-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: start;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
    opacity: 0.42;
    transform: translateX(-6px);
    transition: opacity 0.55s var(--ease-out-quart), transform 0.55s var(--ease-out-quart), border-color 0.45s, box-shadow 0.45s;
}

.career-item.is-lit {
    opacity: 1;
    transform: translateX(0);
    border-color: rgba(255, 111, 63, 0.34);
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 111, 63, 0.12) inset;
}

.career-blip {
    position: absolute;
    left: -42px;
    top: 26px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(8, 8, 14, 0.96);
    border: 2px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 4px rgba(8, 8, 14, 0.78);
    transition: all 0.45s var(--ease-out-quart);
    z-index: 4;
}

.career-item.is-lit .career-blip {
    background: var(--accent);
    border-color: var(--accent-warm);
    animation: blipPulse 2.4s ease-in-out infinite;
}

@keyframes blipPulse {
    0%, 100% {
        box-shadow:
            0 0 16px rgba(255, 111, 63, 0.6),
            0 0 0 4px rgba(255, 111, 63, 0.14),
            0 0 0 8px rgba(8, 8, 14, 0.78);
    }
    50% {
        box-shadow:
            0 0 26px rgba(255, 111, 63, 0.95),
            0 0 0 6px rgba(255, 111, 63, 0.22),
            0 0 0 10px rgba(8, 8, 14, 0.78);
    }
}

.career-index {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fg-mute);
    line-height: 1.2;
    transition: color 0.5s ease;
}

.career-item.is-lit .career-index {
    color: var(--accent-warm);
    animation: indexFlicker 0.7s steps(7) 1;
}

@keyframes indexFlicker {
    0%   { opacity: 0; }
    14%  { opacity: 1; }
    28%  { opacity: 0.3; }
    42%  { opacity: 1; }
    56%  { opacity: 0.5; }
    71%  { opacity: 1; }
    85%  { opacity: 0.7; }
    100% { opacity: 1; }
}

.career-item p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--fg-soft);
    text-wrap: pretty;
}

/* Keep desktop's auto+1fr grid (index column visible) on phones,
   just tighten the rail/blip geometry so the timeline still fits. */
@media (max-width: 540px) {
    .career-track {
        padding-left: 44px;
    }

    .career-track-rail,
    .career-track-beam {
        left: 16px;
    }

    .career-blip {
        left: -36px;
        top: 22px;
        width: 12px;
        height: 12px;
    }

    .career-item {
        gap: 14px;
        padding: 18px 18px 18px 20px;
    }

    .career-index {
        font-size: 0.9rem;
    }

    .career-item p {
        font-size: 0.88rem;
    }
}

/* ------------------------------------------------------------
   Scene: CONTACT
   ------------------------------------------------------------ */

.scene-contact {
    text-align: center;
}

.scene-contact .scene-stage { text-align: center; perspective: 1100px; }
.scene-contact .scene-kicker { display: inline-block; }
.scene-contact .scene-title {
    margin: 0 auto 40px;
    max-width: 820px;
    transform-style: preserve-3d;
}

.scene-contact .scene-title span {
    display: inline-block;
    transform-origin: 50% 100%;
    will-change: transform, opacity;
}

.contact-video {
    position: relative;
    width: min(100%, 880px);
    margin: 0 auto;
    isolation: isolate;
    opacity: 0;
}

.contact-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--hairline-warm);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
    background:
        linear-gradient(180deg, rgba(6, 6, 11, 0.2), rgba(6, 6, 11, 0.62)),
        url("https://i.ytimg.com/vi/_gFSaAoCfYE/hqdefault.jpg") center / cover no-repeat,
        var(--bg-elev);
}

/* Subtle attention aura behind the video. */
.contact-video::before {
    content: "";
    position: absolute;
    inset: -28px;
    border-radius: 32px;
    background: radial-gradient(ellipse at center, rgba(255, 111, 63, 0.22), transparent 65%);
    filter: blur(20px);
    pointer-events: none;
    opacity: 0;
    z-index: -1;
    animation: contactAura 5.6s ease-in-out infinite;
}

.scene-contact.is-entered .contact-video::before {
    animation-delay: 1.2s;
}

@keyframes contactAura {
    0%, 100% { opacity: 0.18; transform: scale(0.96); }
    50%      { opacity: 0.5;  transform: scale(1.02); }
}

.contact-video-player,
.contact-video-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.contact-video-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    pointer-events: none;
    color: rgba(255, 236, 224, 0.82);
    background: linear-gradient(180deg, rgba(6, 6, 11, 0.14), rgba(6, 6, 11, 0.5));
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.55s var(--ease-out-quart), visibility 0.55s;
}

.contact-video-loader-mark {
    width: 52px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--accent-warm), transparent);
    box-shadow: 0 0 18px rgba(255, 111, 63, 0.48);
    animation: contactVideoLoad 1.4s ease-in-out infinite;
}

.contact-video.is-playing .contact-video-loader {
    opacity: 0;
    visibility: hidden;
}

@keyframes contactVideoLoad {
    0%, 100% { transform: scaleX(0.35); opacity: 0.42; }
    50% { transform: scaleX(1); opacity: 1; }
}

.contact-video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 4px 0;
}

.contact-video-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-mute);
}

.contact-video-status::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--accent-warm);
    box-shadow: 0 0 0 4px rgba(255, 111, 63, 0.1), 0 0 14px rgba(255, 111, 63, 0.34);
}

.contact-video.is-playing .contact-video-status::before {
    animation: contactVideoLive 1.8s ease-in-out infinite;
}

@keyframes contactVideoLive {
    0%, 100% { opacity: 0.55; transform: scale(0.88); }
    50% { opacity: 1; transform: scale(1.08); }
}

.contact-video-sound {
    appearance: none;
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 180, 138, 0.2);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--accent-warm);
    background: rgba(12, 12, 20, 0.52);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.3s var(--ease-out-quart);
}

.contact-video-sound:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(255, 180, 138, 0.58);
    color: var(--fg);
    background: rgba(255, 111, 63, 0.12);
}

.contact-video-sound:focus-visible {
    outline: 2px solid rgba(255, 180, 138, 0.94);
    outline-offset: 3px;
}

.contact-video-sound:disabled {
    cursor: wait;
    opacity: 0.48;
}

.contact-video.is-blocked .contact-video-sound {
    border-color: rgba(255, 111, 63, 0.52);
    color: var(--fg);
    background: rgba(255, 111, 63, 0.16);
}

.contact-cta {
    margin: 56px auto 0;
    opacity: 0;
}

.contact-eyebrow {
    margin: 0 0 14px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.42em;
    color: var(--fg-mute);
}

.contact-cta {
    display: inline-block;
    padding: 16px 24px;
    /* magnetic hit area extends beyond the button */
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 500;
    color: var(--fg);
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 180, 138, 0.18), transparent 60%),
        linear-gradient(135deg, rgba(255, 111, 63, 0.2), rgba(125, 88, 255, 0.14));
    border: 1px solid rgba(255, 111, 63, 0.36);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    transition: transform 0.5s var(--ease-out-quart), border-color 0.4s, box-shadow 0.4s;
    will-change: transform;
    position: relative;
    overflow: hidden;
}

.contact-link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: radial-gradient(circle at var(--shine-x, 50%) var(--shine-y, 50%), rgba(255, 220, 196, 0.32), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.contact-link:hover {
    border-color: rgba(255, 180, 138, 0.7);
    box-shadow: 0 30px 56px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 111, 63, 0.18) inset;
}

.contact-link:hover::before { opacity: 1; }

.contact-link i {
    color: var(--accent-warm);
    font-size: 1.2rem;
}

.contact-credit {
    margin: 80px 0 0;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--fg-faint);
    opacity: 0;
}

@media (max-width: 540px) {
    .contact-link { padding: 14px 22px; }
    .scene-contact .scene-title { margin-bottom: 26px; }
    .contact-video-frame { min-height: 210px; aspect-ratio: auto; }
    .contact-video-meta { gap: 10px; padding-top: 10px; }
    .contact-video-status { font-size: 0.62rem; letter-spacing: 0.11em; }
    .contact-video-sound { padding: 7px 10px; font-size: 0.62rem; }
    .contact-credit { margin-top: 56px; }
}

/* ------------------------------------------------------------
   Reduced motion — flatten everything to a calm, readable state
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .scene-kicker,
    .scene-title,
    .hero-title,
    .hero-lead,
    .hero-bio p,
    .hero-lead-bullet,
    .hero-social,
    .hero-photo,
    .hero-scroll-cue,
    .expertise-item,
    .tech-marquee li,
    .career-track,
    .career-item,
    .contact-video,
    .contact-cta,
    .contact-credit {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .hero-scroll-cue span::after,
    .career-track-beam::after,
    .career-item.is-lit .career-blip,
    .career-item.is-lit .career-index,
    .contact-video::before,
    .contact-video-loader-mark,
    .contact-video-status::before,
    .scene-career::after {
        animation: none !important;
    }

    .career-track-beam {
        height: 100% !important;
    }

    .career-item .career-blip {
        background: var(--accent);
        border-color: var(--accent-warm);
    }

    .career-item .career-index {
        color: var(--accent-warm);
    }
}

/* ------------------------------------------------------------
   Phone polish — keep desktop's structure, just dial back atmospherics
   so the smaller viewport doesn't get visually overloaded.
   ------------------------------------------------------------ */
@media (max-width: 540px) {
    .scene-career::before {
        background-size: 48px 48px;
        opacity: 0.4;
    }

    /* Particles backdrop already tuned via JS density; keep grain a touch lighter on phones. */
    #grain { opacity: 0.04; }
}
