@font-face { font-family: 'Thin'; src: url('../fonts/Thin.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Lux'; src: url('../fonts/Lux.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Bold'; src: url('../fonts/Bold.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Heavitas'; src: url('../fonts/Heavitas.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Variable.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-VariableItalic.ttf') format('truetype'); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
    --white: #fff;
    --black: #000;
    --ink: #111;
    --text: #d5d5d5;
    --text-muted: #a0a0a0;
    --text-faint: #888;
    --glass: rgba(255, 255, 255, 0.1);
    --hairline: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.2);

    --font-body: 'Thin', sans-serif;
    --font-display: 'Lux', serif;

    --pad-section: clamp(40px, 10vh, 120px);
    --pad-edge: clamp(20px, 5vw, 80px);
    --container-width: 1400px;
    --radius-pill: 50px;

    --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.3);
    --perlin-smoke: url(#perlin-smoke);
    --section-gradient: radial-gradient(circle at 50% 0%, #333 0%, #202020 30%, var(--black) 80%);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}


/* Base */

html {
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: var(--white) var(--black);
    scroll-padding-top: 100px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background: var(--black);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: clip;
}

p {
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.7;
    text-wrap: pretty;
}

code {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
    color: var(--white);
}

:focus-visible {
    outline: 3px solid var(--white);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100000;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

[hidden] {
    display: none !important;
}

section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: clamp(60px, 12vh, 120px) var(--pad-edge);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--section-gradient) center top / cover no-repeat fixed;
}

/* Section content fades in once the section scrolls into view (reveal() in common.js).
   Pinned case study scenes are excluded: scrollyScenes() in effects.js drives them. */
section:not(.case-scene) > * {
    opacity: 0;
    transition: opacity 1.5s var(--ease-out);
}

section.visible > * {
    opacity: 1;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}


/* Page loader */

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    background: var(--black);
    pointer-events: none;
    transition: opacity 0.6s var(--ease-out) 0.2s;
}

.page-loader.done {
    opacity: 0;
}

.page-loader-bar {
    width: 0;
    height: 2px;
    background: var(--white);
    transition: width 0.7s var(--ease-out);
}


/* Cursors */

.cursor {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--white);
    mix-blend-mode: exclusion;
    pointer-events: none;
    transition: transform 0.1s ease-out, opacity 0.3s ease;
}

.custom-cursor .cursor {
    display: block;
}

html.custom-cursor,
html.custom-cursor * {
    cursor: none;
}

.cta-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-float);
    font-size: clamp(12px, 1.4vw, 16px);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.cta-cursor.active {
    opacity: 1;
    transform: translate(-50%, -50%);
    border-radius: 30px;
}

.cta-cursor-arrow {
    width: 0.85em;
    height: 0.85em;
    background: currentColor;
    mask: url('../images/core/arrow-cta.svg') no-repeat center / contain;
}


/* Shared components */

/* Section title flanked by two lines that draw out from the text when visible. */
.title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: var(--container-width);
    box-sizing: border-box;
    margin: var(--pad-section) auto clamp(16px, 3vh, 32px);
    padding: 0 var(--pad-edge);
    font-size: clamp(10px, 1.2vw, 14px);
    font-weight: normal;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
}

.title::before,
.title::after {
    content: '';
    flex: 1;
    height: 0.8px;
    margin: 0 clamp(12px, 2.5vw, 28px);
    background: var(--text);
    transform: scaleX(0);
    transition: transform 1.5s var(--ease-out);
}

.title::before {
    transform-origin: right;
}

.title::after {
    transform-origin: left;
}

.title.visible::before,
.title.visible::after {
    transform: scaleX(1);
}

.button {
    min-height: 44px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: clamp(16px, 3vh, 32px);
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    background: var(--glass);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--white);
    font-size: clamp(10px, 1vw, 12px);
    letter-spacing: 1.5px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tag {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-pill);
    color: var(--white);
    font-size: clamp(11px, 0.95vw, 13px);
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* Navbar */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(12px, 2.5vh, 28px) var(--pad-edge);
    color: var(--white);
    font-size: clamp(13px, 1.4vw, 16px);
    mix-blend-mode: difference;
}

.brand {
    display: flex;
    align-items: center;
}

.brand img {
    width: clamp(40px, 8vh, 72px);
}

.navbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.status-badge {
    padding: 5px 14px;
    border: 2px solid var(--glass);
    border-radius: var(--radius-pill);
    font-size: clamp(10px, 1vw, 12px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.links-container {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 20px);
}

.link {
    padding: clamp(4px, 0.5vh, 8px) clamp(6px, 0.8vw, 12px);
    color: inherit;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s var(--ease-out);
    will-change: transform;
}

.link:hover,
.link.active {
    background: var(--hairline);
}

.link--cta {
    padding: clamp(4px, 0.5vh, 8px) clamp(10px, 1.2vw, 18px);
    border-radius: var(--radius-pill);
    background: var(--glass);
    letter-spacing: 1px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-out);
}

.link--cta:hover {
    background: var(--white);
    color: var(--ink);
}

.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font-size: clamp(18px, 5vw, 22px);
    line-height: 1;
    cursor: pointer;
}

.hamburger svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.hamburger[aria-expanded="true"] .icon-open,
.hamburger[aria-expanded="false"] .icon-close {
    display: none;
}


/* Mobile menu */

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--section-gradient);
    opacity: 0;
    pointer-events: none;
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    transition: opacity 0.6s var(--ease-out), backdrop-filter 0.6s var(--ease-out), -webkit-backdrop-filter 0.6s var(--ease-out);
}

.mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
}

html.menu-open,
html.menu-open body {
    overflow: hidden;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 4vh, 32px);
}

.mobile-menu-link {
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(36px, 10vw, 80px);
    font-style: italic;
    letter-spacing: 2px;
    text-decoration: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s var(--ease-out), color 0.2s;
}

.mobile-menu-link:hover,
.mobile-menu-link.active,
.mobile-menu-link[aria-current="page"] {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 8px;
    text-decoration-thickness: 2px;
}

.mobile-menu.open .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.open .mobile-menu-link:nth-child(1) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-menu-link:nth-child(2) { transition-delay: 0.22s; }
.mobile-menu.open .mobile-menu-link:nth-child(3) { transition-delay: 0.29s; }

.mobile-menu-footer {
    position: absolute;
    bottom: clamp(24px, 5vh, 48px);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 var(--pad-edge);
    font-size: clamp(11px, 2vw, 14px);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.5s ease 0.4s;
}

.mobile-menu.open .mobile-menu-footer {
    opacity: 1;
}


/* Footer */

#footer {
    position: relative;
    min-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(40px, 15vh, 200px) clamp(20px, 10vw, 200px) clamp(24px, 5vh, 48px);
    overflow: hidden;
}

.footer-bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    pointer-events: none;
}

/* Dark layer multiplied over the video: the white name below punches a hole through it. */
.footer-title-mask {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--ink);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.big-name {
    margin: 0;
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(80px, 45vw, 50vh);
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    transform: translateY(35%);
}

.footer-top-links {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(20px, 4vw, 40px);
}

.footer-col h3 {
    margin: 0 0 clamp(10px, 2vw, 20px);
    font-size: clamp(9px, 0.9vw, 11px);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.footer-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    margin-bottom: clamp(6px, 1vw, 10px);
}

.footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: clamp(13px, 1.3vw, 18px);
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}

.footer-links a:hover {
    opacity: 0.6;
}

.footer-links svg {
    width: 20px;
    height: 1em;
    fill: currentColor;
}


/* Back to top: rotating circular label around an arrow */

.back-to-top {
    --size: 100px;
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
    width: var(--size);
    height: var(--size);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    color: var(--white);
    mix-blend-mode: difference;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.back-to-top.visible:hover {
    transform: scale(0.9);
}

.btt-text {
    position: absolute;
    inset: 0;
    animation: spin 15s linear infinite;
    pointer-events: none;
}

.btt-text span {
    position: absolute;
    top: 0;
    left: 50%;
    transform-origin: 0 calc(var(--size) / 2);
    font-family: 'Heavitas', sans-serif;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: pre;
}

.btt-icon {
    width: 75%;
    filter: brightness(0) invert(1);
}

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


/* Home: hero */

#header {
    --hero-progress: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
    pointer-events: none;
}

/* Film grain over both page heroes. */
#header::after,
.about-header::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    mix-blend-mode: overlay;
    opacity: 0.18;
    pointer-events: none;
}

#hero-video,
#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: grayscale(1) blur(calc(var(--hero-progress) * 26px)) brightness(calc(1 - var(--hero-progress) * 0.55));
    transition: filter 0.1s linear;
}

#hero-video {
    z-index: 0;
    object-fit: cover;
    background: var(--black);
}

#hero-canvas {
    z-index: 1;
}

.header-content {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12.5px;
    padding: 50px;
    mix-blend-mode: difference;
    pointer-events: auto;
}

.header-subtitles {
    width: auto;
    color: var(--white);
    font-size: clamp(14px, 2.5vw, 28px);
    letter-spacing: 1px;
}

#site-title {
    margin: 0 0 clamp(8px, 1.5vh, 20px);
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(48px, 18vw, 250px);
    font-style: italic;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.hero-spacer {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
}


/* Home: intro */

#about-me {
    padding: clamp(48px, 10vh, 120px) 0 clamp(48px, 8vh, 100px);
    overflow: hidden;
}

/* Text and portrait overlap in the middle, the text blending over the photo. */
.intro {
    position: relative;
    width: min(1500px, 100%);
    min-height: 80vh;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(48px, 8vw, 140px);
    margin: 0 auto;
    padding: clamp(100px, 15vh, 200px) var(--pad-edge);
}

.intro-text {
    flex: 1;
    z-index: 10;
    max-width: 62ch;
    margin-right: -12vw;
    text-align: right;
    mix-blend-mode: difference;
}

.intro-text .about-title {
    margin-top: 0;
    text-wrap: pretty;
}

.intro-text .about-hero-lede {
    line-height: 1.7;
    margin-bottom: clamp(18px, 2.5vh, 28px);
}

.intro-portrait {
    position: relative;
    z-index: 5;
    flex: 0 0 45%;
    max-width: 600px;
    margin: 0;
    will-change: transform;
}

.intro-portrait img {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(1) contrast(1.05);
    backface-visibility: hidden;
}

/* "Hey! I'm Léo Tosku." on both the home intro and the about hero. */
.about-title {
    margin-bottom: clamp(24px, 4vh, 40px);
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 92px);
    font-style: italic;
    font-weight: normal;
    line-height: 1.05;
    text-wrap: balance;
}

.about-hero-lede {
    max-width: 60ch;
    margin: 0;
    font-size: clamp(17px, 2vw, 24px);
    line-height: 1.55;
}


/* Home: project grid */

#featured-projects {
    padding: clamp(48px, 8vh, 96px) 0 clamp(120px, 18vh, 220px);
    overflow-x: clip;
}

