/* The portfolio: an editorial gallery. A full-screen scroll story opens it (dark, the splat
   does the talking), then the page turns to warm paper with near-black ink: selected work,
   about, contact. One quiet sans throughout, set large and tight for the headlines, and one
   terracotta accent taken from the clay walls the work hangs on. */
:root {
    --paper: #f3efe8;
    --paper-2: #ebe5db;
    --ink: #161412;
    --muted: #6d665d;
    --line: rgba(22, 20, 18, 0.14);
    --accent: #b5532f;
    --night: #0e0d0c;
    --on-night: #f5f1ea;
    --on-night-muted: rgba(245, 241, 234, 0.88);
    /* lifts words off a moving picture; one light shadow, cheap to redraw as captions fade */
    --lift: 0 1px 10px rgba(8, 7, 6, 0.5);
    --head: 'Geist', 'Helvetica Neue', Arial, system-ui, sans-serif;
    --sans: 'Geist', 'Helvetica Neue', Arial, system-ui, sans-serif;
    --gutter: clamp(16px, 5vw, 72px);
    color-scheme: light;
}
* {
    box-sizing: border-box;
}
html {
    background: var(--night);
}
/* Lenis drives the scroll on desktop; its own rules */
html.lenis,
html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
    overflow: hidden;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
}
[hidden] {
    display: none !important;
}
a {
    color: inherit;
}
/* the accent words in headlines: colour, not italics */
em {
    font-style: normal;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* navigation: light over the story; a frosted paper bar with ink once the page is under it */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(env(safe-area-inset-top, 0px) + 20px) var(--gutter) 20px;
    color: var(--on-night);
    font-size: 15px;
    letter-spacing: 0.01em;
    transition: background 0.4s ease, color 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}
