/* ============================================================
   Giorgio Lombisani — Premium Pencil Atelier
   Tokens, type system, layout
   ============================================================ */

:root {
    /* Paper & ink palette — warm graphite on bone-cream */
    --paper:        #f3eee4;
    --paper-soft:   #ebe5d6;
    --paper-warm:   #efe9dc;
    --ink:          #100d0a;
    --ink-soft:     #1d1915;
    --graphite:     #44403a;
    --pencil:       #837d72;
    --pencil-light: #b5ad9f;
    --bronze:       #b08d56;        /* sparingly used */
    --glow:         #f8f3e8;

    /* Fonts */
    --f-serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --f-sans:  'Manrope', system-ui, sans-serif;
    --f-mono:  'IBM Plex Mono', ui-monospace, monospace;

    /* Layout */
    --gutter: clamp(1.25rem, 4vw, 4rem);
    --rail:   clamp(2.5rem, 5vw, 4.5rem);
}

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

html { scroll-behavior: auto; }
html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--f-sans);
    font-weight: 300;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    overflow-x: hidden;
}
body { overscroll-behavior-y: none; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--ink); color: var(--paper); }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ============================================================
   Type primitives
   ============================================================ */

h1, h2, h3, h4 {
    font-family: var(--f-serif);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
h1 em, h2 em, h3 em, h4 em {
    font-style: italic;
    font-weight: 300;
    color: var(--graphite);
}

p { text-wrap: pretty; font-size: clamp(0.95rem, 1.05vw, 1.075rem); color: var(--ink-soft); }

.mono-cap {
    font-family: var(--f-mono);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 400;
    color: var(--pencil);
}

/* clip-text reveal (paired with GSAP) */
.clip { overflow: hidden; display: block; }
.clip-inner { display: block; transform: translateY(101%); will-change: transform; }

/* ============================================================
   Paper grain overlay
   ============================================================ */

.paper-grain {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
    background-size: 240px 240px;
    opacity: 0.08;
    mix-blend-mode: multiply;
}

/* ============================================================
   Custom cursor (desktop)
   ============================================================ */
.cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    pointer-events: none;
    z-index: 9998;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
}
.cursor-dot {
    width: 6px; height: 6px;
    background: var(--ink);
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}
.cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid var(--ink);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}
body.cursor-hover .cursor-ring { width: 56px; height: 56px; }
body.cursor-dark .cursor-dot { background: var(--paper); }
body.cursor-dark .cursor-ring { border-color: var(--paper); }

@media (hover: none) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ============================================================
   Chrome (top nav)
   ============================================================ */

.chrome {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.4rem var(--gutter);
    display: flex; align-items: center; justify-content: space-between;
    color: var(--paper);
    mix-blend-mode: difference;
}
.chrome-mark {
    display: flex; align-items: center; gap: 0.8rem;
}
.chrome-mark-mono {
    font-family: var(--f-serif);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
}
.chrome-mark-line {
    width: 28px; height: 1px;
    background: currentColor;
    opacity: 0.4;
}
.chrome-mark-name {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.chrome-cta {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.chrome-cta svg { width: 14px; height: 14px; }
.chrome-cta:hover svg { transform: translateX(2px); transition: transform 0.3s ease; }

@media (max-width: 720px) {
    .chrome-mark-name { display: none; }
    .chrome-cta span { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
    position: relative;
    min-height: 100vh; min-height: 100dvh;
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
    padding: 9rem var(--gutter) 3rem;
    display: flex; flex-direction: column;
    isolation: isolate;
}
.hero-bg {
    position: absolute; inset: 0;
    background-image: url('bilder/tierportrait-labrador.jpg');
    background-size: 220% auto;
    background-position: 42% 32%;
    background-repeat: no-repeat;
    filter: grayscale(100%) contrast(1.18) brightness(0.55);
    z-index: -2;
    will-change: transform;
}
.hero-vignette {
    position: absolute; inset: 0;
    background:
        radial-gradient(120% 80% at 50% 40%, transparent 0%, rgba(16,13,10,0.65) 70%, rgba(16,13,10,0.92) 100%),
        linear-gradient(to bottom, rgba(16,13,10,0.5) 0%, transparent 22%, transparent 65%, rgba(16,13,10,0.85) 100%);
    z-index: -1;
}

.hero-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-content: end;
    gap: 1.6rem;
    max-width: 1000px;
}

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 0.7rem;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--pencil-light);
    opacity: 0; transform: translateY(20px);
}
.eyebrow-num { color: var(--bronze); }

