/* ==========================================================================
   Apurva Amin Architects — responsive.css
   Loaded after main.css. main.css = the exact 1920 desktop design.
   This file adapts it to every other screen:

     R1  shared fixes (all widths, all browsers)
     R2  desktop ≥1201      (full-height sidebar / contact column, dvh)
     R2b desktop 1201–1439  (laptops, iPad Pro landscape, small monitors)
     R3  mobile  ≤1200      (phones + tablets — Figma iPhone 16 Pro 402 frame)
     R4  tablet  600–1200   (iPad portrait/landscape, big phones landscape)
     R5  small   ≤599       (phones)

   Rules of the layout:
     · Left column = max(420px, 25%) → logo (ends x=373) and the longest
       sidebar item (ends x=329) can never overlap images/text.
     · Squares (cards, project thumb) stay 500px whenever there is room,
       shrink only when two of them + 50px gap don't fit.
     · No image is cropped by the layout except the fixed-ratio slots of
       the design (squares, full-screen home / landing image). For those,
       upload the "Mobile image" in the backend.
   ========================================================================== */

/* ============================ R1  SHARED ============================== */

/* Safety net: nothing may ever create a sideways scroll
   (clip keeps position:sticky/fixed working; hidden = old Safari fallback) */
html {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html {
    overflow-x: clip;
  }
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* <picture> wrapper (desktop + mobile image) must not affect layout */
.aaa-pic {
  display: contents;
}

/* Square slots: 500px at 1920, proportional above, never squeezed below
   two columns + 50px gap (see --card in variables.css). */
.card-grid,
.gallery-grid__list {
  grid-template-columns: repeat(2, var(--card));
}

.project__intro {
  column-gap: var(--gap);
}

.project__intro-left {
  flex: 0 1 var(--intro-left);
  width: auto;
}

.project__thumb {
  flex: 0 0 var(--card);
  width: var(--card);
}

/* ======================== R2  DESKTOP ≥ 1201 ========================= */
@media (min-width: 1201px) {

  /* Sidebar column = real flex column: logo zone on top, nav pushed to the
     bottom (52px, as Figma). If the window is too short the column scrolls
     instead of hiding items (Healthcare / Footprints were cut before).
     100dvh = the visible height, also with Safari/iPad toolbars. */
  .inner-sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: calc(var(--logo-top) + var(--logo-h) + 40px) 0 var(--side-bottom);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .inner-sidebar::-webkit-scrollbar {
    display: none;
  }

  .side-nav {
    position: static;
    margin-top: auto;
    padding: 0 20px 0 var(--pad-x);
  }

  /* Contact column: same idea, info block bottom-anchored */
  .contact__left {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-top: calc(var(--logo-top) + var(--logo-h) + 40px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .contact__left::-webkit-scrollbar {
    display: none;
  }

  .contact__info {
    position: static;
    margin-top: auto;
    padding: 0 20px 57.5px var(--pad-x);
  }

  /* full-height images = visible height */
  .landing-media,
  .footprints {
    height: 100vh;
    height: 100dvh;
  }

  @supports (height: 100dvh) {
    .lightbox {
      --lb-sw: min(var(--lb-w), calc((100dvh - 230px) * 1.777778));
    }
  }
}

@media (min-width: 1201px) and (max-height: 640px) {

  /* very short windows: tighter nav */
  .side-nav__list {
    gap: 14px;
  }
}

/* ===================== R2b DESKTOP 1201 – 1439 ======================= */
@media (min-width: 1201px) and (max-width: 1439px) {

  /* About: give the text column a bit more room */
  .about__media {
    flex-basis: 48%;
    width: 48%;
  }

  .about__text {
    flex-basis: 47%;
    width: 47%;
  }

  /* Team: fewer, larger portraits per row */
  .team__tier--a {
    grid-template-columns: repeat(3, 30.5%);
  }

  .team__tier--b {
    grid-template-columns: repeat(4, 22%);
  }

  .team__tier--c {
    grid-template-columns: repeat(5, 18%);
  }

  /* Footprints: map + list share the narrower band */
  .footprints__map {
    left: 4%;
    width: 52%;
  }

  .footprints__list-wrap {
    left: 62%;
    width: 34%;
  }

  .footprints__more {
    left: min(208px, calc(100% - 30px));
  }

  /* Awards: year column min width */
  .awards__year {
    flex-basis: max(var(--award-year), 110px);
  }

  .awards__title {
    flex: 1 1 auto;
  }
}

/* ========================= R3  MOBILE ≤ 1200 ========================= */
@media (max-width: 1200px) {

  /* ---------- SMART STICKY HEADER (all pages except home) ----------
     White bar fixed to the top + logo on it. Height includes the iPhone
     notch / status-bar area, so content never shows above the bar.
     Scroll down → bar + logo slide up (html.is-header-hidden).
     Scroll up   → they slide back. Hairline once scrolled (is-scrolled). */
  .aaa-logo,
  .inner-sidebar .aaa-logo,
  .contact__left .aaa-logo {
    position: fixed;
    top: var(--logo-top);
    left: var(--pad-x);
    z-index: 30;
  }

  .lightbox .aaa-logo {
    position: absolute;
  }

  .aaa-logo svg,
  .aaa-logo img {
    height: var(--logo-h);
  }

  body:not(.is-home)::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 25;
    height: var(--m-head);
    background: var(--c-bg);
    pointer-events: none;
  }

  body:not(.is-home)::before,
  body:not(.is-home) .aaa-logo {
    transform: translate3d(0, 0, 0);
    transition: transform .3s var(--ease), box-shadow var(--dur) var(--ease);
    will-change: transform;
  }

  html.is-scrolled body:not(.is-home)::before {
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  }

  /* hidden state: bar + logo move up by the full header height */
  html.is-header-hidden body:not(.is-home)::before,
  html.is-header-hidden body:not(.is-home) .aaa-logo {
    transform: translate3d(0, calc(-1 * var(--m-head) - 4px), 0);
    box-shadow: none;
  }

  /* the lightbox has its own logo — never moves */
  html.is-header-hidden body:not(.is-home) .lightbox .aaa-logo,
  body:not(.is-home) .lightbox .aaa-logo {
    transform: none;
    transition: none;
  }

  /* anchor jumps land below the header */
  html {
    scroll-padding-top: var(--m-head);
  }

  @media (prefers-reduced-motion: reduce) {

    body:not(.is-home)::before,
    body:not(.is-home) .aaa-logo {
      transition: none;
    }
  }

  /* ---------- HOME: image + bottom bar PROJECTS · ABOUT · CONTACT ----------
     image 0 → (100% − 46), bar 46px white, Inter Regular 14 #7F7F7F,
     centred, 41.4px apart. */
  .home-slider {
    height: calc(100vh - var(--m-home-bar) - env(safe-area-inset-bottom, 0px));
    height: calc(100svh - var(--m-home-bar) - env(safe-area-inset-bottom, 0px));
  }

  .site-nav {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    height: calc(var(--m-home-bar) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-bg);
  }

  .site-nav__list {
    gap: 41.4px;
    align-items: center;
  }

  .site-nav__list a {
    font-size: 14px;
    line-height: 17px;
    font-weight: var(--fw-regular);
    letter-spacing: 0;
    margin-right: 0;
    color: var(--c-soft);
  }

  .site-nav__list .sub-menu {
    display: none;
  }

  .home-slider__arrow--prev {
    left: 8px;
  }

  .home-slider__arrow--next {
    right: 8px;
  }

  .home-slider__dots {
    bottom: 20px;
  }

  /* ---------- SIDEBAR SHELL ----------
     Landing (Projects / Architecture / About): list at top (Light 20,
     pitch 41), image full width at the bottom (natural ratio, no crop).
     Listing / about sub-pages: list hidden (Figma shows only the logo). */
  .inner {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    min-height: 100svh;
    align-content: space-between;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .page-id-321 .inner {
    display: flex;
    flex-direction: column;
  }

  .inner-sidebar,
  .contact__left {
    position: static;
    width: 100%;
    height: auto;
    background: transparent;
    z-index: auto;
  }

  .side-nav {
    position: static;
    padding: calc(var(--m-head) + 33.7px) var(--pad-x) 40px;
  }

  .side-nav.has-active {
    display: none;
  }

  .side-nav__list {
    gap: 17px;
  }

  .side-nav__item a,
  .side-nav.has-active .side-nav__item a {
    font-size: 20px;
    line-height: 24px;
    color: var(--c-soft);
    white-space: normal;
  }

  /* Product Design (opens its first category directly): with more than
     one category, keep a compact category switcher above the products. */
  .is-svc-first .side-nav.has-active {
    display: block;
    padding: calc(var(--m-head) + 20px) var(--pad-x) 0;
  }

  .is-svc-first .side-nav.has-active .side-nav__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 22px;
  }

  .is-svc-first .side-nav.has-active .side-nav__item a {
    font-size: 16px;
    line-height: 20px;
    color: var(--c-muted);
  }

  .is-svc-first .side-nav.has-active .side-nav__item.is-active a {
    color: var(--c-soft);
  }

  .is-svc-first .listing.inner__band {
    padding-top: 40px;
  }

  .inner__main,
  .contact__media {
    margin-left: 0;
    max-width: 100%;
    width: 100%;
  }

  /* landing pages: list at the top, image at the bottom of the screen
     (.is-landing body class = works in browsers without :has too) */
  .is-landing .inner__main,
  .inner__main:has(> .landing-media) {
    margin-top: auto;
  }

  /* landing images: full width, natural height → never cropped */
  .landing-media,
  .contact__media .landing-media {
    height: auto;
  }

  .landing-media .aaa-media,
  .landing-media img,
  .landing-media video {
    height: auto;
  }

  .inner__band {
    padding: var(--content-top) var(--pad-x) var(--page-bottom);
  }

  /* ---------- CATEGORY LISTING (Houses / Hinchko) ----------
     cards 372² from top 100, caption Light 16, 421 pitch.
     Hinchko header: title Light 20 · sub Light 16 · desc 16/22. */
  .card-grid {
    grid-template-columns: 1fr;
    row-gap: 22.8px;
  }

  .card__title {
    margin-top: 6.2px;
    font-size: 16px;
    line-height: 20px;
  }

  .listing.inner__band {
    padding-bottom: 58px;
  }

  .listing__head {
    margin-bottom: 50px;
  }

  .listing__title {
    font-size: 20px;
    line-height: 24px;
  }

  .listing__subtitle {
    margin-top: 18.4px;
    font-size: 16px;
    line-height: 22px;
  }

  .listing__desc {
    margin-top: 18.6px;
    font-size: 16px;
    line-height: 22px;
  }

  .listing__desc>*+* {
    margin-top: 19.5px;
  }

  /* ---------- INTERIOR / LANDSCAPE GRID ----------
     150² squares, 2 per row (x 15 / 237), rows 30 apart, top 100. */
  .gallery-grid {
    padding: var(--content-top) var(--pad-x) 62px;
  }

  .gallery-grid__list {
    grid-template-columns: repeat(2, 40.3226%);
    row-gap: 30px;
  }

  /* ---------- LIGHTBOX ----------
     Stage = the whole free area between the logo bar and the thumb strip.
     The image is "contain"-fitted inside it, so landscape AND portrait
     images get the full width / height they can use — never cropped,
     no square box with empty sides any more.
     thumbs 45² 6 apart, 15 from the bottom, active = 1px black frame.
     Swipe to change. Landscape phones / tablets: see R11. */
  .lightbox {
    --lb-head: calc(var(--logo-top) + var(--logo-h) + 24px);
    --lb-strip-h: 45px;
    --lb-strip-b: calc(15px + env(safe-area-inset-bottom, 0px));
    --lb-strip-gap: 20px;
    --lb-stage-b: calc(var(--lb-strip-b) + var(--lb-strip-h) + var(--lb-strip-gap));
    --lb-side: var(--pad-x);
    overscroll-behavior: contain;
    touch-action: none;
    /* page behind never scrolls → Safari bars don't jump */
  }

  .lightbox__stage {
    top: var(--lb-head);
    right: var(--lb-side);
    bottom: var(--lb-stage-b);
    left: var(--lb-side);
    width: auto;
    height: auto;
    aspect-ratio: auto;
    transform: none;
  }

  .lightbox__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .lightbox__arrow {
    display: none;
  }

  .lightbox__close {
    top: calc(var(--logo-top) + var(--logo-h, 12px) / 2 - 12px);
    left: auto;
    right: var(--pad-x);
    color: var(--c-black);
  }

  .lightbox__strip {
    top: auto;
    bottom: var(--lb-strip-b);
    left: var(--pad-x);
    right: 0;
    width: auto;
    transform: none;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
  }

  .lightbox__thumbs {
    gap: 6px;
    padding: 0;
  }

  .lightbox__thumb {
    width: var(--lb-strip-h);
    height: var(--lb-strip-h);
    outline: 0;
    border: 1px solid transparent;
  }

  .lightbox__thumb:not(.is-active) {
    border: 0;
  }

  .lightbox__thumb.is-active {
    padding: 1px;
    border-color: var(--c-black);
  }

  /* ---------- PROJECT / PRODUCT ----------
     project: banner full width under the logo bar · title Light 20 ·
     details: label Medium 16, value Light 16, line 22 · thumb 372² ·
     images full width 24 apart · back 18px icon + BACK Regular 16.
     product: square image at the top instead of the banner. */
  .project--has-banner .project__banner {
    margin-top: var(--m-head);
  }

  .project__body,
  .project--no-banner .project__body {
    padding: 0 var(--pad-x) 90px;
  }

  .project--no-banner .project__body {
    padding-top: var(--m-head);
  }

  .project__intro {
    flex-direction: column;
    gap: 0;
  }

  .project__intro-left {
    flex: 0 0 auto;
    width: 100%;
    gap: 43.5px;
    justify-content: flex-start;
  }

  .project__title {
    margin-top: 19.7px;
    font-size: 20px;
    line-height: 24px;
    font-weight: var(--fw-light);
  }

  .project__details {
    gap: 12px;
    margin-bottom: 0;
  }

  .project__detail-title {
    font-size: 16px;
    line-height: 22px;
  }

  .project__detail-text {
    margin-top: 2px;
    font-size: 16px;
    line-height: 22px;
  }

  .project__thumb {
    width: 100%;
    flex: 0 0 auto;
    margin-top: 22.8px;
  }

  .project--no-banner .project__thumb {
    order: -1;
    width: calc(100% + 2 * var(--pad-x));
    margin: 0 calc(-1 * var(--pad-x));
  }

  .project--no-banner .project__title {
    margin-top: 23.7px;
  }

  .project--no-banner .project__intro-left {
    gap: 47.9px;
  }

  .project__gallery {
    gap: 24px;
    margin-top: 24px;
  }

  .grow--pair {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .grow--single .grow__col {
    width: 100%;
  }

  .project__foot {
    margin-top: 24px;
  }

  .back-link {
    gap: 7.3px;
    font-size: 16px;
    line-height: 20px;
  }

  .back-link svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .back-link span {
    top: 0;
  }

  /* ---------- ABOUT (AAA / Practice / Apurva Amin) ----------
     image full width at top 54 · text 15px sides, Light 16 / 22,
     paragraphs 20 apart. */
  .about.inner__band {
    padding: var(--m-media-top) 0 81px;
  }

  .about {
    flex-direction: column;
    gap: 0;
  }

  .about__media {
    width: 100%;
    flex: 0 0 auto;
  }

  .about__text {
    width: 100%;
    flex: 0 0 auto;
    padding: 21.7px var(--pad-x) 0;
  }

  .about__name {
    font-size: 20px;
    line-height: 24px;
  }

  .about__role {
    margin-top: 3.4px;
    font-size: 16px;
    line-height: 22px;
  }

  .about__name+.about__body,
  .about__role+.about__body {
    margin-top: 24.1px;
  }

  .about__body {
    font-size: 16px;
    line-height: 22px;
  }

  /* ---------- TEAM ----------
     group photo full width (natural ratio, no crop) · 1 × 372×313 ·
     2 × 150² · 3 × 100² · captions Regular 16 / 15 / 14. */
  .team.inner__band {
    padding: var(--m-media-top) var(--pad-x) 60px;
  }

  .team__group {
    margin: 0 calc(-1 * var(--pad-x));
  }

  .team__group img {
    width: 100%;
    height: auto;
  }

  .team__tier--a {
    margin-top: 50px;
    grid-template-columns: 1fr;
    row-gap: 22.8px;
  }

  .team__tier--b {
    margin-top: 65.8px;
    grid-template-columns: repeat(2, 40.3226%);
    row-gap: 22px;
  }

  .team__tier--c {
    margin-top: 65px;
    grid-template-columns: repeat(3, 26.8817%);
    row-gap: 22.1px;
  }

  .team__tier--a .team__cap {
    margin-top: 6.2px;
    font-size: 16px;
    line-height: 20px;
  }

  .team__tier--b .team__cap {
    margin-top: 5px;
    font-size: 15px;
    line-height: 21px;
  }

  .team__tier--c .team__cap {
    margin-top: 4.9px;
    font-size: 14px;
    line-height: 20px;
  }

  /* ---------- AWARDS ----------
     year Light 16 ls 1.6 · title Light 16 · line 19 · 47 between rows. */
  .awards.inner__band {
    padding: calc(var(--m-head) + 61.5px) var(--pad-x) 81px;
  }

  .awards__list {
    padding-top: 0;
  }

  .awards__year {
    flex: 0 0 101px;
    font-size: 16px;
    line-height: 19px;
    letter-spacing: 1.6px;
  }

  .awards__title {
    flex: 1 1 auto;
    font-size: 16px;
    line-height: 19px;
  }

  /* ---------- FOOTPRINTS ----------
     map full width from top 92 · dots 4px · list under the map:
     state Medium 16, cities Light 16. */
  .footprints {
    height: auto;
    min-height: 0;
    padding: calc(var(--m-head) + 42px) var(--pad-x) 42px;
    overflow-x: hidden;
  }

  @supports (overflow: clip) {
    .footprints {
      overflow-x: clip;
    }
  }

  .footprints__map {
    position: static;
    width: 106.5958%;
  }

  .footprints__dot {
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
  }

  .footprints__list-wrap {
    position: static;
    width: 100%;
    margin-top: 42.7px;
  }

  .footprints__list {
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .footprints__state-name,
  .footprints__city,
  .footprints__tip {
    font-size: 16px;
    line-height: 22px;
  }

  .footprints__cities {
    margin-top: 15.5px;
    gap: 15px;
  }

  .footprints__state+.footprints__state {
    margin-top: 28.7px;
  }

  /* ⌄ / ⌃ arrow — fixed bottom-right while the page scrolls */
  .footprints__more {
    position: fixed;
    left: auto;
    right: 37.6px;
    bottom: calc(51.8px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    width: 28.8px;
    height: 28.8px;
  }

  .footprints__more svg {
    width: 28.8px;
    height: 28.8px;
  }

  /* ---------- CONTACT ----------
     text from top 79 · values Light 16 ls 1.6 · headings Medium 16 ·
     line 19 · blocks 20 apart · icons 24 boxes 16 apart · image at the
     end (natural ratio). */
  .contact__info {
    position: static;
    padding: calc(var(--m-head) + 28.7px) var(--pad-x) 0;
    font-size: 16px;
    line-height: 19px;
    overflow-wrap: anywhere;
  }

  .contact__value,
  .contact__address,
  .contact__direction {
    letter-spacing: 1.6px;
  }

  .contact__block+.contact__block {
    margin-top: 20px;
  }

  .contact__social {
    margin: 26.5px 0 0 1px;
  }

  .contact__media {
    margin-top: 53px;
  }
}

/* ===================== R4  TABLET 600 – 1200 ========================= */
@media (min-width: 600px) and (max-width: 1200px) {

  /* sidebar landing list */
  .side-nav {
    padding-top: calc(var(--m-head) + 40px);
  }

  .side-nav__item a,
  .side-nav.has-active .side-nav__item a {
    font-size: 22px;
    line-height: 27px;
  }

  /* listing: 2 columns */
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--m-col-gap);
    row-gap: 30px;
  }

  .listing__head {
    max-width: 720px;
  }

  /* interior / landscape: 3 columns */
  .gallery-grid__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--m-col-gap);
    row-gap: var(--m-col-gap);
  }

  /* project / product intro: details left, square right (like desktop) */
  .project__body,
  .project--no-banner .project__body {
    padding: 40px var(--pad-x) 90px;
  }

  .project--no-banner .project__body {
    padding-top: calc(var(--m-head) + 40px);
  }

  .project__intro,
  .project--no-banner .project__intro {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    column-gap: 30px;
  }

  .project__intro-left,
  .project--no-banner .project__intro-left {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    gap: 30px;
    justify-content: space-between;
  }

  .project__title,
  .project--no-banner .project__title {
    margin-top: 0;
  }

  .project__thumb,
  .project--no-banner .project__thumb {
    order: 0;
    flex: 0 0 46%;
    width: 46%;
    margin: 0;
    align-self: flex-start;
  }

  .project__gallery {
    margin-top: 30px;
  }

  /* half-pair images side by side again */
  .grow--pair {
    grid-template-columns: 1fr 1fr;
    column-gap: 0;
  }

  /* about: image + text side by side */
  .about.inner__band {
    padding: calc(var(--m-head) + 30px) var(--pad-x) 80px;
  }

  .about {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
  }

  .about__media {
    flex: 0 0 48%;
    width: 48%;
  }

  .about__text {
    flex: 1 1 auto;
    width: auto;
    padding: 0;
  }

  /* team */
  .team__group {
    margin: 0;
  }

  .team__tier--a {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--m-col-gap);
  }

  .team__tier--b {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--m-col-gap);
  }

  .team__tier--c {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--m-col-gap);
  }

  /* awards */
  .awards.inner__band {
    padding-top: calc(var(--m-head) + 60px);
  }

  .awards__item {
    max-width: 820px;
  }

  .awards__year {
    flex-basis: 120px;
  }

  /* footprints: map centred, list in columns */
  .footprints {
    padding-top: calc(var(--m-head) + 40px);
  }

  .footprints__map {
    width: min(100%, 560px);
    margin: 0 auto;
  }

  .footprints__list {
    column-count: 3;
    column-gap: var(--m-col-gap);
  }

  .footprints__state {
    break-inside: avoid;
  }

  .footprints__state+.footprints__state {
    margin-top: 0;
    padding-top: 28.7px;
  }

  /* contact */
  .contact__info {
    padding-top: calc(var(--m-head) + 40px);
  }
}

