/* ==========================================================================
   SECTIONS — one block per §4.x, in page order.
   Each block carries: background · per-breakpoint min-height · the grid that
   reproduces the original composition.

   Heights are the original artboard heights, read out of the export at the
   five real breakpoints (base = >=1200, then 1199 / 959 / 639 / 479); where a
   breakpoint is absent the original inherits the value above it.

   Vertical placement uses fr row tracks whose ratios are the original's y
   deltas, so the rhythm scales with the section instead of snapping. Content
   rows are `auto`, so text can never overlap the block beneath it.
   Horizontal placement uses the 12-column grid, derived from the artboard
   x/width values (column k starts at 20 + (k-1)*98.33 on a 1200 board).
   ========================================================================== */

/* --- §4.0  Header (rec2683956401 / rec2683956501) ------------------------ */
.s-header {
  --h: clamp(50px, 4.167vw, 80px);
  --fg: var(--c-ivory);
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: var(--z-header);
  overflow: visible;
}

/* Three columns rather than space-between: the mark has to sit on the page's
   true centre, and space-between only centres it between its neighbours — so
   it drifts by half the difference between the phone number's width and the
   burger's. The outer columns are minmax(0, 1fr), which keeps them exactly
   equal instead of letting the wider side push the mark off centre. Each item
   is placed by hand so the middle column stays the middle column below 640,
   where the phone number leaves the bar. */
.header__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-xs);
  min-height: var(--h);
}

.header__bar > .link  { grid-column: 1; justify-self: start; }
.header__bar > .header__mark { grid-column: 2; justify-self: center; }
.header__bar > .burger { grid-column: 3; justify-self: end; }

.header__mark img { width: clamp(20px, 4.25vw, 64px); height: auto; }

@media (max-width: 639px) {
  /* Below the tablet board only the mark and the burger stay in the bar. */
  .header__bar .link { display: none; }
}

/* --- §4.0b Sticky header (rec2683956701, .uc-menu-scroll) ---------------- */
/* Frosted ivory with a hairline, so the bar separates from an ivory band
   beneath it without needing a second colour. */
.s-header-sticky {
  --h: clamp(70px, 5.833vw, 112px);
  --bg: color-mix(in srgb, var(--c-ivory) 90%, transparent);
  --fg: var(--c-navy);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  box-shadow: 0 1px 0 var(--rule);
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: var(--z-sticky);
  overflow: visible;
  transform: translateY(-100%);   /* §5.7 start state; nav.js takes over */
}

/* --- §4.1  Hero -----------------------------------------------------------
   The 3D "Blueprint to skyline" scene. Its layout, overlay and held state
   live with the component in css/hero-3d.css; this only sets the ground and
   keeps it beneath the §5.4 dive layers (z 991-994). */
.s-hero {
  --bg: #071324;
  --fg: var(--c-ivory);
  z-index: var(--z-raised);
}

/* --- §4.2  Hero dive — the gold line, then "From sketch to home" ------------
   The line and panel take a fixed span at the top (the .video-dive-top-1
   spacer, which anim-videodive.js reads back off the DOM); whatever is left
   is the window for the four-chapter run (js/dive-sketch.js). Each chapter
   gets roughly a screen of travel at every width, so the drawing is read,
   not whipped past. */
.s-dive {
  --h: clamp(3600px, 300vw, 5400px);
  /* Transparent so the pinned hero shows through beneath the dive layers —
     this section is pure scroll runway for the sequence, not a backdrop. */
  --bg: transparent;
}

.dive__spacer {
  position: absolute;
  width: 100px;
  pointer-events: none;
}

/* The one source mark the run is still keyed to: top-1 is where the panel
   finishes and the frames take over. Its other five spacers belonged to the
   three separate tiles. */
.video-dive-top-1 { inset-block-start: 0; inset-inline-start: 45.83%; height: clamp(500px, 41.667vw, 800px); }

/* The dive is a stack of four layers that all grow from the same point at
   the centre of the screen: a terracotta line, then the three images.
   The source pins them with position:fixed (Tilda `fi:'fixed'`) so the
   sequence plays against a still viewport while the page scrolls past —
   anim-videodive.js adds .is-pinned for exactly that span.
   z-order is the source's: line 991, tiles 992 / 993 / 994. */
