/* css/styles.css */
/* Fonts are loaded via <link> in each page's <head> (preconnect + stylesheet).
   Do not re-add an @import here: it would fetch the same fonts twice and blocks rendering. */

:root {
    /* Dark palette - keeps captures, VFX and UI screenshots readable */
    --bg-color: #0f1115;
    --card-bg: #1a1d24;
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --accent: #8d6fe0; /* muted royal purple - the site-wide accent */
    --border-color: #30363d;

    /* V2 design tokens */
    /* Type scale */
    --fs-h2: clamp(1.4rem, 2.6vw, 1.8rem);
    --fs-h3: clamp(1.1rem, 2vw, 1.3rem);
    --fs-small: 0.9rem;
    --fs-micro: 0.75rem;
    /* Spacing rhythm */
    --section-pad: clamp(56px, 8vw, 96px);
    --card-pad: 24px;
    --gap-grid: 24px;
    /* Radius steps */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    /* Per-discipline accent hues. Used ONLY for small dots on tag pills and
       active filter borders - card glow and rim light stay accent-purple. */
    --hue-vfx: #d2a8ff;
    --hue-shaders: #8d6fe0;
    --hue-tools: #7ee787;
    --hue-ui: #ffa657;
    --hue-anim: #ff7b72;
    --hue-3d: #39c5cf;
    --hue-opt: #d29922;
    --hue-prod: #8b949e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* HEADER */
.site-header {
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}
.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 24px;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.main-nav a:hover {
    color: var(--text-main);
}
/* Retained: the Resume CTA returns once a current CV exists (see LAUNCH.md). */
.btn-resume {
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 6px;
}
.btn-resume:hover {
    border-color: var(--text-main);
}

/* HERO SECTION */
/* NOTE for every section that also carries .container: use padding-top /
   padding-bottom longhand, never the "padding: X 0" shorthand - the shorthand
   silently overrides .container's 24px side gutters (same specificity, later
   in the file wins) and content ends up flush against the viewport edge. */
.hero-section {
    padding-top: 100px;
    padding-bottom: 80px;
    max-width: 750px;
}
.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 40px;
}
.hero-links {
    display: flex;
    gap: 24px;
}
.link-item {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}
.link-item:hover {
    text-decoration: underline;
}