.featured-filters {
    z-index: 5;
    width: 100%;
    max-width: var(--container-width);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 1.2vw, 14px);
    margin: 0 auto clamp(24px, 4vh, 48px);
    padding: 0 var(--pad-edge);
}

.filter-btn {
    min-height: 44px;
    box-sizing: border-box;
    padding: clamp(6px, 1.2vh, 10px) clamp(14px, 1.8vw, 22px);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: clamp(10px, 1.1vw, 12px);
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
    will-change: transform, background, border-color;
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    transform: translateY(-1px);
}

.filter-btn.active {
    border-color: var(--white);
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.12);
}

/* Columns are built by projectGrid() in main.js. */
.featured-scatter {
    --gap: 7px;
    width: min(1500px, 100%);
    box-sizing: border-box;
    display: grid;
    gap: var(--gap);
    margin: 0 auto;
    padding: 0 var(--pad-edge);
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}

.featured-scatter.filtering {
    opacity: 0;
    transform: translateY(15px);
}

.scatter-column {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    will-change: transform;
}

.scatter-item {
    position: relative;
    display: block;
    background: var(--ink);
    overflow: hidden;
    transition: filter 0.25s ease;
}

.scatter-item-details {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 28px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
    color: var(--white);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}

.scatter-item-details strong {
    font-family: var(--font-display);
    font-size: clamp(17px, 1.7vw, 24px);
    font-style: italic;
    line-height: 1.05;
}

.scatter-item-details span {
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(10px, 0.9vw, 12px);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scatter-item:hover {
    filter: brightness(0.5);
}

.scatter-item:hover .scatter-item-details,
.scatter-item:focus-visible .scatter-item-details {
    opacity: 1;
    transform: none;
}

.scatter-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    backface-visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.scatter-item img.loaded {
    opacity: 1;
}


/* About: hero (video scrubbed by scroll, see scrollScrubbedVideo() in effects.js) */

.about-header {
    --hero-progress: 0;
    position: relative;
    z-index: 1;
    height: 125vh;
}

.about-header-video {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    pointer-events: none;
}

.about-header-overlay {
    position: fixed;
    inset: 0;
    z-index: 3;
    background: rgba(0, 0, 0, calc(var(--hero-progress) * 0.65));
    -webkit-backdrop-filter: blur(calc(var(--hero-progress) * 24px));
    backdrop-filter: blur(calc(var(--hero-progress) * 24px));
    pointer-events: none;
}

.about-header-text {
    position: fixed;
    inset: 0;
    z-index: 2;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(20px, 5vh, 60px) var(--pad-edge);
    text-align: center;
    mix-blend-mode: difference;
    pointer-events: none;
}

.about-header-text > * {
    pointer-events: auto;
}

.about-header-text .about-hero-lede {
    color: var(--white);
}


/* About: story */

#my-story {
    padding: var(--pad-section) 0;
}

.story {
    width: min(1500px, 100%);
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(16px, 4vw, 64px);
    margin: 0 auto;
    padding: 0 var(--pad-edge);
}

.story-text {
    position: relative;
    z-index: 2;
    width: 55%;
    min-width: 0;
    text-align: right;
}

.story-text h3 {
    margin-top: 0;
    margin-bottom: clamp(8px, 2vh, 20px);
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 48px);
    font-style: italic;
    font-weight: 700;
    font-synthesis: weight style;
    text-wrap: balance;
}

.story-paragraph {
    font-size: clamp(15px, 1.8vw, 26px);
    line-height: 1.6;
    text-wrap: balance;
}

.story-image {
    position: relative;
    width: 50%;
    min-width: 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.story-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    backface-visibility: hidden;
    will-change: transform;
}


/* About: experience & education */

.exp-stack {
    width: min(1500px, 100%);
    max-width: 820px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 4vh, 56px);
    margin: 0 auto;
    padding: 0 var(--pad-edge);
}

/* Year in the left column, everything else stacked in the right one. */
.exp-block {
    display: grid;
    grid-template-columns: clamp(90px, 14vw, 150px) minmax(0, 1fr);
    gap: clamp(12px, 2vw, 24px);
    align-items: start;
    padding-bottom: clamp(16px, 3vh, 28px);
    border-bottom: 1px solid var(--hairline);
}

.exp-block:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.exp-head {
    display: contents;
}

.exp-year {
    grid-column: 1;
    grid-row: 1 / span 3;
    padding-top: clamp(8px, 1.2vh, 14px);
    color: var(--text-muted);
    font-size: clamp(11px, 1vw, 13px);
    letter-spacing: 2px;
    white-space: nowrap;
}

.exp-title,
.exp-role,
.exp-lede,
.exp-list,
.exp-facts {
    grid-column: 2;
}

.exp-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(8px, 1.5vh, 16px);
    margin: 0 0 clamp(6px, 1vh, 10px);
    color: var(--white);
    font-family: var(--font-display);
    font-style: italic;
    line-height: 1.05;
}

.company-logo {
    width: auto;
    height: 100px;
    max-width: 220px;
    object-fit: contain;
    border-radius: 15px;
    filter: brightness(1.1) contrast(1.1);
    mix-blend-mode: screen;
}

.exp-company-name {
    font-size: clamp(20px, 2.8vw, 36px);
}