/* Centring is applied by GSAP (xPercent / yPercent in anim-videodive.js) and
   deliberately NOT by the CSS translate property: GSAP folds transforms into
   its own matrix, so a CSS translate here is wiped the moment anything
   animates y, and the panel drops half a screen. */
.dive__layer {
  position: fixed;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  pointer-events: none;
}

/* Once the sequence is over the layers drop back into the section, so the
   finished images scroll away instead of covering the rest of the page. */
.s-dive.is-released .dive__layer { position: absolute; }

.s-dive.is-released .dive__overlay {
  position: absolute;
  inset-block-start: auto;
  height: 100vh;
}

/* The panel is a full viewport of --c-terracotta that starts scaled down to
   the source's 10x1px seed. Sizing it in vw/vh rather than tweening to a
   JS-measured pixel value means the end state is always exactly one screen —
   it cannot drift if the viewport changed after the tween was built. */
/* Hidden until anim-videodive.js seeds it. The layer is a full viewport
   anchored at top:50%/left:50%, and the centring and the 10x1px seed scale
   are both GSAP's — so between first paint and init it would otherwise draw
   at full size hanging off the centre point, i.e. a terracotta block over the
   bottom-right quarter of the hero. The module sets opacity to 1 in the same
   call that applies the seed, so there is no frame where it is visible and
   wrong. */
/* Gold, to carry on from the hero. At its 10px seed width the gradient reads
   as a hairline with a bright core and a soft glow either side. As the panel
   opens, anim-videodive.js floods it with the hero night and fades the core,
   and the two inset gold edges — invisible while the layer is scaled down to
   a line — widen with it, so the line parts like a curtain.
   Only the colour changed here; the scale and centring behaviour is the
   signed-off sequence, untouched. */
.main-transform {
  z-index: 991;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7, 19, 36, 0);
  background-image: linear-gradient(90deg, rgba(208, 173, 103, 0) 0%, rgba(243, 223, 174, 1) 40%, rgba(243, 223, 174, 1) 60%, rgba(208, 173, 103, 0) 100%);
  box-shadow:
    inset 2px 0 0 var(--c-gold),
    inset -2px 0 0 var(--c-gold),
    inset 110px 0 110px -90px rgb(208 173 103 / .32),
    inset -110px 0 110px -90px rgb(208 173 103 / .32);
  transform-origin: center center;
  opacity: 0;
}

/* The frame run covers the screen exactly like the panel under it, so the
   two share the same centring and the same drift into About. Its backing
   store is set in JS; these are the display box. */
.dive__frames {
  z-index: 992;
  width: 100vw;
  height: 100vh;
  opacity: 0;
}

/* --- the copy over the run -----------------------------------------------
   The chapter overlay — captions, chapter rail, title block, level markers —
   styled in css/dive-sketch.css. Fixed like the layers under it, but on
   inset:0 rather than the centre point, so it needs none of their GSAP
   centring and cannot be caught by it.

   Hidden at rest: anim-videodive.js fades it in with autoAlpha as the run
   begins, so nothing captions the line while it opens, and the call stays
   out of the focus order whenever it cannot be seen. */