.hero-title {
    font-size: clamp(3.4rem, 11vw, 11rem);
    line-height: 0.92;
    letter-spacing: -0.035em;
    font-weight: 400;
    color: var(--paper);
    margin: 0.4rem 0 0.6rem;
}
.hero-title em { color: var(--pencil-light); font-style: italic; font-weight: 300; }

.hero-lede {
    max-width: 560px;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    color: rgba(243,238,228,0.72);
    line-height: 1.55;
    margin-top: 0.4rem;
}

.hero-actions {
    margin-top: 1.4rem;
}
.hero-actions .clip-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.6rem;
}

.btn-ghost {
    --c: var(--paper);
    --bg: var(--ink);
    position: relative;
    display: inline-flex; align-items: center; gap: 1rem;
    padding: 1.1rem 1.8rem 1.1rem 2rem;
    color: var(--c);
    border: 1px solid rgba(248,243,232,0.35);
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    transition: border-color 0.4s ease, color 0.4s ease;
}
.btn-ghost::before {
    content: "";
    position: absolute; inset: 0;
    background: var(--c);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(.7,.05,.2,1);
    z-index: -1;
}
.btn-ghost:hover { color: var(--bg); border-color: var(--c); }
.btn-ghost:hover::before { transform: translateY(0); }
.btn-ghost-label {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.btn-ghost-arrow {
    display: inline-grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid currentColor;
    transition: transform 0.4s ease;
}
.btn-ghost-arrow svg { width: 14px; height: 14px; }
.btn-ghost:hover .btn-ghost-arrow { transform: rotate(-45deg); }

.btn-ghost-light {
    --c: var(--ink);
    --bg: var(--paper);
    border-color: rgba(16,13,10,0.35);
}
.btn-ghost-light:hover { color: var(--paper); }

.link-quiet {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(243,238,228,0.7);
    position: relative;
    padding-bottom: 4px;
}
.link-quiet::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: currentColor;
    transform-origin: right;
    transform: scaleX(0.35);
    transition: transform 0.4s ease;
}
.link-quiet:hover::after { transform: scaleX(1); transform-origin: left; }

.hero-bottom {
    display: flex; align-items: flex-end; justify-content: space-between;
    padding-top: 2rem;
    border-top: 1px solid rgba(248,243,232,0.12);
    margin-top: 2rem;
}
.hero-scroll {
    display: flex; align-items: center; gap: 0.9rem;
}
.hero-scroll-line {
    width: 60px; height: 1px;
    background: currentColor; opacity: 0.4;
    animation: scroll-pulse 2.4s cubic-bezier(.7,.05,.2,1) infinite;
    transform-origin: left;
}
@keyframes scroll-pulse {
    0%   { transform: scaleX(0.2); opacity: 0.2; }
    50%  { transform: scaleX(1);   opacity: 0.8; }
    100% { transform: scaleX(0.2); opacity: 0.2; transform-origin: right; }
}
.hero-meta {
    display: flex; align-items: center; gap: 0.8rem;
    color: var(--pencil);
}
.hero-meta-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: currentColor; opacity: 0.5;
}