/* ======================== R5  PHONES ≤ 599 =========================== */
@media (max-width: 768PX) {

  .footprints__state-name,
  .footprints__city,
  .footprints__tip {
    font-size: 14px;
    line-height: 20px;
  }
}

/* ======================== R5  PHONES ≤ 599 =========================== */
@media (max-width: 599px) {

  /* long words (emails, URLs) never push the page sideways */
  .about__body,
  .listing__desc,
  .project__detail-text {
    overflow-wrap: anywhere;
  }
}

/* ========================= Reduced motion ============================ */
@media (prefers-reduced-motion: reduce) {

  .home-slider__track,
  .home-slider__slide,
  .lightbox,
  .lightbox__img,
  .site-nav__list .sub-menu {
    transition: none !important;
  }
}

/* ================= R6  ABOUT (AAA / Practice / Apurva Amin) ==============
   · whole image always visible (no square crop, natural ratio)
   · desktop: image sticks at its own start position (--content-top),
     only the text column scrolls; short text = no scroll at all
   · mobile: stacked as before (image top, text below)              */
.about__media {
  aspect-ratio: auto;
  height: auto;
  background: transparent;
}

.about__media img,
.about__media video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left top;
}

@media (min-width: 1201px) {

  /* sticky needs visible overflow on its parents */
  .inner:has(.about),
  .inner__main:has(> .about) {
    overflow: visible;
  }

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

  .about__media {
    position: sticky;
    top: var(--content-top);
    align-self: flex-start;
  }

  /* very tall image → fits the screen, never cut */
  .about__media img,
  .about__media video {
    max-height: calc(100vh - var(--content-top) - 40px);
    max-height: calc(100dvh - var(--content-top) - 40px);
  }
}