.exp-location {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: clamp(12px, 1.1vw, 14px);
    font-style: normal;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.exp-role {
    margin: 0 0 clamp(6px, 1vh, 10px);
    font-size: clamp(13px, 1.2vw, 15px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.exp-lede {
    max-width: 58ch;
    margin: 0;
    font-size: clamp(15px, 1.45vw, 19px);
    line-height: 1.65;
}

.exp-list {
    max-width: 58ch;
    margin: clamp(8px, 1.2vh, 12px) 0 0;
    padding: 0;
    list-style: none;
}

.exp-list li {
    position: relative;
    margin-bottom: clamp(8px, 1.2vh, 12px);
    padding-left: clamp(20px, 2vw, 28px);
    font-size: clamp(14px, 1.35vw, 17px);
    line-height: 1.6;
}

.exp-list li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--white);
    opacity: 0.4;
}

.exp-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(12px, 1.5vw, 24px);
    margin: clamp(12px, 2vh, 20px) 0 0;
}

.exp-facts > div {
    padding-top: clamp(10px, 1.5vh, 14px);
    border-top: 1px solid var(--border);
}

.exp-facts dt {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: clamp(9px, 0.9vw, 11px);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.exp-facts dd {
    margin: 0;
    color: var(--white);
    font-size: clamp(13px, 1.2vw, 15px);
    line-height: 1.4;
}


/* Project page: hero */

.project-hero {
    position: relative;
    height: 100svh;
    overflow: hidden;
}

.project-hero-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.article-header {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    padding: clamp(32px, 5vh, 56px) var(--pad-edge);
    color: var(--white);
    mix-blend-mode: difference;
    pointer-events: none; /* text-only layer: lets clicks reach the hero links below */
}

/* Header lines slide up one after the other once project.js adds .loaded. */
.article-header > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.article-header.loaded > * {
    opacity: 1;
    transform: none;
}

.article-header.loaded > :nth-child(2) { transition-delay: 80ms; }
.article-header.loaded > :nth-child(3) { transition-delay: 160ms; }
.article-header.loaded > :nth-child(4) { transition-delay: 240ms; }

.article-title {
    margin: 0 0 clamp(12px, 2vh, 24px);
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 96px);
    line-height: 1.05;
}

.article-subtitle {
    margin: 0 0 clamp(16px, 3vh, 32px);
    color: var(--text-muted);
    font-size: clamp(16px, 1.4vw, 20px);
}

.article-meta {
    margin: 0 0 clamp(16px, 2.4vh, 24px);
    color: var(--text-muted);
    font-size: clamp(14px, 1.2vw, 18px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Outlined pill used by the hero link and the bottom call-to-action links. */
.project-hero-live,
.project-cta-bottom-link {
    padding: clamp(10px, 1.4vh, 14px) clamp(18px, 1.8vw, 26px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-pill);
    color: var(--white);
    font-size: clamp(12px, 1vw, 14px);
    letter-spacing: 1.5px;
    text-decoration: none;
    text-transform: uppercase;
    mix-blend-mode: difference;
    transition: background 0.3s ease, color 0.3s ease;
}

.project-hero-live:hover,
.project-cta-bottom-link:hover {
    background: var(--white);
    color: var(--ink);
}

.project-hero-live {
    white-space: nowrap;
    pointer-events: auto;
}

.project-hero-links {
    position: absolute;
    bottom: clamp(32px, 5vh, 56px);
    right: var(--pad-edge);
    /* No z-index here: it would create a stacking context trapping the pills'
       mix-blend-mode inside the container. DOM order already paints this
       above the overlay. */
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    max-width: min(440px, calc(100% - 2 * var(--pad-edge)));
    pointer-events: none; /* only the pills themselves are clickable */
}


/* Project page: case study blocks (projects/cases/*.html) */

.case-intro,
.case-chapter {
    text-align: center;
}

.case-team {
    margin-top: 1.5rem;
    color: var(--text-faint);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.case-pullquote {
    position: relative;
    padding: 0 var(--pad-edge);
}

.pullquote {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    max-width: 880px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(24px, 3.5vw, 52px);
    line-height: 1.25;
    text-align: center;
    text-wrap: balance;
}

/* Comfortable reading measure for full-width case study text. */
.case-intro p {
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}

.case-heading {
    margin: 0 0 clamp(20px, 3vh, 32px);
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(28px, 2.6vw, 44px);
    font-style: italic;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

/* Project pages: no scrollbar, a slim progress bar sticks to the bottom instead. */
html:has(.project-main) {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html:has(.project-main)::-webkit-scrollbar {
    display: none;
}

.reading-progress {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    height: 3px;
    background: rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.reading-progress > span {
    display: block;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
}
/* Project page: scrollytelling scenes (scrollyScenes() in effects.js). The pin is
   held in place by JS transforms (immune to scroll-container quirks); its
   characters scrub in with scroll, then the scene fades out for the next one.
   Pinning is desktop-only; on mobile the scenes scroll naturally with a plain
   progressive reveal. */
@media (min-width: 769px) {
    .case-scene.case-intro,
    .case-scene.case-chapter {
        height: 260vh;
    }

    .case-scene.case-pullquote {
        height: 180vh;
    }

    /* Pin at the section top: base `section` centers its content, which would
       strand the pin mid-section with dead scroll above it. */
    .case-scene {
        justify-content: flex-start;
        padding-top: 0;
        padding-bottom: 0;
    }

    .case-scene-pin {
        display: grid;
        align-content: center;
    }

    /* Keep pinned chapters within one viewport so the centered pin never clips:
       tighter row padding plus capped visuals (long prose stays readable). */
    .case-scene .case-row {
        padding: clamp(24px, 4vh, 48px) 0;
    }

    .case-scene .case-panel {
        max-height: 64svh;
        display: flex;
        flex-direction: column;
    }

    .case-scene .case-panel img {
        flex: 1;
        min-height: 0;
        width: 100%;
        object-fit: contain;
    }
}

/* Text and media side by side; --reverse puts the media first. */
.case-row {
    width: 100%;
    max-width: var(--container-width);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 96px);
    align-items: center;
    padding: clamp(60px, 10vh, 120px) 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.4s var(--ease-out), transform 1.4s var(--ease-out);
}

.case-row.visible {
    opacity: 1;
    transform: none;
}

.case-row > :only-child {
    grid-column: 1 / -1;
    text-align: left;
}

.case-row .case-prose {
    text-align: right;
}

.case-row--reverse .case-prose {
    text-align: left;
}

.case-row--reverse .case-panel {
    order: -1;
}

.case-panel {
    width: 100%;
    margin: 0;
    align-self: center;
    overflow: hidden;
}

.case-panel img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    will-change: transform;
}

.media-caption {
    margin-top: 8px;
    color: var(--text-faint);
    font-size: 1em;
    text-align: right;
}

.media-caption a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.quote-grid {
    display: grid;
    gap: 16px;
}

.quote-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.quote-card blockquote {
    margin: 0;
    color: var(--white);
    font-size: 0.88rem;
    line-height: 1.65;
}

.quote-card footer {
    color: var(--text-faint);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.quote-card footer strong {
    color: var(--white);
    font-weight: 600;
}

.case-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.case-table-scroll {
    width: 100%;
}

.case-table-hint {
    display: none;
}

.case-table th,
.case-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--hairline);
    text-align: left;
}

.case-table thead th {
    padding-bottom: 12px;
    color: var(--text-faint);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.case-table td:first-child {
    color: var(--white);
}

.case-table td:not(:first-child),
.case-table th:not(:first-child) {
    width: 72px;
    text-align: center;
}

.case-table tbody tr:last-child td {
    border-bottom: none;
}

.col-accent-gold { color: #e8c97a; }
.col-accent-blue { color: #7ab8e8; }
.col-accent-green { color: #a8d8a8; }
.col-accent-red { color: #e87a7a; }

.case-gallery {
    padding: var(--pad-section) 0;
}

.case-gallery-grid {
    width: 100%;
    max-width: var(--container-width);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1vw, 16px);
    margin: clamp(32px, 6vh, 80px) auto 0;
    padding: 0 var(--pad-edge);
}

.gallery-item {
    margin: 0;
    overflow: hidden;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}


/* Project page: bottom call to action */

.project-cta-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 100px);
    align-items: center;
    padding: clamp(60px, 12vh, 120px) var(--pad-edge);
}

.project-cta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(16px, 3vh, 28px);
}

.project-cta-heading {
    margin: 0;
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 80px);
    font-style: italic;
    font-weight: bold;
    line-height: 1.05;
}

.project-cta-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 1.5vw, 24px);
    align-items: start;
}

.project-cta-tile {
    width: 100%;
    aspect-ratio: 3 / 5;
    background: #1a1a1a center / cover;
    will-change: transform;
}

.project-cta-tile:nth-child(1) { margin-top: 40px; }
.project-cta-tile:nth-child(3) { margin-top: 60px; }


/* Project page: previous / next */

.project-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    background: var(--hairline);
}