@media (max-width: 720px) {
    .hero { padding: 7rem var(--gutter) 2rem; }
    .hero-meta { display: none; }
    .hero-bottom { padding-top: 1.4rem; margin-top: 1.4rem; }
    .hero-actions .clip-inner { gap: 1rem; flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Master section — pinned vault + horizontal timeline
   ============================================================ */

.master {
    position: relative;
    width: 100%;
    height: 100vh; height: 100dvh;
    background: var(--paper);
    overflow: hidden;
    z-index: 5;
}

/* Timeline (behind the vault) */
.timeline-layer {
    position: absolute; inset: 0;
    z-index: 1;
    background: var(--paper);
}

.timeline-track {
    position: absolute;
    top: 5.5rem; left: var(--gutter); right: var(--gutter);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.2rem;
    z-index: 20;
}
.timeline-track-line {
    height: 1px;
    background: linear-gradient(to right, var(--pencil-light), transparent);
}

.timeline-rail {
    position: absolute;
    top: auto;
    bottom: 4.5rem;
    left: var(--gutter); right: var(--gutter);
    height: 1px;
    z-index: 2;
}
.rail-bg {
    position: absolute; inset: 0;
    background: var(--pencil-light);
    opacity: 0.35;
    height: 1px;
    top: 0;
}
.rail-fill {
    position: absolute; top: 0; left: 0;
    height: 1px;
    background: var(--ink);
    width: 0%;
    transform: none;
    will-change: width;
}

.timeline-strip {
    position: relative;
    display: flex;
    width: 400%;
    height: 100%;
    will-change: transform;
}

.panel {
    position: relative;
    width: 25%;
    height: 100%;
    flex-shrink: 0;
    padding: 9rem var(--gutter) 8.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    column-gap: clamp(2rem, 4vw, 5rem);
}

/* Roman-numeral chapter marker on the rail */
.panel-node {
    position: absolute;
    left: 50%;
    bottom: 4.5rem;
    transform: translate(-50%, 50%);
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--ink);
    z-index: 3;
    display: grid; place-items: center;
    font-family: var(--f-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--ink);
}
.panel-node::after {
    content: attr(data-roman);
}

.panel-text {
    position: relative;
    max-width: 520px;
    justify-self: end;
}
.panel-text .mono-cap { display: block; margin-bottom: 1rem; color: var(--bronze); }
.panel-h {
    font-size: clamp(2.6rem, 5.4vw, 5.2rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
}
.panel-h-line { color: var(--ink); }
.panel-h em { color: var(--graphite); font-style: italic; font-weight: 300; }
.panel-text p {
    margin-top: 1.6rem;
    max-width: 460px;
    color: var(--graphite);
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    line-height: 1.65;
}
.panel-meta {
    display: flex; align-items: center; gap: 0.8rem;
    margin-top: 1.6rem;
    color: var(--pencil);
}
.panel-meta-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: currentColor; opacity: 0.6;
}
.panel-link {
    position: relative;
    padding-bottom: 3px;
    color: var(--bronze);
    transition: color 0.4s ease;
}
.panel-link::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    height: 1px; width: 100%;
    background: currentColor;
    transform-origin: right;
    transform: scaleX(0.4);
    transition: transform 0.5s cubic-bezier(.22,.61,.36,1);
}
.panel-link:hover { color: var(--ink); }
.panel-link:hover::after { transform: scaleX(1); transform-origin: left; }

.panel-frame {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--paper-soft);
    justify-self: start;
}
.panel-frame::after {
    content: "";
    position: absolute; inset: 0;
    box-shadow: inset 0 0 0 1px rgba(16,13,10,0.05);
    pointer-events: none;
}
.panel-frame-img {
    width: 110%; height: 110%;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%) contrast(1.06);
    will-change: transform;
}
.panel-frame-tag {
    position: absolute;
    bottom: 0.9rem; left: 0.9rem;
    color: var(--paper);
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

/* Even panels: flip text and frame (image left, text right) */
.panel:nth-child(even) .panel-text  { grid-column: 2; justify-self: start; }
.panel:nth-child(even) .panel-frame { grid-column: 1; grid-row: 1; justify-self: end; }

/* ============================================================
   Vault doors
   ============================================================ */

.vault {
    position: absolute; inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
}
.vault-door {
    position: relative;
    width: 50%; height: 100%;
    background: var(--ink);
    will-change: transform;
    overflow: hidden;
}
.vault-door::after {
    /* subtle seam */
    content: "";
    position: absolute; top: 0; bottom: 0;
    width: 1px;
    background: rgba(248,243,232,0.06);
}
.vault-left::after  { right: 0; }
.vault-right::after { left: 0; }

.vault-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}