.nav.on-paper {
    color: var(--ink);
    background: rgba(243, 239, 232, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
    padding-bottom: 14px;
    box-shadow: 0 1px 0 var(--line);
}
.nav a {
    text-decoration: none;
}
.brand {
    font: 600 clamp(20px, 1.6vw, 24px) / 1 var(--head);
    letter-spacing: -0.02em;
}
.nav nav {
    display: flex;
    gap: clamp(16px, 3vw, 36px);
}
.nav nav a:hover,
.nav nav a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---- hero: the scroll story ---------------------------------------------------------------- */
.hero {
    position: relative;
    background: var(--night);
    color: var(--on-night);
}
.hero-stage {
    position: sticky;
    top: 0;
    /* the tallest the window gets (phone toolbars hidden), so no strip shows under it */
    height: 100vh;
    height: 100lvh;
    overflow: hidden;
    pointer-events: none;
}
.hero-poster,
.hero-canvas {
    position: absolute;
    inset: 0;
}
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--night);
}
/* the dark the video dissolves into, held through the making-of while the splat loads */
.hero-veil {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 45%, #1b1815, var(--night) 70%);
}
/* the making-of's last frame: the story's first view, which opens up into the live splat */
.hero-render {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
}
.hero-render img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: 0 0;
    will-change: transform, clip-path;
    transition: opacity 0.8s ease;
}
.hero-render.handed img {
    opacity: 0;
}
.hero-poster {
    background: center / cover no-repeat;
    transition: opacity 1.4s ease;
}
.hero-poster.gone {
    opacity: 0;
}
/* the still that stands in for the splat on phones drifts slowly, so it doesn't look frozen */
.hero-poster.drift {
    animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
    from {
        transform: scale(1.02) translate(0, 0);
    }
    to {
        transform: scale(1.12) translate(-2%, -1%);
    }
}
.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 9, 8, 0.45), rgba(10, 9, 8, 0) 18%),
        linear-gradient(90deg, rgba(10, 9, 8, 0.68), rgba(10, 9, 8, 0.12) 55%, rgba(10, 9, 8, 0) 75%),
        linear-gradient(0deg, rgba(10, 9, 8, 0.55), rgba(10, 9, 8, 0) 45%);
}
.hero .display,
.hero .lede,
.frame-label,
.hero .count,
.step h2,
.step p.caption,
.scroll-cue,
.nav:not(.on-paper) {
    text-shadow: var(--lift);
}
/* the making-of: three frames pinned in the window while the section scrolls by */
.step.making {
    display: block;
    min-height: 0;
    height: 280vh;
    height: 280svh;
    padding: 0;
    /* the first caption comes up over its end, as the render fills the window */
    margin-bottom: -80vh;
    margin-bottom: -80svh;
}
.making-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.frames {
    --cw: min(25vw, 44vh);
    position: relative;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: repeat(3, var(--cw));
    justify-content: center;
    gap: clamp(20px, 3vw, 52px);
}
.frames li {
    position: relative;
}
.shot {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    background: #1b1815;
}
.shot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* the photograph as a print: a white border, and a little thicker at the bottom */
.shot.print {
    border-radius: 3px;
    background: #f7f4ee;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.shot.print img {
    inset: 5% 5% 14%;
    width: 90%;
    height: 81%;
    border-radius: 1px;
}
/* the render shows through here: it lives behind, in the stage, so it can open to fill it */
.shot.window {
    background: none;
}
.frame-label {
    display: grid;
    gap: 4px;
    margin-top: 20px;
}
.frame-label .num {
    font-size: 13px;
    letter-spacing: 0.14em;
    color: var(--on-night-muted);
    font-variant-numeric: tabular-nums;
}
.frame-label h3 {
    font: 500 clamp(1.4rem, 2vw, 1.8rem) / 1.1 var(--head);
    letter-spacing: -0.02em;
    margin: 0;
}
.frame-label p {
    margin: 0;
    font-size: 15px;
    color: var(--on-night-muted);
}
.load-line {
    width: 100%;
    height: 2px;
    margin-top: 14px;
    background: rgba(245, 241, 234, 0.18);
    overflow: hidden;
    transition: opacity 0.6s ease 0.4s;
}
.load-line.done {
    opacity: 0;
}
.load-line span {
    display: block;
    height: 100%;
    background: var(--on-night);
    transform-origin: 0 50%;
    transform: scaleX(0);
    transition: transform 0.5s ease;
}
.hero-steps {
    position: relative;
    margin-top: -100vh;
    margin-top: -100lvh;
}
.step {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 0 var(--gutter);
}
.step-inner {
    max-width: 34rem;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.step.shown .step-inner {
    opacity: 1;
    transform: none;
}
.intro {
    align-items: flex-end;
    padding-bottom: clamp(96px, 16vh, 180px);
}
.intro .step-inner {
    max-width: 64rem;
}
/* a full sentence: big, in about three lines */
.display {
    font: 400 clamp(2.3rem, 5.2vw, 5.2rem) / 1.02 var(--head);
    letter-spacing: -0.035em;
    margin: 0 0 20px;
    text-wrap: balance;
}
.lede {
    margin: 0;
    font-weight: 500;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    color: var(--on-night-muted);
    max-width: 30rem;
}
.count {
    margin: 0 0 16px;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--on-night-muted);
    font-variant-numeric: tabular-nums;
}
.step h2 {
    font: 400 clamp(2.1rem, 4.6vw, 4.1rem) / 1.04 var(--head);
    letter-spacing: -0.035em;
    margin: 0 0 18px;
    text-wrap: balance;
}
.step p.caption {
    margin: 0;
    font-weight: 500;
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    color: var(--on-night-muted);
    max-width: 26rem;
}
/* into the free 3D player, at the end of the story */
.hero-pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 30px;
    padding: 15px 28px;
    border-radius: 999px;
    background: var(--on-night);
    color: var(--ink);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(8, 7, 6, 0.35);
    transition: background 0.3s ease, transform 0.3s ease;
}
.hero-pill:hover,
.hero-pill:focus-visible {
    background: #e08b62;
    transform: translateY(-1px);
}
.scroll-cue {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
    transform: translateX(-50%);
    z-index: 3;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--on-night-muted);
    transition: opacity 0.6s ease;
}
.scroll-cue.gone {
    opacity: 0;
}

/* ---- the paper part ------------------------------------------------------------------------ */
.page {
    position: relative;
    z-index: 1;
    background: var(--paper);
    border-radius: 28px 28px 0 0;
    margin-top: -28px;
}
.page > section {
    padding: clamp(72px, 12vw, 160px) var(--gutter);
}
.kicker {
    margin: 0 0 18px;
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}
.section-title {
    font: 400 clamp(2rem, 4.4vw, 4rem) / 1.05 var(--head);
    letter-spacing: -0.035em;
    margin: 0;
    max-width: 16ch;
    text-wrap: balance;
}
.section-title em,
.contact-title em {
    color: var(--accent);
}
.section-head {
    display: grid;
    gap: 0;
    margin-bottom: clamp(40px, 6vw, 80px);
}

