*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --black: #000;
    --white: #fff;
    --red: #d41222;
    --gray: #666;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--white);
    color: var(--black);
    font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.brand-mark {
    position: fixed;
    top: clamp(1.2rem, 3.5vh, 2rem);
    left: clamp(1.2rem, 3.5vw, 2rem);
    font-family: "Unbounded", "Space Grotesk", sans-serif;
    font-weight: 800;
    font-size: clamp(0.8rem, 1.3vw, 1rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--black);
    text-decoration: none;
}

.page {
    max-width: 34rem;
    margin: 0 auto;
    padding: clamp(6rem, 18vh, 9rem) 1.5rem 6rem;
}

.page-eyebrow {
    margin: 0 0 1.2rem;
    font-family: "Newsreader", "Space Grotesk", serif;
    font-weight: 500;
    font-size: clamp(1.9rem, 3.8vw, 2.6rem);
    color: var(--black);
}

.page-text {
    margin: 0;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    font-weight: 300;
    line-height: 1.85;
    letter-spacing: 0.02em;
    color: var(--gray);
}

.page-text + .page-text {
    margin-top: 1.2rem;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    margin-top: 2.2rem;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.2rem;
    border: 1px solid var(--red);
    font-family: "Space Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--red);
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .contact-button:hover {
        background: var(--red);
        color: var(--white);
    }
}

.back-link {
    position: fixed;
    bottom: clamp(1.2rem, 3.5vh, 2rem);
    left: clamp(1.2rem, 3.5vw, 2rem);
    font-family: "Space Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .back-link:hover {
        color: #ff1a2e;
    }
}

/* ── Project wheel (projets.html) — a static 3D fan of tiles. The page
   doesn't scroll; a wheel/touch listener drives the rotation directly
   (see the inline script), real focusable links. ── */

.wheel-columns {
    display: flex;
    width: 100%;
    gap: 2.5rem;
    align-items: flex-start;
}

.wheel-column {
    flex: 1 1 0;
    min-width: 0;
}

.wheel-index {
    margin: 0 0 0.75rem;
    font-family: "Space Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red);
    opacity: 0.7;
}

.wheel {
    --tile-size: 15rem;
    --tile-radius: 30rem;
    width: 100%;
    perspective: 1800px;
    height: 34rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-ring {
    position: relative;
    width: 1px;
    height: 1px;
    transform-style: preserve-3d;
}

.wheel-tile {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--tile-size);
    height: var(--tile-size);
    margin: calc(var(--tile-size) / -2) 0 0 calc(var(--tile-size) / -2);
    display: block;
    text-decoration: none;
    /* wide radius relative to tile size keeps the fan's rungs from
       overlapping — see the trig note above each column in the HTML */
    transform: rotateX(calc(var(--a) + var(--wheel-offset, 0deg))) translateZ(var(--tile-radius)) scale(var(--tile-scale, 1));
}

.wheel-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Each logo's artwork fills a different share of its own canvas (some
       bleed edge-to-edge, some sit in a lot of padding), so object-fit alone
       makes them read as wildly different sizes. --art-scale is a per-image
       correction (set inline in the HTML) so they look consistent at a glance. */
    transform: scale(var(--art-scale, 1));
}

.wheel-tile--empty {
    border: 1px dashed #ddd;
}

.wheel-title-mobile {
    display: none;
}

.wheel-dots {
    display: none;
}

.wheel-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: rgba(212, 18, 34, 0.25);
    transition: background-color 0.25s ease;
}

.wheel-dot.is-active {
    background: var(--red);
}

@keyframes jackpot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 18, 34, 0.55); }
    70% { box-shadow: 0 0 0 2.5rem rgba(212, 18, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 18, 34, 0); }
}

.wheel-tile--jackpot {
    animation: jackpot-pulse 0.9s ease-out;
}

@keyframes jackpot-banner {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

.jackpot-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 50;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--red);
    background: var(--white);
    font-family: "Space Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red);
    pointer-events: none;
    opacity: 0;
    animation: jackpot-banner 1.1s ease-out forwards;
}