/* ================= R7  MOBILE HEADER = REAL ELEMENTS (iOS Safari) ========
   .aaa-mbar replaces body::before (Safari ignores pseudo / transformed
   fixed elements when it tints the status bar). .aaa-safe-top never moves,
   so the strip stays white even while the header is hidden.
   :has() → the old ::before stays as fallback if the divs are missing. */
html {
  background: var(--c-bg, #fff);
}

.aaa-mbar,
.aaa-safe-top {
  display: none;
}

@media (max-width: 1200px) {

  body:has(> .aaa-mbar)::before {
    content: none;
  }

  .aaa-mbar {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 25;
    height: var(--m-head);
    background: var(--c-bg);
    pointer-events: none;
    transition: transform .3s var(--ease), box-shadow var(--dur) var(--ease);
  }

  html.is-scrolled .aaa-mbar {
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  }

  html.is-header-hidden .aaa-mbar {
    transform: translate3d(0, calc(-1 * var(--m-head) - 4px), 0);
    box-shadow: none;
  }

  .aaa-safe-top {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 35;
    /* above bar (25) + logo (30) */
    height: max(env(safe-area-inset-top, 0px), 1px);
    background: var(--c-bg);
    pointer-events: none;
  }
}

@media (max-width: 1200px) and (prefers-reduced-motion: reduce) {
  .aaa-mbar {
    transition: none;
  }
}

/* ================= R9  BACK LINK (phones / tablets) =====================
   Same .back-link as the project page (18px icon + BACK, Regular 16),
   24px under the content, 90px bottom space — like .project__foot. */
.aaa-mback {
  display: none;
}

@media (max-width: 1200px) {

  .aaa-mback {
    display: block;
    padding: 24px var(--pad-x) calc(90px + env(safe-area-inset-bottom, 0px));
    background: var(--c-bg);
  }

  /* short pages: Back sits right under the content, no empty screen */
  .has-mback .inner {
    min-height: 0;
  }

  /* the Back block now gives the bottom space */
  .has-mback .listing.inner__band,
  .has-mback .about.inner__band,
  .has-mback .team.inner__band,
  .has-mback .awards.inner__band,
  .has-mback .gallery-grid,
  .has-mback .footprints {
    padding-bottom: 0;
  }
}

/* ================= R10 MENU SCREENS — MENU TOP, IMAGE BOTTOM ============
   Projects / Architecture / About landing on phones + tablets (≤1200).
   Portrait  : menu at the top, image full width glued to the bottom of
               the visible screen, natural ratio → NEVER cropped.
               Image height does not depend on the list → it starts on the
               same line on every menu page (4 items or 7 items).
   Landscape : screen too short for a full-width uncropped image →
               desktop-like: menu left (bottom), image right, glued to the
               bottom-right, whole image visible.
   Safety    : if a tiny screen + long list leaves less room than the
               image needs, the image scales DOWN (no crop, no scroll).
   Screen height = svh (visible height with the browser bars shown). */
@media (max-width: 1200px) {

  html:has(> body.is-landing),
  html:has(> body.is-landing)>body {
    height: auto;
  }

  .is-landing .inner {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    height: 100vh;
    height: 100svh;
    min-height: 0;
  }

  .is-landing .inner-sidebar {
    flex: 0 0 auto;
    min-height: 0;
  }

  .is-landing .inner__main {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 1 1 0%;
    min-height: 160px;
    margin: 0;
  }

  .is-landing .landing-media {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex: 0 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    line-height: 0;
  }

  .is-landing .landing-media .aaa-media,
  .is-landing .landing-media picture {
    position: static;
    inset: auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }

  .is-landing .landing-media img,
  .is-landing .landing-media video {
    position: static;
    inset: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
  }
}

/* phone / tablet sideways = EXACTLY the desktop landing (R2):
   · column max(420px, 25%) like desktop → logo (ends x≈353) stays inside
   · white header bar only as wide as the column → never over the image
   · image right, from top 0 to the bottom (cover, as desktop)
   · nav uses the desktop tokens (size / line / gap / bottom space)
   → 1180 / 1194 landscape now look the same as 1201+ desktop. */
@media (max-width: 1200px) and (orientation: landscape) {

  .is-landing {
    --m-land-col: max(420px, 25vw);
  }

  .is-landing .aaa-mbar,
  .is-landing .aaa-safe-top {
    right: auto;
    width: var(--m-land-col);
  }

  .is-landing .inner {
    flex-direction: row;
    align-items: stretch;
  }

  .is-landing .inner-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--m-land-col);
    width: var(--m-land-col);
    padding: calc(var(--logo-top) + var(--logo-h) + 40px) 0 var(--side-bottom, 52px);
    overflow: hidden;
  }

  .is-landing .side-nav {
    margin-top: auto;
    padding: 0 20px 0 var(--pad-x);
  }

  .is-landing .side-nav__list {
    gap: var(--t-side-gap, 23px);
  }

  .is-landing .side-nav__item a {
    font-size: var(--t-side-size, 24px);
    line-height: var(--t-side-lh, 29px);
  }

  .is-landing .inner__main {
    display: block;
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    padding-top: 0;
  }

  .is-landing .landing-media {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .is-landing .landing-media .aaa-media,
  .is-landing .landing-media picture,
  .is-landing .landing-media img,
  .is-landing .landing-media video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  .is-landing .landing-media img,
  .is-landing .landing-media video {
    object-fit: cover;
    object-position: center;
  }
}