.dive__overlay {
  position: fixed;
  inset: 0;
  z-index: 993;
  color: var(--c-ivory);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

/* No WebGL: the canvas cannot draw the run, so it shows the finished frame. */
.s-dive.dsk--fallback .dive__frames { background: #071324 url("../assets/scronew/frame_049.webp") center / cover no-repeat; }

/* Stands in for the run wherever it cannot play, and is the accessible
   description of it either way. */
.dive__poster {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  width: 100%;
  height: clamp(620px, 51.667vw, 992px);
  object-fit: cover;
  display: none;
}

/* No JavaScript, or motion reduced: the line and the run are both
   meaningless without the scroll, so the poster frame stands alone and the
   runway shrinks to the one screen it needs. */
@media (scripting: none), (prefers-reduced-motion: reduce) {
  .s-dive { --h: clamp(620px, 51.667vw, 992px); }
  .main-transform,
  .dive__frames { display: none; }
  .dive__poster { display: block; }

  /* The copy is content, not motion, so it still shows — laid over the poster
     inside the section rather than fixed to the viewport, since there is no
     scrubbed run for it to be held against. */
  .dive__overlay {
    position: absolute;
    visibility: visible;
    opacity: 1;
  }
  .dive__overlay .dsk__levels,
  .dive__overlay .dsk__block { display: none; }
  .dive__overlay .dsk__cap[data-stage="4"] { opacity: 1; visibility: visible; translate: none; }
  .dive__overlay .dsk__chapter[data-stage="4"] { color: var(--c-ivory); }
  .dive__overlay .dsk__chapters::after { width: 100%; }
}

/* --- §4.3  About (rec2683957201, uc-random-rise-1) -----------------------
   Two bands. The first is an eyebrow and a serif statement on the left with
   the headline figures on the right; the second is a tinted plate, inset from
   the left so the render overhangs it, with the copy set against the tint.

   Mobile-first: the two-column placements only exist from 960 up, so nothing
   has to be un-placed at the small end. */
.s-about {
  --h: max(1217px, 81vw);
  --bg: var(--c-ivory);
  z-index: 995;                       /* rises over the held hero layers */

  @media (max-width: 959px) { --h: auto; }
}

.about__grid {
  display: grid;
  align-content: center;
  gap: var(--sp-lg);
  padding-block: var(--sp-2xl) var(--section-gap);
}

.about__eyebrow {
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-accent);
}

/* The serif carries the statement — it is the one place on the page that
   speaks rather than labels, so it gets the Cormorant rather than the
   grotesque everything else is set in. */
/* Set exactly as the Masterful Interiors headline — the .t-h2 class on the
   element carries the face, size and tracking; this only holds the measure. */
/* No character cap: in the display face a ch is narrower than the words,
   and capping the measure broke them mid-syllable. The grid column is the
   measure, and balance evens the lines out. */
.about__h { text-wrap: balance; }

.about__figures { display: flex; flex-wrap: wrap; gap: var(--sp-xl); }

.about__fig-value {
  font-family: var(--font-display);
  font-size: clamp(64px, 7.5vw, 144px);
  font-weight: var(--fw-medium);
  font-variant-numeric: lining-nums;
  line-height: 1;
  letter-spacing: var(--ls-display);
  color: var(--c-navy);
}

/* The + rides at the cap line, as a superior figure rather than inline. */
.about__fig-sup { font-size: .45em; vertical-align: super; line-height: 0; }

.about__fig-label {
  margin-block-start: var(--sp-xs);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  line-height: 1.3;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.about__panel {
  position: relative;
  display: grid;
  gap: var(--sp-lg);
  padding-block: var(--sp-lg);
}

/* The plate. Inset from the left at the wide end so the render overhangs it;
   full width below that, where there is no room to overhang anything. */
/* Bleeds past the container to the right edge of the screen, so the plate
   has no gutter beside it. calc(50% - 50vw) is negative by exactly the
   container's own gutter, whatever the breakpoint makes it. */
.about__panel::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inset-inline-end: calc(50% - 50vw);
  background: var(--bg-panel);
}

.about__shot,
.about__copy { position: relative; }   /* above the plate */

.about__shot {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.about__sub {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: var(--fw-medium);
  line-height: var(--lh-h3);
  letter-spacing: var(--ls-card);
  text-transform: none;
  color: var(--fg-title);
}

.about__p {
  max-width: 58ch;
  margin-block: var(--sp-xs) var(--sp-md);
  font-size: var(--fs-text);
  line-height: var(--lh-body);
  color: var(--fg-default);
}

.about__more {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2xs);
  min-height: 44px;                    /* [SPEC §8] touch target */
  border-block-end: 1px solid var(--c-gold);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-title);
  transition: gap var(--dur-fast) var(--ease-css),
              color var(--dur-fast) var(--ease-css);
}

.about__more svg { width: 24px; height: 10px; flex: none; }
.about__more:hover,
.about__more:focus-visible { gap: var(--sp-xs); color: var(--fg-accent); }