@media (max-width: 640px) {
    /* One reel at a time, full-width, swiped between horizontally — a phone
       screen is too narrow for two side-by-side columns, and stacking them
       vertically ran into the same tiles-overshoot-their-box problem the
       gap between columns was already fighting. The wheel's own touch
       handler only claims vertical drags (see the inline script), so a
       horizontal swipe reaches this native scroll-snap untouched. */
    /* A sliver of the next reel peeking in at the edge (via the 6% side
       padding + each column being 88% wide, not 100%) is what actually
       tips people off that there's a second page to swipe to — a dot
       indicator alone is easy to miss, this you see without even moving. */
    .wheel-columns {
        flex-wrap: nowrap;
        gap: 0;
        padding: 0 6%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .wheel-column {
        flex: 0 0 88%;
        scroll-snap-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* The per-reel title used to live inside the (vertically centered)
       column, so it drifted down with the wheel instead of reading as a
       page title. One shared, fixed title up near the KAIZO mark instead —
       its text is kept in sync with whichever reel is active (see the
       inline script's scroll listener). */
    .wheel-index {
        display: none;
    }

    .wheel-title-mobile {
        display: block;
        position: fixed;
        top: clamp(4.5rem, 13vh, 5.5rem);
        left: clamp(1.2rem, 3.5vw, 2rem);
        margin: 0;
    }

    .wheel {
        --tile-size: 11rem;
        --tile-radius: 15rem;
        height: 22rem;
        perspective: 1300px;
    }

    /* The 7/7 jackpot only makes sense when both reels are visible at once
       to see them line up — on mobile, where it's one reel at a time, drop
       the easter egg tiles entirely rather than leave a pointless gag. */
    .wheel-tile[data-project="seven"] {
        display: none;
    }

    .wheel-dots {
        display: flex;
        position: fixed;
        top: clamp(1.2rem, 3.5vh, 2rem);
        right: clamp(1.2rem, 3.5vw, 2rem);
        gap: 0.5rem;
    }
}

.page--wide {
    max-width: 64rem;
}

/* ── Project detail page ── */

.project-header {
    margin-bottom: 2rem;
}

.project-header + .page-text {
    margin-bottom: 2.5rem;
}

.project-title {
    margin: 0 0 0.8rem;
    font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--black);
}

.project-meta-line {
    margin: 0;
    font-family: "Space Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    font-family: "Space Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #aaa;
}

.project-photo {
    display: block;
    width: 100%;
    margin-bottom: 2.5rem;
    background: #fafafa;
}

.project-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.project-gallery .project-photo {
    margin-bottom: 0;
}

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

.project-caption {
    margin: -1.8rem 0 2.5rem;
    font-family: "Space Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: #999;
}

/* ── Portfolio (portfolio/index.html) — unlisted page. The PDF's spreads are
   shown edge to edge on the white page, with no frame, so they read as part
   of the site rather than a document dropped onto it. On phones each spread
   is cut into its two pages (.folio-halves). Every image opens a zoomable
   lightbox (js/portfolio.js). ── */

.portfolio {
    max-width: 120rem;
    margin: 0 auto;
    padding: clamp(6rem, 18vh, 9rem) clamp(1rem, 3vw, 3rem) 6rem;
}

.portfolio .project-header,
.portfolio-actions {
    max-width: 64rem;
}

.portfolio-actions {
    margin: 0 0 clamp(3rem, 8vh, 5rem);
}

.folio {
    margin: 0 0 clamp(2rem, 6vw, 5rem);
}

.folio-img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
}

.folio--single {
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
}

.folio-halves {
    display: none;
}

@media (max-width: 640px) {
    .portfolio {
        padding-left: 0;
        padding-right: 0;
    }

    .portfolio .project-header,
    .portfolio-actions {
        padding: 0 1.2rem;
    }

    .folio-spread {
        display: none;
    }

    .folio-halves {
        display: grid;
        gap: 1rem;
    }

    .folio {
        margin-bottom: 1rem;
    }

    .folio--single {
        max-width: none;
    }
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--white);
}

.lightbox[hidden] {
    display: none;
}

.lightbox-stage {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
}

.lightbox-img {
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    cursor: zoom-in;
}

.lightbox.is-zoomed .lightbox-img {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.lightbox-btn {
    position: fixed;
    padding: 0.6rem 0.9rem;
    border: 0;
    background: rgba(255, 255, 255, 0.85);
    font-family: "Space Mono", monospace;
    font-size: 1.1rem;
    color: var(--red);
    cursor: pointer;
}

.lightbox-close {
    top: clamp(0.6rem, 2vh, 1.2rem);
    right: clamp(0.6rem, 2vw, 1.2rem);
    font-size: 1.6rem;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: clamp(0.4rem, 1.5vw, 1rem);
}

.lightbox-next {
    right: clamp(0.4rem, 1.5vw, 1rem);
}

.lightbox-hint {
    position: fixed;
    bottom: clamp(0.8rem, 2.5vh, 1.5rem);
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-family: "Space Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    pointer-events: none;
}

.lightbox.is-zoomed .lightbox-hint {
    display: none;
}

@media (max-width: 640px) {
    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: 0.6rem;
        transform: none;
    }
}