/* PROJECTS SECTION */
.projects-section {
    padding-top: calc(var(--section-pad) * 0.7);
    padding-bottom: calc(var(--section-pad) * 0.7);
}
.section-title {
    font-size: var(--fs-h2);
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

/* Two-up cards from tablet width */
@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PROJECT CARDS */
/* NOTE: backdrop-filter was removed from every card (V2 perf pass) - behind
   them is the flat page background, so the blur cost per frame on mobile GPUs
   bought nothing visible. Background alpha was raised to compensate. */
.project-card {
    position: relative;
    background: rgba(26, 29, 36, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(141, 111, 224, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(141, 111, 224, 0.1);
}
.project-media-placeholder {
    background: #21262d;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.project-info {
    padding: 24px;
}
.project-tag {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
}
.project-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
}
.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}
.project-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.project-link:hover {
    color: var(--accent);
    transform: translateX(4px);
}

/* FOOTER */
.site-footer {
    padding-top: 60px;
    padding-bottom: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
/* --- TECH ART EFFECTS --- */

/* 1. Faint Unity-Editor style grid background */
body {
    background-image:
            linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center center;
}

/* 2. Scroll animation (fade-up) classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 3. Mouse-tracking rim light (per-card dynamic light) */
.projects-grid {
    position: relative;
}
.project-card {
    position: relative;
}
/* Dynamic light layer behind the card (shader-style) */
.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
            350px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(141, 111, 224, 0.22),
            transparent 60%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    pointer-events: none; /* must not swallow mouse events */
}
/* Only run the light effect on devices with a real pointer */
@media (hover: hover) and (pointer: fine) {
    .project-card:hover::before {
        opacity: 1;
    }
}
/* Keep content above the light layer */
.project-media-placeholder, .project-info {
    position: relative;
    z-index: 1;
}

/* PAGE TRANSITION */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes pageLeave {
    from {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
        filter: blur(4px);
    }
}

body {
    animation: pageEnter 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.page-leave {
    animation: pageLeave 0.25s cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    body,
    body.page-leave {
        animation: none;
        transform: none;
        filter: none;
    }
}

/* ============================================================
   HERO SHELL / WEBGL CANVAS
   The canvas is injected by js/hero-shader.js only when WebGL
   works; .hero-shell--gl marks that state. Without it the CSS
   hero below renders exactly as before.
   ============================================================ */
.hero-shell {
    position: relative;
}
.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.hero-shell > .hero-section {
    position: relative;
    z-index: 1;
}
/* With a live animated field behind it, the three-layer name effect reads as
   noise - keep only the base gradient sweep. The full effect remains for the
   no-WebGL fallback. */
.hero-shell--gl .fx-name::before,
.hero-shell--gl .fx-name::after {
    content: none;
    animation: none;
}

/* --- HERO NAME / BRAND UPDATE --- */
.logo-mark a {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    border: 1px solid rgba(141, 111, 224, 0.28);
    background: rgba(26, 29, 36, 0.62);
    overflow: hidden;
}

.logo-mark a::before {
    content: "";
    position: absolute;
    inset: -45%;
    background: conic-gradient(from 180deg, transparent, rgba(141, 111, 224, 0.42), transparent 34%);
    animation: logoSpin 5s linear infinite;
    opacity: 0.55;
}

.logo-mark a::after {
    content: "BI";
    position: absolute;
    inset: 1px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(15, 17, 21, 0.92);
}

.hero-section {
    padding-top: 120px;
    padding-bottom: 90px;
    max-width: 920px;
    overflow: visible;
}

.hero-name {
    position: relative;
    display: inline-block;
    font-size: clamp(3.8rem, 11vw, 8.4rem);
    line-height: 1.08;
    letter-spacing: -0.065em;
    margin-bottom: 10px;

    /* Prevent large clipped glyphs / Turkish character tails while keeping the tight logo-like look */
    padding: 0.04em 0.12em 0.12em 0.02em;
    margin-right: -0.12em;
    overflow: visible;
}

.hero-role {
    color: var(--accent);
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.fx-name {
    color: transparent;
    background-image:
            linear-gradient(
                    90deg,
                    #f0f6fc 0%,
                    #f0f6fc 26%,
                    #8d6fe0 38%,
                    #ffd166 46%,
                    #e07bd2 51%,
                    #a44de0 56%,
                    #8d6fe0 66%,
                    #f0f6fc 78%,
                    #f0f6fc 100%
            );
    background-size: 260% 100%;
    background-position: 160% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: nameEnergyFlow 3.8s linear infinite;
    filter: drop-shadow(0 0 18px rgba(141, 111, 224, 0.18));
    overflow: visible;
}

.fx-name::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: transparent;
    background-image:
            repeating-linear-gradient(
                    115deg,
                    rgba(255, 255, 255, 0.32) 0px,
                    rgba(255, 255, 255, 0.32) 1px,
                    transparent 1px,
                    transparent 7px
            );
    background-size: 220% 100%;
    background-position: 140% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0.16;
    animation: nameNoiseDrift 6s linear infinite;
    pointer-events: none;
    overflow: visible;
}

.fx-name::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: transparent;
    background-image:
            linear-gradient(
                    90deg,
                    transparent 0%,
                    transparent 42%,
                    rgba(255, 255, 255, 0.9) 50%,
                    transparent 58%,
                    transparent 100%
            );
    background-size: 260% 100%;
    background-position: 180% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0.42;
    animation: nameScanSweep 3.8s linear infinite;
    pointer-events: none;
    overflow: visible;
}

@keyframes nameEnergyFlow {
    from { background-position: 160% 50%; }
    to { background-position: -160% 50%; }
}

@keyframes nameNoiseDrift {
    from { background-position: 140% 50%; }
    to { background-position: -140% 50%; }
}

@keyframes nameScanSweep {
    from { background-position: 180% 50%; }
    to { background-position: -180% 50%; }
}

@keyframes logoSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .hero-name {
        font-size: clamp(3.1rem, 17vw, 5.4rem);
        line-height: 1.1;
        letter-spacing: -0.045em;
        padding-right: 0.14em;
        padding-bottom: 0.14em;
    }

    .hero-role {
        letter-spacing: 0.12em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fx-name,
    .fx-name::before,
    .fx-name::after,
    .logo-mark a::before {
        animation: none;
    }
}

/* ============================================================
   ACCESSIBILITY BASELINE
   ============================================================ */

/* Skip link - visually hidden until focused, then pinned to the top-left */
.skip-link {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--accent);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}
.skip-link:focus-visible {
    top: 8px;
}

