/* Reset & Base Styles */

@font-face {
    font-family: 'Paragon';
    src: url('fonts/Paragon-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Dark mode (default) */
    --bg-color: #0f0f0f;
    --text-color: #F0F4F6;           /* Primary text - AAA ~16:1 */
    --secondary-text: #ADBAC2;       /* Secondary text - AAA ~9:1 */
    --tertiary-text: #9EAAB3;        /* Tertiary text - AAA ~7:1 */
    --quaternary-text: #8B949C;      /* Quaternary text - AAA ~7.5:1 */
    --accent-color: #3b82f6;
    --card-bg: #18181b;
    --line-color: #27272a;
    --line-active-color: #3b82f6;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Limelight', serif;
    --font-paragon: 'Paragon', 'Times New Roman', Times, serif;
    --timeline-left: 20px;
    /* Frosted top bar: tint + blur (see .header-bg) */
    --header-glass-bg: rgba(15, 15, 15, 0.38);
    --header-glass-bg-scrolled: rgba(15, 15, 15, 0.6);
    --header-glass-blur: 18px;
    --hero-gradient-start: #F0F4F6;
    --hero-gradient-end: #ADBAC2;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --grid-line-color: rgba(255, 255, 255, 0.05);
    --timeline-dot-color: #F0F4F6;
    --header-height: 52px;
    /* Shared with project pages: .container, grid lines, hero, featured projects inset */
    --layout-max-width: 1200px;

    /* User accent: JS overwrites these; defaults must exist before script runs or `var(--user-accent)` is invalid */
    --user-accent-dark: #ffffff;
    --user-accent-light: #000000;
    --user-accent: var(--user-accent-dark);

    /* Typography scale (responsive) */
    --text-h1: clamp(2.5rem, 5vw + 1.5rem, 4rem);       /* 40px–64px */
    --text-h2: clamp(2rem, 4vw + 1.5rem, 3rem);         /* 32px–48px */
    --text-h3: clamp(1.5rem, 2vw + 1rem, 2rem);         /* 24px–32px */
    --text-h4: clamp(1.125rem, 1vw + 1rem, 1.25rem);    /* 18px–20px */
    --text-body: 1rem; /* 16px */
    --text-small: clamp(0.8125rem, 0.25vw + 0.75rem, 0.875rem); /* 13px–14px */
    --text-small-14: 14px; /* Small text token: 14px regular */
}

/* Light mode variables */
[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #21262A;           /* Primary text - AAA ~14:1 */
    --secondary-text: #4C555B;       /* Secondary text - AAA ~7:1 */
    --tertiary-text: #566069;        /* Tertiary text - AAA ~7:1 */
    --quaternary-text: #737B83;      /* Quaternary text - AAA ~4.6:1 large / ~7:1 effective */
    --accent-color: #2563eb;
    --card-bg: #f4f4f5;
    --line-color: #e4e4e7;
    --line-active-color: #2563eb;
    --header-glass-bg: rgba(255, 255, 255, 0.46);
    --header-glass-bg-scrolled: rgba(255, 255, 255, 0.7);
    --hero-gradient-start: #21262A;
    --hero-gradient-end: #4C555B;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --grid-line-color: rgba(0, 0, 0, 0.05);
    --timeline-dot-color: #21262A;
    --user-accent: var(--user-accent-light);
}

[data-theme="light"] .timeline-section-dot {
    background: var(--timeline-dot-color);
    border-color: var(--bg-color);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Vertical dashed grid lines - Stripe style */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    background-image: 
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 3px,
            var(--grid-line-color) 3px,
            var(--grid-line-color) 6px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 3px,
            var(--grid-line-color) 3px,
            var(--grid-line-color) 6px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 3px,
            var(--grid-line-color) 3px,
            var(--grid-line-color) 6px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 3px,
            var(--grid-line-color) 3px,
            var(--grid-line-color) 6px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 3px,
            var(--grid-line-color) 3px,
            var(--grid-line-color) 6px
        );
    background-size: 
        1px 100%,
        1px 100%,
        1px 100%,
        1px 100%,
        1px 100%;
    background-position:
        0 0,
        25% 0,
        50% 0,
        75% 0,
        100% 0;
    background-repeat: no-repeat;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* On large screens: grid = header width; first and last lines at header start/end */
@media (min-width: 1024px) {
    .grid-background {
        left: 50%;
        transform: translateX(-50%);
        width: var(--layout-max-width);
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
}

/* Viewports larger than 1440px: match project.html inner width */
@media (min-width: 1441px) {
    :root {
        --layout-max-width: 1440px;
    }
}

/* Ensure content is above grid */
.header,
.hero,
.timeline-section {
    position: relative;
    z-index: 1;
}

/* Below sticky #projects so project links stay hoverable when the footer scrolls up alongside */
.footer {
    position: relative;
    z-index: 2;
}

.container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s, color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    opacity: 0.7;
}

/* Header: frosted glass bar — content behind shows through; slightly stronger tint when scrolled */
.header-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 52px;
    box-sizing: border-box;
    background-color: var(--header-glass-bg);
    backdrop-filter: blur(var(--header-glass-blur)) saturate(1.25);
    -webkit-backdrop-filter: blur(var(--header-glass-blur)) saturate(1.25);
    z-index: 100;
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.header-bg.scrolled {
    background-color: var(--header-glass-bg-scrolled);
}

@media (prefers-reduced-transparency: reduce) {
    .header-bg {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 52px;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    z-index: 101;
    display: flex;
    align-items: center;
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
    position: relative;
    z-index: 1;
}

/* Header nav uses same width as page .container (see --layout-max-width) */
.header .nav.container {
    margin-left: auto;
    margin-right: auto;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    color: var(--text-color);
    margin-right: 24px;
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-img {
    display: block;
    width: 32px;
    height: 32px;
    color: inherit;
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure logo SVG tracks the current theme until an accent override is applied */
.logo,
.logo-img {
    color: var(--text-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    position: relative;
    z-index: 2;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

/* Active page indicator (uses aria-current="page") */
.nav-links a[aria-current="page"] {
    opacity: 1;
    color: var(--user-accent, var(--text-color));
}

.nav-links a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    width: 6px;
    height: 6px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: var(--user-accent, var(--text-color));
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--user-accent, var(--text-color)) 16%, transparent);
}

/* Color switcher: one expanding bar (panel + trigger) */
.color-switcher-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1.5px solid var(--text-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-switcher-wrap:has(.color-switcher-panel.is-open) {
    overflow: visible;
}

[data-theme="light"] .color-switcher-wrap {
    background: rgba(0, 0, 0, 0.1);
}

.color-switcher-wrap:hover {
    transform: scale(1.02);
}

.color-switcher-trigger {
    width: 50px;
    min-width: 50px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.color-switcher-chevron {
    display: block;
    font-size: 0.65rem;
    color: var(--text-color);
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-switcher-close-icon {
    display: none;
    font-size: 0.75rem;
    color: var(--text-color);
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-switcher-trigger[aria-expanded="true"] .color-switcher-chevron {
    display: none;
}

.color-switcher-trigger[aria-expanded="true"] .color-switcher-close-icon {
    display: block;
}

.color-switcher-trigger-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--user-accent, var(--text-color));
    flex-shrink: 0;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-switcher-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-switcher-panel.is-open {
    max-width: 144px;
    padding: 6px 6px 6px 10px;
    opacity: 1;
    overflow: visible;
}

/* Staggered reveal of swatches when expanding */
.color-switcher-panel .color-swatch {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s ease;
}

.color-switcher-panel.is-open .color-swatch {
    opacity: 1;
    transform: scale(1);
}

.color-switcher-panel.is-open .color-swatch:nth-child(1) { transition-delay: 0.06s; }
.color-switcher-panel.is-open .color-swatch:nth-child(2) { transition-delay: 0.09s; }
.color-switcher-panel.is-open .color-swatch:nth-child(3) { transition-delay: 0.12s; }
.color-switcher-panel.is-open .color-swatch:nth-child(4) { transition-delay: 0.15s; }
.color-switcher-panel.is-open .color-swatch:nth-child(5) { transition-delay: 0.18s; }

.color-switcher-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--text-color);
    border-radius: 999px;
    border: none;
}

.color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: var(--swatch);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Default swatch - black/white based on theme */
.color-swatch-default {
    --swatch: var(--text-color);
    background: var(--text-color);
}

/* Blue swatch - balanced blue for light theme */
.color-swatch-blue {
    --swatch: #60a5fa;
}
[data-theme="light"] .color-swatch-blue {
    --swatch: #2563eb;
}

/* Pink swatch - balanced pink for light theme */
.color-swatch-pink {
    --swatch: #f472b6;
}
[data-theme="light"] .color-swatch-pink {
    --swatch: #db2777;
}

/* Green swatch - balanced green for light theme */
.color-swatch-green {
    --swatch: #4ade80;
}
[data-theme="light"] .color-swatch-green {
    --swatch: #16a34a;
}

/* Purple swatch - balanced purple for light theme */
.color-swatch-purple {
    --swatch: #c084fc;
}
[data-theme="light"] .color-swatch-purple {
    --swatch: #7e22ce;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.is-selected {
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--swatch);
}

/* Color selection: logo on all pages; Raysa, scroll icon, timeline dots only on index (not .page-project) */
[data-accent] .logo,
[data-accent] .logo-img {
    color: var(--user-accent) !important;
}

/* Index only (body without .page-project): accent on Raysa, scroll icon, timeline dots */
[data-accent] body:not(.page-project) .mouse {
    border-color: var(--user-accent);
}

[data-accent] body:not(.page-project) .mouse::before {
    background-color: var(--user-accent);
}

[data-accent] body:not(.page-project) .timeline-section-dot {
    background: var(--user-accent) !important;
}

/* Hero title gradient - Default (grayscale) */
[data-accent] body:not(.page-project) .hero-title,
[data-accent] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #18181b 0%, #52525b 50%, #71717a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"][data-accent] body:not(.page-project) .hero-title,
[data-theme="dark"][data-accent] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #a1a1aa 0%, #d4d4d8 60%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero title gradient - Blue */
[data-accent="1"] body:not(.page-project) .hero-title,
[data-accent="1"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #1e3a5f 0%, #2563a0 40%, #3b7fc4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"][data-accent="1"] body:not(.page-project) .hero-title,
[data-theme="dark"][data-accent="1"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 60%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero title gradient - Pink */
[data-accent="2"] body:not(.page-project) .hero-title,
[data-accent="2"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #831843 0%, #be185d 40%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"][data-accent="2"] body:not(.page-project) .hero-title,
[data-theme="dark"][data-accent="2"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #ec4899 0%, #f472b6 60%, #fbcfe8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero title gradient - Green */
[data-accent="3"] body:not(.page-project) .hero-title,
[data-accent="3"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #14532d 0%, #15803d 40%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"][data-accent="3"] body:not(.page-project) .hero-title,
[data-theme="dark"][data-accent="3"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 60%, #bbf7d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero title gradient - Purple */
[data-accent="4"] body:not(.page-project) .hero-title,
[data-accent="4"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #3b0764 0%, #7c3aed 40%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"][data-accent="4"] body:not(.page-project) .hero-title,
[data-theme="dark"][data-accent="4"] body:not(.page-project) .about-title-name {
    background: linear-gradient(90deg, #8b5cf6 0%, #c4b5fd 60%, #f5f3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav right group: color switcher + theme toggle, exactly 40px apart */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle-track {
    width: 48px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid var(--text-color);
    border-radius: 14px;
    position: relative;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .theme-toggle-track {
    background: rgba(0, 0, 0, 0.1);
    border-color: var(--text-color);
}

.theme-toggle-thumb {
    width: 20px;
    height: 20px;
    background: var(--text-color);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(19px);
}

.theme-toggle-icon {
    width: 12px;
    height: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon path,
.theme-toggle-icon circle,
.theme-toggle-icon line {
    stroke: currentColor;
    fill: none;
}

.theme-icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    color: var(--bg-color);
    font-size: 12px;
}

.theme-icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(-90deg);
    color: var(--bg-color);
}

.theme-icon-moon,
.theme-icon-sun {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .theme-icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(90deg);
}

[data-theme="light"] .theme-icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* Smooth transitions for color-dependent elements */
.logo,
.nav-links a,
.section-title,
.project-title,
.project-desc,
.sticky-label,
.cta-button,
.copyright {
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-line,
.timeline-section-dot {
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: var(--layout-max-width);
    gap: clamp(1rem, 1.6vw, 1.25rem);
}

.hero-artsy-layout {
    --hero-portrait-height: clamp(347px, 42vw, 560px);
    width: min(var(--layout-max-width), 100%);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(260px, 420px) minmax(300px, 360px);
    align-items: center;
    justify-content: center;
    column-gap: clamp(1rem, 2vw, 2.5rem);
    padding: clamp(1rem, 2vw, 1.75rem);
    min-height: clamp(400px, 62vh, 620px);
}

.hero-side-label {
    margin: 0;
    font-family: var(--font-paragon);
    /* ~25% larger than /4.6 — stronger balance with portrait + name block */
    font-size: calc(var(--hero-portrait-height) / 3.65);
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.02em;
    line-height: 0.92;
    color: #C3CED5;
    position: relative;
    z-index: 3;
    opacity: 0;
}

.hero-side-label--left {
    justify-self: center;
    align-self: center;
    height: var(--hero-portrait-height);
    display: flex;
    align-items: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-orientation: mixed;
    white-space: nowrap;
    margin-right: -20px;
    top: clamp(14px, 2.2vh, 26px);
    animation: heroSideLabelVerticalIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.hero-portrait-frame {
    height: var(--hero-portrait-height);
    width: calc(var(--hero-portrait-height) * 0.75);
    overflow: hidden;
    background: #ddd5c8;
    justify-self: center;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: heroParallaxUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards;
}

.hero-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-copy {
    width: 100%;
    max-width: 500px;
    justify-self: start;
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 1.6vw, 1.3rem);
    margin-left: clamp(-30px, -2.7vw, -14px);
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .hero {
        min-height: 100svh;
        height: auto;
        padding-top: calc(var(--header-height) + 0.5rem);
        padding-bottom: clamp(1.2rem, 4vw, 1.8rem);
    }

    .hero-content {
        min-height: calc(100svh - var(--header-height) - 0.75rem);
        justify-content: space-between;
        gap: 0.6rem;
    }

    .hero-artsy-layout {
        --hero-portrait-height: auto;
        grid-template-columns: 1fr;
        justify-items: start;
        row-gap: clamp(0.45rem, 2.2vw, 0.9rem);
        text-align: left;
        min-height: 0;
        width: 100%;
        padding: clamp(0.25rem, 1.2vw, 0.45rem) 0 0;
    }

    .hero-side-label--left {
        writing-mode: horizontal-tb;
        transform: none;
        height: auto;
        align-self: auto;
        display: block;
        justify-self: start;
        font-size: clamp(2rem, 8vw, 3rem);
        margin-right: 0;
        top: 0;
        animation: heroParallaxUp 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
    }

    .hero-portrait-frame {
        width: min(78vw, 340px);
        height: auto;
        aspect-ratio: 3 / 4;
        justify-self: start;
    }

    .hero-copy {
        justify-self: start;
        align-items: flex-start;
        width: min(100%, 28rem);
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 100svh;
        height: auto;
        padding-top: calc(var(--header-height) + 0.45rem);
        padding-bottom: 1rem;
    }

    .hero-artsy-layout {
        width: 100%;
    }

    .hero-portrait-frame {
        width: min(76vw, 320px);
    }
}

/* ==========================================================================
   MOBILE HAMBURGER MENU
   ========================================================================== */

/* Hamburger button — hidden on desktop */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 26px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    width: 28px;
    height: 28px;
    -webkit-tap-highlight-color: transparent;
}

/* Animated hamburger bars → X */
.hamburger-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 20px;
    height: 20px;
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.25s ease,
                background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Middle bar fades out */
.mobile-menu-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

/* Top bar rotates down to form X */
.mobile-menu-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

/* Bottom bar rotates up to form X */
.mobile-menu-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu overlay — sits below the header so the close icon stays accessible */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0s linear 0.38s;
}

.mobile-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0s linear 0s;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 80px 2rem 2rem;
    height: 100%;
}

/* Controls row: theme toggle + color selector */
.mobile-menu-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Make theme toggle match color selector height in mobile menu */
.mobile-menu-controls .theme-toggle-track {
    width: 50px;
    height: 31px;
    border-radius: 16px;
}

.mobile-menu-controls .theme-toggle-thumb {
    width: 22px;
    height: 22px;
    top: 3.5px;
    left: 3.5px;
}

[data-theme="light"] .mobile-menu-controls .theme-toggle-thumb {
    transform: translateX(20px);
}

/* Navigation links */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu-link {
    text-decoration: none;
    padding: 0.75rem 0;
    border-bottom: 2px dotted var(--grid-line-color, rgba(128,128,128,0.15));
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                color 0.3s ease;
}

.mobile-menu-link:first-child {
    border-top: 2px dotted var(--grid-line-color, rgba(128,128,128,0.15));
}

.mobile-menu-link-text {
    font-family: var(--font-main);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    display: block;
    margin: 0;
    transition: color 0.3s ease;
}

.mobile-menu-link:hover .mobile-menu-link-text {
    color: var(--accent-color);
}

/* Staggered entrance for links */
.mobile-menu.is-open .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.is-open .mobile-menu-link:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.is-open .mobile-menu-link:nth-child(2) { transition-delay: 0.14s; }
.mobile-menu.is-open .mobile-menu-link:nth-child(3) { transition-delay: 0.20s; }

/* Controls also stagger in */
.mobile-menu-controls {
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu.is-open .mobile-menu-controls {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.02s;
}

/* Reset stagger on close (instant) */
.mobile-menu:not(.is-open) .mobile-menu-link,
.mobile-menu:not(.is-open) .mobile-menu-controls {
    transition-delay: 0s;
    transition-duration: 0.2s;
}

.mobile-menu-link:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        margin-left: 0;
        width: 32px;
        height: 32px;
    }

    .mobile-menu-toggle .menu-icon {
        font-size: 24px;
        line-height: 1;
        position: absolute;
        transition: opacity 220ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .mobile-menu-toggle .menu-icon--open {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    .mobile-menu-toggle .menu-icon--close {
        opacity: 0;
        transform: rotate(-90deg) scale(0.7);
    }

    .mobile-menu-toggle.is-active .menu-icon--open {
        opacity: 0;
        transform: rotate(90deg) scale(0.7);
    }

    .mobile-menu-toggle.is-active .menu-icon--close {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    .nav-links {
        display: none !important;
    }

    .nav-right {
        display: none !important;
    }

    body:not(.page-project) .nav-right {
        display: flex !important;
        align-items: center;
        gap: 0.55rem;
        margin-left: auto;
        margin-right: 0.35rem;
        transition: gap 260ms cubic-bezier(0.22, 1, 0.36, 1),
                    margin-right 260ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    body:not(.page-project) .nav.container {
        gap: 0.5rem;
    }

    body:not(.page-project) .mobile-menu .mobile-menu-inner {
        gap: 0;
        padding-top: 96px;
    }

    body:not(.page-project) .mobile-menu-nav {
        width: 100%;
    }

    body:not(.page-project) .mobile-menu-link-text {
        font-size: clamp(2rem, 9vw, 2.6rem);
    }

    body:not(.page-project) .mobile-menu-toggle,
    body:not(.page-project) .nav-right .theme-toggle {
        transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1),
                    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    body.is-mobile-color-picking:not(.page-project) .mobile-menu-toggle,
    body.is-mobile-color-picking:not(.page-project) .nav-right .theme-toggle {
        opacity: 0;
        transform: scale(0.85);
        pointer-events: none;
    }
}

/* INDEX h1: 64px - Limelight */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw + 0.65rem, 5.85rem);
    font-weight: 700;
    font-style: normal;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 0.9;
    background: linear-gradient(to right, var(--hero-gradient-start), var(--hero-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: heroParallaxUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-title--artsy {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: clamp(3rem, 7vw, 7rem);
    letter-spacing: 0.02em;
    line-height: 1;
    color: #111218;
    background: none;
    -webkit-text-fill-color: currentColor;
    text-transform: none;
    justify-self: start;
    text-align: left;
    display: inline-flex;
    flex-direction: column;
    gap: 0.05em;
    padding-bottom: 0.08em;
    margin-left: calc(-0.9ch + 20px);
}

[data-theme="dark"] .hero-title--artsy {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 12px rgba(0, 0, 0, 0.35));
}

.hero-title-line {
    display: block;
    line-height: 1.06;
}

[data-theme="light"] .hero-avatar {
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .hero-avatar-frame {
    border-color: rgba(0, 0, 0, 0.12);
}

/* INDEX body: 17px - Inter 500 */
.hero-subtitle {
    font-family: var(--font-main);
    font-size: clamp(0.92rem, 1vw, 1rem);
    font-weight: 500;
    line-height: 1.55;
    color: #63656f;
    max-width: min(440px, 100%);
    margin: 0;
    padding: 0;
    padding-left: 40px;
    opacity: 0;
    animation: heroParallaxUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.75s forwards;
}

@media (min-width: 1024px) {
    .hero-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .hero-title--artsy {
        justify-self: start;
        text-align: left;
        align-items: baseline;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.28em;
        white-space: nowrap;
        font-size: clamp(2.05rem, 8vw, 2.65rem);
        margin-left: 0;
    }

    .hero-copy {
        margin-left: 0;
    }

    .hero-subtitle {
        padding-left: 0;
        text-align: left;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.45;
        font-size: clamp(0.88rem, 3.4vw, 1rem);
    }

    .scroll-indicator {
        bottom: max(0.75rem, env(safe-area-inset-bottom, 0));
        font-size: 0.82rem;
        gap: 0.35rem;
        color: var(--secondary-text);
        z-index: 5;
    }

    .mouse {
        height: 28px;
    }
}

@media (max-width: 480px) {
    .hero-title--artsy {
        font-size: clamp(2.25rem, 11vw, 3.1rem);
    }
}

.hero-subtitle p {
    margin: 0 0 0.5rem 0;
    font-weight: 400;
}

.hero-subtitle p:last-child {
    margin-bottom: 0;
}

.hero-subtitle-accent {
    color: var(--hero-subtitle-accent-color);
}

/* INDEX body-small: 14px - Inter - tertiary color */
.scroll-indicator {
    position: absolute;
    bottom: clamp(1rem, 4vw, 2rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: heroParallaxUpCenter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.1s forwards;
    font-family: var(--font-main);
    font-size: var(--text-small);
    color: var(--tertiary-text);
    z-index: 4;
}

.mouse {
    width: 20px;
    height: 32px;
    border: 2px solid var(--tertiary-text);
    border-radius: 12px;
    position: relative;
    transition: border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 4px;
    background-color: var(--text-color);
    border-radius: 2px;
    animation: scrollMouse 2s infinite;
}

/* Timeline Section */
.timeline-section {
    padding: clamp(4rem, 10vw, 8rem) 0;
    position: relative;
}

#projects.timeline-section {
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    /* Sticky stack: slides over the hero while scrolling */
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bg-color);
    overflow: hidden;
}

[data-theme="light"] #projects.timeline-section {
    background: #f8fafb;
}

/* Fixed TTP split preview extends to viewport top/bottom — avoid clipping by section overflow */
#projects.timeline-section.has-visual-split-preview {
    overflow: visible;
}

/* Hero stays pinned underneath until the projects block scrolls over it */
.hero.hero--stack {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* INDEX h2: match hero artsy title style */
.section-title {
    font-family: var(--font-main);
    font-size: clamp(1.85rem, 3.6vw, 3rem);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.005em;
    line-height: 0.92;
    text-transform: none;
    margin-bottom: 64px;
    text-align: center;
}

.timeline {
    position: relative;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding-left: 14rem; /* Significantly increased space between timeline and projects */
}

/* The static background line */
.timeline-line {
    position: absolute;
    left: var(--timeline-left);
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--line-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Filled portion of the line, uses accent color at 50% opacity */
.timeline-line-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0;
    background: color-mix(in srgb, var(--user-accent, var(--text-color)) 30%, transparent);
    border-radius: 2px;
    transition: height 0.15s ease-out, background 0.3s ease;
}

/* Section dots and titles (each dot moves down during its project, then stops) */
.timeline-section-dot {
    --timeline-dot-size: 18px;
    position: absolute;
    left: var(--timeline-left);
    width: var(--timeline-dot-size);
    height: var(--timeline-dot-size);
    background: var(--timeline-dot-color);
    border: 2px solid var(--bg-color);
    transform: translate(-50%, -50%);
    z-index: 2;
    border-radius: 50%;
    transition: top 0.15s ease-out;
}

.section-dot-title {
    position: absolute;
    left: calc(var(--timeline-dot-size, 18px) / 2 + 12px); /* Space from dot edge, scales with dot size */
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    text-shadow: 0 0 10px var(--shadow-color);
    pointer-events: none;
    opacity: 1;
    z-index: 4; /* Above project content so titles don't get covered */
    transition: opacity 0.4s cubic-bezier(0.33, 1, 0.68, 1), color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Position each dot at the start of its corresponding section */
.timeline-section-dot[data-section="1"] {
    top: 0;
}

.timeline-section-dot[data-section="2"] {
    top: 0; /* Will be positioned by JS based on project item position */
}

.timeline-section-dot[data-section="3"] {
    top: 0; /* Will be positioned by JS based on project item position */
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* Stretch to make visual match content height */
    margin-bottom: 6rem; /* Reduced for more compact layout */
    opacity: 0;
    transform: translateX(-50px); /* Slide in from left */
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

.project-item:last-child {
    margin-bottom: 0;
}

/* Deleted Project Marker styles */
.project-marker { display: none; }
.marker-title { display: none; }

.project-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.project-label-column {
    width: 150px; /* Fixed width for the label column */
    flex-shrink: 0;
    padding-right: 2rem;
}

.sticky-label {
    position: sticky;
    top: 6rem; /* Stick to top with some offset */
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-item {
    gap: 1.5rem; /* Same margin between image and text as reference (gap-6) */
}

.project-visual {
    width: 45%; /* Adjusted width */
    position: relative;
    perspective: 1000px; /* For 3D effect */
    display: flex; /* Make children fill height */
}

/* Featured projects — Apple-style cards grid */
.project-card-grid {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 900px) {
    .project-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-card-text {
        height: 172px;
        min-height: 172px;
    }
}

@media (max-width: 640px) {
    .project-card-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    transform-origin: center center;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .project-card {
    background: #1b1b1f;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.project-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.project-card-link:hover,
.project-card-link:focus-visible {
    opacity: 1 !important;
}

.project-card-text {
    padding: 20px 20px 14px;
    height: 188px;
    min-height: 188px;
    display: flex;
    flex-direction: column;
}

.project-card-head {
    display: block;
    position: relative;
    margin-bottom: 0.5rem;
    min-height: 22px;
    padding-right: 116px;
}

.project-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.project-card-company {
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e6e73;
    margin: 0;
}

[data-theme="dark"] .project-card-company {
    color: #a1a1aa;
}

.project-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-main);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin: 0;
    position: absolute;
    top: 0;
    right: 0;
}

.project-card-badge--coming {
    background: #e5e7eb;
    color: #1f2937;
}

.project-card-badge--shipped {
    background: #dcfce7;
    color: #14532d;
}

.project-card-title {
    font-family: var(--font-main);
    font-size: clamp(1rem, 0.55vw + 0.9rem, 1.2rem);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    color: #1d1d1f;
}

[data-theme="dark"] .project-card-title {
    color: #f5f5f7;
}

.project-card-desc {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: #424245;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="dark"] .project-card-desc {
    color: #d4d4d8;
}

.project-card-media {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-height: 220px;
    gap: 0;
}

.project-card-image {
    flex: 0 0 auto;
    width: 100%;
    border-radius: 0 0 20px 20px;
    aspect-ratio: 1 / 1;
    min-height: 220px;
    height: auto;
    display: block;
    object-fit: cover;
}

/* FEAM card: plane flyover animation */
.project-card-feam .project-card-media {
    overflow: hidden;
}

.feam-plane-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.feam-contrail {
    position: absolute;
    top: 22%;
    right: -42%;
    width: 40%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        270deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.55) 38%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: feamContrailFly 10.5s cubic-bezier(0.32, 0.05, 0.2, 1) infinite;
}

[data-theme="light"] .feam-contrail {
    background: linear-gradient(
        270deg,
        rgba(29, 29, 31, 0) 0%,
        rgba(29, 29, 31, 0.2) 38%,
        rgba(29, 29, 31, 0) 100%
    );
}

.feam-plane-icon {
    position: absolute;
    top: 18%;
    right: -16%;
    width: 34px;
    height: 34px;
    fill: var(--user-accent, var(--text-color));
    opacity: 0.92;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
    animation: feamPlaneFly 10.5s cubic-bezier(0.32, 0.05, 0.2, 1) infinite;
}

@keyframes feamPlaneFly {
    0% {
        transform: translateX(0) translateY(1%) scaleX(-1) rotate(2deg) scale(0.94);
        opacity: 0;
    }
    8% {
        opacity: 0.92;
    }
    30% {
        transform: translateX(-120%) translateY(-6%) scaleX(-1) rotate(-2deg) scale(1);
        opacity: 0.92;
    }
    62% {
        transform: translateX(-250%) translateY(2%) scaleX(-1) rotate(1deg) scale(1.02);
        opacity: 0.88;
    }
    100% {
        transform: translateX(-390%) translateY(-3%) scaleX(-1) rotate(-3deg) scale(1.03);
        opacity: 0;
    }
}

@keyframes feamContrailFly {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    12% {
        opacity: 0.65;
    }
    70% {
        transform: translateX(-260%);
        opacity: 0.52;
    }
    100% {
        transform: translateX(-410%);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .feam-contrail,
    .feam-plane-icon {
        animation: none;
    }

    .feam-contrail {
        display: none;
    }

    .feam-plane-icon {
        left: auto;
        right: 10px;
        top: 12px;
        opacity: 0.85;
        transform: none;
    }

    .resolution-copy--long,
    .resolution-copy--short,
    .resolution-copy--longer,
    .resolution-processing,
    .resolution-loading-text--shorten,
    .resolution-loading-text--lengthen,
    .resolution-processing-logo,
    .resolution-chip,
    .resolution-chip-row,
    .resolution-disclaimer,
    .resolution-footer-actions {
        animation: none !important;
    }

    .resolution-copy--long {
        opacity: 1;
    }

    .resolution-copy--short,
    .resolution-copy--longer {
        opacity: 0;
    }

    .resolution-processing {
        opacity: 0;
    }

    .resolution-chip-row,
    .resolution-disclaimer,
    .resolution-footer-actions {
        opacity: 1;
    }
}

/* Tap to Pay card: exact Figma screen sequence (360x800) */
.tap-pay-card-demo {
    background: #f2f3f5;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.tap-demo-phone {
    position: relative;
    height: 96%;
    aspect-ratio: 360 / 800;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    border: 1px solid #d4d7dc;
    background: #ffffff;
}

.tap-demo-screen {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: tapDemoExactFlow 12s linear infinite;
}

.tap-demo-screen img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.tap-demo-screen--charge { animation-delay: 0s; }
.tap-demo-screen--tip { animation-delay: -9.6s; }
.tap-demo-screen--loading { animation-delay: -7.2s; }
.tap-demo-screen--tap { animation-delay: -5.2s; }
.tap-demo-screen--reading { animation-delay: -2.6s; }

@keyframes tapDemoExactFlow {
    0%, 18% { opacity: 1; }
    21%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tap-demo-screen {
        animation: none !important;
    }

    .tap-demo-screen--charge {
        opacity: 1;
    }
}

/* ShowApp card: mini version of project hero animation */
.showapp-card-hero {
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

[data-theme="dark"] .showapp-card-hero {
    background: #151518;
}

.showapp-card-layers {
    position: relative;
    width: 100%;
    height: 100%;
}

.showapp-card-bg-img,
.showapp-card-phone-img {
    display: block;
    position: absolute;
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 86%;
    height: auto;
    max-width: none;
}

.showapp-card-bg-img {
    z-index: 1;
}

.showapp-card-phone-img {
    z-index: 3;
    pointer-events: none;
}

.showapp-card-bubbles {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(74% + 12px);
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    pointer-events: none;
}

.showapp-card-bubbles-row {
    overflow: hidden;
}

.showapp-card-bubbles-track {
    display: flex;
    gap: 6px;
    width: max-content;
    animation: showappCardBubblesScroll 12s linear infinite;
    will-change: transform;
}

.showapp-card-bubbles-track--reverse {
    animation-name: showappCardBubblesScrollReverse;
    animation-duration: 14s;
}

.resolution-card-demo {
    background: transparent;
    padding: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.resolution-workbench {
    width: 100%;
    aspect-ratio: 752 / 500;
    border-radius: 12px;
    border: 1px solid #d4d7dc;
    background: #ffffff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.resolution-wb-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    font-size: 0.62rem;
    font-weight: 600;
    color: #393a3d;
}

.resolution-ai-logo {
    width: 10px;
    height: 10px;
    object-fit: contain;
    display: block;
}

.resolution-wb-title {
    flex: 1;
}

.resolution-wb-close {
    color: #393a3d;
    font-size: 0.9rem;
    line-height: 1;
}

.resolution-wb-helper {
    margin: 0;
    font-family: var(--font-main);
    font-size: 0.58rem;
    line-height: 1.4;
    color: #393a3d;
}

.resolution-wb-helper:empty {
    display: none;
}

.resolution-wb-body {
    flex: 1 1 auto;
    border-radius: 7px;
    border: 1px solid #d4d7dc;
    background: #ffffff;
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.resolution-copy {
    font-family: var(--font-main);
    font-size: 0.57rem;
    line-height: 1.45;
    color: #393a3d;
    opacity: 0;
}

.resolution-copy--short,
.resolution-copy--longer {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 8px;
}

.resolution-copy--long {
    animation: resolutionCopyLong 10.5s ease-in-out infinite;
}

.resolution-copy--short {
    animation: resolutionCopyShort 10.5s ease-in-out infinite;
}

.resolution-copy--longer {
    animation: resolutionCopyLonger 10.5s ease-in-out infinite;
}

.resolution-processing {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-main);
    font-size: 0.56rem;
    color: #393a3d;
    opacity: 0;
    animation: resolutionLoadingVisibility 10.5s ease-in-out infinite;
}

.resolution-processing-logo {
    width: 10px;
    height: 10px;
    object-fit: contain;
    display: block;
    transform-origin: center;
    animation: resolutionLogoSpin 0.9s linear infinite;
}

.resolution-loading-text {
    display: none;
}

.resolution-loading-text--shorten {
    display: inline;
    animation: resolutionLoadingTextShorten 10.5s linear infinite;
}

.resolution-loading-text--lengthen {
    display: inline;
    animation: resolutionLoadingTextLengthen 10.5s linear infinite;
}

.resolution-chip-row {
    margin-top: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    opacity: 1;
    animation: resolutionControlsVisibility 10.5s ease-in-out infinite;
}

.resolution-chip {
    border: 1px solid #6b6c72;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--font-main);
    font-size: 0.5rem;
    font-weight: 600;
    color: #393a3d;
    background: rgba(107, 108, 114, 0);
}

.resolution-chip--shorten {
    animation: resolutionShortenActive 10.5s ease-in-out infinite;
}

.resolution-chip--lengthen {
    animation: resolutionLengthenActive 10.5s ease-in-out infinite;
}

.resolution-disclaimer {
    margin: 0;
    font-family: var(--font-main);
    font-size: 0.46rem;
    line-height: 1.35;
    color: #6b6c72;
    opacity: 0.95;
    animation: resolutionControlsVisibility 10.5s ease-in-out infinite;
}

@keyframes resolutionCopyLong {
    0%, 22% { opacity: 1; }
    23%, 100% { opacity: 0; }
}

@keyframes resolutionCopyShort {
    0%, 34% { opacity: 0; }
    36%, 54% { opacity: 1; }
    56%, 100% { opacity: 0; }
}

@keyframes resolutionCopyLonger {
    0%, 66% { opacity: 0; }
    68%, 100% { opacity: 1; }
}

@keyframes resolutionLoadingVisibility {
    0%, 22% { opacity: 0; }
    23%, 34% { opacity: 1; }
    35%, 54% { opacity: 0; }
    55%, 66% { opacity: 1; }
    67%, 100% { opacity: 0; }
}

@keyframes resolutionLoadingTextShorten {
    0%, 22% { opacity: 0; }
    23%, 34% { opacity: 1; }
    35%, 100% { opacity: 0; }
}

@keyframes resolutionLoadingTextLengthen {
    0%, 54% { opacity: 0; }
    55%, 66% { opacity: 1; }
    67%, 100% { opacity: 0; }
}

@keyframes resolutionControlsVisibility {
    0%, 22% { opacity: 1; }
    23%, 34% { opacity: 0; }
    35%, 54% { opacity: 1; }
    55%, 66% { opacity: 0; }
    67%, 100% { opacity: 1; }
}

@keyframes resolutionLogoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes resolutionShortenActive {
    0%, 34% {
        background: rgba(107, 108, 114, 0);
        border-color: #6b6c72;
        color: #393a3d;
    }
    35%, 54% {
        background: rgba(0, 151, 230, 0.12);
        border-color: #0097e6;
        color: #1276a8;
    }
    55%, 100% {
        background: rgba(107, 108, 114, 0);
        border-color: #6b6c72;
        color: #393a3d;
    }
}

@keyframes resolutionLengthenActive {
    0%, 66% {
        background: rgba(107, 108, 114, 0);
        border-color: #6b6c72;
        color: #393a3d;
    }
    67%, 100% {
        background: rgba(0, 151, 230, 0.12);
        border-color: #0097e6;
        color: #1276a8;
    }
}

.resolution-wb-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.resolution-feedback {
    font-family: var(--font-main);
    font-size: 0.54rem;
    color: #6b6c72;
}

.resolution-footer-actions {
    display: inline-flex;
    gap: 4px;
    opacity: 1;
    animation: resolutionControlsVisibility 10.5s ease-in-out infinite;
}

.resolution-footer-btn {
    min-width: 42px;
    border-radius: 4px;
    padding: 3px 8px;
    border: 2px solid #00892e;
    font-family: var(--font-main);
    font-size: 0.56rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.resolution-footer-btn--secondary {
    background: rgba(0, 137, 46, 0);
    color: #00892e;
}

.resolution-footer-btn--primary {
    background: #00892e;
    color: #ffffff;
}

.showapp-card-bubble {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 14px;
    font-family: var(--font-main);
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.2;
}

[data-theme="dark"] .showapp-card-bubble {
    background: rgba(40, 40, 45, 0.9);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .showapp-card-bubble {
    background: rgba(255, 255, 255, 0.82);
    color: rgba(0, 0, 0, 0.78);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

@keyframes showappCardBubblesScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes showappCardBubblesScrollReverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.project-card-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 8px;
    box-sizing: content-box;
    border-radius: 50%;
    background: #1d1d1f;
    color: #ffffff;
    --ionicon-stroke-width: 28px;
    position: absolute;
    right: 12px;
    bottom: 12px;
    flex-shrink: 0;
    transform: none;
    transition: background-color 0.25s ease;
    z-index: 5;
}

.project-card:hover {
    transform: scale(1.02);
}

@media (max-width: 640px) {
    .project-card-text {
        height: auto;
        min-height: 0;
    }

    .project-card-media {
        align-items: flex-end;
    }

    .resolution-wb-helper {
        font-size: 0.54rem;
    }
}

/* ==========================================================================
   PROJECTS HOVER LIST (fluid list + full-bleed background — no card chrome)
   ========================================================================== */

#projects .timeline-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0;
}

.projects-hover {
    position: relative;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    /* Reserve space for fixed header so list centers in the visible viewport */
    min-height: 100vh;
    padding: var(--header-height) 0 env(safe-area-inset-bottom, 0);
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    isolation: isolate;
}

/* Split preview uses position:fixed — must not clip it to this scroll box */
.projects-hover.has-visual-split {
    overflow: visible;
}

/* Cross-fade layers: hex or CSS gradient — opacity only (no scale) for smooth blends */
.projects-hover-bg {
    position: absolute;
    inset: 0;
    background: transparent;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.62s cubic-bezier(0.33, 1, 0.32, 1);
    z-index: 0;
    will-change: opacity;
}

.projects-hover-bg.is-active {
    opacity: 1;
}

.projects-hover-stage {
    position: relative;
    /* Must stay above .projects-hover-bg (JS sets bg z-index 1–2 for crossfade) */
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    flex: 1 1 auto;
    /* Left column aligns with page .container; right column bleeds to viewport edge. */
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    --projects-container-max: var(--layout-max-width);
    padding-top: clamp(3.5rem, 12vh, 7rem);
    padding-bottom: clamp(2rem, 6vh, 4rem);
    padding-left: max(2rem, calc((100vw - var(--projects-container-max)) / 2 + 2rem));
    padding-right: clamp(0px, calc((100vw - 1600px) * 0.18), 8vw);
}

/* Small label above list — left-aligned with titles (reference: “Design”) */
#projects .section-title--projects {
    font-family: var(--font-paragon);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-align: left;
    text-transform: none;
    margin: 0 0 clamp(0.85rem, 1.8vw, 1.35rem);
    color: var(--secondary-text);
    align-self: flex-start;
    position: relative;
    z-index: 2;
}

/* Default: one column — list uses full width so title + badge stay on one row. */
.projects-hover-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.25rem, 3.2vw, 3rem);
    align-items: start;
    width: 100%;
    min-width: 0;
    flex: 0 1 auto;
}

/*
 * Preview open (desktop): one grid cell — list paints above image so titles aren’t squeezed.
 * Image stays right-sized; links stay clickable (pointer-events on list off, on <a> on).
 */
@media (min-width: 901px) {
    .projects-hover.has-visual .projects-hover-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        align-items: center;
        gap: 0;
        position: relative;
    }

    .projects-hover.has-visual .projects-hover-list {
        grid-column: 1;
        grid-row: 1;
        z-index: 6;
        position: relative;
        pointer-events: none;
    }

    #projects .projects-hover.has-visual .projects-hover-link {
        pointer-events: auto;
    }

    .projects-hover.has-visual .projects-hover-visual:not(.is-split-viewport) {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
        width: min(48vw, 840px);
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .projects-hover.has-visual .projects-hover-visual:not(.is-split-viewport) {
        width: min(47vw, 900px);
    }
}

@media (min-width: 1600px) {
    .projects-hover.has-visual .projects-hover-visual:not(.is-split-viewport) {
        width: min(44vw, 920px);
    }
}

@media (min-width: 2000px) {
    .projects-hover.has-visual .projects-hover-visual:not(.is-split-viewport) {
        width: min(40vw, 960px);
    }
}

/*
 * TTP split preview: fixed to the viewport’s right edge, full screen height so each half
 * can slide in from the true top / bottom (not from a vertically-centered grid cell).
 */
@media (min-width: 901px) {
    .projects-hover.has-visual .projects-hover-visual.is-split-viewport {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: min(48vw, 840px);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        align-self: auto;
        justify-self: end;
        margin: 0;
        padding: 0;
        z-index: 1;
        display: flex;
        align-items: stretch;
        justify-content: flex-end;
    }

    .projects-hover.has-visual .projects-hover-visual.is-split-viewport .projects-hover-visual-stack {
        height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        width: 100%;
        align-items: stretch;
        justify-items: end;
        align-content: stretch;
    }
}

@media (min-width: 1200px) {
    .projects-hover.has-visual .projects-hover-visual.is-split-viewport {
        width: min(47vw, 900px);
    }
}

@media (min-width: 1600px) {
    .projects-hover.has-visual .projects-hover-visual.is-split-viewport {
        width: min(44vw, 920px);
    }
}

@media (min-width: 2000px) {
    .projects-hover.has-visual .projects-hover-visual.is-split-viewport {
        width: min(40vw, 960px);
    }
}

.projects-hover-list {
    position: relative;
    z-index: 2;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.projects-hover-item {
    min-width: 0;
}

.projects-hover-item + .projects-hover-item {
    margin-top: 12px;
}

/* Hit-area = title + badge only (not full row width) */
#projects .projects-hover-link {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    font-family: var(--font-main);
    /* Primary text only — follows light/dark theme, not the accent swatch */
    color: var(--text-color);
    font-size: clamp(2.6rem, 4.6vw + 0.75rem, 5.25rem);
    padding: clamp(0.18rem, 0.28vw, 0.35rem) 0;
    border-radius: 0;
    opacity: 1;
    transition:
        padding-left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* Text arrow: slides in L→R while hover padding pushes the title right */
#projects .projects-hover-link::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-0.55em);
    opacity: 0;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1em;
    line-height: 1;
    letter-spacing: 0;
    color: var(--text-color);
    transition:
        opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.25s ease;
    pointer-events: none;
}

#projects .projects-hover-link:hover,
#projects .projects-hover-link:focus-visible {
    background: transparent;
    opacity: 1; /* override global a:hover { opacity: 0.7 } */
    /* Room for arrow + gap (scales with title size via em) */
    padding-left: 1.12em;
}

#projects .projects-hover-link:hover::before,
#projects .projects-hover-link:focus-visible::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    color: var(--text-color);
}

[data-theme="dark"] #projects .projects-hover-link:hover,
[data-theme="dark"] #projects .projects-hover-link:focus-visible {
    background: transparent;
}

#projects .projects-hover-link:hover .projects-hover-title,
#projects .projects-hover-link:focus-visible .projects-hover-title {
    color: var(--text-color);
}

/* "Coming soon" rows are intentionally non-interactive. */
#projects .projects-hover-link.is-coming-soon {
    cursor: default;
}

/* Title + company pill — Figma: 16px gap, badge vertically centered to title line */
#projects .projects-hover-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    width: max-content;
    max-width: 100%;
}

#projects .projects-hover-title {
    font-family: var(--font-main);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.02;
    font-size: 1em;
    color: inherit;
    transition: color 0.25s ease;
    display: block;
    padding-bottom: 0.04em;
    white-space: nowrap;
    min-width: 0;
    /* Don’t grow: badge stays 16px after the title, not pushed to the row’s end */
    flex: 0 1 auto;
}

/* Width --badge-w-rest / --badge-w-hover set in script.js so the pill hugs text and grows on hover */
.projects-hover-badge {
    flex-shrink: 0;
    align-self: center;
    margin-left: 16px;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-family: var(--font-main);
    font-size: clamp(15px, 0.45vw + 13px, 18px);
    font-weight: 500;
    letter-spacing: 0.015em;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
    overflow: hidden;
    max-width: min(360px, 52vw);
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: transparent;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    vertical-align: middle;
    width: var(--badge-w-rest, max-content);
    min-height: calc(1.2em + 1rem);
    transform: translate3d(0, 0, 0) scale(1);
    transition:
        width 0.48s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.35s ease,
        color 0.35s ease,
        border-color 0.35s ease;
}

.projects-hover-badge__label,
.projects-hover-badge__hover {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-hover-badge__hover {
    opacity: 0;
    pointer-events: none;
}

[data-theme="light"] .projects-hover-badge {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.22);
    color: var(--text-color);
}

[data-theme="dark"] .projects-hover-badge {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--text-color);
}

#projects .projects-hover-link:hover .projects-hover-badge__label,
#projects .projects-hover-link:focus-visible .projects-hover-badge__label {
    opacity: 0;
}

#projects .projects-hover-link:hover .projects-hover-badge__hover,
#projects .projects-hover-link:focus-visible .projects-hover-badge__hover {
    opacity: 1;
}

#projects .projects-hover-link:hover .projects-hover-badge,
#projects .projects-hover-link:focus-visible .projects-hover-badge {
    width: var(--badge-w-hover, var(--badge-w-rest, max-content));
}

/* Coming soon (Intuit): neutral gray fill */
#projects .projects-hover-link:hover .projects-hover-badge[data-badge-variant="soon"],
#projects .projects-hover-link:focus-visible .projects-hover-badge[data-badge-variant="soon"] {
    background: #5f6470;
    color: #f5f5f7;
    border-color: transparent;
}

[data-theme="dark"] #projects .projects-hover-link:hover .projects-hover-badge[data-badge-variant="soon"],
[data-theme="dark"] #projects .projects-hover-link:focus-visible .projects-hover-badge[data-badge-variant="soon"] {
    background: #848994;
    color: #121418;
}

