:root {
    --bg-dark: #08080a;
    --bg-card: #121216;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f5f5f7;
    --text-muted: #a1a1aa;
    --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --logo-size: 20px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    /* Section snapping: scrolling settles with a section's top flush against the
       (fixed) header, e.g. hero -> Selected Works, instead of stopping mid-section.
       "proximity" only pulls in near a snap point - it won't trap you while scrolling
       through the middle of a tall section like the portfolio grid or contact form. */
    scroll-snap-type: y proximity;
}

.hero,
.about-hero,
.portfolio-section,
.stats-section,
.about-services,
.contact-section {
    scroll-snap-align: start;
    scroll-margin-top: 90px; /* height of the fixed header, so it doesn't cover the section title */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100%;
}

/* Prevent scrolling when mobile overlay is active */

body.nav-open {
    overflow: hidden;
}

/* --- INCARNAGE HEADER BASE --- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 4rem;
    z-index: 1000;
    background: transparent;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, padding 0.3s ease, backdrop-filter 0.3s ease;
}

/* Glassmorphism state on scroll.
   The blur lives on a pseudo-element, NOT on .header itself: backdrop-filter on an ancestor turns it
   into the containing block of the position:fixed mobile menu, which squashes the menu on iOS Safari. */

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(8, 8, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.header.header--scrolled::before {
    opacity: 1;
}

.header.header--scrolled {
    padding: 0.9rem 4rem;
}

/* Auto-hide header when scrolling down */

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

/* 1. Nav Links (Left side on desktop) */

.nav-links {
    order: 1;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

/* 2. Logo centered on the viewport */

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.logo img, .site-logo {
    height: var(--logo-size);
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.04);
}

/* 3. Action button pushed to the far right */

.header-actions {
    order: 2;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-backdrop {
    display: none;
}

/* Header button: text on desktop, icon on mobile */

.cta-icon {
    display: none;
}

/* --- MOBILE TOGGLE BUTTON --- */

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    z-index: 1002;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.mobile-toggle span:first-child {
    transform: translateY(-3px);
}

.mobile-toggle span:last-child {
    transform: translateY(3px);
}

/* Hamburger transition to X */

.mobile-toggle.is-active span:first-child {
    transform: translateY(1px) rotate(45deg);
}

.mobile-toggle.is-active span:last-child {
    transform: translateY(-1px) rotate(-45deg);
}

/* --- BIO PAGE CORE LAYOUT --- */

body.bio-body {
    position: relative;
    background: #050507;
    margin: 0;
    padding: 3rem 1rem 2rem;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Fabric background: single fixed, full-bleed layer, sitting behind everything.
   background-size: 100% 100% stretches the image to exactly fill the viewport
   on both axes (width and height), regardless of the image's own aspect ratio. */
.bio-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.bio-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

.bio-avatar-wrapper {
    position: relative !important;
    width: 140px !important;
    height: 140px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    margin: 0 0 1.2rem 0 !important;
    border: 3px solid rgba(255, 255, 255, 0.2) !important;
    flex-shrink: 0 !important;
}

.bio-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

.bio-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

/* Frosted-glass button, shared by every button/CTA on the site (see also .bio-btn). */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease,
        border-color 0.35s ease, box-shadow 0.35s ease;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn:active { transform: translateY(-1px); }

/* Primary = the same glass, just a touch stronger (mirrors .bio-btn.featured) */
.btn-primary {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.24);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
}

.hero {
    position: relative;
    width: 100%;
    height: auto;
    /* Fixed shape per screen size (2:3 phones, 4:3 tablets, 2:1 desktop) so the hero's height
       only changes when crossing a breakpoint - not continuously while the window is resized,
       which would otherwise shove every section below it up and down. */
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 2rem;
}

@media (min-width: 601px) {
    .hero { aspect-ratio: 4 / 3; }
}

@media (min-width: 1024px) {
    .hero { aspect-ratio: 2 / 1; }
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.marquee-section {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: #000;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-track {
    display: inline-block;
    animation: marquee 25s linear infinite;
}

.marquee-track span {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3rem;
    margin: 0 3rem;
    opacity: 0.4;
}

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

.portfolio-section {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.sub-heading {
    font-size: 0.75rem;
    letter-spacing: 0.2rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.3rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.55rem 1.2rem;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: 600;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 3rem 2rem;
}

.video-card {
    display: block;
    color: inherit;
    text-decoration: none;
    outline-offset: 6px;
}

.video-wrapper {
    position: relative;
    aspect-ratio: 4/5;
    width: 100%;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: border-color 0.3s ease;
}

.video-card:hover .video-wrapper {
    border-color: rgba(255, 255, 255, 0.4);
}

.card-thumb,
.card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.5s ease;
}

.card-thumb {
    z-index: 1;
}

.card-video {
    z-index: 2;
    opacity: 0;
}

/* Thumbnail shows by default; the preview clip crossfades in on hover (desktop) */
.video-card:hover .card-video {
    opacity: 1;
}

.video-card:hover .card-thumb {
    opacity: 0;
}

.video-card:hover .card-video,
.video-card:hover .card-thumb {
    transform: scale(1.04);
}

.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.video-card:hover .play-badge {
    opacity: 1;
    transform: scale(1);
}

.card-info {
    padding: 1.1rem 0 0;
}

.card-meta {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.card-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

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

.stats-section {
    padding: 5rem 4rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

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

.contact-section {
    padding: 8rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 3.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.contact-card h2 {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row {
    display: flex;
    gap: 1.2rem;
}

.form-row input, .contact-form select, .contact-form textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.btn-block {
    width: 100%;
    padding: 1.1rem;
    border-radius: 12px;
}

/* --- PROJECT PAGE --- */

.project-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 7rem 3.5rem 5rem;
    /* Smooth switch between projects (see assets/js/project.js) */
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.project-media {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
}

.project-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-view.is-leaving {
    opacity: 0;
    transform: translateY(-14px);
}

.project-view.is-entering {
    opacity: 0;
    transform: translateY(18px);
    transition: none;
}

.project-view.is-entering .project-media img {
    transform: scale(1.05);
    transition: none;
}

.project-info {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 3fr;
    gap: 4rem;
    padding: 3.5rem 0 4.5rem;
}

.project-meta dt {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.project-meta dd {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.75rem;
    text-transform: capitalize;
}

.project-text h1,
.project-text h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.project-text p {
    max-width: 60ch;
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.8;
    color: #cfcfd6;
}

.project-gallery {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 3.5rem;
}

.gallery-track {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.gallery-track::-webkit-scrollbar { height: 6px; }
.gallery-track::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.gallery-track img {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: min(70vw, 480px);
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: #000;
}

.gallery-arrow {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gallery-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
}

.gallery-arrow svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
    .gallery-arrow { display: none; }
}

.project-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.project-back,
.project-next {
    color: #fff;
    text-decoration: none;
}

.project-back {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.project-back:hover { color: #fff; }

.project-text p a { color: #fff; }

.project-next {
    max-width: 70%;
    text-align: right;
    font-size: clamp(1.6rem, 4.5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.project-next:hover { opacity: 0.7; }

.bio-name {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
}

.bio-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.bio-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.4rem;
    border-radius: 999px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease,
        border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Glass shimmer: a soft diagonal highlight sweeps across the pill on hover */
.bio-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.65s ease;
    pointer-events: none;
}

.bio-btn:hover::after {
    left: 130%;
}

.bio-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bio-btn:active { transform: translateY(-1px); }

.bio-btn-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bio-btn-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    opacity: 0.9;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bio-btn:hover .bio-btn-icon {
    transform: scale(1.15);
}

.bio-btn.featured {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

.bio-btn.featured:hover {
    background: rgba(255, 255, 255, 0.24);
}

.bio-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.bio-footer a:hover {
    color: #fff;
}

/* Pinned to the bottom of the page via margin-top: auto on the flex column body */
.bio-bottom {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 3rem auto 0;
    margin-top: auto;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
}

.bio-bottom-logo {
    display: inline-flex;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.bio-bottom-logo:hover {
    opacity: 1;
}

.bio-bottom-logo img {
    display: block;
    height: 22px;
    width: auto;
}

.bio-bottom-copy {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* Soft breathing ring around the avatar - a continuous, understated "alive" touch */
.bio-avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

/* Entrance: avatar, name, tagline, each button, then the footer rise in one after another.
   Everything here lives inside prefers-reduced-motion: no-preference, so anyone who has
   asked their system to reduce motion sees the page fully in place immediately - never
   stuck at opacity: 0. */
@media (prefers-reduced-motion: no-preference) {
    .bio-avatar-wrapper::after {
        animation: bio-avatar-pulse 3.2s ease-in-out infinite;
        animation-delay: 0.9s;
    }

    @keyframes bio-avatar-pulse {
        0%, 100% { transform: scale(1); opacity: 0.6; }
        50% { transform: scale(1.1); opacity: 0; }
    }

    .bio-avatar-wrapper,
    .bio-name,
    .bio-tagline,
    .bio-links .bio-btn,
    .bio-bottom {
        opacity: 0;
        animation: bio-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

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

    .bio-avatar-wrapper { animation-name: bio-pop; animation-delay: 0.05s; }

    @keyframes bio-pop {
        from { opacity: 0; transform: scale(0.85); }
        to { opacity: 1; transform: scale(1); }
    }

    .bio-name { animation-delay: 0.16s; }
    .bio-tagline { animation-delay: 0.24s; }
    .bio-links .bio-btn:nth-child(1) { animation-delay: 0.32s; }
    .bio-links .bio-btn:nth-child(2) { animation-delay: 0.40s; }
    .bio-links .bio-btn:nth-child(3) { animation-delay: 0.48s; }
    .bio-links .bio-btn:nth-child(4) { animation-delay: 0.56s; }
    .bio-links .bio-btn:nth-child(5) { animation-delay: 0.64s; }
    .bio-links .bio-btn:nth-child(6) { animation-delay: 0.72s; }
    .bio-links .bio-btn:nth-child(n+7) { animation-delay: 0.78s; }
    .bio-bottom { animation-delay: 0.85s; }
}

/* --- ABOUT PAGE --- */

.about-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 9rem 4rem 6rem;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 4rem;
    align-items: center;
}

.about-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.about-copy h1 {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.about-lead {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.about-copy p {
    color: var(--text-muted);
    margin-bottom: 1.1rem;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
}

.about-services {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 4rem 8rem;
}

.about-services h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
}

/* Bottom-to-top reveal: applied to .portfolio-section, #about, .stats-section,
   .about-services and .contact-section in index.php. Starts shifted down + invisible,
   then slides/fades into place once scrolled into view (see the IntersectionObserver
   in assets/js/script.js) - so jumping there via the nav link actually feels like
   something happened, not just an instant scroll. */
.reveal-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

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

/* --- FOOTER --- */

footer {
    background: #000;
    border-top: 1px solid var(--border-color);
    padding: 3rem 4rem 2.5rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "social logo meta";
    align-items: center;
    gap: 2rem;
}

.social-links {
    grid-area: social;
    justify-self: start;
    list-style: none;
    display: flex;
    gap: 0.75rem;
}

.footer-meta {
    grid-area: meta;
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    text-align: right;
}

.logo-2 {
    grid-area: logo;
    justify-self: center;
    display: block;
}

.logo-2 img, .site-logo-2 {
    display: block;
    height: 44px;
    width: auto;
    max-width: 100%;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.social-links svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Right on desktop: copyright (+ small links) */

.footer-meta p, .footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

.footer-links a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

/* --- RESPONSIVE HEADER & OVERLAY (INCARNAGE STYLE) --- */

.form-status {
    margin-top: 1rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.form-status.is-success {
    color: #86efac;
}

.form-status.is-error {
    color: #fca5a5;
}

.video-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.stats-section, .contact-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 480px;
}

@media (prefers-reduced-motion: reduce) {
    .project-view, .project-media img { transition: none; }
    .marquee-track {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}

@media (max-width: 900px) {
    :root {
        --logo-size: 16px;
    }

    .header {
        padding: 1rem 1.25rem;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        column-gap: 0.75rem;
    }

    .header.header--scrolled {
        padding: 0.85rem 1.25rem;
    }

    /* Phones: solid header background, no backdrop blur (blur re-renders on every video frame) */

    .header::before {
        background: rgba(8, 8, 10, 0.94);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* 1. Mobile Toggle on Far Left */

    .mobile-toggle {
        display: flex;
        grid-column: 1;
        justify-self: start;
        z-index: 1002;
    }

    /* 2. Slide-in side bar on mobile (opens from the left, next to the toggle) */

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: min(80vw, 320px);
        height: 100vh;
        height: 100dvh;
        padding: 5.5rem 2rem 2rem;
        background: rgba(12, 12, 15, 0.98);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
        overflow-y: auto;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.4s;
        z-index: 1001;
    }

    .nav-links.is-active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
    }

    /* Dimmed backdrop behind the side bar - tap to close */

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0s linear 0.35s;
        z-index: 999;
    }

    .nav-backdrop.is-active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.35s ease, visibility 0s;
    }

    .nav-links a {
        display: block;
        font-size: 1.05rem;
        letter-spacing: 0.12em;
        padding: 1.1rem 0;
    }

    .nav-links a.active {
        color: #fff;
    }

    /* 3. Logo centered on mobile viewport */

    .logo {
        position: static;
        transform: none;
        grid-column: 2;
        justify-self: center;
        min-width: 0;
        z-index: 1000;
    }

    /* 4. Action button pushed to Far Right */

    .header-actions {
        grid-column: 3;
        justify-self: end;
        margin-left: 0;
        display: flex;
        align-items: center;
    }

    /* Mobile: plain icon (no button background) instead of text */

    .header-actions .header-cta {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        color: #ffffff;
    }

    .header-actions .header-cta:hover {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        transform: none;
    }

    .header-cta .cta-text {
        display: none;
    }

    .header-cta .cta-icon {
        display: block;
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .portfolio-section {
        padding: 5rem 1.5rem;
    }

    /* Filter tabs were overflowing past the right edge of the screen on phones
       (four buttons in one row wider than the viewport). Center them and let
       them wrap onto a second row instead of spilling off-screen. */
    .section-header {
        justify-content: center;
        text-align: center;
    }

    .filter-tabs {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 0.6rem;
    }

    /* --- ABOUT PAGE (mobile): stack the two-column hero, shrink oversized type,
       and cut the desktop-width padding down to something a phone can actually use --- */

    .about-hero {
        grid-template-columns: 1fr;
        padding: 7rem 1.5rem 3rem;
        gap: 2rem;
        text-align: center;
    }

    .about-photo {
        max-width: 320px;
        margin: 0 auto;
    }

    .about-copy {
        text-align: left;
    }

    .about-copy h1 {
        font-size: 2.1rem;
    }

    .about-lead {
        font-size: 1.05rem;
    }

    .about-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .about-services {
        padding: 4rem 1.5rem 5rem;
    }

    .about-services h2 {
        font-size: 1.8rem;
    }

    .stats-section {
        padding: 4rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1.5rem;
    }

    .stat-card h3 {
        font-size: 2.1rem;
    }

    .form-row {
        flex-direction: column;
    }

    footer {
        padding: 2.5rem 1.5rem 2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        grid-template-areas: "logo" "social" "meta";
        justify-items: center;
        gap: 1.5rem;
    }

    .social-links, .footer-meta {
        justify-self: center;
    }

    .footer-meta {
        align-items: center;
        text-align: center;
    }

    .logo-2 img, .site-logo-2 {
        height: 36px;
    }

    .video-grid { gap: 2.5rem 1.25rem; }

    .project-view { padding: 6rem 1.25rem 3rem; }
    .project-info { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 0 3rem; }
    .project-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1.5rem; }
    .project-meta dd { margin-bottom: 0; }
    .project-text h2 { font-size: 1.6rem; }
    .project-text p { font-size: 1.1rem; }
    .project-nav { flex-direction: column-reverse; align-items: flex-start; }
    .project-next { max-width: 100%; text-align: left; }
}

/* Very small phones: shrink the logo a little so the three header items keep breathing room */

@media (max-width: 400px) {
    :root {
        --logo-size: 13px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 1rem;
    }

    .stat-card h3 {
        font-size: 1.8rem;
    }
}

/* --- CUSTOM CURSOR (desktop only; see assets/js/cursor.js) --- */
html.has-custom-cursor,
html.has-custom-cursor a,
html.has-custom-cursor button,
html.has-custom-cursor .video-card,
html.has-custom-cursor input,
html.has-custom-cursor textarea {
    cursor: none;
}

.cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: #fff;
    transition: opacity 0.25s ease;
}

.cursor-ring {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        margin 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, background 0.35s ease;
}

.cursor-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Hovering a project card: the ring grows into a soft "view" badge, the dot hides */
html.cursor-hover-card .cursor-dot { opacity: 0; }

html.cursor-hover-card .cursor-ring {
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-color: rgba(255, 255, 255, 0.75);
}

html.cursor-hover-card .cursor-label { opacity: 1; }

/* Hovering a link or button: the ring tightens around it instead */
html.cursor-hover-link .cursor-ring {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border-color: #fff;
}

html.cursor-hover-link .cursor-dot { opacity: 0; }

@media (max-width: 900px), (hover: none), (pointer: coarse) {
    .cursor { display: none; }
}