/* ============================================================
   Portfolio v2 — editorial dark redesign
   Type: Atomed (display) · Exo 2 (body/headings) · Space Mono (labels)
   ============================================================ */

/* Atomed display font, self-hosted from /Assets/Font/. */
@font-face {
    font-family: 'Atomed';
    src: url('/Assets/Font/atomed-x31w8.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0a0a0c;
    --surface: #101014;
    --ink: #ececea;
    --muted: #93939b;
    --faint: #5c5c64;
    --accent: #c8f14f;
    --accent-ink: #0d1202;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    /* Atomed = big display type (name, section titles); Exo 2 = body + sub-headings. */
    --font-display: 'Atomed', 'Space Grotesk', sans-serif;
    --font-head: 'Exo 2', 'Space Grotesk', sans-serif;
    --font-body: 'Exo 2', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --pad: clamp(1.25rem, 4vw, 4rem);
    --nav-h: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* Film-grain overlay for depth */
.noise {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.version-badge {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 2100;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--faint);
}

/* ============================== NAV ============================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad);
    border-bottom: 1px solid transparent;
    transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}

.nav.is-scrolled {
    background: rgba(10, 10, 12, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}

.nav.is-hidden { transform: translateY(-100%); }

.nav-logo {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.nav-links { display: flex; gap: 1.75rem; }

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    transition: color 0.2s ease;
    position: relative;
    padding: 4px 0;
}

.nav-link:hover, .nav-link.is-active { color: var(--ink); }

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

.nav-link--ext { color: var(--accent); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 7px;
    padding: 10px 4px;
    z-index: 1200;
}

.nav-toggle-bar {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); }

/* Full-screen mobile menu */
/* Sits below .nav so the logo and toggle stay clickable above the overlay. */
.menu {
    position: fixed;
    inset: 0;
    z-index: 990;
    background: rgba(10, 10, 12, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--pad);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.menu.is-open { opacity: 1; visibility: visible; }

.menu-links { display: flex; flex-direction: column; gap: 0.25rem; }

.menu-link {
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 3.2rem);
    font-weight: 400;
    line-height: 1.25;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    color: var(--ink);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.menu.is-open .menu-link { opacity: 1; transform: translateY(0); }
.menu.is-open .menu-link:nth-child(1) { transition-delay: 0.05s; }
.menu.is-open .menu-link:nth-child(2) { transition-delay: 0.1s; }
.menu.is-open .menu-link:nth-child(3) { transition-delay: 0.15s; }
.menu.is-open .menu-link:nth-child(4) { transition-delay: 0.2s; }
.menu.is-open .menu-link:nth-child(5) { transition-delay: 0.25s; }
.menu.is-open .menu-link:nth-child(6) { transition-delay: 0.3s; }

.menu-link-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
}

.menu-footer {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

.menu-ext {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

/* ============================== HERO ============================== */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--nav-h) + 2rem) var(--pad) 0;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 55% at 75% 8%, rgba(200, 241, 79, 0.07), transparent 60%),
        radial-gradient(ellipse 60% 45% at 12% 90%, rgba(90, 120, 255, 0.06), transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 72px 72px, 72px 72px;
    mask-image: linear-gradient(to bottom, black 55%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent);
}

.hero-inner { position: relative; }

.hero-kicker {
    font-family: var(--font-mono);
    font-size: clamp(0.68rem, 1.4vw, 0.82rem);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.hero-kicker-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(200, 241, 79, 0.8);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.hero-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3.4rem, 14.5vw, 12.5rem);
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin-left: -0.05em;
}

.hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2.5rem;
    margin: clamp(1.5rem, 4vh, 3rem) 0;
    flex-wrap: wrap;
}

.hero-sub {
    max-width: 34rem;
    font-size: clamp(0.98rem, 1.6vw, 1.15rem);
    color: var(--muted);
}

.hero-ctas { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.9rem 1.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}

.btn--solid {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    font-weight: 700;
}