@media (min-width: 960px) {
  .about__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: var(--sp-2xl);
    row-gap: var(--sp-2xl);
  }

  .about__eyebrow { grid-column: 1; grid-row: 1; }
  .about__h       { grid-column: 1; grid-row: 2; }
  .about__figures { grid-column: 2; grid-row: 1 / 3; align-self: center; gap: var(--sp-2xl); }
  .about__panel   { grid-column: 1 / -1; }

  .about__panel {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    align-items: center;
    column-gap: var(--sp-2xl);
    padding-block: var(--sp-2xl);
  }

  /* Starts a fifth of the way in, so the render sits across its edge rather
     than inside it. */
  .about__panel::before { inset-inline-start: 21%; }

  .about__shot { aspect-ratio: 4 / 3; }
}

@media (max-width: 959px) {
  .about__h { max-width: none; }
  .about__shot { aspect-ratio: 16 / 10; }
  .about__panel { padding-inline: var(--sp-md); }
}   /* y1735 / 2020 */

/* --- §4.5  Project locations ----------------------------------------------
   The 3D map; its styles live with the component in css/location-3d.css. */

/* --- §4.6  Architecture, annotated -----------------------------------------
   Its styles live with the component in css/arch-band.css. */

/* --- §4.7  Architecture — GAFA (rec2683957701, uc-random-rise-2) ---------
   Rule y20 full width · headline y170 x626 w370 · body y338 x626 w412 ·
   collage x20 y170 w433 and x1020 y498 w160. */
/* Featured projects. The band sizes to its content rather than to a fixed
   artboard height, because the card row is the only thing setting the height
   and it is already proportional (2:3 cards in a fluid container). */
/* A full section gap above and below, and a hairline across the column at
   its top: About ends on the same ivory, so the line is what says a new
   section begins. */
.s-architecture {
  --h: auto;
  --bg: var(--c-ivory);
  background-image: linear-gradient(var(--rule), var(--rule));
  background-size: var(--container) 1px;
  background-position: top center;
  background-repeat: no-repeat;
}

.fp__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-content: start;
  padding-block: var(--section-gap);
}

.fp__eyebrow {
  grid-column: 1 / 9;
  grid-row: 1;
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-accent);
}

/* .t-h2 on the element carries the face, size, weight and tracking, the same
   way the About headline is built; only placement and colour live here. */
.fp__h {
  grid-column: 1 / 9;
  grid-row: 2;
  margin-block-start: var(--sp-sm);
  text-wrap: balance;
  color: var(--c-navy);
}

/* Sits on the headline's last baseline at the far right, over the rule that
   runs under it. */
.fp__all {
  grid-column: 9 / 13;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  min-height: 44px;                    /* [SPEC §8] touch target */
  padding-block-end: var(--sp-xs);
  border-block-end: 1px solid var(--c-gold);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-title);
  transition: color var(--dur-fast) var(--ease-css),
              border-color var(--dur-fast) var(--ease-css);
}

.fp__all svg { width: 24px; height: 10px; flex: none; }

.fp__all:hover,
.fp__all:focus-visible { color: var(--fg-accent); }

.slider--projects {
  grid-column: 1 / 13;
  grid-row: 3;
  --slides-desktop: 4;
  margin-block-start: var(--sp-xl);
}

/* slider.js steps the track by exactly 100/slides of its own width, which is
   only one card-plus-gap if the gap is inside the slide box. The shared rule
   puts it between boxes instead, so each step lands half a gap short and the
   row walks left of the column. Carrying the gap as slide padding on a track
   one gap wider than the viewport makes the step exact: the first card is
   flush left at 0 and the last is flush right at the end. */
.slider--projects .slider__track {
  gap: 0;
  width: calc(100% + var(--grid-gap));
}

.slider--projects .slider__slide {
  flex: 0 0 calc(100% / var(--slides-desktop));
  padding-inline-end: var(--grid-gap);
}

.slider--projects.is-enhanced .slider__track { cursor: grab; }
.slider--projects.is-enhanced.is-dragging .slider__track { user-select: none; }

.fp__controls {
  justify-content: flex-end;
  margin-block-start: var(--sp-md);
  color: var(--c-navy);
}