.project-pager-item {
    position: relative;
    isolation: isolate;
    min-height: clamp(220px, 32vh, 360px);
    display: flex;
    align-items: flex-end;
    padding: clamp(24px, 4vw, 48px);
    background: var(--black);
    text-decoration: none;
    overflow: hidden;
}

.project-pager-item:focus-visible {
    outline-offset: -4px;
}

.project-pager-item--next {
    justify-content: flex-end;
    text-align: right;
}

.project-pager-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #1a1a1a center / cover;
    opacity: 0.28;
    transform: scale(1.05);
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.project-pager-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.75) 100%);
    transition: background 0.4s ease;
}

.project-pager-item:hover .project-pager-img,
.project-pager-item:focus-visible .project-pager-img {
    opacity: 0.5;
    transform: scale(1);
}

.project-pager-meta {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 12px);
}

.project-pager-dir {
    color: rgba(255, 255, 255, 0.6);
    font-size: clamp(11px, 0.9vw, 13px);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.project-pager-item:hover .project-pager-dir,
.project-pager-item:focus-visible .project-pager-dir {
    color: var(--white);
}

.project-pager-title {
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(26px, 3.6vw, 56px);
    font-style: italic;
    font-weight: bold;
    line-height: 1.05;
}

.project-pager-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(12px, 1vw, 15px);
}


/* Project page: not found */

.project-not-found {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: var(--pad-edge);
    text-align: center;
}

.project-not-found p {
    margin: 0;
    color: var(--white);
    font-family: 'Bold', sans-serif;
    font-size: clamp(24px, 4vw, 48px);
}