.btn--solid:hover { background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--big { padding: 1.1rem 2.2rem; }

.hero-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    margin: 0 calc(-1 * var(--pad));
    padding: 0 var(--pad);
}

.hero-stat {
    padding: 1.4rem 1rem 1.6rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hero-stat + .hero-stat { padding-left: 1.4rem; border-left: 1px solid var(--line); }

.hero-stat-n {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
}

.hero-stat-l {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--faint);
}

/* ============================== MARQUEE ============================== */

.marquee {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    padding: 0.9rem 0;
    background: var(--surface);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 36s linear infinite;
}

.marquee-seg {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    white-space: nowrap;
    padding-right: 0.5rem;
}

.marquee-seg i { font-style: normal; color: var(--accent); padding: 0 0.6rem; }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ============================== SECTION SCAFFOLD ============================== */

.section {
    padding: clamp(5rem, 11vh, 8.5rem) var(--pad);
    border-bottom: 1px solid var(--line);
}

.section-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: end;
    margin-bottom: clamp(3rem, 7vh, 5.5rem);
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    padding-bottom: 0.6rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 6.5vw, 5rem);
    line-height: 1.02;
    letter-spacing: 0;
    text-transform: uppercase;
}

.section-desc {
    max-width: 24rem;
    color: var(--muted);
    font-size: 0.95rem;
    padding-bottom: 0.35rem;
}

/* ============================== WORK / PROJECTS ============================== */

.projects { display: flex; flex-direction: column; }

.project {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(2.5rem, 6vh, 4.5rem) 0;
    border-top: 1px solid var(--line);
    align-items: center;
}

.project:nth-child(even) .project-media { order: 2; }

.project-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--line);
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.project-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.6s ease, transform 0.8s ease;
}

.project-media.is-playing video { opacity: 1; transform: scale(1); }

.project-media:hover video { transform: scale(1.03); }

.project-media-num {
    position: absolute;
    top: 0.9rem;
    left: 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(0, 0, 0, 0.45);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
}

.project-info { min-width: 0; }

.project-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.project-meta .sep { color: var(--faint); padding: 0 0.5rem; }

.project-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.project-desc { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.4rem; }
.project-desc a { color: var(--accent); border-bottom: 1px solid transparent; }
.project-desc a:hover { border-bottom-color: var(--accent); }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink);
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 0.35rem;
    transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}

.project-link:hover { color: var(--accent); border-color: var(--accent); gap: 0.8rem; }

.work-more {
    border-top: 1px solid var(--line);
    padding-top: clamp(2.5rem, 6vh, 4rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.work-more-lead {
    font-family: var(--font-head);
    font-size: clamp(1.2rem, 2.4vw, 1.7rem);
    font-weight: 500;
}

/* ============================== UNITY / CAPABILITIES ============================== */

.cap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.cap-cell {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1.8rem 1.5rem 2rem;
    transition: background 0.3s ease;
}

.cap-cell:hover { background: var(--surface); }

.cap-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.02rem;
    margin-bottom: 1rem;
    color: var(--ink);
}

.cap-list li {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.32rem 0 0.32rem 1.1rem;
    position: relative;
}

.cap-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--faint);
}

/* ============================== SKILLS ============================== */

.expertise {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    margin-bottom: clamp(3.5rem, 8vh, 6rem);
}

.expertise-item {
    border-left: 2px solid var(--accent);
    padding-left: 1.5rem;
}

.expertise-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
}

.expertise-item p { color: var(--muted); font-size: 0.93rem; }

.tech {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.tech-page {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.4rem clamp(1.5rem, 3vw, 2.5rem);
}

.tech-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.7rem;
    margin-bottom: 0.9rem;
}

.tech-list li {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.28rem 0;
}

.tech-col--more .tech-list li { color: var(--ink); }

/* ============================== ABOUT ============================== */

.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}

.about-lede {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.2vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 1.6rem;
}

.about-copy p:not(.about-lede) {
    color: var(--muted);
    font-size: 1.02rem;
    margin-bottom: 1rem;
    max-width: 38rem;
}