/* Screen-reader-only text */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Floating pause/play control injected by js/video-loops.js on pages that
   autoplay loop videos (WCAG 2.2.2: motion must be stoppable without the OS
   reduced-motion preference). */
.motion-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(15, 17, 21, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.motion-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Visible keyboard focus for links, buttons and interactive elements */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Disable the scroll-reveal animation entirely when reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.active {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================================
   HERO — POSITIONING EXTRAS
   ============================================================ */
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 34px;
}
.hero-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background: rgba(15, 17, 21, 0.5);
    padding: 5px 12px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

/* Studio strip — where the work happened; each card links to the studio site */
.shipped-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 40px;
}
.shipped-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(26, 29, 36, 0.72);
    text-decoration: none;
    color: var(--text-main);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}
a.shipped-card:hover {
    transform: translateY(-4px);
    border-color: rgba(141, 111, 224, 0.45);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 10px rgba(141, 111, 224, 0.08);
}
.shipped-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
            250px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(141, 111, 224, 0.16),
            transparent 60%
        );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    a.shipped-card:hover::before {
        opacity: 1;
    }
}
.shipped-game {
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 0.98rem;
}
.shipped-stats {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.shipped-stats strong {
    color: var(--accent);
    font-weight: 700;
}
@media (max-width: 768px) {
    .shipped-strip {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   SELECTED WORKS — ENRICHED PROJECT CARD
   ============================================================ */
.project-media-placeholder img,
.project-media-placeholder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    display: block;
}
.project-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    margin-bottom: 10px;
}
.project-role strong {
    color: var(--accent);
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}
.tech-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background: rgba(15, 17, 21, 0.6);
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}
.project-metric {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.project-metric strong {
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 700;
}
.project-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}
/* ============================================================
   FEATURED CASE STUDY
   ============================================================ */
.featured-case {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: rgba(26, 29, 36, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 56px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.18);
}
.featured-case:hover {
    transform: translateY(-4px);
    border-color: rgba(141, 111, 224, 0.35);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 15px rgba(141, 111, 224, 0.08);
}
.featured-case::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
            450px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(141, 111, 224, 0.18),
            transparent 60%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    .featured-case:hover::before {
        opacity: 1;
    }
}
.featured-media, .featured-body {
    position: relative;
    z-index: 1;
}
.featured-media {
    background: #21262d;
    min-height: 240px;
    border-bottom: 1px solid var(--border-color);
}
.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.featured-body {
    padding: 32px;
}
.featured-kicker {
    display: inline-block;
    color: var(--accent);
    border: 1px solid rgba(141, 111, 224, 0.35);
    background: rgba(141, 111, 224, 0.08);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 18px;
}
.featured-body h3 {
    font-size: 1.7rem;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}