/* ---- the card -----------------------------------------------------------
   Portrait 2:3, image full-bleed under a foot gradient, with the title on the
   left and a ghost index on the right sharing the same baseline band. */
.fp-card {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--c-navy);
  color: var(--c-ivory);
}

.fp-card__frame { position: absolute; inset: 0; overflow: hidden; }

.fp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--dur-slow) var(--ease-css);
}

/* The renders are bright at the foot, so the caption carries its own scrim
   rather than the whole picture being dimmed. */
.fp-card__frame::after {
  content: "";
  position: absolute;
  inset-block-start: 40%;
  inset-block-end: 0;
  inset-inline: 0;
  background: linear-gradient(to bottom, transparent, rgb(var(--scrim) / .4) 50%, rgb(var(--scrim) / .9));
  transition: opacity var(--dur-base) var(--ease-css);
}

.fp-card__body {
  position: absolute;
  inset-inline: var(--sp-sm);
  inset-block-end: var(--sp-sm);
  display: grid;
  gap: var(--sp-3xs);
  transition: translate var(--dur-base) var(--ease-css);
}

.fp-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-h5);
  font-weight: var(--fw-semi);
  line-height: var(--lh-card);
  letter-spacing: var(--ls-card);
}

.fp-card__place {
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--c-mist);
}

/* Index — a small gold numeral above the title, inside the caption block, so
   it can never sit on top of the project name the way the old ghost figure did. */
.fp-card__num {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: var(--ls-label);
  color: var(--c-gold);
}

/* The spec table. Collapsed to a zero-height row at rest and opened on
   hover, so it costs no card height until it is asked for. 0fr -> 1fr is what
   lets it animate without a hard-coded height that would clip a wrapped
   value. It stays in the accessibility tree either way. */
.fp-card__specs {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;                    /* clips the inner rule and its padding,
                                          which the inner box cannot clip itself */
  opacity: 0;
  transition: grid-template-rows var(--dur-base) var(--ease-css),
              opacity var(--dur-base) var(--ease-css),
              margin-block-start var(--dur-base) var(--ease-css);
}

/* The 0fr track floors at this box's own padding and border, which its
   overflow cannot clip — so it carries neither. The separator is an absolute
   pseudo-element, which contributes no height, and the space under it is
   padding on the columns, which is inside the clip. */
.fp-card__specs-grid {
  position: relative;
  overflow: hidden;
  display: grid;
  /* minmax floors each column at its label, so a narrow card redistributes
     rather than letting BATH spill into LAND. */
  grid-template-columns:
    minmax(min-content, 2fr) minmax(min-content, .7fr)
    minmax(min-content, .7fr) minmax(min-content, 1.1fr);
  column-gap: var(--sp-xs);
}

.fp-card__specs-grid::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  background: var(--rule-on-dark);
}

.fp-card__spec {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-block-start: var(--sp-2xs);
}

.fp-card__spec-k {
  font-size: var(--fs-legal);
  font-weight: var(--fw-semi);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-mist);
}

.fp-card__spec-v {
  font-size: var(--fs-small);
  font-weight: var(--fw-semi);
  line-height: 1.3;
  text-wrap: balance;
}

.fp-card:hover .fp-card__specs,
.fp-card:focus-visible .fp-card__specs {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-block-start: var(--sp-2xs);
}

.fp-card:hover .fp-card__img,
.fp-card:focus-visible .fp-card__img { scale: 1.07; }

.fp-card:hover .fp-card__body,
.fp-card:focus-visible .fp-card__body { translate: 0 calc(var(--sp-2xs) * -1); }

/* Motion is decoration here; the scrim and the caption stay put without it. */
@media (prefers-reduced-motion: reduce) {
  .fp-card__img,
  .fp-card__body { transition: none; }

  .fp-card:hover .fp-card__img,
  .fp-card:focus-visible .fp-card__img { scale: 1; }

  .fp-card:hover .fp-card__body,
  .fp-card:focus-visible .fp-card__body { translate: none; }

  /* The table still opens — it is information, not decoration — but it
     appears rather than unfolds. */
  .fp-card__specs { transition: none; }
}

@media (max-width: 1199px) { .slider--projects { --slides-desktop: 3; } }