/* Explore: full fill from the row’s backdrop hue, darkened (computed in JS) */
#projects .projects-hover-link:hover .projects-hover-badge[data-badge-variant="explore"],
#projects .projects-hover-link:focus-visible .projects-hover-badge[data-badge-variant="explore"] {
    background: var(--badge-explore-bg) !important;
    color: var(--badge-explore-fg, #fafafa) !important;
    border-color: transparent !important;
}

.projects-hover-visual {
    justify-self: end;
    padding-right: 0;
    margin-right: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    /* Let mouse events pass through so leaving a title for the preview reads as “left the row”, not still “inside” a hit target. */
    pointer-events: none;
}

.projects-hover-visual-stack {
    display: grid;
    grid-template: 1fr / 1fr;
    width: 100%;
    justify-items: end;
    align-items: end;
    pointer-events: none;
}

/* Two stacked layers: crossfade + slide when switching projects */
.projects-hover-visual-img--layer {
    grid-area: 1 / 1;
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    /* Taller on laptop/desktop; clamp keeps tablets/small laptops sane */
    max-height: min(82vh, clamp(560px, 66vh, 1000px));
    object-fit: contain;
    filter: drop-shadow(0 24px 52px rgba(0, 0, 0, 0.18));
    opacity: 0;
    transform: translate3d(44px, 0, 0) scale(0.98);
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 0;
}