.about-stats { display: flex; flex-direction: column; }

.about-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
}

.about-stat:first-child { border-top: 1px solid var(--line); }

.about-stat-n {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    color: var(--accent);
}

.about-stat-l {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--faint);
}

/* ============================== EXPERIENCE (timeline) ==============================
   Vertical spine on the left; each role draws its line segment + dot as it
   scrolls into view, so the timeline visibly builds. */

.xp {
    --tl-pad: clamp(2rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    padding-left: var(--tl-pad);
}

.xp-item {
    position: relative;
    padding: clamp(1.6rem, 3.5vh, 2.6rem) 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
}

/* Line segment: one per item, drawn top-to-bottom on reveal */
.xp-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--tl-pad));
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line-strong);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.xp-item.is-visible::before { transform: scaleY(1); }

/* Node dot, pops once the segment reaches it */
.xp-item::after {
    content: '';
    position: absolute;
    left: calc(-1 * var(--tl-pad));
    top: clamp(2.2rem, 4.5vh, 3.2rem);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    transform: translateX(-50%) scale(0);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s;
}

.xp-item.is-visible::after { transform: translateX(-50%) scale(1); }

.xp-item:first-child::after { box-shadow: 0 0 16px rgba(200, 241, 79, 0.5); }

.xp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.xp-role {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    line-height: 1.25;
}

.xp-org {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-top: 0.4rem;
}

.xp-meta { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }

.xp-period {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--faint);
    white-space: nowrap;
}

.xp-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-weight: 700;
}

.xp-bullets {
    max-width: 52rem;
    columns: 1;
}

.xp-bullets li {
    font-size: 0.9rem;
    color: var(--muted);
    padding: 0.3rem 0 0.3rem 1.2rem;
    position: relative;
}

.xp-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--faint);
}

.xp-bullets em { color: var(--ink); font-style: italic; }

/* Impact numbers pop in accent green. */
.xp-bullets strong { color: var(--accent); font-weight: 700; }

/* ============================== CONTACT ============================== */

.contact { border-bottom: none; }

.contact-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: clamp(1.8rem, 4vw, 3.5rem);
    background: var(--surface);
}

.email-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    width: 100%;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    padding: 1.5rem 1.8rem;
    text-align: left;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.email-btn:hover { border-color: var(--accent); background: rgba(200, 241, 79, 0.04); }
.email-btn[hidden] { display: none; }

.email-btn-label {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.3rem;
}

.email-btn-hint {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--faint);
}

.email-out {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 1.5rem 1.8rem;
}

.email-out[hidden] { display: none; }

.email-link {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    color: var(--accent);
    word-break: break-all;
}

.email-copy {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.email-copy:hover { border-color: var(--accent); color: var(--accent); }

.contact-links { display: flex; flex-direction: column; }

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 1.05rem 0.2rem;
    border-bottom: 1px solid var(--line);
    transition: color 0.2s ease, padding-left 0.25s ease;
}

.contact-link:first-child { border-top: 1px solid var(--line); }
.contact-link:hover { color: var(--accent); padding-left: 0.8rem; }
.contact-link[hidden] { display: none; }

/* ============================== FOOTER ============================== */

.footer {
    border-top: 1px solid var(--line);
    padding: clamp(2.5rem, 6vh, 4rem) var(--pad) 2rem;
    background: var(--surface);
}

.footer-top {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 2.5rem;
}

.footer-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    letter-spacing: 0;
    text-transform: uppercase;
}

.footer-role {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--faint);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
}

.footer-copy { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }

.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

.footer-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    transition: color 0.2s ease;
}

.footer-link:hover { color: var(--accent); }
.footer-link[hidden] { display: none; }

/* ============================== REVEAL ANIMATION ============================== */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .marquee-track { animation: none; }
    html { scroll-behavior: auto; }
}

