/* Geist — self-hosted (replaces Nohemi). Sans for UI/headlines + stats/body (Black for the
   hero wordmark), Pixel for the nav + footer wordmark. */
@font-face {
    font-family: 'Geist Sans';
    src: url('geist-font-v1.7.2/geist-font/Geist/webfonts/Geist-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Geist Sans';
    src: url('geist-font-v1.7.2/geist-font/Geist/webfonts/Geist-Black.woff2') format('woff2');
    font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Geist Pixel';
    src: url('geist-font-v1.7.2/geist-font/GeistPixel/webfonts/GeistPixel-Square.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}

/* Instrument Serif — self-hosted; kept for the display headings / hero tagline. */
@font-face {
    font-family: 'Instrument Serif';
    src: url('Instrument_Serif/InstrumentSerif-Regular.ttf') format('truetype');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Instrument Serif';
    src: url('Instrument_Serif/InstrumentSerif-Italic.ttf') format('truetype');
    font-weight: 400; font-style: italic; font-display: swap;
}

:root {
    --font-serif: 'Instrument Serif', serif;
    --font-sans: 'Geist Sans', sans-serif;
    --font-pixel: 'Geist Pixel', monospace;
    --color-bg: #f1f1f1;
    --color-text: #010101;

    --border-style: 2px solid var(--color-text);

    /* ONE source of truth for the horizontal page gutter — the nav's left/right padding,
       which every other edge (container, case wrapper, full-bleed break-outs, the menu
       overlay via --edge) is aligned to. Halved from the original 5rem, so change it
       HERE and the whole site follows instead of drifting apart. */
    --gutter: 2.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Background on <html> too, so the page is never white — including the instant the body
   is hidden during a scramble transition. Without this, hiding <body> exposes the
   browser's default white canvas, which reads as a visible page reload. */
html {
    background-color: var(--color-bg);
    /* Fluid scale: every size on the site is rem, so the root maps the 1920px design
       onto the viewport — full size at ≥1920, shrinking proportionally down to the
       820px breakpoint (where the mobile root below takes over). 16/1920 = 0.83333vw. */
    font-size: min(0.83333vw, 16px);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.02em; /* matches Figma tracking on all text */
}

/* Hidden before paint when arriving via a scramble transition, so there's no flash of
   unscrambled text; transition.js reveals it instantly once the scramble is in place. */
.fl-enter body { opacity: 0; }

.container {
    width: 100%;
    max-width: 120rem;
    margin: 0 auto;
    padding: 2.5rem var(--gutter);
    display: flex;
    flex-direction: column;
    overflow-x: clip; /* contains the hero word's horizontal scroll-drift */
}

.viewport-section {
    min-height: calc(100vh - 5rem); /* 100vh minus container vertical padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 12.5rem;
}

/* Header — fixed, floats over the content and inverts via difference blend so it stays
   legible over both the light page and the dark type that scrolls beneath it. Lives
   OUTSIDE the locomotive scroll container so it stays put on scroll. */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    max-width: 120rem;
    margin: 0 auto;
    /* Top padding is 80% deeper than the bottom on purpose — the bar sits lower in its
       strip. Horizontal is the shared --gutter, so the wordmark and "Reach out" stay on
       the same edges as all page content. */
    padding: 0.675rem var(--gutter) 0.375rem;
    background: var(--color-bg);    /* solid, so content no longer bleeds through the nav — same colour as the page, so it just occludes */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-pixel);   /* nav in Geist Pixel */
    font-weight: 400;
    font-size: 1.75rem;
    color: var(--color-text);    /* crisp dark nav by default — no blend, so no grayscale-AA bolding */
    pointer-events: none;        /* gaps pass clicks through to the hero; links re-enable below */
    transition: color 0.25s ease;
}
header a { pointer-events: auto; color: inherit; text-decoration: none; }

/* Over a dark-background section, nav-theme.js adds .nav-light → white text + white logo. */
header.nav-light { color: #fff; }

.nav-logo {
    width: 3rem;                      /* 48px at max root = 1:1 with the 48px pixel art */
    height: 3rem;
    display: block;
    /* Pixel-art tulip (favicon.png): black ink on transparent — shown as-is on
       the light nav, inverted to white over dark sections (.nav-light). */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: none;
    transition: filter 0.25s ease;
}
header.nav-light .nav-logo { filter: invert(1); }

/* The Studio / Work pair (third nav group). */
.nav-links {
    display: flex;
    gap: 2.5rem;
}

/* Hero — editorial masthead with a physics-driven wordmark */
.hero {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 20rem;
}

/* Physics stage — covers the whole hero so FLORIUM falls full height and
   piles up on the left. Sits behind the framing text. */
.hero-physics {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.phys-letter {
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: clamp(8.75rem, 18vw, 20rem);
    line-height: 1;
    text-transform: uppercase;
    transform-origin: center center;
    will-change: transform;
    visibility: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.hero-physics.ready .phys-letter {
    visibility: visible;
}

/* Framing text — overlaid on top, positioned as in the masthead layout */
.hero-frame {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;   /* base meta sits at the bottom; tagline is centered separately */
    pointer-events: none;
}

.hero-meta {
    display: flex;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
}

.hero-meta--top {
    justify-content: space-between;
}

.hero-tagline {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    text-align: right;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2rem, 3.6vw, 3.5rem);
    line-height: 1.05;
    max-width: 16ch;
}

.hero-meta--base {
    align-self: flex-end;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
}

/* Stats Section */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 7.5rem;                       /* the two blocks hug their content; the 12.5rem margins buffer neighbours */
    margin-bottom: 12.5rem;
}

.stat-block, .team-block {
    width: 50%;
    min-width: 45rem;
}

.stat-block h2, .team-block h2 {
    font-family: var(--font-sans);
    font-size: 3.75rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.divider {
    border-bottom: var(--border-style);
    margin-bottom: 1.5rem;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    font-family: var(--font-sans);
    font-size: 1.875rem;
}

.team-list {
    display: grid;
    grid-template-columns: 1fr auto;   /* role column sizes to its content so it never wraps */
    row-gap: 0.75rem;
    column-gap: 2.5rem;
}

.team-member {
    font-family: var(--font-sans);
    font-size: 1.875rem;
    white-space: nowrap;
}

.team-role {
    font-family: var(--font-sans);
    font-size: 1.875rem;
    text-align: right;
    white-space: nowrap;
}

/* Featured Work */
.work-section {
    margin-bottom: 12.5rem;
}

.work-label {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 400;   /* it's an <h2> for structure; keep the regular look */
    margin-bottom: 0.75rem;
}

.work-list {
    border-top: var(--border-style);
    display: flex;
    flex-direction: column;
}

.work-item {
    font-family: var(--font-serif);
    font-size: 10.5rem;
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: var(--border-style);
}

.work-description {
    font-family: var(--font-serif);
    font-size: 4.5rem;
    line-height: 1.1;
    margin-top: 2.5rem;
}

/* Featured Work — hover interaction: scramble text + cursor-tracking photo */
.work-item {
    position: relative;
}

.work-item__label {
    position: relative;
    z-index: 2;
}

/* Hover peek (hover-peek.js) — two pixel images flank the hovered row's
   centered text and de-pixelate through the case-study hard-cut steps.
   Boxes are positioned by JS against the label's edges; they never move
   the label (absolute, out of flow). */
.peek {
    position: absolute;
    top: 50%;
    width: 13rem;
    height: 9rem;
    transform: translateY(-50%);
    overflow: hidden;
    pointer-events: none;
    z-index: 1;               /* under the label (z 2), so text always wins */
    display: none;
}
.peek.is-on { display: block; }
.peek img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.peek canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* FAQ / Extra Content */
.faq-section {
    margin-bottom: 12.5rem;
}

.faq-header {
    font-family: var(--font-sans);
    font-size: 3.75rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.faq-container {
    border-top: var(--border-style);
    display: grid;
    grid-template-columns: 1fr 2fr;
    padding-top: 1.5rem;
}

.faq-label {
    font-family: var(--font-sans);
    font-size: 2.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
}

.faq-item {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    text-align: right;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-text);
}
.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Accordion Q&A: <details>/<summary> — native semantics, content indexed while
   collapsed. Same motif as the consent panel: the +/− indicator flips with NO
   transition, it's a state change. */
.faq-item__q {
    cursor: pointer;
    list-style: none;                 /* no disclosure triangle */
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::after {
    content: "+";
    display: inline-block;
    margin-left: 0.6em;
    width: 1em;                       /* reserved box: + → − never shifts the question */
    text-align: center;
}
.faq-item[open] > .faq-item__q::after { content: "−"; }
/* The body wrapper animates height 0↔measured (faq.js). The vertical spacing
   lives on the INNER .faq-item__a, NOT here: padding on the animated element
   can't collapse at height:0, so it would leave a ~28px sliver of text peeking
   for a beat on close. With no padding, height:0 truly collapses to nothing;
   the child's padding still counts toward scrollHeight, so the open measures
   true. No-JS: no inline height, no motion. */
.faq-item__body {
    overflow: hidden;
    transition: height 0.56s cubic-bezier(0.23, 1, 0.32, 1);
}
.faq-item__a {
    max-width: 42rem;
    margin: 0 0 0 auto;               /* hugs the right column, under the question */
    padding: 1.25rem 0 0.5rem;        /* the question↔answer gap — here, not on the wrapper (collapse-safe) */
    font-size: 1.75rem;                /* body voice — same as the nav/agency copy */
    line-height: 2rem;
    text-align: left;
}
.faq-item__a a { color: inherit; }
/* Typewriter scramble (faq.js): the ghost is the real letter and owns the
   width; the live overlay cycles glyphs on top, so nothing ever reflows. */
.faq-word { display: inline-block; }
.faq-scr { position: relative; display: inline-block; }
.faq-scr.is-pending .faq-scr__ghost { visibility: hidden; }
.faq-scr__live { position: absolute; left: 0; top: 0; }
@media (prefers-reduced-motion: reduce) {
    .faq-item__body { transition: none; }
}

/* Footer */
footer {
    border-top: var(--border-style);
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
    container-type: inline-size;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 5rem;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

/* The footer "Cookies" item is a real <button> (opens the consent popup) styled
   to read exactly like its sibling spans. */
.footer-cookies {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
    cursor: pointer;
}

.footer-big {
    width: 100%;
    margin-top: -1.25rem; /* Pull it slightly up */
}

.footer-big svg {
    display: block;
    width: 100%;
    height: auto;
}

/* SVG font-family attribute can't read a CSS var(); set it here so the
   wordmark renders in the pixel face (Figma: 400 / 273px). */
.footer-big text {
    font-family: var(--font-pixel);
}

/* ============================================================
   Mobile menu — shared base (all viewports)
   The "Menu" toggle and the red full-screen overlay are hidden on desktop and
   only surface inside the mobile breakpoint below. Kept here (not per-page) so
   any page carrying the markup gets the same behaviour.
   ============================================================ */
.nav-menu-toggle {
    display: none;              /* revealed in the mobile query */
    pointer-events: auto;       /* header itself is pointer-events:none */
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.nav-menu-overlay {
    display: none;              /* becomes a flex column in the mobile query */
}

/* ============================================================
   Mobile layout — ALL PAGES. Everything below is authored in rem; the fluid
   root maps the 1400px-wide Figma mobile frames 1:1 onto the phone's width,
   so a value is simply (figma-px / 16)rem.
   ============================================================ */
@media (max-width: 819px) {
    /* Fluid mobile root: 1rem = one 16px design unit of the 1400px mobile
       artboard (16/1400 = 1.143vw), clamped so small phones stay legible and
       wide phones/tablets don't oversize. */
    html {
        font-size: clamp(3.4px, 1.143vw, 5.7px);

        /* Shared CONTENT EDGE for full-bleed elements.
           `header` and `.container` are both max-width:120rem and centred, so once the
           viewport is wider than that cap their content edge moves inward — a flat
           4.4375rem on a full-bleed element does NOT follow it (at 768px the cap is
           684px, so the header's edge sits 42px further right). Anything full-bleed
           must pad to var(--edge) so nothing pokes out to the left of the
           "FloriumStudio" wordmark or to the right of the "Menu" toggle. */
        --edge: calc(max(0px, (100vw - 120rem) / 2) + var(--gutter));

        /* Mobile gutter — halved from the original 4.4375rem, same as desktop. */
        --gutter: 2.21875rem;
    }

    /* ---- Header: Florium Studio | logo | Menu (3-up grid, logo centred) ---- */
    header {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 2rem;
        padding: 2.7rem var(--gutter) 1.5rem;   /* top 80% deeper, as on desktop */
        font-family: var(--font-pixel);  /* Geist Pixel, same voice as desktop nav */
        font-size: 3.25rem;              /* 52 design px */
        letter-spacing: -0.02em;
        transition: none;                /* no ease on menu open OR close */
    }
    .nav-wordmark { justify-self: start; }
    .nav-logo {
        justify-self: center;
        width: 6rem;                     /* 2× the 48px pixel art — even pixel blocks */
        height: 6rem;
        transition: none;                /* logo invert flips instantly with the menu */
    }
    .nav-menu-toggle {
        display: block;
        justify-self: end;
        text-align: right;               /* both labels hug the right edge inside the reserved width */
    }
    /* The desktop link groups collapse into the overlay. */
    .nav-links,
    .nav-reach { display: none; }

    /* ---- Red full-screen overlay (sits below the fixed header) ---- */
    .nav-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 90;                     /* header is z-100, stays legible on top */
        display: none;                   /* .menu-open flips it on — instantly */
        flex-direction: column;
        /* Red stays full-bleed; only the CONTENT is inset to the shared edge, so the
           overlay's links line up with the wordmark and ©2026 with "Menu". */
        padding: 0 var(--edge) 5vh;
        background: #eb4236;
    }
    .menu-open .nav-menu-overlay { display: flex; }   /* instant — no animation */
    /* Header recolours to white over the red while the menu is open — also instant. */
    .menu-open header { color: #fff; background: transparent; transition: none; }   /* let the red overlay show through the nav strip */
    .menu-open .nav-logo { filter: invert(1); transition: none; }   /* black tulip → white over the red */

    .nav-menu-links {
        list-style: none;
        margin-top: 28vh;                /* upper-middle, clearing the header */
    }
    .nav-menu-links a {
        display: inline-block;
        font-family: var(--font-serif);
        font-size: 15.625rem;            /* 250 design px */
        line-height: 1.3;
        color: #fff;
        text-decoration: none;           /* pages without a local `a` reset (index) showed underlines */
    }

    .nav-menu-footer {
        margin-top: auto;                /* pinned to the bottom */
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 2rem;
        font-family: var(--font-pixel);
        font-size: 3.25rem;              /* 52 design px */
        line-height: 1.3;
        color: #fff;
    }
    .nav-menu-note { max-width: 30rem; }
    .nav-menu-copy { white-space: nowrap; }

    /* Keep the page scrollable while the menu is open: locking it drops the scrollbar, which
       changes the viewport width and jolts the fixed nav sideways. The opaque overlay covers
       the page, so whatever scrolls underneath stays invisible. */

    /* ---- Container gutters match the Figma 71px side margin ---- */
    .container {
        padding: 0 var(--gutter);        /* top handled per-section/page */
    }

    /* ---- Footer: two rows (contact / socials) + big pixel wordmark ---- */
    footer {
        border-top: var(--border-style);
        padding-top: 1.5rem;
        padding-bottom: 2.5rem;
    }
    .footer-top {
        display: grid;
        grid-template-columns: auto 1fr auto;   /* phone/email hug content so they never wrap */
        grid-template-areas:
            "phone  copy   email"
            "social social social";
        row-gap: 1.5rem;
        font-family: var(--font-serif);
        font-size: 3.25rem;              /* 52 design px */
        margin-bottom: 3rem;
    }
    .footer-phone { grid-area: phone; justify-self: start; white-space: nowrap; }
    .footer-copyright { grid-area: copy; justify-self: center; white-space: nowrap; }
    .footer-email { grid-area: email; justify-self: end; white-space: nowrap; }
    .footer-socials {
        grid-area: social;               /* full-width second row */
        display: flex;
        justify-content: space-between;
        gap: 2rem;
    }
}

/* ============================================================
   Mobile — homepage sections (hero / stats / featured work / FAQ).
   Same 1400px-artboard scale as the shell above.
   ============================================================ */
@media (max-width: 819px) {
    /* Hero — serif tagline steps up to display scale; the studio line is dropped */
    .hero-tagline {
        font-size: 5.25rem;              /* 84 design px */
        max-width: 12ch;
    }
    /* The falling FLORIUM letters double on phones (desktop keeps its clamp) */
    .phys-letter { font-size: clamp(17.5rem, 36vw, 40rem); }
    .hero-meta { font-size: 3.25rem; }   /* 52 design px */
    .hero-meta--base span:first-child { display: none; }   /* "Independent design studio" */

    .viewport-section { margin-bottom: 25rem; }

    /* Stats + team — full-width stacks */
    .stats-section { gap: 15rem; margin-bottom: 25rem; }
    .stat-block, .team-block { width: 100%; min-width: 0; }
    .stat-block h2, .team-block h2 { font-size: 5.25rem; margin-bottom: 1.5rem; }
    .stat-item, .team-member, .team-role { font-size: 3.25rem; }

    /* Featured work list — no cursor-tracking photo on touch; scramble (JS,
       fine-pointer-gated) is unaffected */
    .work-section { margin-bottom: 25rem; }
    .work-label { font-size: 3.25rem; margin-bottom: 1rem; }
    .work-item { font-size: 10rem; padding: 2rem 0; }
    .work-description { font-size: 5.25rem; margin-top: 3rem; }

    /* FAQ stacks to a single column; the "FAQ" label is dropped on phones —
       the "Good to know" heading already carries it */
    .faq-header { font-size: 5.25rem; }
    .faq-container { grid-template-columns: 1fr; row-gap: 3rem; padding-top: 1.5rem; }
    .faq-label { display: none; }
    .faq-item {
        font-size: 3.25rem;
        text-align: left;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .faq-item__a {
        max-width: none;              /* full-width answers on the single column */
        margin: 0;
        padding: 2rem 0 0.5rem;       /* gap on the inner element (collapse-safe close) */
        font-size: 3.25rem;           /* mobile body size (52 design px) */
        line-height: 1.4;
    }
}