@media (max-width: 959px) {
  .fp__eyebrow,
  .fp__h        { grid-column: 1 / 13; }
  .fp__all      { grid-column: 1 / 13; grid-row: 3; justify-self: start; margin-block-start: var(--sp-md); }
  .slider--projects { grid-column: 1 / 13; grid-row: 4; --slides-desktop: 2; }
}

@media (max-width: 639px) { .slider--projects { --slides-desktop: 1.2; } }

/* --- §4.14 Courtyard in daylight -------------------------------------------
   Its styles live with the component in css/courtyard.css. */

/* --- §4.19 Marquee — LAYOUTS (rec2683961201, .uc-slide-mask-1) -----------
   2020px drives the §5.2 clip-path window; the mask image is 1920x1030 at
   x-360. slide-mask-top h=1, slide-mask-bottom top=534 h=1486.
   The mask is disabled at <=640px, which is why the source collapses the
   band below 960. */

.mask__spacer { position: absolute; width: 100px; pointer-events: none; }
.slide-mask-top    { inset-block-start: 0;     inset-inline-start: 45.83%; height: 1px; }
.slide-mask-bottom { inset-block-start: clamp(534px, 44.5vw, 854px); inset-inline-start: 1.67%; height: clamp(1486px, 123.833vw, 2378px); }

/* Both layers share one box (1920x1030 at x-360 of the board). The plate
   sits under the window, so what surrounds the opening is the source's
   striped pattern rather than bare page. */
.slide-mask {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -30%;
  width: 160%;
  height: clamp(1030px, 85.833vw, 1648px);
  background-position: center;
  background-size: cover;
}
.slide-mask  { background-image: var(--img-mq-layouts-2); }

@media (max-width: 959px) {
  .slide-mask { inset-inline: 0; width: 100%; height: 100%; }
}   /* [SPEC §8] */   /* over the two gradients */

/* --- §4.29 Fullscreen menu overlay (.stairs-nav) --------------------------
   The hero's night, carried into the menu: the same deep navy ground and
   warm horizon glow, a gold blueprint floor receding into the distance, and
   names only — set large in the serif, indexed in gold. Hovering one lights
   it gold and draws a hairline under it while the rest step back. A gold rule
   draws across the foot each time the menu opens. */
.s-menu {
  --h: 100vh;
  --bg: #071324;
  --fg: var(--c-ivory);
  --menu-num: 2.6rem;                  /* width of the index column */
  --menu-gap: clamp(14px, 1.6vw, 28px);
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  /* Two levels make a taller list than the flat seven it replaced, so a short
     window scrolls rather than clipping the last item. */
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(80% 55% at 78% 112%, rgb(143 106 62 / .3), transparent 62%),
    radial-gradient(120% 80% at 50% 80%, #0f2740 0%, #071324 55%, #040d18 100%);
}

/* The blueprint floor — the hero's gold grid, laid down in perspective and
   drifting slowly toward the viewer. The frame (perspective + fade) holds
   still; only the grid inside it moves, by transform, one 84px cell per loop.
   That runs on the GPU — animating background-position instead repainted
   this whole 240%-wide layer every frame and made the menu stutter.
   The <span class="menu__floor"> is added by menu.js. */
.menu__floor {
  position: absolute;
  inset-inline: -70%;
  bottom: 0;
  height: 115%;
  overflow: hidden;
  transform: perspective(760px) rotateX(66deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / .55) 30%, transparent 62%);
          mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / .55) 30%, transparent 62%);
  pointer-events: none;
}
.menu__floor::before {
  content: "";
  position: absolute;
  inset: -84px 0 0;                    /* one cell spare, so the loop never shows an edge */
  background-image:
    linear-gradient(rgb(208 173 103 / .3) 2px, transparent 2px),
    linear-gradient(90deg, rgb(208 173 103 / .22) 1px, transparent 1px);
  background-size: 84px 84px;
  animation: menu-floor 9s linear infinite;
}

@keyframes menu-floor {
  from { transform: translateY(0); }
  to   { transform: translateY(84px); }
}

.menu__frame {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Top bar — level with the site header, the close button where the burger was. */
.menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: clamp(70px, 5.833vw, 112px);
}