/* ============================== MODE: PINNED (variant A) ==============================
   Each .pin-section pins on screen while scroll steps through its .pin-step items.
   main.js wraps section contents in .pin-sticky, moves swap steps into .pin-stage,
   and sets --pin-steps. Sections opt into pacing via --step-len. */

body.mode-pinned .pin-section {
    height: calc(100svh + var(--pin-steps, 1) * var(--step-len, 50vh));
    padding: 0;
}

body.mode-pinned #unity { --step-len: 40vh; }
body.mode-pinned #about { --step-len: 62vh; }
body.mode-pinned #contact { --step-len: 48vh; }
body.mode-pinned #work { --step-len: 82vh; }

body.mode-pinned .pin-sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav-h) + 1rem) var(--pad) 1.25rem;
}

/* Tighter rhythm so a full section fits one viewport */
body.mode-pinned .section-head { margin-bottom: clamp(1.2rem, 3vh, 2.2rem); }
body.mode-pinned .cap-cell { padding: 1.1rem 1.2rem 1.2rem; }
body.mode-pinned .cap-title { margin-bottom: 0.6rem; }
body.mode-pinned .cap-list li { font-size: 0.8rem; padding: 0.22rem 0 0.22rem 1rem; }

body.mode-pinned .pin-step {
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-pinned .pin-step.step-future {
    opacity: 0;
    transform: translateY(44px);
    pointer-events: none;
}

/* Swap stage: steps stack on top of each other, one visible at a time */
body.mode-pinned .pin-stage {
    position: relative;
    flex: 1;
    min-height: 0;
}

body.mode-pinned .pin-stage .pin-step {
    position: absolute;
    inset: 0;
    margin: auto;
    height: fit-content;
    max-height: 100%;
    width: 100%;
    overflow: hidden;
    border-top: none;
    padding: 0;
}

body.mode-pinned .pin-stage .pin-step.step-past {
    opacity: 0;
    transform: translateY(-44px);
    pointer-events: none;
}

/* Equal columns so the media box is the same size on left- and right-side cards */
body.mode-pinned .pin-stage .project {
    max-width: 1150px;
    grid-template-columns: 1fr 1fr;
}

/* Work: the heading overlays the top so the card centers in the viewport,
   and steps don't clip the video while it morphs from the center. */
body.mode-pinned #work .pin-sticky { padding-top: 1.25rem; }

body.mode-pinned #work .section-head {
    position: absolute;
    top: calc(var(--nav-h) + 1rem);
    left: var(--pad);
    right: var(--pad);
    margin-bottom: 0;
    z-index: 1;
}

body.mode-pinned #work .pin-stage .pin-step { overflow: visible; }

/* ---------- About: scroll-driven copy lines + counting stat cards ----------
   Copy paragraphs cascade in one at a time; each stat card slides in, its
   number counts up with scroll, then the label reveals (classes from main.js). */

/* Slightly tighter rhythm so all copy lines fit the pinned viewport. */
body.mode-pinned #about .about-lede { margin-bottom: 1.2rem; }
body.mode-pinned #about .about-copy p:not(.about-lede) { margin-bottom: 0.8rem; font-size: 0.98rem; }

body.mode-pinned #about .about-copy > p {
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.45s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-pinned #about .about-copy > p.line-in {
    opacity: 1;
    transform: none;
}

body.mode-pinned #about .about-stat {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.45s ease,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-pinned #about .about-stat.stat-in {
    opacity: 1;
    transform: none;
}

body.mode-pinned #about .about-stat-l {
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.4s ease,
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-pinned #about .about-stat.label-in .about-stat-l {
    opacity: 1;
    transform: none;
}

/* ---------- Skills: pinned stack, one card per scroll step ----------
   The section pins while each expertise card, then each tech column, arrives
   one by one with scroll. Within the active card the list entries scrub in
   one at a time (line-in classes set from main.js). Compact layout so all
   12 cards fit one viewport as they accumulate. */

body.mode-pinned #skills { --step-len: 24vh; }