/* short landscape phones (≤600 high): same layout, smaller logo (10px,
   ends x≈299) + 320 column + tighter nav so 7 items fit without scroll */
@media (max-width: 1200px) and (orientation: landscape) and (max-height: 600px) {

  .is-landing {
    --m-land-col: 320px;
    --logo-top: 20px;
    --logo-h: 10px;
  }

  .is-landing .inner-sidebar {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .is-landing .side-nav__list {
    gap: 10px;
  }

  .is-landing .side-nav__item a {
    font-size: 18px;
    line-height: 22px;
  }
}

/* ================= R11 LIGHTBOX — PHONE / TABLET LANDSCAPE ===============
   Sideways the width is plenty but the height is tiny → tighter chrome,
   arrows on the sides (like desktop), image uses all the height left. */
@media (max-width: 1200px) and (orientation: landscape) {

  .lightbox {
    --lb-side: calc(var(--pad-x) + 40px);
  }

  .lightbox__arrow {
    display: block;
    top: calc(var(--lb-head) + (100% - var(--lb-head) - var(--lb-stage-b)) / 2);
    color: var(--c-black);
  }

  .lightbox__arrow--prev {
    left: var(--pad-x);
  }

  .lightbox__arrow--next {
    right: var(--pad-x);
  }
}

@media (max-width: 1200px) and (orientation: landscape) and (max-height: 600px) {

  .lightbox {
    --lb-head: calc(14px + var(--logo-h) + 14px);
    --lb-strip-h: 36px;
    --lb-strip-b: max(8px, env(safe-area-inset-bottom, 0px));
    --lb-strip-gap: 10px;
  }

  .lightbox .aaa-logo {
    top: 14px;
  }

  .lightbox__close {
    top: calc(14px + var(--logo-h, 12px) / 2 - 12px);
  }

  .lightbox__thumbs {
    gap: 5px;
  }
}