/* =========================================================
   EDITORIAL
   Long-form layout for project case studies and the about page.
   Consolidates the per-page <style> blocks that previously
   duplicated these rules seven times over.
   ========================================================= */

/* `100vw` counts the scrollbar but the page does not get to use it, so
   full-bleed blocks end up a few pixels wider than the viewport. `clip`
   trims that without turning these into scroll containers the way
   `hidden` would; `hidden` stays as the fallback for older browsers. */
html, body {
    overflow-x: hidden;
    overflow-x: clip;
}

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

/* ---------------------------------------------------------
   READING PROGRESS — a single hairline at the top of the page
   --------------------------------------------------------- */
.progress-rule {
    position: fixed;
    top: 0;
    left: 0;
    height: 1px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: var(--ink);
    z-index: 60;
    will-change: transform;
}

/* ---------------------------------------------------------
   SHELL
   --------------------------------------------------------- */
.content-wrapper {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 180px var(--gutter) 100px;
}

.section { margin-bottom: var(--space-xl); }
.section:last-child { margin-bottom: 0; }

.spacer-60 { width: 100%; height: 60px; }

/* ---------------------------------------------------------
   TYPE
   --------------------------------------------------------- */
.project-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 0.9;
    margin: 0 0 var(--space-lg) 0;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    overflow-wrap: break-word;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    font-weight: 700;
    line-height: 0.95;
    margin: 0 0 var(--space-md) 0;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    overflow-wrap: break-word;
}

.section-title {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 var(--space-md) 0;
    letter-spacing: -0.02em;
    text-transform: capitalize;
}

.content-wrapper p {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ink-muted);
    margin: 0 0 1.2em 0;
    max-width: 62ch;
}

.content-wrapper p:last-child { margin-bottom: 0; }

.content-wrapper strong { color: var(--ink); font-weight: 700; }

.content-wrapper p a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule-strong);
    transition: border-color var(--dur-fast) ease;
}
.content-wrapper p a:hover { border-color: var(--ink); }

.full-width-text { width: 100%; }
.full-width-text p { max-width: 80ch; }

/* ---------------------------------------------------------
   GRIDS
   --------------------------------------------------------- */
.grid-2,
.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gutter);
    align-items: start;
}

.grid-large-image {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: var(--gutter);
    align-items: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-col { min-width: 0; }

.flex-row {
    display: flex;
    gap: var(--gutter);
    width: 100%;
    align-items: stretch;
}

.align-start { align-items: flex-start; }

.flex-portrait  { flex: 0.66; aspect-ratio: 2/3; }
.flex-landscape { flex: 1.5;   aspect-ratio: 3/2; }
.flex-square    { flex: 1;     aspect-ratio: 1/1; }

/* ---------------------------------------------------------
   ASPECT RATIOS
   --------------------------------------------------------- */
.aspect-square    { aspect-ratio: 1 / 1; }
.aspect-landscape { aspect-ratio: 3 / 2; }
.aspect-portrait  { aspect-ratio: 2 / 3; }
.aspect-wide      { aspect-ratio: 16 / 9; }
.aspect-ultrawide { aspect-ratio: 2500 / 1036; }

/* ---------------------------------------------------------
   IMAGE CONTAINERS
   --------------------------------------------------------- */
.img-container {
    width: 100%;
    background-color: var(--bg-sunken);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-container img,
.img-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Logos need to breathe rather than crop. */
.contain img { object-fit: contain; }

.parallax-wrapper img,
.parallax-img {
    height: 120%;
    top: -10%;
    position: absolute;
    will-change: transform;
}

/* Text column sitting beside a full-height image */
.intro-text { min-width: 0; }

.full-bleed-container {
    width: 100vw;
    height: 100vh;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    overflow: hidden;
    background-color: var(--bg-sunken);
}

.full-bleed-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.full-screen-section { margin-bottom: 0 !important; }

/* Fixed-height image bands. A definite height overrides any
   aspect-ratio on the same element, which is the intent here. */
.band    { height: 600px; }
.band-sm { height: 500px; }

.flush-top  { margin-top: 0 !important; }

.on-black { background: #000; }

/* Shared backdrop behind a group of sections */
.grouped-sections {
    padding-bottom: 1px;
    margin-bottom: var(--space-xl);
}
.grouped-sections .section:last-child { margin-bottom: 0; }

.section-relative { position: relative; z-index: 1; }

.section-bg-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    object-fit: contain;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

/* ---------------------------------------------------------
   REVEAL ON SCROLL
   --------------------------------------------------------- */
.reveal-element {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--dur-slow) var(--ease),
                transform var(--dur-slow) var(--ease);
}

.reveal-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------------------------------------------------
   PROJECT-TO-PROJECT NAVIGATION
   Two large targets, no explanatory copy — the project names
   carry it. This is what turns each case study from a dead
   end into a path through the work.
   --------------------------------------------------------- */
.project-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--rule);
    margin-top: var(--space-xl);
}