/* Visible front image; outgoing keeps .is-visible while .is-exiting runs (see :not below) */
.projects-hover-visual-img--layer.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.projects-hover-visual-img--layer.is-visible:not(.is-exiting) {
    z-index: 3;
}

/* After .is-visible so outgoing fades/slides out without a flash */
.projects-hover-visual-img--layer.is-exiting {
    opacity: 0;
    transform: translate3d(-32px, 0, 0) scale(0.99);
    z-index: 1;
    transition-duration: 0.42s, 0.52s;
}

@media (min-width: 1200px) {
    .projects-hover-visual-img--layer {
        max-height: min(83vh, clamp(580px, 67vh, 1040px));
    }
}

@media (min-width: 1600px) {
    .projects-hover-visual-img--layer {
        max-height: min(85vh, clamp(620px, 68vh, 1100px));
    }
}

/* TTP: two halves slide from top / bottom and meet in the middle */
.projects-hover-visual-stack.is-split-mode .projects-hover-visual-img--layer {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
}

.projects-hover-visual-split {
    grid-area: 1 / 1;
    z-index: 4;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    overflow: hidden;
    pointer-events: none;
}

/* Top / bottom bands = half the viewport — slide motion reads from screen edges */
.projects-hover-split-half {
    position: absolute;
    left: 0;
    right: 0;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Pin top asset to viewport top (was flex-end → content sat at seam, leaving mint band above) */
.projects-hover-split-half--top {
    top: 0;
    height: 50vh;
    height: 50dvh;
    justify-content: flex-start;
}

/* Pin bottom asset to viewport bottom */
.projects-hover-split-half--bottom {
    bottom: 0;
    height: 50vh;
    height: 50dvh;
    justify-content: flex-end;
}

.projects-hover-split-inner {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-hover-split-half--bottom .projects-hover-split-inner {
    justify-content: flex-end;
}

.projects-hover-split-half--top .projects-hover-split-inner {
    transform: translateY(-100%);
}

.projects-hover-split-half--bottom .projects-hover-split-inner {
    transform: translateY(100%);
}

.projects-hover-visual-split.is-animated .projects-hover-split-half--top .projects-hover-split-inner,
.projects-hover-visual-split.is-animated .projects-hover-split-half--bottom .projects-hover-split-inner {
    transform: translateY(0);
}

.projects-hover-split-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 50vh;
    max-height: 50dvh;
    object-fit: contain;
    filter: drop-shadow(0 24px 52px rgba(0, 0, 0, 0.18));
}

.projects-hover-split-half--top .projects-hover-split-img {
    object-position: top right;
}

.projects-hover-split-half--bottom .projects-hover-split-img {
    object-position: bottom right;
}

[data-theme="dark"] .projects-hover-visual-img--layer {
    filter: drop-shadow(0 28px 60px rgba(0, 0, 0, 0.5));
}

[data-theme="dark"] .projects-hover-split-img {
    filter: drop-shadow(0 28px 60px rgba(0, 0, 0, 0.5));
}

.projects-hover-visual[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .projects-hover-stage {
        min-height: 0;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .projects-hover-grid {
        grid-template-columns: 1fr !important;
        min-height: 0;
        gap: 0.75rem;
    }

    .projects-hover-visual {
        display: none !important;
    }

    #projects .projects-hover-row {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .projects-hover-badge {
        margin-left: auto;
        margin-top: 0;
        flex-shrink: 0;
    }

    #projects .projects-hover-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.12;
    }
}