body.mode-pinned #skills .section-head { margin-bottom: clamp(1.2rem, 3vh, 2rem); }
body.mode-pinned #skills .section-title { font-size: clamp(2rem, 4.5vw, 3.4rem); }

body.mode-pinned #skills .expertise {
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1rem, 2vw, 1.8rem);
    margin-bottom: clamp(1.4rem, 3.5vh, 2.6rem);
}

body.mode-pinned #skills .expertise-item { padding-left: 1.1rem; }

body.mode-pinned #skills .expertise-title {
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    margin-bottom: 0.45rem;
}

body.mode-pinned #skills .expertise-item p {
    font-size: 0.78rem;
    line-height: 1.55;
}

body.mode-pinned #skills .tech { gap: clamp(1.2rem, 2.5vh, 2rem); }

body.mode-pinned #skills .tech-list li {
    font-size: 0.78rem;
    padding: 0.17rem 0;
}

body.mode-pinned #skills .pin-step .tech-list li,
body.mode-pinned #skills .pin-step > p {
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.4s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-pinned #skills .pin-step .tech-list li.line-in,
body.mode-pinned #skills .pin-step > p.line-in {
    opacity: 1;
    transform: none;
}

/* ---------- Unity: scroll-driven bullet reveal (pinned mode) ----------
   Each capability card shows its title first; the bullets slide in one by
   one as scroll progresses through the step (classes set from main.js). */

body.mode-pinned .unity .pin-step .cap-list li {
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.4s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-pinned .unity .pin-step .cap-list li.line-in {
    opacity: 1;
    transform: none;
}

/* ---------- Work: scroll-driven line reveal (pinned mode) ----------
   The video shows first; each info line slides in as scroll progresses
   through the step (classes toggled from main.js based on position). */

/* The media box is driven frame-by-frame from JS (centered -> layout spot);
   it must follow the scroll instantly, so no transition on it in this mode. */
body.mode-pinned .work .pin-step .project-media {
    transition: none;
    will-change: transform;
}

body.mode-pinned .work .pin-step .project-info > * {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.45s ease,
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.3s ease;
}

body.mode-pinned .work .pin-step .project-info > .line-in {
    opacity: 1;
    transform: none;
}

/* ---------- Work: floating collected projects (pinned mode) ---------- */

.float-layer {
    position: absolute;
    inset: calc(var(--nav-h) + 0.5rem) 0 0.5rem;
    z-index: 0;
    pointer-events: none;
}

body.mode-pinned .pin-stage { z-index: 1; }
body.mode-pinned .section-head { position: relative; z-index: 1; }

.float-mini {
    position: absolute;
    left: var(--sx);
    top: var(--sy);
    width: clamp(120px, 12vw, 190px);
    aspect-ratio: 16 / 9;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(var(--rot, 0deg));
    transition:
        left 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        top 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.7s ease,
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.7s ease;
}

/* --fa (set per scroll frame on the sticky) scrubs each collected mini from
   its drift spot (--sx/--sy) to its Fibonacci spiral cell (--cx/--cy). The
   0.9s transitions above chase the moving target, keeping the motion slow
   and fluid rather than jumping with the wheel. */
.float-mini.is-in {
    opacity: calc(0.32 + 0.53 * var(--fa, 0));
    left: calc(var(--sx) * (1 - var(--fa, 0)) + var(--cx, 50%) * var(--fa, 0));
    top: calc(var(--sy) * (1 - var(--fa, 0)) + var(--cy, 40%) * var(--fa, 0));
    transform: translate(-50%, -50%)
        scale(calc(1 - var(--fa, 0) + var(--cs, 1) * var(--fa, 0)))
        rotate(calc(var(--rot, 0deg) * (1 - var(--fa, 0)) + var(--crot, 0deg) * var(--fa, 0)));
}

.float-mini-inner {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    position: relative;
    animation: floatBob var(--bs, 6s) ease-in-out infinite alternate;
    animation-delay: var(--bd, 0s);
}

/* Two-axis wander with a slight tilt so the drift reads clearly. */
@keyframes floatBob {
    0% { transform: translate(-10px, -14px) rotate(-1.4deg); }
    50% { transform: translate(8px, 3px) rotate(0.9deg); }
    100% { transform: translate(11px, 14px) rotate(1.6deg); }
}

.float-mini video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.float-num {
    position: absolute;
    top: 6px;
    left: 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

/* Ghost cards: other projects, greyed out, continuing the spiral outward.
   They sit directly at their spiral cell; --go staggers each one's fade-in
   along the scrub so they appear one after another while scrolling. */
.float-ghost.is-in {
    left: var(--sx);
    top: var(--sy);
    opacity: clamp(0, calc((var(--fa, 0) - var(--go, 0)) * 1.2), 0.16);
    transform: translate(-50%, -50%) scale(var(--cs, 1)) rotate(var(--rot, 0deg));
    filter: grayscale(1) brightness(0.8);
}

/* The CTA step sits centered below the aligned collection; it rises into
   place and fades in with the scroll-driven --fa scrub. */
body.mode-pinned .pin-stage .pin-step.work-more {
    inset: auto 0 11% 0;
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem;
    padding-top: 0;
    transition: none;
    opacity: clamp(0, calc(var(--fa, 0) * 1.6 - 0.2), 1);
    transform: translateY(calc((1 - var(--fa, 0)) * 12vh));
}

/* Progress dots */
.pin-dots {
    position: absolute;
    left: clamp(0.8rem, 2vw, 1.6rem);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 9px;
    z-index: 5;
}

.pin-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--line-strong);
    position: relative;
    overflow: hidden;
    transition: background 0.45s ease, height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.pin-dot.is-on { background: var(--accent); }

/* The current dot stretches into a pill that fills with scroll progress,
   showing how much more scrolling advances to the next step. */
.pin-dot.is-current { height: 30px; }

.pin-dot.is-current::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleY(var(--p, 0));
    transform-origin: top;
    /* Ease the fill so per-frame scroll updates read as one smooth motion. */
    transition: transform 0.3s cubic-bezier(0.25, 0.6, 0.35, 1);
}