.project-not-found a {
    color: var(--text-muted);
    font-size: 16px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-not-found a:hover {
    color: var(--white);
}


/* Responsive */

@media (max-width: 1024px) {
    .intro {
        flex-direction: column-reverse;
        gap: 32px;
        text-align: center;
    }

    .intro-text {
        margin-right: 0;
        text-align: center;
        mix-blend-mode: normal;
    }

    .intro-portrait {
        flex: 1;
        max-width: 420px;
    }

    .project-pager {
        grid-template-columns: 1fr;
    }

    .project-pager-item--next {
        justify-content: flex-start;
        text-align: left;
    }
    .header-content{
        bottom: 40%;
    }
}

@media (max-width: 768px) {
    .link,
    .navbar-center {
        display: none;
    }

    .hamburger {
        display: inline-flex;
    }

    .story {
        flex-direction: column;
    }

    .story-text,
    .story-image {
        width: 100%;
    }

    .story-text {
        text-align: left;
    }

    #footer {
        padding: clamp(24px, 8vh, 80px) var(--pad-edge) clamp(16px, 4vh, 32px);
    }

    .footer-top-links {
        flex-direction: column;
        gap: clamp(24px, 6vw, 40px);
    }

    .exp-block {
        grid-template-columns: 1fr;
        gap: clamp(8px, 1.5vh, 14px);
    }

    .exp-year {
        grid-row: auto;
        margin-bottom: 4px;
        padding-top: 0;
    }

    .exp-title,
    .exp-role,
    .exp-lede,
    .exp-list,
    .exp-facts {
        grid-column: 1;
    }

    .case-row,
    .case-gallery-grid {
        grid-template-columns: 1fr;
    }

    .case-row--reverse .case-panel {
        order: 0;
    }

    .case-row .case-prose {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .big-name {
        font-size: clamp(60px, 30vw, 200px);
    }

    .exp-facts {
        grid-template-columns: 1fr;
    }
}

/* Low-end simplification (old phones): same look, cheaper compositing.
   Fullscreen animated blurs and layer hints are desktop-only costs. */
@media (max-width: 768px) {
    *, *::before, *::after {
        will-change: auto !important;
    }

    #hero-video,
    #hero-canvas {
        filter: grayscale(1);
    }

    .about-header-overlay {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .mobile-menu,
    .mobile-menu.open {
        background: rgba(8, 8, 8, 0.97);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .button,
    .filter-btn {
        background: rgba(255, 255, 255, 0.08);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* Touch layouts favour a continuous reading flow over desktop-style pinning
   and visual effects. */
@media (max-width: 1024px) {
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 0;
        background: var(--section-gradient);
        background-position: center top;
        background-size: cover;
        background-repeat: no-repeat;
        pointer-events: none;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    section {
        background: transparent;
    }

    #header {
        position: relative;
        z-index: 1;
        background: var(--black);
    }

    #header::after {
        position: absolute;
    }

    .hero-spacer {
        display: none;
    }

    .about-header,
    .project-hero {
        background: var(--black);
    }

    #footer {
        position: relative;
        z-index: 2;
        background: var(--black);
    }

    .about-header {
        height: 100vh;
        height: 100svh;
        height: 100dvh;
    }

    .about-header::after,
    .about-header-video,
    .about-header-overlay,
    .about-header-text {
        position: absolute;
    }

    .about-header-text {
        height: auto;
    }

    .case-scene--static {
        min-height: 0;
        justify-content: flex-start;
        padding: clamp(64px, 10vw, 96px) var(--pad-edge);
    }

    .case-scene--static .case-row {
        gap: clamp(24px, 4vw, 40px);
        padding: clamp(24px, 4vw, 40px) 0 0;
    }

    .case-scene--static .case-row + .case-row {
        padding-top: clamp(56px, 8vw, 80px);
    }

    .case-scene--static .title {
        margin: 0 auto clamp(16px, 3vw, 28px);
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 76px;
    }

    p {
        font-size: 18px;
        line-height: 1.65;
    }

    section {
        min-height: 0;
        padding: clamp(64px, 16vw, 88px) var(--pad-edge);
    }

    .title {
        margin: 0 auto 28px;
        padding: 0;
        font-size: 11px;
        letter-spacing: 2px;
    }

    .navbar {
        padding: max(12px, env(safe-area-inset-top)) var(--pad-edge);
    }

    .brand a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .brand img {
        width: 40px;
    }

    .mobile-menu {
        box-sizing: border-box;
        padding: max(76px, calc(env(safe-area-inset-top) + 56px)) var(--pad-edge) max(32px, env(safe-area-inset-bottom));
    }

    .mobile-menu-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .mobile-menu-footer {
        bottom: max(24px, env(safe-area-inset-bottom));
    }

    #header {
        height: 100svh;
        height: 100dvh;
    }

    .header-content {
        right: 0;
        bottom: max(24px, env(safe-area-inset-bottom));
        align-items: flex-start;
        gap: 8px;
        padding: 24px var(--pad-edge);
    }

    #site-title {
        margin-bottom: 8px;
        font-size: clamp(48px, 16vw, 70px);
        white-space: normal;
    }

    .header-subtitles {
        max-width: 25ch;
        font-size: 16px;
        line-height: 1.4;
    }

    #about-me {
        padding: 0;
    }

    .intro {
        min-height: 0;
        flex-direction: row;
        align-items: center;
        gap: 0;
        padding: 40px var(--pad-edge);
        position: relative;
    }

    .intro-text {
        /* texte par-dessus le portrait — empiète vers la droite */
        position: relative;
        z-index: 10;
        flex: 1;
        min-width: 0;
        text-align: left;
        margin-right: -30vw;
        mix-blend-mode: difference;
    }

    .intro-portrait {
        /* portrait prend de la place, pas de flex shrink */
        flex: 0 0 62%;
        max-width: none;
        width: 62%;
        align-self: center;
    }

    #featured-projects {
        padding: 64px 0 96px;
    }

    .featured-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        margin-bottom: 24px;
        padding-inline: var(--pad-edge);
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .featured-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex: 0 0 auto;
        font-size: 12px;
        scroll-snap-align: start;
    }

    .scatter-item-details {
        padding: 28px 10px 10px;
        opacity: 1;
        transform: none;
    }

    .scatter-item-details strong {
        font-size: clamp(15px, 4.4vw, 20px);
    }

    .scatter-item-details span {
        font-size: 9px;
    }

    .scatter-item:hover {
        filter: none;
    }

    .about-header-text {
        padding: 80px var(--pad-edge) 40px;
    }

    .about-header-text .about-title {
        font-size: clamp(44px, 13vw, 68px);
    }

    .story {
        gap: 32px;
    }

    .project-hero {
        min-height: 100svh;
        height: auto;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: max(96px, calc(env(safe-area-inset-top) + 72px)) var(--pad-edge) max(24px, env(safe-area-inset-bottom));
        isolation: isolate;
    }

    .project-hero-img {
        position: absolute;
        inset: 0;
        z-index: 0;
    }

    .project-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.82) 72%, rgba(0, 0, 0, 0.94) 100%);
        pointer-events: none;
    }

    .article-header,
    .project-hero-links {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: 2;
        width: auto;
        max-width: none;
        mix-blend-mode: normal;
    }

    .article-header {
        padding: 0 0 20px;
    }

    .article-title {
        margin-bottom: 12px;
        font-size: clamp(38px, 11vw, 58px);
    }

    .article-subtitle {
        max-width: 34ch;
        margin-bottom: 16px;
        font-size: 16px;
        line-height: 1.45;
    }

    .article-meta {
        margin-bottom: 16px;
        font-size: 11px;
        letter-spacing: 1.1px;
        line-height: 1.45;
    }

    .article-tags {
        gap: 6px;
    }

    .tag {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .project-hero-links {
        justify-content: flex-start;
        gap: 8px;
        pointer-events: auto;
    }

    .project-hero-live,
    .project-cta-bottom-link {
        min-height: 44px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        font-size: 11px;
        letter-spacing: 1px;
        mix-blend-mode: normal;
    }

    .project-cta-bottom {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 64px var(--pad-edge);
    }

    .project-cta-gallery {
        width: min(100%, 460px);
    }

    .project-cta-tile:nth-child(1) {
        margin-top: 20px;
    }

    .project-cta-tile:nth-child(3) {
        margin-top: 32px;
    }

    .project-main .case-intro > *,
    .project-main .case-pullquote > *,
    .project-main .case-chapter > *,
    .project-main .case-row {
        opacity: 1;
        transform: none;
    }

    .case-scene--static {
        padding: 64px var(--pad-edge);
    }

    .case-scene--static .case-row {
        gap: 28px;
        padding-top: 24px;
    }

    .case-scene--static .case-row + .case-row {
        padding-top: 64px;
    }

    .case-panel {
        overflow: visible;
    }

    .case-panel img {
        max-height: 72svh;
        object-fit: contain;
    }

    .media-caption {
        font-size: 14px;
        text-align: left;
    }

    .reading-progress {
        top: 0;
        bottom: auto;
        height: 2px;
        z-index: 1001;
    }

    .case-intro p {
        font-size: clamp(16px, 4.4vw, 20px);
        line-height: 1.65;
        text-align: left;
    }

    .case-prose p {
        font-size: clamp(15px, 4.2vw, 18px);
        line-height: 1.65;
    }

    .pullquote {
        font-size: clamp(20px, 5.5vw, 30px);
        line-height: 1.35;
        padding: 0;
    }

    .case-table-scroll {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        border: 1px solid var(--hairline);
        border-radius: 8px;
    }

    .case-table {
        min-width: 620px;
        font-size: 13px;
    }

    .case-table th,
    .case-table td {
        padding: 10px 12px;
    }

    .case-table-hint {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 10px 0 0;
        color: var(--text-faint);
        font-size: 13px;
        line-height: 1.4;
    }

    .case-table-hint::before {
        content: '↔';
        font-size: 14px;
        opacity: 0.8;
    }

    .company-logo {
        height: clamp(48px, 12vw, 68px);
        max-width: 160px;
    }

    .project-pager-item {
        min-height: clamp(160px, 24vh, 220px);
        padding: 24px var(--pad-edge);
    }

    .project-pager-img {
        opacity: 0.38;
    }

    .project-pager-title {
        font-size: clamp(24px, 7vw, 36px);
    }

    #footer {
        min-height: 0;
        overflow: hidden;
        padding-top: clamp(32px, 6vh, 60px);
        /* leave enough room at the bottom for the big-name to peek in */
        padding-bottom: max(200px, 26vw);
    }

    .footer-links li {
        margin-bottom: 0;
    }

    .footer-links a {
        padding-block: 6px;
        font-size: 16px;
    }

    .back-to-top {
        --size: 64px;
        right: 16px;
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    .btt-text span {
        font-size: 7px;
    }
}