.featured-body p {
    color: var(--text-muted);
    margin-bottom: 22px;
    max-width: 60ch;
}
@media (min-width: 860px) {
    .featured-case {
        grid-template-columns: 1.1fr 0.9fr;
    }
    .featured-media {
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
}

/* ============================================================
   FEATURED SLIDER
   Stacked cards by default (the no-JS state); js/work-grid.js
   adds .slider-on and this becomes a scroll-snap carousel.
   ============================================================ */
.slider-track > .slide-card {
    margin-bottom: var(--gap-grid);
}
.slider-on .slider-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: var(--gap-grid);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* room for the hover lift + focus ring so they don't get clipped */
    padding: 8px 4px;
    margin: -8px -4px 0;
}
.slider-on .slider-track::-webkit-scrollbar {
    display: none;
}
.slider-on .slide-card {
    margin-bottom: 0;
    scroll-snap-align: start;
}
.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
}
.slider-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(26, 29, 36, 0.6);
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.slider-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
/* Edge state uses aria-disabled + this class, never the disabled attribute -
   disabling a focused button silently drops keyboard focus to <body>. */
.slider-btn.is-disabled {
    opacity: 0.35;
    cursor: default;
}
.slider-btn.is-disabled:hover {
    border-color: var(--border-color);
    color: var(--text-main);
}
.slider-dots {
    display: flex;
    gap: 10px;
}
.slider-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.slider-dot[aria-current="true"] {
    background: var(--accent);
    border-color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
    .slider-on .slider-track {
        scroll-behavior: auto;
    }
}

/* ============================================================
   ALL WORK GRID
   Compact cards, one per work item, filtered by discipline tags.
   ============================================================ */
.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-grid);
}
@media (min-width: 640px) {
    .work-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .work-grid { grid-template-columns: repeat(3, 1fr); }
}
.work-card {
    position: relative;
    display: flex;
    flex-direction: column;
    /* grid items default to min-width:auto; without this the 1200px-wide
       placeholder images blow the 1fr track out past the viewport */
    min-width: 0;
    background: rgba(26, 29, 36, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.work-card:hover {
    transform: translateY(-6px);
    border-color: rgba(141, 111, 224, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(141, 111, 224, 0.1);
}
.work-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
            300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(141, 111, 224, 0.18),
            transparent 60%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    .work-card:hover::before {
        opacity: 1;
    }
}
.work-card__media,
.work-card__body {
    position: relative;
    z-index: 1;
}
.work-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    background: #21262d;
    border-bottom: 1px solid var(--border-color);
}
.work-card__media img,
.work-card__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
}
.work-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--card-pad);
}
.work-card__role {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    margin-bottom: 10px;
}
.work-card__title {
    font-size: var(--fs-h3);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.work-card__title a {
    color: var(--text-main);
    text-decoration: none;
}
.work-card__title a:hover {
    color: var(--accent);
}
.work-card__desc {
    color: var(--text-muted);
    font-size: var(--fs-small);
    margin-bottom: 16px;
    flex: 1;
}
.work-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.work-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background: rgba(15, 17, 21, 0.6);
    padding: 3px 10px;
    border-radius: var(--r-sm);
    letter-spacing: 0.02em;
}
.work-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tag-hue, var(--text-muted));
    flex: none;
}
.work-tag--vfx     { --tag-hue: var(--hue-vfx); }
.work-tag--shaders { --tag-hue: var(--hue-shaders); }
.work-tag--tools   { --tag-hue: var(--hue-tools); }
.work-tag--ui      { --tag-hue: var(--hue-ui); }
.work-tag--anim    { --tag-hue: var(--hue-anim); }
.work-tag--3d      { --tag-hue: var(--hue-3d); }
.work-tag--opt     { --tag-hue: var(--hue-opt); }
.work-tag--prod    { --tag-hue: var(--hue-prod); }

/* [hidden] must beat the card's display:flex for the filter to work */
.work-card[hidden] {
    display: none;
}

/* ============================================================
   FILTER BAR
   Hidden until work-grid.js adds .filter-ready to the section -
   no dead buttons without JS.
   ============================================================ */