.project-nav a {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-lg) var(--gutter);
    text-decoration: none;
    color: var(--ink);
    position: relative;
    overflow: hidden;
    transition: background var(--dur) var(--ease);
}

.project-nav a + a { border-left: 1px solid var(--rule); }

.project-nav a:hover { background: var(--bg-raised); }

.project-nav .nav-dir {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    transition: color var(--dur-fast) ease;
}

.project-nav a:hover .nav-dir { color: var(--ink-muted); }

.project-nav .nav-name {
    font-size: clamp(1.2rem, 2.6vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    line-height: 1.05;
    transition: transform var(--dur) var(--ease);
}

.project-nav .nav-next { align-items: flex-end; text-align: right; }

.project-nav a:hover .nav-name         { transform: translateX(-6px); }
.project-nav a.nav-next:hover .nav-name { transform: translateX(6px); }

/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .content-wrapper { padding: 120px var(--gutter) 60px; }

    .project-title { font-size: 2.4rem; margin-bottom: var(--space-md); }
    .hero-title    { font-size: 2.2rem; }

    /* Every multi-column arrangement collapses to a single stack. */
    .grid-2,
    .intro-grid,
    .grid-large-image,
    .grid-3,
    .flex-row {
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }

    .flex-portrait,
    .flex-landscape,
    .flex-square {
        width: 100%;
        flex: none;
    }
    .flex-portrait  { aspect-ratio: 2/3; }
    .flex-landscape { aspect-ratio: 3/2; }
    .flex-square    { aspect-ratio: 1/1; }

    /* Intro blocks keep text above the image on small screens. */
    .grid-2.intro-order > div:first-child { order: 1; }
    .grid-2.intro-order > div:last-child  { order: 2; }

    /* Parallax is disabled on touch; images sit still and fill. */
    .parallax-wrapper img,
    .img-container img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover;
        top: 0 !important;
        transform: none !important;
    }
    .contain img { object-fit: contain !important; }

    .full-bleed-container { height: 70vh; width: 100vw; }

    /* A 600px band is taller than most phones; fall back to a ratio. */
    .band,
    .band-sm { height: auto !important; aspect-ratio: 4 / 3; }

    /* Artwork that must not be cropped on a narrow screen — logo
       lockups, packaging, posters — drops its frame and shows whole. */
    .mobile-auto-height {
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        background: none;
    }
    .mobile-auto-height img {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        top: 0 !important;
        transform: none !important;
        object-fit: contain !important;
    }

    .section-bg-img { width: 100%; }

    /* Sifola Sposato: wide desktop crops become squares on a phone
       so the logo and gallery frames stay readable. */
    .logo-section-container,
    .intro-image-container { aspect-ratio: 1 / 1 !important; height: auto !important; }
    .final-gallery-container { aspect-ratio: 3 / 2 !important; }
    .logo-section-container img { object-fit: contain !important; }

    .project-nav { grid-template-columns: 1fr; }
    .project-nav a { padding: var(--space-md) var(--gutter); }
    .project-nav a + a { border-left: 0; border-top: 1px solid var(--rule); }
    .project-nav .nav-next { align-items: flex-start; text-align: left; }
}