/* the work: big cards, the first one full width */
.cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 56px) clamp(16px, 3vw, 40px);
}
.cards li:first-child {
    grid-column: 1 / -1;
}
.card {
    display: grid;
    gap: 16px;
    text-decoration: none;
}
.frame {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--paper-2);
    aspect-ratio: 4 / 3;
}
.cards li:first-child .frame {
    aspect-ratio: 16 / 8;
}
.frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .frame img,
.card:focus-visible .frame img {
    transform: scale(1.045);
}
.badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(243, 239, 232, 0.88);
    backdrop-filter: blur(6px);
    font-size: 13px;
    color: var(--ink);
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}
.card h3 {
    font: 500 clamp(1.3rem, 2vw, 1.8rem) / 1.15 var(--head);
    letter-spacing: -0.02em;
    margin: 0;
}
.card .where {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 15px;
}
.card .go {
    flex: none;
    font-size: 15px;
    white-space: nowrap;
    transition: color 0.3s ease;
}
.card:hover .go,
.card:focus-visible .go {
    color: var(--accent);
}
.empty {
    color: var(--muted);
}

/* about */
.about {
    border-top: 1px solid var(--line);
}
.about-text {
    font-size: clamp(1.1rem, 1.7vw, 1.35rem);
    line-height: 1.55;
    max-width: 42rem;
    margin: 32px 0 0;
}
/* the one practical line under the story: how a scene reaches people */
.about-note {
    margin: clamp(28px, 4vw, 44px) 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    max-width: 42rem;
    color: var(--muted);
}

/* contact: the closing word, on ink */
.page > .contact {
    background: var(--ink);
    color: var(--paper);
    border-radius: 28px 28px 0 0;
}
.contact .kicker {
    color: rgba(243, 239, 232, 0.6);
}
.contact-title {
    font: 400 clamp(2.6rem, 7vw, 6.5rem) / 1 var(--head);
    letter-spacing: -0.04em;
    margin: 0 0 clamp(32px, 5vw, 56px);
    text-wrap: balance;
}
.contact-title em {
    color: #e08b62;
}
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 999px;
    border: 1px solid rgba(243, 239, 232, 0.35);
    text-decoration: none;
    font-size: 17px;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.pill.main {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}
.pill:hover,
.pill:focus-visible {
    background: #e08b62;
    border-color: #e08b62;
    color: var(--ink);
}
.foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 28px);
    background: var(--ink);
    color: rgba(243, 239, 232, 0.6);
    font-size: 14px;
    border-top: 1px solid rgba(243, 239, 232, 0.12);
}
.foot a {
    text-decoration: none;
}
.foot a:hover {
    color: var(--paper);
}

/* things that rise into place as they enter the window */
.rise {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rise.in {
    opacity: 1;
    transform: none;
}

@media (max-width: 760px) {
    /* on a phone the opening lines sit over the lower half of the picture */
    .hero-shade {
        background: linear-gradient(180deg, rgba(10, 9, 8, 0.45), rgba(10, 9, 8, 0) 18%),
            linear-gradient(0deg, rgba(10, 9, 8, 0.72), rgba(10, 9, 8, 0.25) 55%, rgba(10, 9, 8, 0) 75%);
    }
    .cards {
        grid-template-columns: 1fr;
    }
    .cards li:first-child .frame {
        aspect-ratio: 4 / 3;
    }
    /* one frame at a time, the strip sliding along as the page scrolls */
    .frames {
        --cw: min(72vw, 52svh);
        display: flex;
        justify-content: flex-start;
        gap: 8vw;
        padding: 0 calc((100% - var(--cw)) / 2);
    }
    .frames li {
        flex: none;
        width: var(--cw);
    }
}
@media (prefers-reduced-motion: reduce) {
    .step-inner,
    .rise {
        transition: none;
        transform: none;
        opacity: 1;
    }
    .frame img {
        transition: none;
    }
    .hero-poster.drift {
        animation: none;
    }
}