.menu__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-gold);
}
.menu__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.menu__close { color: var(--c-ivory); }
.menu__close svg { width: 12px; height: 12px; }

/* --- the list --- */
.menu__nav {
  align-self: center;
  justify-self: start;                 /* only as wide as the names, so the
                                          hover state follows the names */
  padding-block: var(--sp-lg);
  padding-inline-start: clamp(0px, 7vw, 140px);
}

.menu__list { display: grid; gap: clamp(0px, .4vh, 8px); }

.menu__link {
  display: inline-flex;
  align-items: baseline;
  gap: var(--menu-gap);
  color: var(--c-ivory);
  text-align: start;
}

.menu__num {
  flex: none;
  width: var(--menu-num);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-label);
  color: var(--c-gold);
  transition: opacity var(--dur-fast) var(--ease-css);
}

.menu__label {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 72px);
  font-weight: var(--fw-medium);
  line-height: 1.14;
  letter-spacing: -.015em;
  transition: color .35s var(--ease-css), opacity .35s var(--ease-css),
              translate .55s var(--ease-css);
}

.menu__label::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: .1em;
  height: 1px;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .55s var(--ease-css);
}

/* Hover: the name under the pointer lights gold and steps in; the rest step
   back. An open group keeps its heading lit while its children are in use. */
:where(.menu__list:has(.menu__link:hover)) .menu__item > .menu__link .menu__label { opacity: .36; }
:where(.menu__list:has(.menu__link:hover)) .menu__item > .menu__link .menu__num   { opacity: .5; }

.menu__list .menu__item > .menu__link:is(:hover, :focus-visible) .menu__label,
.menu__list .menu__item.is-open > .menu__link .menu__label {
  opacity: 1;
  color: var(--c-gold);
  translate: 12px 0;
}
.menu__list .menu__item > .menu__link:is(:hover, :focus-visible) .menu__num,
.menu__list .menu__item.is-open > .menu__link .menu__num { opacity: 1; }
.menu__list .menu__item > .menu__link:is(:hover, :focus-visible) .menu__label::after { transform: scaleX(1); }

/* A group's heading is a button, so it reads as something to press rather
   than somewhere to go, and it carries a caret that turns when it opens. */
.menu__caret {
  flex: none;
  align-self: center;
  width: 16px;
  height: 16px;
  margin-inline-start: 4px;
  color: var(--c-mist);
  transition: rotate var(--dur-fast) var(--ease-css), color var(--dur-fast) var(--ease-css),
              translate .55s var(--ease-css);
}
.menu__link--toggle:is(:hover, :focus-visible) .menu__caret,
.menu__item.is-open > .menu__link--toggle .menu__caret { color: var(--c-gold); translate: 12px 0; }
.menu__item.is-open > .menu__link--toggle .menu__caret { rotate: 180deg; }

/* Second level. Indented under its parent's name (past the index column) and
   set at label scale, so the destinations still carry the page and the
   children read as their detail.

   Open by default: with no script there is nothing to press, and a
   permanently collapsed group would put six destinations out of reach.
   menu.js adds .is-collapsible once it can drive them. */
.menu__sub {
  display: grid;
  grid-template-rows: 1fr;
  margin-inline-start: calc(var(--menu-num) + var(--menu-gap) + 12px);
}

.is-collapsible .menu__sub {
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-base) var(--ease-css);
}

.is-collapsible .menu__item.is-open > .menu__sub { grid-template-rows: 1fr; }

/* The clip carries the indent and its rule, both horizontal, so neither can
   floor the 0fr track. The breathing space is on the rows, inside the clip. */
/* Two classes deep: the reset zeroes padding on ul[class], which outranks one. */
.menu__sub .menu__sub-list {
  overflow: hidden;
  display: grid;
  gap: 2px;
  padding-inline-start: var(--sp-md);
  border-inline-start: 1px solid rgb(208 173 103 / .4);
}

.menu__sub-item:first-child { padding-block-start: var(--sp-2xs); }
.menu__sub-item:last-child  { padding-block-end: var(--sp-sm); }