@media (max-width: 640px) {
    .projects-hover-stage {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    #projects .projects-hover-link {
        padding: 0.75rem 0;
        font-size: clamp(1.25rem, 5vw, 1.85rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .projects-hover-bg,
    .projects-hover-visual,
    .projects-hover-visual-img--layer,
    .projects-hover-split-inner,
    #projects .projects-hover-link,
    #projects .projects-hover-link::before {
        transition: none !important;
    }

    .projects-hover-visual-split.is-visible .projects-hover-split-half--top .projects-hover-split-inner,
    .projects-hover-visual-split.is-visible .projects-hover-split-half--bottom .projects-hover-split-inner {
        transform: translateY(0) !important;
    }

    /* Only fade; badge width snaps when reduced motion */
    .projects-hover-badge {
        transition: border-color 0.35s ease !important;
    }

    .projects-hover-badge__label,
    .projects-hover-badge__hover {
        transition: opacity 0.18s ease !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-indicator {
        opacity: 1 !important;
        animation: none !important;
    }
}

/* ==========================================================================
   MOBILE HERO CARD (HTML/CSS only, no React)
   ========================================================================== */
@media (max-width: 768px) {
    .hero.hero--stack {
        min-height: 100svh;
        height: auto;
        padding-top: calc(var(--header-height) + 0.5rem);
        padding-bottom: 0.75rem;
        align-items: center;
    }

    .hero.hero--stack .hero-content {
        width: 100%;
        min-height: calc(100svh - var(--header-height) - 1.5rem);
        justify-content: center;
        align-items: center;
        gap: 0;
    }

    .hero.hero--stack .hero-artsy-layout {
        width: min(92vw, 380px);
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        row-gap: clamp(0.25rem, 0.8svh, 0.65rem);
        margin: 0;
        padding: clamp(0.5rem, 1.2svh, 1rem) 0.85rem clamp(0.4rem, 1svh, 0.8rem);
        border-radius: 24px;
        background: transparent;
        backdrop-filter: none;
    }

    [data-theme="dark"] .hero.hero--stack .hero-artsy-layout {
        background: transparent;
    }

    .hero.hero--stack .hero-side-label--left {
        display: block;
        writing-mode: horizontal-tb;
        transform: none;
        height: auto;
        justify-self: center;
        margin: 0;
        top: 0;
        font-size: clamp(1.8rem, 4.2svh, 2.8rem);
        line-height: 0.95;
    }

    .hero.hero--stack .hero-portrait-frame {
        width: clamp(100px, 19svh, 200px);
        height: clamp(100px, 19svh, 200px);
        max-width: none;
        justify-self: center;
        aspect-ratio: 1 / 1;
        border-radius: 999px;
        overflow: hidden;
    }

    .hero.hero--stack .hero-copy {
        width: 100%;
        margin: 0;
        align-items: center;
        gap: clamp(0.25rem, 0.6svh, 0.5rem);
    }

    .hero.hero--stack .hero-title--artsy {
        margin: 0;
        display: inline-flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: baseline;
        gap: 0.24em;
        white-space: nowrap;
        font-size: clamp(2rem, 5svh, 3.4rem);
        text-align: center;
    }

    .hero.hero--stack .hero-subtitle {
        padding-left: 0;
        margin: 0;
        max-width: 96%;
        font-size: clamp(0.82rem, 1.8svh, 1.1rem);
        line-height: 1.45;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .hero.hero--stack .scroll-indicator {
        position: static;
        transform: none;
        margin-top: clamp(0.5rem, 1.5svh, 1rem);
        align-items: center;
        font-size: clamp(0.8rem, 1.6svh, 0.95rem);
        gap: clamp(0.3rem, 0.8svh, 0.5rem);
        color: var(--secondary-text);
        opacity: 1;
        animation: none;
    }

    .hero.hero--stack .mouse {
        width: clamp(20px, 3.5svh, 26px);
        height: clamp(30px, 5svh, 38px);
    }
}

/* Height-based scaling is now handled fluidly via svh units in the base mobile hero block above. */

/* Password page */
.password-page {
    min-height: 100vh;
}

.password-header {
    position: sticky;
    top: 0;
    z-index: 20;
}

.password-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.password-back-btn {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    border: 1px solid var(--line-color);
    padding: 10px 16px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.password-back-btn:hover {
    border-color: var(--user-accent, var(--text-color));
    color: var(--user-accent, var(--text-color));
}

.password-main {
    min-height: calc(100vh - 84px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}

.password-card {
    width: min(560px, 100%);
    border-radius: 24px;
    border: 1px solid var(--line-color);
    padding: clamp(1.5rem, 3vw, 2.2rem);
    background: rgba(250, 250, 250, 0.9);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .password-card {
    background: rgba(24, 24, 27, 0.86);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.password-eyebrow {
    margin: 0 0 0.5rem;
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-text);
}

.password-title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 2vw + 1.2rem, 2.8rem);
    line-height: 1.1;
    color: var(--text-color);
}

.password-copy {
    margin: 0 0 1rem;
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--secondary-text);
}

.password-target {
    margin: 0 0 1.25rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-color);
}

.password-form {
    display: grid;
    gap: 0.8rem;
}

.password-label {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.password-input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line-color);
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 0.85rem 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.password-input:focus {
    border-color: var(--user-accent, var(--text-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--user-accent, var(--text-color)) 20%, transparent);
}

.password-error {
    min-height: 1.25rem;
    margin: 0;
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: #ef4444;
}

.password-submit {
    margin-top: 0.2rem;
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.15rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bg-color);
    background: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.password-submit:hover {
    background: var(--user-accent, var(--text-color));
    color: #fff;
}

/* Project page password overlay */
.page-project.is-locked {
    overflow: hidden;
}

.project-password-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.project-password-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 11, 14, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="light"] .project-password-overlay-backdrop {
    background: rgba(241, 242, 244, 0.52);
}

.project-password-modal-wrap {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.project-password-nav {
    width: min(var(--layout-max-width), 100%);
    margin: 0 auto;
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-password-back {
    border: 1px solid var(--line-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 999px;
    padding: 10px 16px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-password-back:hover {
    border-color: var(--user-accent, var(--text-color));
    color: var(--user-accent, var(--text-color));
    transform: translateY(-1px);
}

.project-password-modal {
    width: min(560px, calc(100% - 2rem));
    margin: auto;
    position: relative;
    border: 1px solid var(--line-color);
    border-radius: 24px;
    padding: clamp(1.4rem, 3vw, 2.1rem);
    background: rgba(250, 250, 250, 0.92);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

[data-theme="dark"] .project-password-modal {
    background: rgba(24, 24, 27, 0.9);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.46);
}

.project-password-title {
    margin: 0 0 0.6rem;
    font-family: var(--font-main);
    font-size: clamp(2rem, 2vw + 1.2rem, 2.6rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--text-color);
}

.project-password-copy {
    margin: 0 0 1rem;
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--secondary-text);
}

.project-password-contact-link {
    color: currentColor;
    text-decoration: underline;
    text-underline-offset: 0.14em;
    text-decoration-thickness: 1px;
}

.project-password-contact-link:hover {
    opacity: 1;
    color: var(--user-accent, var(--text-color));
}

.project-password-form {
    display: grid;
    gap: 0.75rem;
}

.project-password-label {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-color);
}

.project-password-input {
    width: 100%;
    border: 1px solid var(--line-color);
    border: 1px solid color-mix(in srgb, var(--user-accent, var(--text-color)) 45%, var(--line-color));
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-password-input:focus {
    border-color: var(--user-accent, var(--text-color));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--user-accent, var(--text-color)) 20%, transparent);
}

.project-password-error {
    min-height: 1.2rem;
    margin: 0;
    font-family: var(--font-main);
    font-size: 0.84rem;
    color: #ef4444;
}

.project-password-submit {
    margin-top: 0.15rem;
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.1rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--bg-color);
    background: var(--text-color);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s ease;
}

.project-password-submit:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    background: var(--user-accent, var(--text-color));
}