.filter-bar {
    display: none;
}
.filter-ready .filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background: rgba(15, 17, 21, 0.5);
    padding: 6px 14px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.filter-btn::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tag-hue, transparent);
    flex: none;
}
.filter-btn[data-filter="all"]::before {
    display: none;
}
.filter-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}
.filter-btn.is-active {
    color: var(--text-main);
    border-color: var(--tag-hue, var(--accent));
    background: rgba(240, 246, 252, 0.06);
}
.filter-count {
    margin-left: auto;
    font-size: var(--fs-small);
    color: var(--text-muted);
}
.filter-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 24px;
    border: 1px dashed var(--border-color);
    border-radius: var(--r-md);
    color: var(--text-muted);
}
.filter-reset {
    margin-top: 14px;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    padding: 8px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.filter-reset:hover {
    border-color: var(--accent);
}
/* Cheap crossfade around the visibility swap */
.work-grid {
    transition: opacity 0.15s ease;
}
.work-grid.grid-swap {
    opacity: 0.15;
}
@media (prefers-reduced-motion: reduce) {
    .work-grid {
        transition: none;
    }
}

/* ============================================================
   LAB MEDIA EXPAND + LIGHTBOX
   ============================================================ */
.work-card__media {
    position: relative;
}
.work-card__media:has(video.loop-video) {
    cursor: zoom-in;
}
.media-expand {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
    color: var(--text-main);
    background: rgba(15, 17, 21, 0.72);
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.media-expand:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.media-lightbox {
    /* the global "* { margin: 0 }" reset kills the UA's margin:auto that
       centers a modal <dialog> - restore it or the dialog sits top-left */
    margin: auto;
    width: min(1100px, 94vw);
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: 0;
}
.media-lightbox::backdrop {
    background: rgba(5, 6, 8, 0.78);
}
.media-lightbox__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.media-lightbox__title {
    font-weight: 600;
    font-size: var(--fs-small);
    margin: 0;
}
.media-lightbox__close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.media-lightbox__close:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.media-lightbox__body video {
    display: block;
    width: 100%;
    max-height: 78vh;
}

/* ============================================================
   TECHNICAL ART FOCUS AREAS
   ============================================================ */
.focus-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 640px) {
    .focus-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .focus-grid { grid-template-columns: repeat(4, 1fr); }
}
.focus-card {
    position: relative;
    background: rgba(26, 29, 36, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.focus-card:hover {
    transform: translateY(-6px);
    border-color: rgba(141, 111, 224, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25), 0 0 12px rgba(141, 111, 224, 0.08);
}
.focus-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
            250px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(141, 111, 224, 0.18),
            transparent 60%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    .focus-card:hover::before {
        opacity: 1;
    }
}
.focus-icon, .focus-card h3, .focus-card p {
    position: relative;
    z-index: 1;
}
.focus-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 14px;
}
.focus-card h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}
.focus-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   ABOUT PREVIEW
   ============================================================ */