.menu__link--sub {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  line-height: 1.3;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-mist);
  transition: color var(--dur-fast) var(--ease-css), translate var(--dur-fast) var(--ease-css);
}

.menu__link--sub:hover,
.menu__link--sub:focus-visible { color: var(--c-gold); translate: 4px 0; }

/* --- the foot --- */
.menu__foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm) var(--sp-md);
  padding-block: var(--sp-md) clamp(24px, 4vh, 44px);
}

/* Draws each time the menu opens: the panel goes from display:none to
   shown, which restarts the animation. */
.menu__foot::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--c-gold), rgb(208 173 103 / .25) 60%, transparent);
  transform-origin: left center;
  animation: menu-rule 1.2s var(--ease-css) .3s both;
}

@keyframes menu-rule {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (pointer: coarse) {
  /* [SPEC §8] touch target. The toggles especially: they are pressed rather
     than followed, so a miss is a dead tap rather than a wrong page. */
  .menu__link,
  .menu__link--sub { min-height: 44px; }
}

@media (max-width: 759px) {
  .s-menu { --menu-num: 1.9rem; }
  .menu__nav { padding-inline-start: 0; }
  .menu__label { font-size: clamp(32px, 9.4vw, 46px); }
  .menu__foot .places { display: none; }
  .menu__foot .btn-ghost { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .menu__floor::before,
  .menu__foot::before { animation: none; }
  .is-collapsible .menu__sub { transition: none; }
  .menu__caret,
  .menu__label,
  .menu__label::after { transition: none; }
}

/* --- §7.3 Popups — inline sections until popup.js upgrades them ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.gallery img { width: 100%; height: auto; border-radius: var(--r-card); }

@media (max-width: 639px) {
  .gallery     { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   RESPONSIVE FALLBACK  [SPEC §8]
   Below 960 the artboard composition stops being meaningful, and the fr row
   tracks that carry the desktop rhythm become actively harmful: an fr track
   is floored by its own content, so one small track holding real copy forces
   every other fr track to scale up with it — the footer grew to 6882px that
   way. Every composition grid therefore becomes a single flow column here,
   and DOM order is the reading order.
   ========================================================================== */

@media (max-width: 959px) {
  .about__grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-md);
    padding-block: var(--sp-xl);
  }

  /* Spacers only exist to give the §5 ScrollTriggers a scroll window; they
     must not open gaps in the flow. */
  .rise-spacer,
  .mask__spacer,
  .curtain__spacer,
  .dive__spacer { display: none; }
}

/* ==========================================================================
   §5.1 CHAR-RISE SPACERS
   Every .uc-random-rise-N block carries zero-content spacers whose heights
   define the scrub window: anim-charrise.js reads them back off the DOM as
   start "top+=<topH> center" / end "bottom-=<bottomH> center". They must
   therefore render at the source's exact geometry, and must NOT participate
   in the section grid — as grid items they would auto-place into the fr
   rhythm tracks and inflate them. Heights scale with the viewport above 1200
   on the same curve as everything else, so the ratios hold at every width.
   ========================================================================== */

.rise-spacer {
  position: absolute;
  inset-inline-start: 91.67%;
  width: 100px;
  pointer-events: none;
}

.s-about .random-rise-top-1 { inset-block-start: 0px; height: clamp(10px, 0.833vw, 16px); }
.s-about .random-rise-bottom-1 { inset-block-start: clamp(143px, 11.917vw, 229px); height: clamp(1295px, 107.917vw, 2072px); }
.s-architecture .random-rise-top-1 { inset-block-start: 0px; height: clamp(10px, 0.833vw, 16px); }
.s-architecture .random-rise-bottom-1 { inset-block-start: clamp(200px, 16.667vw, 320px); height: clamp(480px, 40vw, 768px); }

/* §5.4 — the hero is held still for the length of the dive sequence; the
   rules for its 3D layers live with the component, in css/hero-3d.css. */

/* §4.3 — below the desktop grid the opening paragraph rejoins the flow with
   the rest of the copy; there is no side-by-side band to sit in. */
@media (max-width: 959px) {

  /* after the flow fallback above, which would otherwise reset it */
  .about__grid { padding-block-end: var(--section-gap); }
}
