/* ============================================================
   site.css — shared design system for alexvaldivia portfolio
   Tokens, components, gate, scroll-header, reveal & parallax.
   Edit here once; every page stays consistent.
   ============================================================ */
/* ─── Reset ─────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    img { display: block; }

    /* ─── Design Tokens ─────────────────────────────────── */
    :root {
      --bg:        #fff4ea;
      --card:      #faeddf;
      --muted:     rgba(0, 0, 0, 0.60);
      --grey-dark: #778294;
      --chip:      rgba(151, 102, 18, 0.15);
      --chip-text: #976612;
    }

    html, body {
      background: var(--bg);
      font-family: 'Inter', sans-serif;
      color: #000;
      -webkit-font-smoothing: antialiased;
      overflow-x: clip; /* contain full-bleed (100vw) carousels — no horizontal scroll */
    }

    /* ─── Page shell ────────────────────────────────────── */
    .page {
      width: 100%;
      max-width: 1435px;
      margin: 0 auto;
      padding: clamp(20px, 4vw, 64px);
      display: flex;
      flex-direction: column;
      gap: clamp(56px, 8vw, 120px);
    }

    .card {
      background:    var(--card);
      border-radius: 48px;
      position:      relative;
      overflow:      hidden;
    }

    /* ══════════════════════════════════════════════════════
       HERO  (phone positions are % of the 1311×650 hero box)
    ══════════════════════════════════════════════════════ */
    .hero { aspect-ratio: 1311 / 650; }

    .back-btn {
      position: absolute;
      left: 24px; top: 24px;
      width: 48px; height: 48px;
      border: 1px solid #000;
      border-radius: 9999px;
      background: var(--card);
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      z-index: 4;
      transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
    }
    .back-btn:hover  { background: rgba(151, 102, 18, 0.15); box-shadow: 0 6px 18px rgba(151, 102, 18, 0.18); }
    .back-btn:active { background: rgba(151, 102, 18, 0.24); transform: scale(0.92); box-shadow: none; }
    .back-btn:focus-visible { outline: 2px solid var(--chip-text); outline-offset: 2px; }

    .hero-head {
      position: absolute;
      left: 24px; top: 24px;        /* arrow pinned to the top-left corner, like the Figma */
      width: 56%;
      display: flex; flex-direction: column; gap: 24px;
      z-index: 3;
      --titlegap: clamp(16px, 2.2vw, 36px);
    }
    .hero-title { font-weight: 500; font-size: clamp(22px, 2.4vw, 30.156px); line-height: normal; color: #000; }
    .hero-sub   { font-weight: 500; font-size: clamp(18px, 1.9vw, 24px); line-height: 1.1; color: var(--muted); }
    /* back arrow + project title on one row, so the title is always beside the arrow */
    .hero-titlerow { display: flex; align-items: center; gap: var(--titlegap); }
    .hero-titlerow .back-btn { position: static; flex: none; }
    /* subtitle + chips align under the title (offset past the arrow) */
    .hero-head > .hero-sub, .hero-head > .chips { margin-left: calc(48px + var(--titlegap)); }

    .chips { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
    .chip {
      background: var(--chip);
      color: var(--chip-text);
      font-weight: 700; font-size: 14px; line-height: 41px;
      padding: 0 16px;
      border-radius: 12px;
      white-space: nowrap;
    }
    .chip-arrow { width: 24px; height: 24px; flex: none; }

    /* phone mockups */
    /* container so the phone-screen radius can scale with the hero (cqw) and stay
       locked to the phone-frame SVG, whose corners scale with the hero too */
    .visuals { position: absolute; inset: 0; pointer-events: none; transform: translateY(var(--py, 0px)); will-change: transform; container-type: inline-size; }
    .ph {
      position: absolute;
      /* match the frame's inner aperture corner: 46/352 of the frame, which is
         26.85% of the hero -> 3.51% of the hero width, at every viewport size */
      border-radius: 3.51cqw;
      box-shadow: 0 0 32px rgba(0, 0, 0, 0.1);
      overflow: hidden;
    }
    .ph img { width: 100%; height: 100%; object-fit: cover; }
    .ph-overlay { position: absolute; inset: 0; border-radius: 3.51cqw; }
    .ph-left   { left: 15.48%; top: 40.77%; width: 23.87%; height: 104.31%; }
    .ph-right  { left: 59.65%; top: 40.77%; width: 23.80%; height: 104.46%; }
    .ph-center { left: 37.07%; top: 38.31%; width: 24.79%; height: 107.69%; }
    .ph-left  .ph-overlay { background: linear-gradient(to left,  rgba(0,0,0,0.2) 8.466%, rgba(0,0,0,0) 98.243%); }
    .ph-right .ph-overlay { background: linear-gradient(to right, rgba(0,0,0,0.2) 1.763%, rgba(0,0,0,0) 85.417%); }
    .phone-frame  { position: absolute; left: 35.85%; top: 36.77%; width: 26.85%; height: 111.08%; }
    .phone-shadow { position: absolute; left: 36.54%; top: 147.85%; width: 25.40%; height: 2.15%; }

    /* ══════════════════════════════════════════════════════
       SECTION 2 — Background · loupe graphic · Goals
       (loupe is a placeholder until Figma MCP is reachable)
    ══════════════════════════════════════════════════════ */
    .intro {
      display: flex;
      gap: 24px;
      align-items: center;
    }
    .intro-col        { flex: 1 1 0; min-width: 0; }
    .intro-col.center { display: flex; align-items: center; justify-content: center; }
    .col-heading { font-weight: 500; font-size: 24px; line-height: normal; color: #000; margin-bottom: 20px; }
    .col-body    { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }
    .col-body p + p { margin-top: 20px; }
    .goals-list  { list-style: disc; padding-left: 24px; }
    .goals-list li { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }

    /* Google App search loupe graphic */
    .loupe { width: min(420px, 100%); height: auto; display: block; }
    /* Blogger life-preserver — the grey circle (Figma #e4e4e4) is a VIEWPORT that clips
       everything inside it. The ring is centred and gently bobs; the tether runs toward
       the edge and is masked by the circle, reading as if it continues beyond.
       The orange ring's centre is at (46%, 33.5%) of the source image, so we anchor that
       point to the disc centre. */
    .lifesaver { position: relative; width: min(420px, 100%); aspect-ratio: 1 / 1; border-radius: 9999px; background: #e4e4e4; overflow: hidden; }
    /* Ring anchored to the disc centre with STATIC left/top (the ring sits at
       46%/33.5% of the source image). The bob is a pure-px translateY so iOS/WebKit
       never sees mixed %+px inside a transform (that was throwing the centring off). */
    .lifesaver img {
      position: absolute; left: 7.7%; top: 20.7%; width: 92%; height: auto;
      animation: lifesaver-float 5s ease-in-out infinite;
    }
    @keyframes lifesaver-float {
      0%, 100% { transform: translateY(-7px); }
      50%      { transform: translateY(7px); }
    }
    @media (prefers-reduced-motion: reduce) { .lifesaver img { animation: none; transform: none; } }

    /* ══════════════════════════════════════════════════════
       SECTION 3 — process ("Assemble!" / "No bad ideas")
    ══════════════════════════════════════════════════════ */
    .process { display: flex; gap: 24px; }
    .process-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
    .process-img {
      position: relative; width: 100%; aspect-ratio: 643 / 650;
      background: var(--card); border-radius: 48px; overflow: hidden;
    }
    .process-text .h3 { font-weight: 500; font-size: 24px; line-height: 62.8px; color: #000; }
    .process-text p   { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }

    /* left: grayscale brainstorm wall (% of the 643×650 card) */
    .asm-wall {
      position: absolute; left: -29.55%; top: -3.87%;
      width: 159.26%; height: 118.18%;
      object-fit: cover; max-width: none;
      mix-blend-mode: luminosity;
    }
    /* right: three overlapping screenshots */
    .nbi-wrap { position: absolute; display: flex; align-items: center; justify-content: center; mix-blend-mode: multiply; }
    .nbi-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
    .nbi4-wrap { left: -11.20%; top: 24.92%; width: 56.62%; height: 81.73%; }
    .nbi4-box  { width: 75.26%; height: 91.67%; position: relative; box-shadow: 0 0 32px rgba(0,0,0,0.1); transform: rotate(-11.3deg); }
    .nbi2-wrap { left: 42.46%; top: -6.62%; width: 60.90%; height: 179.73%; }
    .nbi2-box  { width: 82.17%; height: 98.50%; position: relative; transform: rotate(3.51deg); }
    .nbi1 {
      position: absolute; left: 50%; transform: translateX(-50%);
      top: -76.00%; width: 54.43%; height: 212.62%;
      border-radius: 20px; box-shadow: 0 0 32px rgba(0,0,0,0.1); overflow: hidden;
    }
    .nbi1 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }

    /* ══════════════════════════════════════════════════════
       SECTION 4 — "Find out what's unique"
    ══════════════════════════════════════════════════════ */
    .unique-title { font-weight: 500; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.3; color: #000; text-align: left; }
    .unique-rows  { display: flex; flex-direction: column; gap: clamp(28px, 5vw, 68px); margin-top: clamp(48px, 10vw, 144px); }
    .u-row { display: flex; gap: clamp(16px, 2vw, 28px); align-items: center; }
    .u-label {
      flex: 1 1 0; min-width: 0; aspect-ratio: 1 / 1;
      background: var(--card); border-radius: 48px;
      display: flex; align-items: center; justify-content: center;
    }
    .u-label p { font-weight: 500; font-size: clamp(18px, 2.4vw, 24px); line-height: 1.3; color: #000; text-align: center; }
    .u-tile {
      flex: 1 1 0; min-width: 0; aspect-ratio: 1 / 1;
      background: var(--card); border-radius: 48px;
      overflow: hidden; position: relative;
    }
    /* screenshot offsets are % of the square tile (was px / 418) */
    .u-shot { position: absolute; width: 86.12%; max-width: none; object-fit: cover; }
    .shadow30 { box-shadow: 0 0 32px rgba(0, 0, 0, 0.1); }
    .u-flat img { position: absolute; inset: 0; width: 100%; height: 100%; }

    /* ══════════════════════════════════════════════════════
       SECTION 5 — "Then develop a Search & Input system"
    ══════════════════════════════════════════════════════ */
    .s5-title { font-weight: 500; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.3; color: #000; text-align: left; }
    .s5-cards { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 88px); margin-top: clamp(40px, 6vw, 88px); }
    .s5-card  { width: 100%; aspect-ratio: 1311 / 650; border-radius: 48px; overflow: hidden; }
    .s5-card img { width: 100%; height: 100%; display: block; object-fit: cover; }

    /* ══════════════════════════════════════════════════════
       CONTENT-CREATION ADDITIONS
    ══════════════════════════════════════════════════════ */
    /* section eyebrow — scannable narrative spine */
    .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--chip-text); margin-bottom: 16px; }
    .eyebrow.center { text-align: center; }
    .sec-lead { font-weight: 400; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; color: #000; max-width: 70ch; margin: 16px auto 0; }
    .sec-lead.center { text-align: center; }

    /* hero collage — cascade of blog mockups, bleeds off the bottom */
    .hero-collage { position: absolute; left: 50%; transform: translateX(-50%) translateY(var(--py, 0px)); bottom: -14px; width: 86%; height: auto; will-change: transform; }

    /* simple figure that fills a process-img card */
    .fig-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

    /* statement / transition (left-aligned, editorial) */
    .statement { text-align: left; margin: 0; }
    .statement h2 { font-weight: 500; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.25; color: #000; }
    .statement p  { font-weight: 400; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.6; color: #000; margin-top: 20px; }

    /* verbatim Figma card stacks — heading + full-width 1311×650 mock cards */
    .tpl-list  { display: flex; flex-direction: column; gap: clamp(36px, 5vw, 72px); margin-top: clamp(28px, 4vw, 48px); }
    .card-stack{ display: flex; flex-direction: column; gap: clamp(36px, 5vw, 72px); margin-top: clamp(28px, 4vw, 48px); }
    .tpl-block { display: flex; flex-direction: column; }
    .tpl-label { font-weight: 500; font-size: clamp(20px, 2vw, 24px); line-height: 1.3; color: #000; margin-bottom: 16px; }
    /* full-bleed Figma card — image shown at NATURAL scale (no zoom) inside a slightly
       shorter window; it pans vertically for the parallax. */
    .tpl-card-full { position: relative; width: 100%; aspect-ratio: 1311 / 582; border-radius: 48px; overflow: hidden; }
    .tpl-card-full img { position: absolute; top: 50%; left: 0; width: 100%; height: auto; transform: translateY(calc(-50% + var(--py, 0px))); will-change: transform; }
    /* static full-bleed card — full Figma image, no crop, no parallax */
    .tpl-card-static { position: relative; width: 100%; border-radius: 48px; overflow: hidden; }
    .tpl-card-static img { width: 100%; height: auto; display: block; }
    .fig-plain { width: 100%; }
    .fig-plain img { width: 100%; display: block; }

    /* template showcase card — mocks bleed off the bottom (matches Figma) */
    .tpl-card { width: 100%; aspect-ratio: 1311 / 650; border-radius: 48px; overflow: hidden; background: var(--card); }
    .tpl-card img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

    /* editorial two-column (Voices) */
    .editorial { display: flex; gap: clamp(32px, 5vw, 72px); align-items: center; }
    .editorial.reverse { flex-direction: row-reverse; }
    .editorial-text { flex: 1 1 0; min-width: 0; }
    .editorial-text h2 { font-weight: 500; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.2; color: #000; margin-bottom: 16px; }
    .editorial-text p  { font-weight: 400; font-size: clamp(16px, 1.5vw, 18px); line-height: 1.7; color: #000; }
    .editorial-fig { flex: 1 1 0; min-width: 0; }
    .editorial-fig img { width: 100%; display: block; }

    /* keep figures centered in their containers */
    .show-card img, .tcol-fig img, .fig-plain img, .editorial-fig img { margin: 0 auto; object-position: center; }
    @media (max-width: 860px) { .editorial, .editorial.reverse { flex-direction: column; align-items: stretch; gap: 28px; } }

    /* showcase figure card (natural aspect, no crop) */
    .show-card { width: 100%; border-radius: 48px; overflow: hidden; background: var(--card); }
    .show-card img { width: 100%; display: block; }
    .show-cap { margin-top: 20px; }
    .show-cap h3 { font-weight: 500; font-size: 24px; line-height: 1.3; color: #000; }
    .show-cap p  { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; margin-top: 8px; max-width: 70ch; }

    /* template rows: circular label + wide figure */
    .tpl-rows { display: flex; flex-direction: column; gap: clamp(28px, 5vw, 60px); margin-top: clamp(40px, 7vw, 92px); }
    .tpl-row { display: flex; gap: 32px; align-items: center; }
    .tpl-row .u-label { flex: 0 0 clamp(170px, 22vw, 280px); }
    .tpl-fig { flex: 1 1 0; min-width: 0; border-radius: 48px; overflow: hidden; background: var(--card); }
    .tpl-fig img { width: 100%; display: block; }

    /* research — two cards (text + map), verbatim Figma treatment */
    .research-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 2.4vw, 36px); align-items: start; }
    .research-grid > .card { min-width: 0; aspect-ratio: 1 / 1; }
    .research-text { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 88px); }
    .research-text h3 { font-weight: 600; font-size: clamp(20px, 2vw, 24px); line-height: 1.3; color: #000; margin-bottom: 16px; }
    .research-text p  { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }
    .research-text p + p { margin-top: 20px; }
    /* show the whole map within the square tile */
    .research-map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: clamp(20px, 4%, 48px); transform: translateY(var(--py, 0px)); will-change: transform; }
    @media (max-width: 860px) {
      .research-grid { grid-template-columns: 1fr; }
      .research-grid > .research-text { aspect-ratio: auto; }
    }

    /* two-column text + figure */
    .tcol { display: flex; gap: 48px; align-items: center; }
    .tcol-text { flex: 1 1 0; min-width: 0; }
    .tcol-text h3 { font-weight: 500; font-size: 24px; line-height: 1.3; color: #000; margin-bottom: 16px; }
    .tcol-text p  { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }
    .tcol-fig { flex: 1 1 0; min-width: 0; border-radius: 48px; overflow: hidden; background: var(--card); }
    .tcol-fig img { width: 100%; display: block; }

    /* three-column closing text */
    .cols3 { display: flex; gap: 24px; }
    .cols3 > div { flex: 1 1 0; min-width: 0; }
    .cols3 p { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }
    .cols3 p + p { margin-top: 20px; }

    @media (max-width: 860px) {
      .tpl-row { flex-direction: column; align-items: center; gap: 20px; }
      .tpl-row .u-label { flex: none; width: min(420px, 100%); }
      .tcol { flex-direction: column; align-items: stretch; gap: 28px; }
      .cols3 { flex-direction: column; gap: 32px; }
      /* Google App "Search & Input" cards become squares on mobile (image fills the crop) */
      .s5-cards .tpl-card-full { aspect-ratio: 1 / 1; }
      .s5-cards .tpl-card-full img { position: static; top: auto; width: 100%; height: 100%; object-fit: cover; object-position: center; transform: none; }
      /* Content-creation template/showcase cards show the WHOLE mock at natural shape
         (no square crop/zoom) — like the public-page galleries */
      .tpl-list .tpl-card-full, .card-stack .tpl-card-full { aspect-ratio: auto; border-radius: 24px; }
      .tpl-list .tpl-card-full img, .card-stack .tpl-card-full img { position: static; top: auto; width: 100%; height: auto; object-fit: contain; transform: none; }
      /* containers that stay rectangular on mobile get a softer radius (half the
         square tiles' 48px) so the corners don't feel oversized on short shapes */
      .tpl-card-static, .tpl-fig, .tcol-fig, .show-card, .s5-card, .tpl-card { border-radius: 24px; }
    }

    /* ══════════════════════════════════════════════════════
       SCROLL REVEAL — sections fade + rise as they enter the viewport.
       Progressive enhancement: hidden state only applies once JS adds .fx,
       so the page is fully visible if scripting is unavailable.
    ══════════════════════════════════════════════════════ */
    html.fx .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.16,.84,.44,1), transform .7s cubic-bezier(.16,.84,.44,1); will-change: opacity, transform; }
    html.fx .reveal.in { opacity: 1; transform: none; }
    @media (prefers-reduced-motion: reduce) { html.fx .reveal { opacity: 1; transform: none; transition: none; } }

    /* ══════════════════════════════════════════════════════
       SCROLL HEADER — back-home bar that slides in once you scroll
    ══════════════════════════════════════════════════════ */
    .topbar {
      position: fixed; top: 0; left: 0; right: 0; z-index: 200;
      transform: translateY(-100%); opacity: 0;
      transition: transform .4s cubic-bezier(.16,.84,.44,1), opacity .4s ease;
      background: rgba(255, 244, 234, 0.82);
      -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    .topbar.show { transform: translateY(0); opacity: 1; }
    .topbar-inner {
      display: flex; align-items: center; gap: 16px;
      max-width: 1435px; margin: 0 auto;
      padding: 12px clamp(20px, 4vw, 64px);
      text-decoration: none; color: #000;
    }
    .topbar-arrow {
      width: 36px; height: 36px; flex: none;
      display: flex; align-items: center; justify-content: center;
      border: 1px solid #000; border-radius: 9999px;
      transition: background-color .18s ease, box-shadow .18s ease;
    }
    .topbar-inner:hover  .topbar-arrow { background: rgba(151, 102, 18, 0.15); box-shadow: 0 6px 18px rgba(151, 102, 18, 0.18); }
    .topbar-inner:active .topbar-arrow { background: rgba(151, 102, 18, 0.24); }
    .topbar-title { font-weight: 600; font-size: 16px; line-height: 1.2; color: #000; }

    /* ══════════════════════════════════════════════════════
       RESPONSIVE — stacking breakpoints
    ══════════════════════════════════════════════════════ */
    /* tablet & below: stack the multi-column rows */
    @media (max-width: 860px) {
      /* hero: title FIRST (on top), phone cluster below and clipped to its box */
      .hero { aspect-ratio: auto; display: flex; flex-direction: column; }
      .hero-head { position: static; order: 1; width: auto; padding: 28px 24px 28px; }
      .hero-head > .hero-sub, .hero-head > .chips { margin-left: 0; }
      .visuals {
        position: relative; inset: auto; order: 2;
        width: 100%; aspect-ratio: 1311 / 650;
        overflow: hidden;
      }
      /* content-creation hero: show the whole collage big, full-width at its natural
         height (was an absolute, bottom-anchored 86% image inside a short box) */
      .visuals:has(> .hero-collage) { aspect-ratio: auto; overflow: visible; }
      .hero-collage { position: relative; left: auto; bottom: auto; width: 100%; height: auto; transform: none; }

      .intro { flex-direction: column; align-items: stretch; gap: 40px; }
      .process { flex-direction: column; gap: 56px; }

      /* unique rows: label card matches the mock cards — full width, square,
         with the same text size as the desktop breakpoint (not shrunk) */
      .u-row { flex-direction: column; align-items: center; gap: 20px; }
      .u-label { flex: none; width: 100%; aspect-ratio: 1 / 1; border-radius: 48px; }
      .u-label p { font-size: 24px; }
      .u-tile  { flex: none; width: 100%; aspect-ratio: 1 / 1; }
    }

    /* ══════════════════════════════════════════════════════
       PASSWORD GATE (client-side — light protection only)
    ══════════════════════════════════════════════════════ */
    .gate {
      position: fixed; inset: 0; z-index: 9999;
      background: var(--bg);
      display: flex; align-items: center; justify-content: center; padding: 24px;
    }
    html.unlocked .gate    { display: none; }
    html:not(.unlocked) body  { overflow: hidden; }
    html:not(.unlocked) .page { visibility: hidden; }
    .gate-card {
      background: var(--card); border-radius: 24px;
      padding: clamp(32px, 5vw, 48px); width: 420px; max-width: 100%;
      display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
    }
    .gate-lock { width: 44px; height: 44px; color: var(--chip-text); }
    .gate-card h1 { font-size: 22px; font-weight: 600; color: #000; }
    .gate-card p  { font-size: 15px; color: var(--muted); line-height: 1.5; }
    .gate-form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 8px; }
    .gate-input {
      width: 100%; padding: 12px 16px; border: 1px solid #b0b0b0;
      border-radius: 12px; font: inherit; font-size: 16px; background: #fff;
    }
    .gate-input:focus { outline: none; border-color: var(--chip-text); box-shadow: 0 0 0 3px rgba(151,102,18,0.15); }
    .gate-btn {
      padding: 12px 16px; border: none; border-radius: 12px;
      background: var(--chip-text); color: #fff; font: inherit; font-size: 16px; font-weight: 600;
      cursor: pointer; transition: background-color .18s ease, transform .12s ease;
    }
    .gate-btn:hover  { background: #7d530f; }
    .gate-btn:active { transform: scale(0.97); }
    .gate-error { color: #c0392b; font-size: 14px; min-height: 18px; }

/* ============================================================
   META / Design Systems page components (added 2026-06-17)
   ============================================================ */

/* Meta hero — gradient "spatial" room background + Store screenshot */
.hero-meta { background-size: cover; background-position: center; }
.hero-store {
  position: absolute; left: 40.05%; top: 17.7%; width: 51.65%; height: auto;
  border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  transform: translateY(var(--py, 0px)); will-change: transform;
}

/* Auto-advancing carousel — a horizontal marquee of card strips that loops seamlessly.
   The strip PNG is padded on the right by one inter-card gap, then duplicated; the track
   translates -50% so copy 2 lands exactly where copy 1 began. */
/* full-bleed: break out of the .page padding/max-width to span the whole viewport */
.carousel { overflow: hidden; width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }
.carousel-track { display: flex; width: max-content; animation: carousel-scroll var(--cdur, 42s) linear infinite; }
/* individual rounded cards (transparent corners) with an even trailing gap on every card,
   so duplicating the set and translating -50% loops seamlessly with consistent spacing */
.carousel-track img { display: block; height: clamp(260px, 36vw, 440px); width: auto; margin-right: clamp(16px, 1.4vw, 24px); cursor: zoom-in; }
.carousel:hover .carousel-track { animation-play-state: paused; }
@keyframes carousel-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .carousel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .carousel-track { animation: none; width: auto; }
  .carousel-track .dup { display: none; }   /* drop the loop duplicates; show one scrollable set */
}

/* Lightbox — click a carousel image to view it zoomed over a dimmed backdrop */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 60px);
  background: rgba(20, 14, 6, 0.88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility .28s ease;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: min(1200px, 94vw); max-height: 90vh; width: auto; height: auto;
  border-radius: clamp(20px, 2.4vw, 40px); box-shadow: 0 32px 90px rgba(0, 0, 0, .55);
  cursor: default; transform: scale(.96); transition: transform .28s ease;
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: clamp(14px, 3vw, 28px); right: clamp(14px, 3vw, 28px);
  width: 46px; height: 46px; border: none; border-radius: 9999px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color .15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox img { transition: none; }
  .lightbox img { transform: none; }
}

/* ── Public project pages (Experience case studies) ─────
   Reuse the case-study hero system: .card.hero + .hero-head (absolute, top-left)
   + .hero-titlerow / .hero-sub, so the arrow, title and spacing ramp match
   Meta / Google App / Content Creation exactly. The hero composite is anchored
   to the bottom and bleeds off it, masked by the card's overflow:hidden. */
/* taller than the 2:1 case-study hero so the squarer composites sit BELOW the
   head (clear top-left) and bleed off the bottom, masked by the card */
.pp-page { gap: clamp(40px, 5vw, 80px); }    /* tighter section rhythm than the dense case studies */
.pp-hero { aspect-ratio: 8 / 5; }
.pp-hero .visuals { aspect-ratio: 8 / 5; }   /* used on mobile; desktop .visuals is absolute-filled */
.pp-hero-collage {
  position: absolute; left: 50%; bottom: -22px;
  height: 72%; width: auto; max-width: 100%;
  transform: translateX(-50%) translateY(var(--py, 0px));
  will-change: transform;
}
.pp-intro { font-weight: 400; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.5; color: var(--muted); max-width: 32em; }
.hero-head > .pp-intro { margin-left: calc(48px + var(--titlegap)); }

.pp-blocks {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3.4vw, 56px);
}
.pp-block-label {
  font-size: clamp(13px, 1.1vw, 15px); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--chip-text);
  margin: 0 0 16px;
}
.pp-block p { font-size: clamp(15px, 1.15vw, 17px); line-height: 1.62; color: var(--text); margin: 0; }

/* gallery: each screenshot sits in a square cream tile, like the rest of the site */
/* gallery: a grid that keeps each shot in a container matching its shape —
   square shots in 1/3-width square tiles, wide shots in 1/2-width landscape tiles
   (their natural aspect, set inline per image). 6-col base so both fit cleanly. */
.pp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(16px, 1.6vw, 24px); grid-auto-flow: dense; }
.pp-shot { grid-column: span 2; aspect-ratio: 1 / 1; background: var(--card); border-radius: 48px; overflow: hidden; }   /* square: 1/3 width */
/* big/wide shots take the FULL content width, shown whole (aspect-ratio set inline to the image) */
.pp-shot--wide, .pp-shot--full { grid-column: 1 / -1; }
/* square tiles: screenshot fills the tile, flush to the bottom (masked) */
.pp-shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: center bottom;
  display: block; cursor: zoom-in;
}
/* full-width tiles show the whole image (no crop) */
.pp-shot--wide img, .pp-shot--full img { object-fit: contain; object-position: center; }

/* shared footer (homepage carries an inline copy of these rules) */
.site-footer { text-align: center; padding: clamp(28px, 5vw, 64px) 0 32px; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(0,0,0,0.18); }
.site-footer a:hover { color: var(--text); }

@media (max-width: 860px) {
  .pp-hero { aspect-ratio: auto; }
  .pp-blocks { grid-template-columns: 1fr; gap: 32px; }
  .hero-head > .pp-intro { margin-left: 0; }
  /* hero: show the whole mock big — collage fills the width at its natural height
     (the 8/5 box + height-sized collage made it tiny on phones) */
  .pp-hero .visuals { aspect-ratio: auto; }
  .pp-hero-collage { position: relative; left: auto; bottom: auto; width: 100%; height: auto; max-width: 100%; transform: none; }
  /* gallery: 1-up, each shot shown WHOLE at its natural shape — no square crop/zoom,
     so the full template mock is visible */
  .pp-grid { grid-template-columns: 1fr; gap: 20px; }
  .pp-shot, .pp-shot--wide, .pp-shot--full { grid-column: 1 / -1; aspect-ratio: auto !important; border-radius: 24px; }
  .pp-shot img { height: auto; object-fit: contain; object-position: center; }
}

/* Two-card section image that FILLS its square tile (vs research-map which contains) */
.research-grid > .rg-img { overflow: hidden; }
.research-grid > .rg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Expressive patterns — text card + image cards in a 2-col grid */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 2.4vw, 28px); margin-top: clamp(28px, 4vw, 48px); }
.exp-grid > .card { aspect-ratio: 1 / 1; min-width: 0; }
.exp-text { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 56px); }
.exp-text h2 { font-weight: 500; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; color: #000; margin-bottom: 16px; }
.exp-text p  { font-weight: 400; font-size: 16px; line-height: 26px; color: #000; }
.exp-img { overflow: hidden; }
.exp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) {
  .exp-grid { grid-template-columns: 1fr; }
  .exp-grid > .exp-text { aspect-ratio: auto; }
}

/* Impact stats row — big number + label + sub */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(28px, 4vw, 48px); }
.stat-num { font-weight: 600; font-size: clamp(38px, 5.4vw, 72px); line-height: 1.05; letter-spacing: -0.02em; color: #000; }
.stat-label { font-weight: 600; font-size: 16px; color: #000; margin-top: 20px; }
.stat-sub { font-weight: 400; font-size: 16px; line-height: 26px; color: var(--muted); margin-top: 8px; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; gap: 36px 24px; } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* larger section heading inside a two-card text tile (Meta DS sections) */
.research-text h2 { font-weight: 500; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; color: #000; margin-bottom: 20px; }
/* text-style stat (e.g. "Shipped in Meta Quest") sits smaller than numeric stats */
.stat-num.sm { font-size: clamp(26px, 3.2vw, 44px); }

/* Meta overview — animated Quest orb: gradient circle pulses + drifts, headset floats inside.
   Replaces the flat baked headset.png so the layers can move independently. */
.ms-orb {
  position: relative; width: min(420px, 100%); aspect-ratio: 1 / 1;
  border-radius: 9999px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;   /* centre the headset robustly (no top:50% / calc) */
  background: radial-gradient(circle at 30% 74%, #b921fb 0%, #963efc 25%, #725bfd 50%, #4e78fe 75%, #2a95ff 100%);
  background-size: 138% 138%;
  background-position: 50% 50%;
  animation: ms-orb-pulse 6s ease-in-out infinite, ms-orb-drift 15s ease-in-out infinite;
  will-change: transform, background-position;
}
.ms-headset {
  width: 66%; height: auto;
  animation: ms-headset-float 5s ease-in-out infinite;   /* pure-px bob, no mixed calc */
  will-change: transform;
}
@keyframes ms-orb-pulse  { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes ms-orb-drift  { 0%, 100% { background-position: 42% 60%; } 50% { background-position: 60% 42%; } }
@keyframes ms-headset-float {
  0%, 100% { transform: translateY(-11px); }
  50%      { transform: translateY(11px); }
}
@media (prefers-reduced-motion: reduce) {
  .ms-orb { animation: none; }
  .ms-headset { animation: none; transform: none; }
}

/* ── Meta page — mobile refinements (≤860px) ──────────── */
@media (max-width: 860px) {
  /* ensure the Meta hero stacks (title first, then the Store panel) */
  .hero.hero-meta { display: flex; flex-direction: column; aspect-ratio: auto; }
  .hero-meta .hero-head { order: 1; }
  .hero-meta .visuals { order: 2; }
  /* Hero: make the Store panel the focus — large & centred; container grows to fit it */
  .hero-meta .visuals {
    aspect-ratio: auto; height: auto; overflow: visible;
    display: flex; align-items: center; justify-content: center;
    padding: 4px 0 clamp(24px, 6vw, 44px);
  }
  .hero-meta .hero-store {
    position: static; transform: none; width: 92%; max-width: 600px; height: auto;
  }
  /* Keep the blurb tiles square — but let them grow if the copy is long, never clip */
  .research-grid > .research-text.sq,
  .exp-grid > .exp-text.sq { aspect-ratio: 1 / 1; overflow: visible; }
  .research-text.sq p, .exp-text.sq p { font-size: 15px; line-height: 23px; }
  /* "The next system" tile becomes a square on mobile */
  .ms-next-card { aspect-ratio: 1 / 1; }
  .ms-next-card img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
}

/* ═══════════════════════════════════════════════════════════
   HERO STACKING — kick in early (≤1280px) for the collage /
   phone-cluster heroes so the head (title + chips) NEVER overlaps
   the hero artwork. The compact desktop overlay only has vertical
   room above 1280px; below it we stack: head on top, artwork below
   (centred + width-capped so it isn't oversized on laptops).
   Meta's text-over-photo hero is intentionally excluded.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .hero:not(.hero-meta) { aspect-ratio: auto; display: flex; flex-direction: column; }
  .hero:not(.hero-meta) .hero-head {
    position: static; order: 1; width: auto; padding: 28px clamp(20px, 4vw, 40px);
  }
  .hero:not(.hero-meta) .hero-head > .hero-sub,
  .hero:not(.hero-meta) .hero-head > .chips,
  .hero:not(.hero-meta) .hero-head > .pp-intro { margin-left: 0; }

  /* google-app phone cluster keeps its framed box ratio, just moved below the head */
  .hero:not(.hero-meta) .visuals {
    position: relative; inset: auto; order: 2; width: 100%; transform: none;
    aspect-ratio: 1311 / 650; overflow: hidden;
  }
  /* content-creation cascade + public-project collage: show the whole image,
     centred and width-capped so it reads as a hero without overlapping the head */
  .hero:not(.hero-meta) .visuals:has(> .hero-collage),
  .pp-hero .visuals { aspect-ratio: auto; overflow: visible; }
  .hero-collage {
    position: relative; left: auto; bottom: auto; transform: none;
    width: 100%; max-width: 760px; height: auto; margin-inline: auto;
  }
  .pp-hero { aspect-ratio: auto; }
  .pp-hero-collage {
    position: relative; left: auto; bottom: auto; transform: none;
    width: 100%; max-width: 680px; height: auto; margin-inline: auto;
  }
}