.project-password-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line-color);
    background: transparent;
    color: var(--secondary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.project-password-close:hover {
    color: var(--user-accent, var(--text-color));
    border-color: var(--user-accent, var(--text-color));
    transform: scale(1.04);
}

.project-password-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.project-password-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.footer {
    padding: 10px 0 12px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.65rem;
}

/* Footer body: 14px - Inter 500 */
.footer-copyright {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--secondary-text);
    margin: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.footer-socials {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    white-space: nowrap;
}

.footer-socials a {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--secondary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .footer {
        padding: 1.1rem 0 1.25rem;
    }

    .footer-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.95rem;
        text-align: center;
    }

    .footer-socials {
        order: 1;
        width: 100%;
        justify-content: center;
        gap: 1.9rem;
        flex-wrap: wrap;
    }

    .footer-socials a {
        font-size: 0.72rem;
        letter-spacing: 0.03em;
    }

    .footer-copyright {
        order: 2;
        white-space: normal;
        max-width: min(92vw, 380px);
        font-size: 0.68rem;
        line-height: 1.45;
        letter-spacing: 0.03em;
        text-align: center;
    }
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: 99px;
    font-weight: 600;
    margin: 2rem 0;
    transition: transform 0.2s;
}

.cta-button:hover {
    transform: scale(1.05);
}