/* ============================== RESPONSIVE ============================== */

@media (max-width: 1100px) {
    .cap-grid { grid-template-columns: repeat(2, 1fr); }
    .tech-page { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }

    .hero { justify-content: center; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .hero-stat { padding: 1.1rem 0.8rem 1.1rem 0; }
    .hero-stat + .hero-stat { padding-left: 0; border-left: none; }
    .hero-stat:nth-child(even) { padding-left: 1.2rem; border-left: 1px solid var(--line); }
    .hero-stat:nth-child(n+3) { border-top: 1px solid var(--line); }

    .section-head { grid-template-columns: auto 1fr; }
    .section-desc { grid-column: 1 / -1; padding-bottom: 0; }

    .project { grid-template-columns: 1fr; gap: 1.5rem; }
    .project:nth-child(even) .project-media { order: 0; }

    .expertise { grid-template-columns: 1fr; }
    .tech-page { grid-template-columns: repeat(2, 1fr); }

    .about-grid { grid-template-columns: 1fr; }
    .about-stats { flex-direction: row; }
    .about-stat { flex: 1; border-bottom: none; padding: 1.2rem 0; }
    .about-stat:first-child { border-top: none; }
    .about-stat + .about-stat { padding-left: 1.2rem; border-left: 1px solid var(--line); }
    .about-stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

    .contact-panel { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
    .cap-grid { grid-template-columns: 1fr; }
    .tech-page { grid-template-columns: 1fr; gap: 1.8rem; }
    .about-stats { flex-direction: column; border-bottom: none; }
    .about-stat { border-bottom: 1px solid var(--line); }
    .about-stat + .about-stat { padding-left: 0; border-left: none; }
    .hero-ctas { width: 100%; }
    .btn { flex: 1; justify-content: center; }
    .work-more { flex-direction: column; align-items: stretch; text-align: center; }
}