.about-preview p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 65ch;
    margin-bottom: 24px;
}
.text-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.text-link:hover {
    text-decoration: underline;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section {
    padding-top: calc(var(--section-pad) * 0.7);
    padding-bottom: calc(var(--section-pad) * 0.7);
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}
.contact-section h2 {
    font-size: 1.5rem;
    margin-bottom: 14px;
}
.contact-section p {
    color: var(--text-muted);
    max-width: 52ch;
    margin: 0 auto 28px;
}
.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}
.contact-btn {
    color: var(--text-main);
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: rgba(26, 29, 36, 0.6);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.contact-btn.primary {
    background: rgba(141, 111, 224, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   SHARED PROJECT DETAIL COMPONENTS
   (previously duplicated inline in each project-*.html)
   ============================================================ */
.project-header {
    text-align: center;
    padding: 80px 0 40px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}
.project-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    border: 1px solid rgba(141, 111, 224, 0.35);
    background: rgba(141, 111, 224, 0.08);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.project-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 16px;
}
.meta-item strong {
    color: var(--text-main);
    display: block;
}
.back-link {
    display: inline-block;
    margin-bottom: 40px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.back-link:hover {
    text-decoration: underline;
}
.content-block {
    max-width: 840px;
    margin: 0 auto 60px;
}
.content-block h2 {
    color: var(--accent);
    margin-bottom: 16px;
    font-size: var(--fs-h2);
}
.content-block p,
.content-block li {
    color: var(--text-muted);
}
.content-block ul {
    padding-left: 20px;
    margin: 12px 0;
}
/* ASCII workflow diagrams. white-space: pre is load-bearing - without it the
   newlines and alignment spaces collapse and the diagram renders as one run-on
   paragraph. Use <pre class="pipeline-diagram"> so the markup matches. */
.pipeline-diagram {
    background: #1a1d24;
    border: 1px dashed var(--accent);
    padding: 24px;
    border-radius: 8px;
    font-family: 'Fira Code', Consolas, Menlo, monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre;
    margin: 24px 0;
    tab-size: 4;
}
@media (max-width: 600px) {
    .pipeline-diagram {
        font-size: 0.75rem;
        padding: 16px;
        line-height: 1.6;
    }
}

/* Detail: metric cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}
.metric-card {
    background: rgba(26, 29, 36, 0.78);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
}
.metric-card strong {
    display: block;
    color: var(--accent);
    font-size: 1.55rem;
    line-height: 1;
    margin-bottom: 8px;
}
.metric-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Detail: before/after comparison */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 24px;
}
.comparison-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    background: rgba(26, 29, 36, 0.72);
}
.comparison-card h3 {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 1rem;
}
.comparison-card ul {
    padding-left: 18px;
}

/* Detail: technical focus pills */
.tech-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}
.tech-pill {
    border: 1px solid var(--border-color);
    background: rgba(15, 17, 21, 0.6);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-muted);
}
.tech-pill strong {
    color: var(--text-main);
}

/* Detail: media gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 24px 0;
}
.media-gallery figure {
    margin: 0;
}
.media-gallery img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: block;
}
.media-gallery figcaption {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 8px;
    text-align: center;
}

/* Detail: links + NDA note + prev/next footer */
.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
}
.project-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}
.project-links a:hover {
    border-color: var(--accent);
}
.nda-note {
    max-width: 840px;
    margin: 0 auto 40px;
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    background: rgba(141, 111, 224, 0.06);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: 0 8px 8px 0;
}
.project-nav-footer {
    max-width: 840px;
    margin: 0 auto 40px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}
.project-nav-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.project-nav-footer a:hover {
    text-decoration: underline;
}

/* Detail responsive collapse */
@media (max-width: 768px) {
    .media-gallery,
    .metric-grid,
    .comparison-grid,
    .tech-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 60px;
    padding-bottom: 60px;
}
@media (min-width: 768px) {
    .about-grid { grid-template-columns: 1fr 1fr; }
}
.bio-section h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    letter-spacing: -1px;
}
.bio-section p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1.05rem;
}
.skills-section h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.skill-group {
    margin-bottom: 24px;
}
.skill-group h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tag {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE HEADER / NAV
   On narrow screens the nav wraps onto its own line under the
   logo instead of overflowing. Four short links need no
   hamburger, so this stays JS-free and keyboard-accessible.
   ============================================================ */
@media (max-width: 600px) {
    .site-header {
        padding: 20px 0;
    }
    .nav-container {
        flex-wrap: wrap;
        gap: 14px;
    }
    .main-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 20px;
        width: 100%;
    }
    .main-nav a {
        margin-left: 0;
        padding: 4px 0;
    }
    .hero-section {
        padding-top: 64px;
        padding-bottom: 56px;
    }
}

/* ============================================================
   FEATURED CASE — COMPACT METRICS
   The featured body is a narrow column on desktop, so the
   before/after figures read better as value/label rows than as
   a cramped three-up grid.
   ============================================================ */
.featured-body .metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 18px 0 22px;
}
.featured-body .metric-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
}
.featured-body .metric-card strong {
    font-size: 1.05rem;
    margin-bottom: 0;
    white-space: nowrap;
}
.featured-body .metric-card span {
    font-size: 0.85rem;
    text-align: right;
}
@media (max-width: 420px) {
    .featured-body .metric-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .featured-body .metric-card strong {
        white-space: normal;
    }
    .featured-body .metric-card span {
        text-align: left;
    }
}