.vault-lock {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center;
    gap: 1.1rem;
    z-index: 12;
    color: var(--paper);
    will-change: transform, opacity;
}
.vault-lock-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(248,243,232,0.45);
    position: relative;
}
.vault-lock-ring::before, .vault-lock-ring::after {
    content: ""; position: absolute;
    background: rgba(248,243,232,0.45);
}
.vault-lock-ring::before {
    width: 1px; height: 20px;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.vault-lock-ring::after {
    width: 20px; height: 1px;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.vault-lock-label {
    color: rgba(248,243,232,0.7);
    font-size: 0.65rem;
    letter-spacing: 0.36em;
}
.vault-lock-bar {
    position: relative;
    width: 140px; height: 1px;
    background: rgba(248,243,232,0.15);
    overflow: hidden;
}
.vault-lock-bar-fill {
    position: absolute; top: 0; left: 0;
    width: 0%; height: 100%;
    background: var(--glow);
    will-change: width;
}

/* ============================================================
   Mobile master (no horizontal scroll — clean vertical)
   ============================================================ */

@media (max-width: 900px) {
    .master {
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }
    .timeline-layer { position: relative; height: auto; order: 2; padding-top: 2rem; }
    /* The "Chronik 00/04" track is desktop chrome — hide on mobile */
    .timeline-track { display: none; }
    .timeline-strip {
        flex-direction: column;
        width: 100%;
        height: auto;
        padding: 0;
    }
    .panel {
        width: 100%;
        height: auto;
        padding: 3.5rem var(--gutter) 3.5rem calc(var(--gutter) + 2rem);
        position: relative;
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        column-gap: 0;
        align-items: stretch;
        gap: 1.6rem;
    }
    .panel-text, .panel-frame {
        position: relative; inset: auto;
        width: 100%; max-width: 100%;
        top: auto !important; bottom: auto !important;
        left: auto !important; right: auto !important;
        justify-self: start;
    }
    .panel:nth-child(even) .panel-text,
    .panel:nth-child(even) .panel-frame {
        grid-column: auto;
        grid-row: auto;
        justify-self: start;
    }
    .panel-text { margin-bottom: 0; }
    .panel-text .mono-cap { margin-bottom: 0.7rem; font-size: 0.62rem; }
    .panel-h { font-size: clamp(2rem, 9vw, 2.8rem); }
    .panel-text p { font-size: 0.98rem; line-height: 1.55; margin-top: 0.9rem; }
    .panel-meta {
        flex-wrap: wrap;
        gap: 0.6rem 0.8rem;
        margin-top: 1.2rem;
    }
    .panel-meta .mono-cap { font-size: 0.58rem; }
    .panel-frame {
        aspect-ratio: 4/5;
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
    .panel-node {
        left: var(--gutter);
        top: 3.6rem;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 26px; height: 26px;
        font-size: 0.5rem;
        background: var(--paper);
    }
    .timeline-rail {
        top: 0; bottom: 0;
        left: var(--gutter);
        right: auto;
        width: 1px; height: 100%;
    }
    .rail-bg { width: 1px; height: 100%; top: 0; left: 0; right: auto; }
    .rail-fill {
        width: 1px; height: 0%; top: 0; left: 0;
        transform: none;
    }

    /* Vault becomes its own 100vh block — placed BEFORE the timeline */
    .vault {
        position: relative;
        width: 100%;
        height: 100vh; height: 100dvh;
        z-index: 10;
        display: flex;
        order: 1;
    }
}

/* ============================================================
   Works / Gallery
   ============================================================ */

.works {
    background: var(--paper);
    padding: 10rem var(--gutter) 9rem;
    position: relative;
    z-index: 6;
}
.works-head {
    max-width: 1400px;
    margin: 0 auto 5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 4rem;
    row-gap: 1.4rem;
    align-items: end;
}
.works-head .mono-cap { color: var(--bronze); align-self: start; }
.works-h {
    grid-column: 2;
    font-size: clamp(2.8rem, 6vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
}
.works-h em { color: var(--graphite); font-style: italic; font-weight: 300; }
.works-sub {
    grid-column: 2;
    max-width: 540px;
    color: var(--graphite);
}

.filter-menu {
    grid-column: 1 / -1;
    display: flex;
    gap: 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(16,13,10,0.1);
    padding-top: 1.4rem;
    flex-wrap: wrap;
}
.filter-btn {
    background: none; border: none;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--pencil);
    cursor: pointer;
    padding: 0.4rem 1.4rem 0.4rem 0;
    margin-right: 1.4rem;
    position: relative;
    transition: color 0.3s ease;
}
.filter-num { color: var(--bronze); margin-right: 0.4rem; }
.filter-btn::after {
    content: ""; position: absolute;
    left: 0; bottom: -1.4rem; height: 1px;
    width: 0; background: var(--ink);
    transition: width 0.4s ease;
}
.filter-btn:hover, .filter-btn.active { color: var(--ink); }
.filter-btn.active::after { width: 100%; }

.works-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(2rem, 3vw, 3.2rem) clamp(1.4rem, 2vw, 2rem);
}

.work {
    grid-column: span 6;
    display: flex; flex-direction: column;
    gap: 1.4rem;
    cursor: pointer;
}
.work.tall { transform: translateY(4rem); }
.work-frame {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: var(--paper-soft);
}
.work-img {
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    filter: grayscale(100%) contrast(1.05);
    transform: scale(1.04);
    transition:
        transform 1.6s cubic-bezier(.22,.61,.36,1),
        filter   1.2s cubic-bezier(.22,.61,.36,1),
        opacity  0.9s ease;
    will-change: transform, filter;
}
.work:hover .work-img {
    transform: scale(1.1);
    filter: grayscale(70%) contrast(1.1);
}
.work-frame::after {
    content: "";
    position: absolute; inset: 0;
    box-shadow: inset 0 0 0 1px rgba(16,13,10,0.05);
    pointer-events: none;
    transition: box-shadow 0.6s ease;
}
.work:hover .work-frame::after {
    box-shadow: inset 0 0 0 1px rgba(16,13,10,0.18);
}

/* Lazy-bg load fade — opacity ONLY; do NOT add a transition shorthand
   here because [data-img-src] shares specificity with .work-img /
   .panel-frame-img and would clobber their transform/filter transitions. */
[data-img-src].is-loading { opacity: 0; }
.work-tag {
    position: absolute;
    top: 1rem; left: 1rem;
    color: var(--paper);
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}
.work-meta {
    display: flex; flex-direction: column; gap: 0.4rem;
}
.work-title {
    font-size: clamp(1.4rem, 1.8vw, 1.9rem);
    line-height: 1.1;
    color: var(--ink);
}
.work-meta .mono-cap { color: var(--pencil); }

@media (max-width: 900px) {
    .works { padding: 6rem var(--gutter); }
    .works-head { grid-template-columns: 1fr; gap: 1rem; }
    .works-h, .works-sub { grid-column: 1; }
    .works-grid { grid-template-columns: 1fr; gap: 3rem; }
    .work, .work.tall { grid-column: 1; transform: none; }
    .filter-menu { gap: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.4rem; }
    .filter-btn { white-space: nowrap; }
}

/* ============================================================
   Testimonial / Proof
   ============================================================ */

.testimonial {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    padding: 9rem var(--gutter);
    overflow: hidden;
    z-index: 5;
}
.testimonial-grain {
    position: absolute; inset: 0;
    background: radial-gradient(80% 60% at 50% 30%, rgba(176,141,86,0.05), transparent 70%);
    pointer-events: none;
}

.proof {
    max-width: 1200px;
    margin: 0 auto 7rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 3.5rem;
    align-items: center;
}
.proof-item { text-align: center; }
.proof-item .mono-cap {
    color: var(--bronze);
    display: block; margin-bottom: 1.4rem;
}
.proof-num, .proof-num-text {
    font-family: var(--f-serif);
    font-size: clamp(3rem, 5.5vw, 5rem);
    line-height: 1;
    font-weight: 400;
    color: var(--paper);
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
}
.proof-num-text { font-style: italic; color: var(--pencil-light); }
.proof-item p {
    color: rgba(243,238,228,0.7);
    max-width: 240px;
    margin: 0 auto;
    font-size: 0.92rem;
}
.proof-divider {
    width: 1px; height: 70px;
    background: rgba(243,238,228,0.15);
}

.quote {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}
.quote-mark {
    font-family: var(--f-serif);
    font-size: 7rem;
    line-height: 0.6;
    color: var(--bronze);
    opacity: 0.3;
    display: block;
    margin-bottom: 0.4rem;
}
.quote-text {
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
    line-height: 1.35;
    color: var(--paper);
    letter-spacing: -0.01em;
    text-wrap: balance;
}
.quote-author {
    display: block;
    margin-top: 2rem;
    color: var(--pencil);
}

@media (max-width: 900px) {
    .testimonial { padding: 6rem var(--gutter); }
    .proof {
        grid-template-columns: 1fr;
        gap: 3rem;
        margin-bottom: 5rem;
    }
    .proof-divider {
        width: 60px; height: 1px;
        justify-self: center;
    }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
    background: var(--paper);
    color: var(--ink);
    padding: 7rem var(--gutter) 2rem;
    position: relative;
    z-index: 5;
}
.footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 5rem;
    align-items: end;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgba(16,13,10,0.1);
}

.footer-mark {
    display: flex; flex-direction: column; gap: 0.8rem;
}
.footer-mark-letters {
    font-family: var(--f-serif);
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: 0.9;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.footer-mark .mono-cap { color: var(--pencil); }

.footer-cta {
    display: flex; flex-direction: column;
    gap: 1.2rem;
    max-width: 520px;
}
.footer-cta .mono-cap { color: var(--bronze); }
.footer-h {
    font-size: clamp(2.4rem, 4.5vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
}
.footer-h em { color: var(--graphite); font-style: italic; font-weight: 300; }
.footer-cta p { color: var(--graphite); }
.footer-cta .btn-ghost { align-self: flex-start; margin-top: 1rem; }

.footer-meta {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 2.4rem;
}
.footer-meta-block { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-meta-block .mono-cap { color: var(--bronze); }
.footer-meta-block p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--graphite);
}
.footer-link {
    position: relative;
    color: var(--ink);
    padding-bottom: 2px;
    transition: color 0.4s ease;
    display: inline-block;
}
.footer-link::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: currentColor;
    transform-origin: right;
    transform: scaleX(0.3);
    transition: transform 0.5s cubic-bezier(.22,.61,.36,1);
}
.footer-link:hover { color: var(--bronze); }
.footer-link:hover::after { transform: scaleX(1); transform-origin: left; }

.footer-bar {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 1.6rem;
    display: flex; justify-content: space-between; align-items: center;
}
.footer-bar .mono-cap { color: var(--pencil); }

@media (max-width: 900px) {
    .footer { padding: 5rem var(--gutter) 2rem; }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding-bottom: 3rem;
    }
    .footer-meta { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-bar { flex-direction: column; gap: 0.6rem; align-items: flex-start; }
}

/* ============================================================
   Reveal helpers (paired with GSAP)
   ============================================================ */

.reveal { opacity: 0; transform: translateY(20px); }
.reveal-y { /* used inside .clip — handled by clip transform */ }

/* Avoid lag — disable a few heavy filters on mobile */
@media (max-width: 900px) {
    .paper-grain { opacity: 0.05; }
    .hero-bg { filter: grayscale(100%) contrast(1.1) brightness(0.5); }

    /* Vault: kill the GPU-heavy SVG layers — keep only door + letter outline + lock */
    .vault-svg .hatch-dim,
    .vault-svg .letter-fill,
    .vault-svg .vault-engrave { display: none; }
    .vault-svg .letter-outline {
        opacity: 1;
        stroke: rgba(248,243,232,0.6);
        stroke-width: 2;
    }
    .vault-door { will-change: auto; }
    .vault-lock { will-change: auto; }
    .vault-lock-bar-fill { will-change: auto; }
}

/* Reduced motion — skip all the heavy ScrollTrigger work */
@media (prefers-reduced-motion: reduce) {
    .clip-inner { transform: translateY(0) !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .hero-eyebrow { opacity: 1 !important; transform: none !important; }
}