.copyright {
    color: var(--secondary-text);
    font-size: clamp(0.8125rem, 1.5vw + 0.7rem, 0.9rem);
}

/* Animations */
@keyframes gridLinesReveal {
    from {
        clip-path: inset(0 0 100% 0);
    }
    to {
        clip-path: inset(0);
    }
}

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

@keyframes heroSideLabelVerticalIn {
    from {
        opacity: 0;
        transform: rotate(180deg) translateY(40px);
    }
    to {
        opacity: 1;
        transform: rotate(180deg) translateY(0);
    }
}

@keyframes heroParallaxUpCenter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes scrollMouse {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 10px); opacity: 0; }
}

/* Responsive */
@media (max-width: 900px) {
    .timeline {
        padding-left: 0;
    }
    
    .timeline-line,
    .timeline-section-dot {
        display: none;
    }

    /* Smaller dots on mobile so they don’t dominate */
    .project-item {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 4rem;
        padding-left: 0;
        padding-right: 0;
    }

    .project-item::before {
        content: attr(data-title);
        display: block;
        font-size: 0.875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--accent-color);
        margin-bottom: 0.75rem;
        font-family: var(--font-main);
    }

    .section-dot-title {
        display: none; /* Hide static titles on mobile */
    }

    .project-visual, .project-content {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    .project-label-column {
        width: 100%;
        margin-bottom: 0.5rem;
        padding-right: 0;
    }
    
    .sticky-label {
        display: none;
    }

    .project-visual {
        margin-bottom: 1.5rem;
    }

    .project-content {
        margin-bottom: 0;
    }

    .placeholder-image {
        height: 250px;
        min-height: 220px;
        border-radius: 12px;
        box-shadow: 0 4px 24px -4px var(--shadow-color);
        transform: none;
    }

    .project-card-image.placeholder-image {
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
        border-radius: 0 0 20px 20px;
        box-shadow: none;
    }

    .project-item.visible .placeholder-image {
        transform: none;
    }

    .project-separator {
        margin: 3rem 0 4rem 0;
    }
}