/* ── Mobile project carousel ── */
@media (max-width: 768px) {
    /* On a phone the page is the showcase: no about hero, no section title */
    #about-me,
    #featured-projects > .title,
    .featured-filters {
        display: none;
    }

    #featured-projects {
        padding: 0 !important;
    }

    .mob-carousel-section {
        position: relative;
        width: 100%;
        min-width: 0;
        background: var(--black);
    }

    .mob-carousel {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .mob-carousel::-webkit-scrollbar {
        display: none;
    }

    .mob-card {
        flex: 0 0 100%;
        min-height: 100svh;
        display: flex;
        flex-direction: column;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    /* Top part: image, title on a fade from black (bottom) to transparent (top) */
    .mob-card-top {
        position: relative;
        flex: 0 0 64svh;
        overflow: hidden;
    }

    .mob-card-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
        display: block;
    }

    /* Black smoke rising from the bottom of each image; it travels with its project.
       Flat black below, flat transparent above, so the displacement only waves the middle. */
    .mob-smoke {
        position: absolute;
        left: -60px;
        right: -60px;
        bottom: -50px;
        height: 40svh;
        z-index: 1;
        background: linear-gradient(to top, var(--black) 110px, transparent calc(100% - 60px));
        filter: var(--perlin-smoke);
        pointer-events: none;
    }

    .mob-card-title {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        margin: 0;
        padding: 0 var(--pad-edge) 20px;
        font-family: var(--font-display);
        font-style: italic;
        font-weight: bold;
        font-size: clamp(30px, 9vw, 50px);
        line-height: 1.05;
        color: var(--white);
    }

    /* Bottom part: role, description, tags, then the button */
    /* Bottom texts slide down and fade in each time their card arrives */
    .mob-card-bottom > * {
        opacity: 0;
        translate: 0 -14px;
        transition: opacity 0.6s ease, translate 0.6s var(--ease-out), transform 0.2s;
    }

    .mob-card.is-active .mob-card-bottom > * {
        opacity: 1;
        translate: 0 0;
    }

    .mob-card.is-active .mob-card-bottom > :nth-child(2) { transition-delay: 0.08s; }
    .mob-card.is-active .mob-card-bottom > :nth-child(3) { transition-delay: 0.16s; }

    @media (prefers-reduced-motion: reduce) {
        .mob-card-bottom > * { transition: none; translate: none; }
    }

    .mob-card-bottom {
        position: relative;
        z-index: 2;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        padding: 8px var(--pad-edge) 96px;
        background: var(--black);
    }

    .mob-card-role,
    .mob-card-desc,
    .mob-card-tags {
        align-self: stretch;
        margin: 0;
    }

    .mob-card-role {
        font-family: var(--font-sans);
        font-size: 13px;
        font-weight: 700;
        color: var(--white);
    }

    .mob-card-desc {
        font-size: 14px;
        line-height: 1.6;
        color: var(--text, #ccc);
    }

    .mob-card-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .mob-card-tags span {
        padding: 5px 12px;
        border: 1px solid var(--border, rgba(255,255,255,0.15));
        border-radius: var(--radius-pill, 999px);
        font-family: var(--font-sans);
        font-size: 9px;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--text-muted, #999);
        white-space: nowrap;
    }

    /* View project: glass pill fixed at the bottom centre of the screen. It never moves, never fades. */
    .mob-card-cta {
        position: absolute;
        left: 50%;
        bottom: 88px;
        z-index: 3;
        translate: -50% 0;
        padding: 14px 34px;
        overflow: hidden;
        isolation: isolate;
        border: 1px solid rgba(255,255,255,0.5);
        border-radius: 999px;
        background: linear-gradient(to bottom, rgba(255,255,255,0.25), rgba(255,255,255,0.1));
        color: var(--white);
        font-family: 'Satoshi', sans-serif;
        font-size: 12px;
        font-weight: 900;
        letter-spacing: 2px;
        text-transform: uppercase;
        text-decoration: none;
        white-space: nowrap;
        transition: transform 0.2s;
    }

    .mob-card-cta > span {
        position: relative;
        z-index: 1;
        font-weight: 900;
    }

    /* Two soft light blobs ride the button's edge like a rail, clipped to the button */
    .mob-glow {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255,255,255,0.45) 0, rgba(255,255,255,0.3) 14%, rgba(255,255,255,0.14) 32%, rgba(255,255,255,0.04) 52%, transparent 68%);
        filter: blur(12px);
        offset-path: inset(0 round 999px);
        offset-rotate: 0deg;
        animation: glow-rail 10s linear infinite;
        pointer-events: none;
    }

    .mob-glow:nth-of-type(2) {
        animation-delay: -5s;
    }

    @keyframes glow-rail {
        from { offset-distance: 0%; }
        to { offset-distance: 100%; }
    }

    .mob-card-cta:active {
        transform: scale(0.96);
    }

    /* Dots: sit under the cards (not sticky); outline and small when idle, filled when active */
    .mob-dots {
        position: absolute;
        left: 0;
        right: 0;
        bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
        z-index: 20;
        display: flex;
        justify-content: center;
        gap: 10px;
        pointer-events: none;
    }

    .mob-dot {
        pointer-events: auto;
        width: 12px;
        height: 12px;
        padding: 0;
        border: 1.5px solid var(--white);
        border-radius: 50%;
        background: transparent;
        scale: 0.6;
        transition: scale 0.25s var(--ease-out), background 0.25s var(--ease-out);
        -webkit-appearance: none;
        cursor: pointer;
    }

    .mob-dot.active {
        background: var(--white);
        scale: 1;
    }

    .mob-dot:focus-visible {
        outline: 2px solid var(--white);
        outline-offset: 3px;
    }

    @media (prefers-reduced-motion: reduce) {
        .mob-glow { animation: none; }
        .mob-dot { transition: none; }
    }
}

@media (hover: none) {
    .button:active,
    .filter-btn:active,
    .project-hero-live:active,
    .project-cta-bottom-link:active,
    .scatter-item:active,
    .project-pager-item:active,
    .back-to-top:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .mobile-menu-link:active {
        opacity: 0.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    section > *,
    .case-row {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btt-text {
        animation: none;
    }

    .project-pager-img,
    .project-pager-item::after,
    .project-pager-dir {
        transition: none;
    }
}
