/* ==========================================================================
   Responsive — phone layout (< 760px)
   Keep this breakpoint in sync with CB.config.mobileQuery in js/config.js
   ========================================================================== */

/* Not enough room for all 7 header links: use the hamburger only */
@media (max-width: 1099px) {
  .nav__link { display: none; }
}

@media (max-width: 759px) {

  /* Header & menu */
  .nav__link { display: none; }
  .menu { grid-template-columns: minmax(0, 1fr); }
  .menu__preview { display: none; }

  /* Hero */
  /* bigger cards, centred a little lower so the hero fills the whole screen */
  .hero__stage { --hy: 47vh; --hh: min(52vw, 31vh); --hw: calc(var(--hh) * 0.77); }
  /* heading sits a fixed distance above the front card, so it never runs under the header */
  .hero__title-wrap { bottom: calc(100vh - var(--hy) + var(--hh) * .55 + 5.6vh); }
  .hero__title { font-size: min(10.2vw, 5.4vh); }
  .hero__title .r-line { display: inline; }
  /* paragraph + CTAs anchored to the bottom edge so the hero fills the screen */
  /* sits right under the deck controls */
  .hero__sub { top: calc(var(--hy) + var(--hh) * .58 + 8.4vh); bottom: auto; }
  .scroll-hint { left: 50%; right: auto; top: auto; bottom: 18px; transform: translateX(-50%); flex-direction: row; gap: 10px; }
  .scroll-hint::before { display: none; }
  .scroll-hint__text { display: none; }
  .scroll-hint__mouse { width: 16px; height: 24px; border-radius: 9px; }
  .scroll-hint__mouse span { top: 5px; height: 5px; }
  .scroll-hint__text { font-size: 12px; }
  .hero__sub p { font-size: 16px; }
  .hero__sub .cta-row { margin-top: 24px; gap: 10px; }
  /* tags sit in the gap between heading and cards, never on the cards */
  .hero__chip--coplin { left: 7vw;  top: calc(var(--hy) - var(--hh) * .55 - 4.4vh); z-index: 140; }
  .hero__chip--andrea { right: 7vw; top: calc(var(--hy) - var(--hh) * .55 - 3.4vh); z-index: 140; }

  /* Showcase */
  .showcase { top: 12vh; width: calc(100vw - 40px); }
  .showcase__chip--howard { left: 6vw;  top: 58vh; }
  .showcase__chip--robin  { left: 66vw; top: 64vh; }

  /* Vision */
  .vision__panel {
    left: 4vw;
    top: 10vh;
    width: 92vw;
    height: 86vh;
    clip-path: inset(calc(40vh * var(--v)) 0 0 0 round 22px);
  }
  .folder { left: 4vw; width: 92vw; }
  .folder--top { top: 37vh; }
  .folder--tab { top: 43vh; }
  .vision__copy { top: 11vh; width: calc(100vw - 40px); }
  .vision__copy .lead,
  .vision-icon { display: none; }

  /* Gallery feature panel */
  .gallery__stage {
    --gal-scale: 0.351;
    --gal-side: 11vw;
    --gal-side-2: 1.1vw;
    --gal-r: 30px;
    --gal-r-2: 12px;
    --gal-ov-left: 12.1vw;
    --gal-ov-width: 67.8vw;
    --gal-ov-size: 22px;
  }
}

/* Hero service cards on phones: swipeable deck (js/service-modal.js) */
@property --d   { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --dxn { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --ox { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --oy { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --or { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --os { syntax: '<number>'; inherits: false; initial-value: 1; }
@media (max-width: 759px) {
  .hero-card {
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    opacity: calc(1 - var(--fa) * clamp(0, var(--d) - 4, 1));
    touch-action: pan-y;
    transition: --ox .8s cubic-bezier(.19, 1, .22, 1), --oy .8s cubic-bezier(.19, 1, .22, 1), --or .8s cubic-bezier(.19, 1, .22, 1), --os .8s cubic-bezier(.19, 1, .22, 1), --dxn .45s cubic-bezier(.19, 1, .22, 1), opacity .5s ease;
  }
  .hero-card.is-dragging { transition: --ox .8s cubic-bezier(.19, 1, .22, 1), --oy .8s cubic-bezier(.19, 1, .22, 1), --or .8s cubic-bezier(.19, 1, .22, 1), --os .8s cubic-bezier(.19, 1, .22, 1), opacity .5s ease; }
  .hero-card.is-returning { transition: --ox .8s cubic-bezier(.19, 1, .22, 1), --oy .8s cubic-bezier(.19, 1, .22, 1), --or .8s cubic-bezier(.19, 1, .22, 1), --os .8s cubic-bezier(.19, 1, .22, 1), opacity .5s ease; }
  .hero-card, .hero-card:hover { --hv: 0; -webkit-tap-highlight-color: transparent; }
  .hero-card.is-front { box-shadow: 0 22px 44px rgba(0, 0, 0, .18); }
  .hero-card__num { display: inline; }
  .hero-card__title { inset: 9% 10% auto; font-size: max(11px, calc(var(--hw) * .066)); }
  .hero-card__arrow { display: none; }

  .deck-nav {
    position: absolute;
    left: 50%;
    top: calc(var(--hy) + var(--hh) * .58 + 3.6vh);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translate(-50%, -50%);
    opacity: calc(var(--t) * (1 - var(--a) * 3));
  }
  .deck-nav button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-line);
    border-radius: 50%;
    background: #fff;
    color: var(--c-ink);
    font-size: 14px;
  }
  .deck-count { min-width: 52px; text-align: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--c-muted); }
}
@media (min-width: 760px) { .deck-nav { display: none; } }
@media (max-width: 759px) {
  .hero__chip { padding: 6px 12px; font-size: 12px; }
  /* after the hero, cards leave the deck and cascade in their natural order */
  .hero__stage.is-cascade .hero-card { z-index: var(--zc) !important; opacity: 1; }
}

/* Short phones: keep everything on one screen */
@media (max-width: 759px) and (max-height: 700px) {
  .hero__stage { --hy: 48vh; --hh: min(54vw, 32vh); }
  .hero__sub { bottom: 58px; }
  .scroll-hint { bottom: 12px; }
  .hero__title { font-size: 9.4vw; }
  .hero__sub p { font-size: 15px; }
  .hero__sub .cta-row { margin-top: 16px; }
}
