/* ==========================================================================
   VELRA landing page — section styles.
   Mobile-first. Breakpoints: 48em (768px tablet), 80em (1280px desktop).
   The desktop artboard is 1440px wide with a 1360px content band.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-section-title);
  line-height: var(--lh-section-title);
  text-align: center;
  text-wrap: balance;
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.59;
  text-align: center;
  text-wrap: pretty;
}

.disclaimer {
  font-size: var(--fs-disclaimer);
  line-height: 1.59;
  text-align: center;
  text-wrap: pretty;
}

/* Outlined pill button — Figma component `button2` / `button`. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem;
  border: 1px solid currentcolor;
  border-radius: var(--radius-button);
  background: none;
  color: var(--color-porcelain-ivory);
  font-family: var(--font-body);
  font-size: var(--fs-btn);
  line-height: 1.5;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--color-porcelain-ivory);
  color: var(--color-deep-velvet-blue);
}

.btn__icon {
  width: 25px;
  height: 25px;
  flex: none;
}

/* The exported mark is a fixed ivory stroke, so it is swapped for a
   navy-inverted rendition on hover instead of being recoloured. */
.btn:hover .btn__icon,
.btn:focus-visible .btn__icon {
  filter: brightness(0) saturate(100%) invert(11%) sepia(38%) saturate(2276%)
    hue-rotate(180deg) brightness(96%) contrast(94%);
}

.btn--wide {
  width: 260px;
  max-width: 100%;
  min-height: 45px;
}

.btn--sm {
  min-height: 42px;
  padding-inline: 1.25rem;
  font-size: var(--fs-btn-sm);
}

/* Chevron control — Figma component `arrow1` / `arrow3`: a square rotated 45°
   with a stroke on two sides. */
.chevron {
  --chevron-size: 26px;
  --chevron-weight: 3px;
  --chevron-color: var(--color-porcelain-ivory);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.chevron::before {
  content: "";
  width: var(--chevron-size);
  height: var(--chevron-size);
  border-left: var(--chevron-weight) solid var(--chevron-color);
  border-bottom: var(--chevron-weight) solid var(--chevron-color);
  transform: rotate(45deg) translate(12%, -12%);
}

.chevron--next::before {
  transform: rotate(-135deg) translate(12%, -12%);
}

.chevron:hover {
  opacity: 0.7;
}

.chevron[aria-disabled="true"] {
  opacity: 0.3;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.scroll-probe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 20;
  height: 60px;
  background-color: var(--color-deep-velvet-blue);
}

.site-header__inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo {
  display: block;
  width: 81px;
  flex: none;
}

.site-header__logo img {
  width: 100%;
  height: auto;
}

.site-header__contact {
  display: none;
  align-items: center;
  gap: 2rem;
  color: var(--color-porcelain-ivory);
}

.site-header__tel {
  font-size: 1.5625rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__tel:hover {
  text-decoration: underline;
}

/* Hamburger — mobile only. A native <details> disclosure, so the panel opens
   with JavaScript disabled. */
.nav-disclosure {
  position: static;
}

.nav-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-right: -0.5rem;
  color: var(--color-porcelain-ivory);
  cursor: pointer;
  list-style: none;
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 25px;
  height: 2.18px;
  background-color: currentcolor;
}

.nav-toggle__bars {
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -9.8px;
}

.nav-toggle__bars::after {
  top: 9.8px;
}

.nav-panel {
  position: absolute;
  inset: 60px 0 auto;
  display: grid;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 1.75rem;
  background-color: var(--color-deep-velvet-blue);
  color: var(--color-porcelain-ivory);
  border-top: 1px solid rgb(240 233 223 / 0.2);
}

.nav-panel__tel {
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
}

/* Section links. Below the tel and the register button, behind the same
   hairline the panel uses against the header bar. */
.nav-panel__links {
  display: grid;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(240 233 223 / 0.2);
  font-family: var(--font-ui);
  font-size: var(--fs-footer);
}

.nav-panel__links a {
  text-decoration: none;
}

@media (min-width: 64em) {
  /* Sticky, and pulled out of flow by its own height so the hero still starts
     at y=0 and the bar floats over it exactly as on the artboard. */
  .site-header {
    position: sticky;
    top: 0;
    height: 102px;
    margin-bottom: -102px;
    background-color: var(--color-deep-velvet-blue);
    transition: background-color var(--dur) var(--ease);
  }

  /* Transparent only while the page is at the very top, where the hero's own
     scrim carries the header text. Both flags live on the root element so the
     inline head script can set them before the first paint; without
     JavaScript `.js` is never added and the bar stays solid and legible over
     every section. */
  .js:not(.is-scrolled) .site-header {
    background-color: transparent;
  }

  /* Anchor targets clear the sticky bar. */
  [id] {
    scroll-margin-top: 102px;
  }

  .site-header__inner {
    padding-block: 28px 29px;
  }

  .site-header__logo {
    width: 166px;
  }

  .site-header__contact {
    display: flex;
  }

  .nav-disclosure {
    display: none;
  }
}

@media (min-width: 80em) {
  .site-header__contact {
    gap: 85px;
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  /* Parallax travel, and the 0→1 scroll progress parallax.js writes here. */
  --hero-parallax: 56px;
  --hero-progress: 0;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 316px;
  background-color: var(--color-deep-velvet-blue);
  color: var(--color-porcelain-ivory);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Absolute, not `height: 100%` — a percentage height on the img resolves
   against the inline <picture>, falls back to auto, and the natural 2880x2028
   ratio then overflows the hero. */
.hero__media img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Parallax. The `.has-parallax` root flag is set by the inline head script
   before the first paint and torn back down by parallax.js on a reduced-motion
   change, so it is only ever present with JavaScript on.
   The photo is grown by the full travel distance and parked that far above the
   section, so translating it back down as the page scrolls can never uncover
   an edge. `bottom` is dropped because `top` + `height` already size the box.

   Only the <img> moves — the scrims are `.hero__media` pseudo-elements and stay
   pinned to the section, keeping the headline and stat-row contrast fixed. */
.has-parallax .hero__media img {
  top: calc(var(--hero-parallax) * -1);
  bottom: auto;
  height: calc(100% + var(--hero-parallax));
  transform: translate3d(0, calc(var(--hero-parallax) * var(--hero-progress)), 0);
  will-change: transform;
}

/* The copy trails the photo at roughly half its rate and fades out as the
   section leaves; at progress 1 the hero is a full height off-screen. */
.has-parallax .hero__inner {
  transform: translate3d(
    0,
    calc(var(--hero-parallax) * var(--hero-progress) * 0.45),
    0
  );
  opacity: calc(1 - var(--hero-progress) * 0.55);
}

/* Belt and braces: parallax.js already removes the class when the user asks
   for reduced motion, but a media query beats a race with a late `change`. */
@media (prefers-reduced-motion: reduce) {
  .has-parallax .hero__media img,
  .has-parallax .hero__inner {
    transform: none;
    opacity: 1;
    will-change: auto;
  }
}

/* Top scrim (Figma `Rectangle 8`, rotated 180°). Deepened past the Figma
   ramp: over the bright sky the original fade left the headline at 2.3:1,
   under the 3:1 AA floor for large text. */
.hero__media::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  background-image: linear-gradient(
    to top,
    rgb(12 42 68 / 0),
    rgb(12 42 68 / 0.6) 45%,
    var(--color-deep-velvet-blue)
  );
}

/* Bottom scrim: transparent → Deep Velvet Blue (Figma `Rectangle 9`), with an
   extra mid stop so the stat row clears AA over the lit facade behind it. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background-image: linear-gradient(
    to bottom,
    rgb(12 42 68 / 0),
    rgb(12 42 68 / 0.62) 42%,
    var(--color-deep-velvet-blue)
  );
}

.hero__inner {
  display: flex;
  min-height: 316px;
  flex-direction: column;
  padding-bottom: 21px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-hero-title);
  line-height: var(--lh-hero-title);
  text-align: center;
  text-wrap: balance;
  padding-top: 10px;
}

.hero__subtitle {
  margin-top: 0.25rem;
  font-size: var(--fs-hero-sub);
  font-weight: 500;
  text-align: center;
}

.hero__foot {
  display: flex;
  margin-top: auto;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero__stat {
  display: flex;
  width: 85px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.hero__stat dt {
  order: 2;
  font-family: var(--font-ui);
  font-size: var(--fs-stat-label);
  font-weight: 500;
}

.hero__stat dd {
  order: 1;
  margin: 0;
  font-size: var(--fs-stat-value);
  font-weight: 600;
}

@media (min-width: 48em) {
  .hero__stat dt,
  .hero__stat dd {
    white-space: nowrap;
  }
}

/* Price disclaimer between the stats and the CTA (Figma 1943:5640 mobile,
   1943:5645 desktop). Negative margins pull it into the .hero__foot gap so the
   stats-to-note and note-to-button spacing match the artboard: 13px / 12px on
   mobile, 38px / 24px on desktop. */
.hero__note {
  margin-block: -5px -6px;
  font-size: 0.5rem; /* 8px */
  line-height: 1.59;
  text-align: center;
  color: #ffffff;
}

.hero__rule {
  width: 1px;
  height: 30px;
  flex: none;
  background-color: #ffffff;
}

@media (min-width: 48em) {
  .hero {
    --hero-parallax: 96px;

    min-height: 620px;
  }

  .hero__media::after {
    height: 48%;
  }

  .hero__inner {
    min-height: 620px;
    padding-top: 140px;
    padding-bottom: 48px;
  }

  .hero__stat {
    width: auto;
    min-width: 150px;
  }

  .hero__rule {
    width: 2px;
    height: 85px;
  }

  .hero__foot {
    gap: 32px;
  }

  /* Tablet has no artboard — interpolated between the mobile and desktop notes. */
  .hero__note {
    margin-block: -12px;
    font-size: 0.75rem;
  }
}

@media (min-width: 80em) {
  .hero {
    --hero-parallax: 150px;

    min-height: 1016px;
  }

  .hero__inner {
    min-height: 1016px;
    padding-top: 154px;
    /* CTA bottom at y 974 of the 1016px artboard. */
    padding-bottom: 42px;
  }

  /* Desktop weights differ from mobile (Figma 479:2094 / 479:2098 / 479:2099):
     subtitle Regular, stat values Bold, stat labels Satoshi Regular. */
  .hero__subtitle {
    margin-top: 0;
    font-weight: 400;
  }

  .hero__stat dt {
    font-weight: 400;
  }

  .hero__stat dd {
    font-weight: 700;
  }

  .hero__stats {
    gap: 80px;
  }

  .hero__foot {
    gap: 50px;
  }

  .hero__note {
    margin-block: -12px -26px;
    font-size: 1rem; /* 16px */
  }

  .hero__stat--residences {
    min-width: 197px;
  }

  .hero__stat--price {
    min-width: 142px;
  }

  .hero__stat--location {
    min-width: 223px;
  }
}

/* --------------------------------------------------------------------------
   Section shells
   -------------------------------------------------------------------------- */

/* On a phone the fold lands inside this section, so its marble is the largest
   thing painted in the first viewport — the LCP element. A phone never needs
   more than ~840 device pixels of a low-contrast `cover` texture, and the wide
   file is four times the bytes, so the narrow one is the default and the wide
   one is picked up from 30em. */
.section--ivory {
  background-color: var(--color-bg-ivory);
  background-image: url("../assets/images/texture-marble-840.webp");
  background-size: cover;
  background-position: center;
  color: var(--color-ink);
}

@media (min-width: 30em) {
  .section--ivory {
    background-image: url("../assets/images/texture-marble.webp");
  }
}

.section--deep {
  background-color: var(--color-bg-deep);
  color: var(--color-ink-inverse);
}

/* Below-the-fold sections are taken out of the first layout and paint pass.
   Between them they hold 47 of the page's images; on a phone the fold lands in
   the middle of ".rarest", so everything from ".residences" down is work the
   first frame does not need.

   `contain-intrinsic-size: auto <n>` is the placeholder height only until the
   section has been rendered once — after that the browser reuses the height it
   actually measured, so the scrollbar does not jump and an anchor jump lands in
   the right place. The numbers are the measured heights (mobile / desktop):
   residences 1258/1114, crafted 988/650, location 865/484, connect 838/490.

   ".hero" and ".rarest" are deliberately absent — both are in the first
   viewport, and a section that intersects the viewport is rendered anyway. */
.residences,
.crafted,
.location,
.connect {
  content-visibility: auto;
}

.residences {
  contain-intrinsic-size: auto 1200px;
}

.crafted {
  contain-intrinsic-size: auto 900px;
}

.location {
  contain-intrinsic-size: auto 800px;
}

.connect {
  contain-intrinsic-size: auto 800px;
}


/* --------------------------------------------------------------------------
   Gallery — "The Rarest of Private Living"
   -------------------------------------------------------------------------- */

.rarest {
  padding-block: 16px 16px;
}

.rarest__head {
  display: grid;
  gap: 0;
  padding-block: 10px;
}

/* `balance` evens the line lengths, so on mobile every line sits the same
   distance from both screen edges instead of two full lines over a short
   one. */
.rarest__lede {
  padding-top: 10px;
  text-wrap: balance;
}

/* Mobile lets the lede wrap freely so every line runs the full measure and
   the margins match on both sides; the forced break only applies once the
   line is wide enough to hold the two-line desktop setting. */
.lede__break {
  display: none;
}

@media (min-width: 48em) {
  .lede__break {
    display: inline;
  }
}

/* Mobile-only line break — the disclaimer starts its last line at "ในการ"
   (563:6068). */
.break-mobile {
  display: inline;
}

@media (min-width: 48em) {
  .break-mobile {
    display: none;
  }
}

.gallery {
  position: relative;
  margin-top: 36px;
}

.gallery__track {
  display: flex;
  gap: 13px;
  align-items: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  scrollbar-width: none;
}

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

.gallery__slide {
  flex: none;
  width: 299px;
  max-width: 85vw;
  scroll-snap-align: center;
  text-align: center;
}

.gallery__slide img {
  width: 100%;
  aspect-ratio: 299 / 181;
  object-fit: cover;
}

/* Each photo is a link to its full-size file; the lightbox intercepts it. */
.gallery__zoom {
  display: block;
  cursor: zoom-in;
}

.gallery__caption {
  display: block;
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: var(--fs-slide-caption);
  line-height: 1.59;
}

.gallery__nav {
  display: none;
}

/* Pressing an arrow pages the row by re-ordering the slides in the DOM, which
   is an instant swap. The re-ordered row is glided in from the side it was
   paged from — next comes from the right, prev from the left — the same idiom
   as the unit photo switch, and it runs on the track so a single
   `animationend` marks the end of the turn.

   Only the rotating (>=80em) layout reaches this; below that the track is a
   native scroll-snap strip and the browser animates the scroll itself.
   `prefers-reduced-motion` collapses the duration globally (base.css). */
.gallery__track--enter {
  animation: gallery-turn calc(var(--dur) * 1.5) var(--ease) both;
}

.gallery__track--enter-next {
  --turn-shift: 3.5%;
}

.gallery__track--enter-prev {
  --turn-shift: -3.5%;
}

/* The centre slide grows on the swap — `.gallery__slide--active` changes both
   its width and its aspect ratio — so it settles up from slightly under size
   rather than snapping straight to the larger box. */
.gallery__track--enter .gallery__slide--active {
  animation: gallery-slide-settle calc(var(--dur) * 1.5) var(--ease) both;
}

@keyframes gallery-turn {
  from {
    opacity: 0.4;
    translate: var(--turn-shift, 3.5%) 0;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes gallery-slide-settle {
  from {
    scale: 0.96;
  }

  to {
    scale: 1;
  }
}

/* Mobile sets the disclaimer in a fixed 323px box (563:6068), which is what
   makes "…วัสดุ" end the first line. Wider layouts lift the cap. */
.rarest__disclaimer {
  max-width: 323px;
  margin-top: 36px;
  margin-inline: auto;
}

@media (min-width: 48em) {
  .rarest__disclaimer {
    max-width: none;
  }
}

@media (min-width: 80em) {
  /* The turn glides the row a few percent sideways, and the outward half of
     that travel briefly reaches past the viewport — enough for the page to
     gain a horizontal scrollbar mid-animation. `clip` rather than `hidden`
     because it only bounds the x axis: `overflow-y` stays visible, so the
     centre slide's drop shadow and the arrows are not cut. */
  .rarest {
    padding-block: 38px 46px;
    overflow-x: clip;
  }

  .gallery {
    margin-top: 29px;
  }

  /* Widths are the Figma row (426 / 475 / 426 with 16px gaps = 1349px) held
     as percentages so the row still fits a 1280px viewport. */
  .gallery__track {
    gap: 1.18%;
    overflow: visible;
    justify-content: center;
    padding-inline: 0;
  }

  /* The whole room list lives in the DOM in Figma's order — mobile scrolls all
     of it — so the desktop row renders only the three slides a `Gallery
     Slider` state shows. `order` rather than DOM position places them, so the
     window still reads left-centre-right where it wraps past the end of the
     list (the last room's next slide is the first one). */
  .gallery__slide {
    display: none;
    width: 31.35%;
    flex: 0 0 31.35%;
    max-width: none;
  }

  .gallery__slide--prev,
  .gallery__slide--active,
  .gallery__slide--next {
    display: block;
  }

  .gallery__slide--prev {
    order: 1;
  }

  .gallery__slide--next {
    order: 3;
  }

  .gallery__slide img {
    aspect-ratio: 426 / 266;
  }

  .gallery__caption {
    font-size: var(--fs-slide-caption-desktop);
  }

  /* Centre slide is larger and carries the shared drop-shadow style. */
  .gallery__slide--active {
    order: 2;
    width: 34.95%;
    flex: 0 0 34.95%;
  }

  .gallery__slide--active img {
    aspect-ratio: 475 / 287;
    box-shadow: var(--shadow-slide);
  }

  .gallery__nav {
    display: block;
  }

  .gallery__btn {
    position: absolute;
    top: calc(50% - 16px);
    translate: 0 -50%;
    z-index: 2;
  }

  .gallery__btn--prev {
    left: -12px;
  }

  .gallery__btn--next {
    right: -12px;
  }

  .gallery__btn .chevron {
    --chevron-color: var(--color-deep-velvet-blue);
  }

  .rarest__disclaimer {
    margin-top: 32px;
  }
}

/* --------------------------------------------------------------------------
   Residences — plans + comparison table
   -------------------------------------------------------------------------- */

/* Figma 580:4203 — the section frame carries no fill of its own, so it shows the
   mobile page frame's Percelain Ivory. The project paints per section rather
   than on <body> (which is white), so the ivory lands here: without it the title
   and the 10px bottom radius of the spec panel sat on white. The frame's layout
   is paddingTop/Bottom 16 with a 42px itemSpacing to `.residences__body`. */
.residences {
  padding-block: 1px;
  background-color: var(--color-bg-ivory);
}

.residences__title {
  padding-inline: var(--gutter);
  color: var(--color-ink);
  padding-bottom: 1.6em;
}

.residences__body {
  margin-top: 42px;
}

/* The unit arrows sit over the exterior photo on the mobile artboard, so the
   photos get a wrapper to position against — `.plans` cannot host them any more
   because its `container-type: inline-size` makes it a containing block for
   absolutely positioned descendants, trapping them inside the plan panel. */
.residences__gallery {
  position: relative;
}

.residences__photo {
  display: block;
  width: 100%;
  /* Clips the incoming photo's slide. It has to sit on the <picture> rather
     than on the wrapper, because the wrapper also holds the arrows and the
     desktop next arrow is placed outside its right edge. */
  overflow: hidden;
}

.residences__photo img {
  width: 100%;
  aspect-ratio: 320 / 345;
  object-fit: cover;
}

/* A unit switch swaps the photo on the same frame, so the incoming one is slid
   in from the side it was paged from — next comes from the right, prev from the
   left. `prefers-reduced-motion` collapses the duration globally (base.css). */
.residences__photo--enter img {
  animation: residences-photo-in calc(var(--dur) * 2) var(--ease) both;
}

.residences__photo--enter-prev img {
  --photo-shift: -12%;
}

.residences__photo--enter-next img {
  --photo-shift: 12%;
}

@keyframes residences-photo-in {
  from {
    opacity: 0;
    translate: var(--photo-shift, 12%) 0;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

.plans {
  position: relative;
  padding: 30px 0px;
  background-color: var(--color-bg-ivory);
  /* The 6-up plan row sizes every plan off the panel's width (see the
     `.plans__grid img` height below), and a percentage cannot express a height
     from an inline size, so the panel is a query container. Read on the
     descendants — an element's own `container-type` does not apply to itself. */
  container-type: inline-size;
}

.plans__name {
  display: none;
}

.plans__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* No column gap on the 3-up artboard: three equal columns fill the content
     band (3 * 331 = 993 of 992.5 measured) and the separation comes from the
     plans being narrower than their column, not from a gutter. The row gap is
     0.272x the plan height there, so it rides the same scale — less the ~6px
     the 13px floor label under each plan adds beyond the artboard's 132px
     label-to-label pitch, so the panel keeps its height at 393px. */
  column-gap: 0;
  row-gap: calc(9.45cqi - 16.5px);
  align-items: center;
  justify-items: center;
}

.plans__thumb {
  display: block;
  width: 100%;
  text-decoration: none;
  cursor: zoom-in;
  transition: opacity var(--dur) var(--ease);
}

.plans__thumb:hover {
  opacity: 0.65;
}

/* Every plan is drawn to the same height and centred in its column, so the row
   keeps its shape whichever unit is active — the plans are different shapes and
   the exports are cropped tight, so each width follows its own aspect ratio.

   The height is a fixed multiple of the column width, measured off the artboard
   for each arrangement. On the 3-up row that is 1.043 (a 345.8px plan in a 331px
   column), so `height` is 1.043 * ((100cqi - 110px) / 3), folded into one calc —
   110px is the panel's 2 * 55px of padding, and there is no column gap to
   subtract. `max-width` has to go because the plans are sized off their height
   and the base reset would clamp the wide ones. */
.plans__grid img {
  height: calc(34.77cqi - 38.24px);
  width: auto;
  max-width: none;
}

/* Below desktop each plan carries its own floor name directly under it, as in
   the mobile `Unit Plan` (563:6641: Proxima Nova Thai Semibold 8px, black,
   centred). It is read off the thumbnail's `data-plan-label` — the same name
   the viewer captions with — so a unit switch swaps it along with the plan and
   the markup stays one source. Black matches the viewer caption; no project
   token carries pure black. Desktop hides it for the shared `.plans__labels`
   row instead. */
.plans__thumb::after {
  content: attr(data-plan-label);
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: var(--fs-plan-label-mobile);
  font-weight: 600;
  line-height: 11px;
  text-align: center;
  white-space: nowrap;
  color: #000000;
}

.plans__label {
  display: none;
}

.plans__btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
}

.plans__btn--prev {
  left: 2px;
}

.plans__btn--next {
  right: 2px;
}

.plans__btn .chevron {
  --chevron-color: var(--color-deep-velvet-blue);
}

@media (min-width: 80em) {
  .residences__title {
    font-size: 2.5rem;
    line-height: 1.1;
    text-align: left;
  }
}

/* Comparison table -------------------------------------------------------- */

.spec {
  position: relative;
  padding-block: 24px 32px;
  background-color: var(--color-bg-deep);
  background-image: url("../assets/images/pattern-table.webp");
  background-size: cover;
  background-position: center;
  color: var(--color-ink-inverse);
  border-end-start-radius: var(--radius-panel);
  border-end-end-radius: var(--radius-panel);
}

.spec__unit {
  padding-inline: 28px;
  font-size: var(--fs-unit-name);
  font-weight: 700;
  color: #ffffff;
}

.spec__table {
  /* Inset from the panel edges so the row rules stop short of both sides
     instead of bleeding edge to edge. The cell padding below is reduced by the
     same idea, keeping the labels on the 28px line `.spec__unit` sits on. */
  width: calc(100% - var(--gutter) * 2);
  margin-inline: auto;
  margin-top: 6px;
  font-size: var(--fs-table);
  /* Auto layout on mobile: the single visible unit column then centres in
     whatever the label column leaves. `fixed` returns at the desktop
     breakpoint, where the five columns are pinned by <colgroup>. */
  table-layout: auto;
}

.spec__table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.spec__table th,
.spec__table td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
}

.spec__table thead {
  display: none;
}

.spec__table tbody th {
  width: 1%;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.spec__table tbody td {
  text-align: center;
  line-height: 2; /* 24px on 12px — Figma value cells (563:6250), 44px rows */
}

.spec__table tbody tr:not(:last-child) th,
.spec__table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--color-rule);
}

/* Mobile shows the active unit's column only, as designed. `display:none` on a
   <col> is not honoured, so the cells themselves are dropped. */
.spec__table tr > *:not(:first-child) {
  display: none;
}

.spec[data-active-unit="1"] .spec__table tr > *:nth-child(2),
.spec[data-active-unit="2"] .spec__table tr > *:nth-child(3),
.spec[data-active-unit="3"] .spec__table tr > *:nth-child(4),
.spec[data-active-unit="4"] .spec__table tr > *:nth-child(5) {
  display: table-cell;
}

/* The unit names in <thead> double as desktop switch controls. They ship
   `disabled` so that without JS they read as plain headings. */
.spec__tab {
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.spec__tab:disabled {
  cursor: default;
}

.spec__tab:not(:disabled):hover {
  text-decoration: underline;
}

.spec__cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
  padding-inline: var(--gutter);
}

@media (min-width: 48em) {
  .residences__photo img {
    aspect-ratio: 393 / 260;
  }

  /* Six even columns from here up, off the 6-up artboard, which does gutter its
     columns — so the gap comes back and the height is re-derived against the
     pitch it produces: 1.098 * ((100cqi - 180px) / 6 + 14px), where 180px is the
     panel's 2 * 55px of padding plus the row's 5 * 14px of gaps. */
  .plans__grid {
    grid-template-columns: repeat(6, 1fr);
    column-gap: 14px;
  }

  .plans__grid img {
    height: calc(18.3cqi - 17.6px);
  }
}

@media (min-width: 80em) {
  .residences {
    padding-block: 0;
  }

  .residences__body {
    display: grid;
    margin-top: 0;
    grid-template-columns: 572fr 868fr;
    grid-template-rows: auto;
    align-items: stretch;
    background-color: var(--color-bg-ivory);
  }

  /* The heading sits inside the right-hand column on the desktop artboard,
     stacked over the ivory plan panel that shares the same grid cell. */
  .residences__title {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    padding: 57px 40px 0 68px;
  }

  .residences__gallery {
    grid-column: 1;
    grid-row: 1;
  }

  .plans {
    grid-column: 2;
    grid-row: 1;
  }

  .residences__photo img {
    height: 654px;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .plans {
    display: flex;
    flex-direction: column;
    padding: 128px 40px 0 68px;
  }

  .plans__name {
    display: block;
    margin-top: 51px;
    font-size: var(--fs-unit-name);
    font-weight: 600;
  }

  /* The thumbnails and the label row under them ride the same six columns and
     the same gap, so a unit switch changes the images and nothing else. */
  .plans__grid,
  .plans__labels {
    grid-template-columns: repeat(6, 1fr);
    gap: 11px;
  }

  .plans__grid {
    margin-top: 39px;
    align-items: center;
    justify-items: center;
    padding-right: 60px;
  }

  /* Re-derived again because the panel is now a column of its own and the gap
     changed: 223px is its 68px + 40px of padding, the row's 60px padding-right
     and its 5 * 11px of gaps, and 11px is one gap. That puts the plans at 130px
     in the 868px panel of the 1440px artboard. */
  .plans__grid img {
    height: calc(18.3cqi - 28.7px);
  }

  .plans__thumb::after {
    content: none;
  }

  .plans__label {
    display: block;
    margin-top: 35px;
    padding-block: 10px;
    font-size: var(--fs-plan-label);
    text-align: center;
  }

  .plans__labels {
    display: grid;
    padding-right: 60px;
  }

  /* Both arrows are offsets on the photo column now (572 of the 1440 frame).
     The prev arrow sits at x=54, so 54/572 = 9.44%. The next arrow sits 8px in
     from the frame's right edge, which is 868 - 8 = 860px past the photo's own
     right edge, so 860/572 = 150.35% of negative inset. */
  .plans__btn--prev {
    left: 9.44%;
    top: 300px;
    translate: 0 0;
  }

  .plans__btn--next {
    right: -150.35%;
    top: 300px;
    translate: 0 0;
  }

  .plans__btn--prev .chevron {
    --chevron-size: 40px;
    --chevron-weight: 4px;
    width: 62px;
    height: 62px;
  }

  .plans__btn--next .chevron {
    --chevron-size: 40px;
    --chevron-weight: 4px;
    width: 62px;
    height: 62px;
  }

  .spec {
    padding-block: 0 0;
    border-radius: 0;
  }

  .spec__unit {
    display: none;
  }

  .spec__table {
    margin-top: 0;
    table-layout: fixed;
  }

  .spec__table thead {
    display: table-header-group;
  }

  .spec__table thead th {
    padding-block: 26px 16px;
    font-size: var(--fs-table);
    font-weight: 800;
    text-align: center;
    border-bottom: 2px solid var(--color-rule);
  }

  .spec__table tbody th {
    width: auto;
    /* 74px off the panel edge, minus the table's own --gutter inset. */
    padding-left: 34px;
    font-weight: 600;
    white-space: normal;
  }

  .spec__table th,
  .spec__table td {
    height: 45px;
    padding-block: 0;
  }

  .spec__table tbody tr:not(:last-child) th,
  .spec__table tbody tr:not(:last-child) td {
    border-bottom: 0.5px solid var(--color-rule);
  }

  .spec__table tbody tr th,
  .spec__table tbody tr td {
    border-bottom: 0.5px solid var(--color-rule);
  }

  .spec__col--head {
    width: 22%;
  }

  .spec__col--1 {
    width: 17.7%;
  }

  .spec__col--2,
  .spec__col--3 {
    width: 19.4%;
  }

  .spec__col--4 {
    width: 21.5%;
  }

  /* Every unit column is shown at desktop; only the highlight moves. */
  .spec__table tr > *:not(:first-child) {
    display: table-cell;
  }

  /* Highlight band over the active unit — Figma `Rectangle 31`. */
  .spec[data-active-unit="1"] .spec__col--1,
  .spec[data-active-unit="2"] .spec__col--2,
  .spec[data-active-unit="3"] .spec__col--3,
  .spec[data-active-unit="4"] .spec__col--4 {
    background-color: rgb(217 217 217 / 0.3);
  }

  .spec__cta {
    margin-top: 0;
    padding-block: 57px 62px;
  }
}

/* --------------------------------------------------------------------------
   Crafted for Exceptional Living
   -------------------------------------------------------------------------- */

.crafted {
  padding-block: 40px 48px;
  background-color: var(--color-bg);
  color: var(--color-ink);
}

.crafted__body {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 36px;
}

/* Feature grid ------------------------------------------------------------- */

.features {
  order: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 24px;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.feature img {
  height: 50px;
  width: auto;
}

.feature__text {
  font-size: var(--fs-feature);
  line-height: var(--lh-feature);
  color: var(--color-shadow-brown);
}

.feature__text b {
  display: block;
  font-weight: 700;
}

/* Living slides ------------------------------------------------------------ */

.living {
  order: 1;
  position: relative;
  isolation: isolate;
}

.living__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  scrollbar-width: none;
}

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

/* One `<li>` per `image slide3` state. The opening state is the only one that
   draws two photos in the 808×412 frame, so a slide is a row of panes and the
   pane — not the slide — is what carries a photo, its scrim and its caption. */
.living__slide {
  display: flex;
  flex: none;
  gap: 12px;
}

.living__pane {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: none;
  width: 78vw;
  max-width: 320px;
  scroll-snap-align: center;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-card);
  background-color: var(--color-deep-velvet-blue);
}

.living__pane img {
  display: block;
  width: 100%;
  aspect-ratio: 545 / 348;
  object-fit: cover;
}

/* `Rectangle 45` — the two-stop transparent → Deep Velvet Blue scrim behind
   the captions, over the bottom 179px of the 412px frame. */
.living__pane::after {
  content: "";
  display: none;
  position: absolute;
  inset: auto 0 0;
  height: 43.45%;
  background-image: linear-gradient(
    to bottom,
    rgb(12 42 68 / 0),
    var(--color-deep-velvet-blue)
  );
  z-index: 1;
}

.living__caption {
  flex: 1 1 auto;
  z-index: 2;
  padding: 20px 18px 26px;
  font-size: 0.875rem; /* 14px / 21px — Figma 587:4241 */
  line-height: 21px;
  color: var(--color-porcelain-ivory);
}

.living__caption b {
  display: block;
  margin-bottom: 8px; /* Figma itemSpacing 8 */
  font-size: 1rem; /* 16px / 21px Bold — Figma 587:4242 */
  line-height: 21px;
  font-weight: 700;
}

.living__dots {
  display: none;
  justify-content: center;
  gap: 17px;
  margin-top: 16px;
}

.living__dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1px solid var(--color-porcelain-ivory);
  border-radius: 50%;
  background-color: transparent;
}

.living__dot[aria-current="true"] {
  background-color: var(--color-placeholder);
}

.living__nav {
  display: none;
}

/* Pressing an arrow pages the row by re-ordering the slides in the DOM, which
   is an instant swap. The state that lands in the window is glided in from the
   side it was paged from — next comes from the right, prev from the left — the
   same idiom as the gallery turn, and it runs on the track so a single
   `animationend` marks the end of the turn.

   Only the rotating (>=80em) layout reaches this; below that the track is a
   native scroll-snap strip and the browser animates the scroll itself.
   `prefers-reduced-motion` collapses the duration globally (base.css). */
.living__track--enter {
  animation: living-turn calc(var(--dur) * 1.5) var(--ease) both;
}

.living__track--enter-next {
  --turn-shift: 3.5%;
}

.living__track--enter-prev {
  --turn-shift: -3.5%;
}

@keyframes living-turn {
  from {
    opacity: 0.4;
    translate: var(--turn-shift, 3.5%) 0;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* The arrow takes the press with it. */
.living__btn:active .chevron {
  transform: translateX(-3px);
}

.living__btn--next:active .chevron {
  transform: translateX(3px);
}

@media (min-width: 48em) {
  .living__pane {
    width: 62vw;
    max-width: 380px;
  }

  .living__dots {
    display: flex;
  }
}

@media (min-width: 80em) {
  .crafted {
    padding-block: 60px 78px;
  }

  .crafted__body {
    display: grid;
    grid-template-columns: 448px 1fr;
    gap: 62px;
    align-items: center;
    margin-top: 50px;
    padding-left: 42px;
  }

  .features {
    order: 1;
    gap: 46px 45px;
  }

  /* The turn glides the track a few percent sideways; `clip` bounds that travel
     to the 808px window without cutting the arrows or the dots, which sit
     inside it. `overflow-y` stays visible. */
  .living {
    order: 2;
    overflow-x: clip;
  }

  /* Desktop shows one 808×412 state at a time; the carousel rotates the list so
     the state to show is always the track's first child. The track stays a
     scroll-snap strip rather than `overflow: hidden` so the other three states
     are still reachable with JavaScript off. */
  .living__track {
    gap: 0;
    padding-inline: 0;
    margin-inline: 0;
    /* Snapping would re-snap to the slide the arrows just moved to the end of
       the row, so desktop scrolls freely and the arrows do the paging. */
    scroll-snap-type: none;
  }

  .living__slide {
    width: 100%;
    gap: 0;
    aspect-ratio: 808 / 412;
  }

  .living__pane {
    width: auto;
    max-width: none;
    flex: 1 1 0;
    scroll-snap-align: none;
    overflow: visible;
    border-radius: 0;
    background-color: transparent;
  }

  .living__pane::after {
    display: block;
  }

  .living__pane img {
    height: 100%;
    aspect-ratio: auto;
  }

  .living__caption {
    position: absolute;
    flex: none;
    left: 84px;
    right: 80px;
    bottom: 45px;
    padding: 0;
    font-size: 1rem;
    line-height: 21px;
    text-shadow: 0 1px 3px rgb(12 42 68 / 0.9);
  }

  .living__caption b {
    margin-bottom: 0;
    font-size: inherit;
    line-height: inherit;
  }

  /* The split state insets its two captions independently (Figma x 56 / 452). */
  .living__slide--split .living__pane:first-child .living__caption {
    left: 56px;
    right: 26px;
  }

  .living__slide--split .living__pane:last-child .living__caption {
    left: 48px;
    right: 63px;
  }

  .living__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    z-index: 3;
    margin-top: 0;
  }

  .living__nav {
    display: block;
  }

  .living__btn {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    z-index: 3;
  }

  .living__btn--prev {
    left: 4px;
  }

  .living__btn--next {
    right: 4px;
  }
}

/* --------------------------------------------------------------------------
   Location
   -------------------------------------------------------------------------- */

.location {
  background-color: var(--color-bg-deep);
  color: var(--color-ink-inverse);
}

.location__grid {
  display: grid;
}

.location__panel {
  padding: 30px var(--gutter) 34px;
}

.location__title {
  text-align: center;
}

.location__address {
  display: block;
  margin-top: 10px;
  font-size: var(--fs-address);
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.location__address:hover {
  text-decoration: underline;
}

/* The Figma artboard gives the map a 1644x594 strip, which on a phone lands
   around 125px tall. Google's embed drops its own +/- zoom controls and its
   fullscreen button at that height, and a two-finger pinch inside a 125px
   band is what iOS reads as a page zoom rather than a map zoom. Phones get a
   taller frame so the embed keeps its controls and the gesture has room; the
   80em rule below restores the artboard strip on desktop.

   The height is clamped rather than driven by `aspect-ratio`, because a
   `max-height` cap on an auto-width block transfers back through the ratio and
   shrinks the width too, leaving the frame narrower than the panel. */
.location__map {
  margin-top: 30px;
  display: block;
  overflow: hidden;
  background-color: #ffffff;
  width: 100%;
  height: clamp(260px, 75vw, 380px);
}

.location__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  /* iOS only hands a pinch to a cross-origin frame when the frame itself
     claims the gesture; the default `auto` is what we want, stated so a later
     `touch-action` on an ancestor cannot silently take it away. */
  touch-action: auto;
}

/* Map facade. The button carries the still and is only offered once `.js` is
   on the root — with JavaScript off the <noscript> frame beside it is the live
   map, and a dead button over it would be a second, useless control. */
.location__map-load {
  display: none;
}

.js .location__map-load {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.location__map-still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.location__map-cta {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: 16px;
  transform: translateX(-50%);
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg-deep);
  color: var(--color-ink-inverse);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgb(0 0 0 / 25%);
}

/* Compositing-only hover, so the hint lifting does not repaint the map still. */
@media (hover: hover) {
  .location__map-cta {
    transition: transform 160ms ease;
  }

  .location__map-load:hover .location__map-cta {
    transform: translateX(-50%) translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .location__map-cta {
    transition: none;
  }

  .location__map-load:hover .location__map-cta {
    transform: translateX(-50%);
  }
}

.location__zoom {
  display: block;
  cursor: zoom-in;
}

.location__illustration {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (min-width: 80em) {
  .location__grid {
    grid-template-columns: 909fr 531fr;
    align-items: stretch;
  }

  /* The right column's illustration sets the row height, so the panel is
     taller than title + address + a fixed 297px strip. Flex column with the
     map as the growing item spends that leftover on the embed instead of
     leaving a navy gap under it. */
  .location__panel {
    padding: 30px 40px 40px 46px;
    display: flex;
    flex-direction: column;
  }

  .location__title,
  .location__address {
    text-align: left;
  }

  .location__title {
    line-height: 60px;
  }

  .location__address {
    margin-top: 0;
  }

  .location__map {
    margin-top: 24px;
    flex: 1 1 auto;
    min-height: 297px;
    height: auto;
  }

  .location__map iframe {
    height: 100%;
  }

  .location__zoom,
  .location__illustration {
    height: 100%;
  }
}

/* --------------------------------------------------------------------------
   Nearby + registration
   -------------------------------------------------------------------------- */

.connect {
  display: grid;
  background-color: var(--color-bg);
}

.nearby {
  padding: 18px var(--gutter) 28px;
  background-color: var(--color-clay-brown);
  color: var(--color-ivory-muted);
}

.nearby__list {
  display: grid;
  gap: 6px;
}

/* The two column wrappers only exist for the desktop artboard's independent
   columns; on mobile they must not interrupt the single accordion stack. */
.nearby__col {
  display: contents;
}

.nearby__group {
  border-bottom: 1px solid rgb(238 231 222 / 0.15);
}

.nearby__summary {
  display: flex;
  align-items: center;
  /* Figma: icon spans 37..55, heading text starts at 63. */
  gap: 8px;
  min-height: 45px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: var(--fs-nearby-cat);
  /* Figma: 20px Marcellus with AUTO line height renders a 25px line box. */
  line-height: 25px;
  /* Figma sets #EEE7DE80 on the collapsed label; 50% measures 3.12:1 against
     the clay panel, below the AA floor for 20px regular text, so it is lifted
     to 75% (4.9:1). */
  color: rgb(238 231 222 / 0.75);
}

.nearby__summary::-webkit-details-marker {
  display: none;
}

.nearby__group[open] > .nearby__summary {
  color: var(--color-ivory-muted);
}

.nearby__summary img {
  width: 18px;
  height: 18px;
  flex: none;
}

.nearby__marker {
  display: block;
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  rotate: -45deg;
  transition: rotate var(--dur) var(--ease);
}

.nearby__group[open] .nearby__marker {
  rotate: 45deg;
}

.nearby__rows {
  padding-bottom: 14px;
}

.nearby__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 12px;
  font-size: var(--fs-nearby-item);
  /* Figma: 12px Proxima Nova Thai with AUTO line height renders a 19px line
     box; the rows auto-layout uses itemSpacing -2, so the pitch is 17px. */
  line-height: 19px;
}

.nearby__row span:nth-child(2) {
  min-width: 3.5rem;
  text-align: right;
}

.nearby__row span:nth-child(3) {
  min-width: 3.5rem;
  text-align: right;
}

/* Registration form -------------------------------------------------------- */

.form {
  padding: 32px var(--gutter) 40px;
  background-color: var(--color-bg);
  color: var(--color-ink);
}

.form__title {
  font-size: var(--fs-form-title);
  font-weight: 700;
  line-height: 1.6;
}

.form__fields {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.form__label {
  font-size: var(--fs-field-label);
  font-weight: 500;
  line-height: 1.6;
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-deep-velvet-blue);
  background-color: transparent;
  font-size: 0.9375rem;
}

.form__input {
  height: 36px;
  border-radius: var(--radius-pill);
}

.form__textarea {
  height: 66px;
  border-radius: var(--radius-field);
  resize: vertical;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.form__consent {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-consent);
  line-height: 1.5;
}

.form__consent input {
  width: 14px;
  height: 14px;
  flex: none;
  accent-color: var(--color-deep-velvet-blue);
}

.form__submit {
  min-width: 113px;
  min-height: 32px;
  padding: 5px 1.25rem;
  border-radius: var(--radius-submit);
  background-color: var(--color-deep-velvet-blue);
  color: var(--color-porcelain-ivory);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  transition: opacity var(--dur) var(--ease);
}

.form__submit:hover,
.form__submit:focus-visible {
  opacity: 0.85;
}

/* Honeypot. Kept in the accessibility tree's blind spot without display:none,
   which some bots detect and skip. */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__status {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.form__status[data-state="ok"] {
  color: var(--color-alert-ok);
}

.form__status[data-state="error"] {
  color: var(--color-alert-error);
}

.form__submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

@media (min-width: 80em) {
  .connect {
    grid-template-columns: 909fr 531fr;
    align-items: stretch;
  }

  .nearby {
    padding: 70px 43px 40px 37px;
    background-color: var(--color-heritage-brown);
    background-image: url("../assets/images/texture-wood.webp");
    background-size: cover;
    background-position: center;
  }

  .nearby__list {
    /* Figma: left column 37..476 = 439 wide, right column 521..866 = 345,
       45 between them; 439 + 45 + 345 = 829 = the list width. */
    grid-template-columns: 439fr 345fr;
    gap: 0 45px;
    align-items: start;
  }

  /* Both columns start at y=3804, then stack on their own: the artboard spaces
     the left column 17px apart (3958 -> 3975, 4061 -> 4078) and the right one
     14px (3974 -> 3988), so the two columns are not row-aligned. */
  .nearby__col {
    display: flex;
    flex-direction: column;
  }

  .nearby__col--left {
    gap: 17px;
  }

  .nearby__col--right {
    gap: 14px;
  }

  .nearby__group {
    border-bottom: 0;
  }

  .nearby__summary {
    min-height: 0;
    cursor: default;
    color: var(--color-ivory-muted);
    pointer-events: none;
  }

  .nearby__marker {
    display: none;
  }

  .nearby__rows {
    /* Figma: rows start 8px under the 25px heading box (schools 3829 -> 3837).
       Left padding is the 18px icon + its 8px gap. */
    padding-top: 8px;
    padding-bottom: 0;
    padding-left: 26px;
  }

  /* Lifestyle is the one group the artboard sets 1px tighter (3829 -> 3836). */
  .nearby__group--lifestyle .nearby__rows {
    padding-top: 7px;
  }

  /* Figma schools rows: name frame 63..373, km 355..418 (63 wide, right
     aligned), mins 435..476 (41 wide) — 17px between the two number columns.
     The longest name overruns into the km gutter in the artboard too, so it
     stays on one line rather than wrapping. */
  .nearby__group--schools .nearby__row {
    /* Number columns hug their own text as in the artboard (km frame 63 wide,
       mins 41), so the mins column stays flush to the 476 group edge instead
       of overrunning it in a font that measures slightly wider. */
    grid-template-columns: 1fr auto auto;
    gap: 0 0;
  }

  /* Every column in the artboard is a hug frame, so no cell wraps; the local
     font is a touch wider than Proxima Nova Thai, so the right-aligned number
     cells overrun leftwards instead of breaking. */
  .nearby__group--schools .nearby__row span {
    white-space: nowrap;
  }

  .nearby__group--schools .nearby__row span:nth-child(2) {
    min-width: 0;
    padding-right: 17px;
  }

  .nearby__group--schools .nearby__row span:nth-child(3) {
    min-width: 0;
  }

  .nearby__row {
    gap: 0 12px;
  }

  /* itemSpacing -2 on the Figma rows frame: 19px line box, 17px pitch. */
  .nearby__row + .nearby__row {
    margin-top: -2px;
  }

  .form {
    padding: 19px 57px 26px 40px;
  }

  .form__fields {
    margin-top: 8px;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding-block: 32px 36px;
  background-color: var(--color-bg-deep);
  background-image: url("../assets/images/pattern-footer.webp");
  background-size: cover;
  background-position: center;
  color: var(--color-ink-inverse);
  /* Every footer text node is Proxima Nova Thai (607:15024, 607:15026,
     607:15049); only the desktop tagline is Satoshi. Figma "auto" line
     height: 14px -> 19px, 12px -> 16.3px. */
  font-family: var(--font-body);
  line-height: 1.36;
}

.site-footer__grid {
  display: grid;
  gap: 24px;
  align-items: start;
}

.site-footer__logo {
  width: 178px;
}

.site-footer__tagline {
  font-family: var(--font-ui);
  font-size: var(--fs-footer);
}

.site-footer__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  margin-top: 20px;
}

.site-footer__block h2 {
  font-size: var(--fs-footer);
  font-weight: 500;
  line-height: inherit;
}

.site-footer__block p,
.site-footer__block a {
  font-size: var(--fs-footer-sm);
}

.site-footer__block a {
  /* Block, not inline-block: an inline-block adds a baseline descender gap
     that pushed the contacts row 6px taller than the design's 54px. */
  display: block;
  width: fit-content;
}

/* "Tel: " is 12px like the rest of the block; only the number is 14px. */
.site-footer__tel {
  text-decoration: none;
}

.site-footer__tel-number {
  font-size: var(--fs-footer);
}

/* "Address" is Medium; "ติดต่อเรา" is Regular (479:13789). */
.site-footer__block h2.site-footer__heading--regular {
  font-weight: 400;
}

.social {
  display: flex;
  gap: 11.25px;
}

.social a {
  display: block;
  width: 30px;
  height: 30px;
  transition: opacity var(--dur) var(--ease);
}

.social a:hover {
  opacity: 0.75;
}

.site-footer__copyright {
  font-size: var(--fs-copyright);
  line-height: 16px;
}

@media (min-width: 80em) {
  .site-footer {
    padding-block: 32px 55px;
  }

  .site-footer__grid {
    grid-template-columns: 276fr 552fr 277fr 255fr;
    gap: 0;
    align-items: end;
    min-height: 140px;
  }

  .site-footer__logo {
    align-self: start;
  }

  .site-footer__contacts {
    gap: 20px;
  }

  .site-footer__tagline {
    margin-bottom: 47px;
  }

  .social,
  .site-footer__copyright {
    /* The design rests these 3px above the contacts column's bottom edge. */
    margin-bottom: 3px;
  }

  .site-footer__copyright {
    /* Starts at its column edge (1145/1440), which already leaves the fixed
       action buttons ~64px of clearance over the footer's right edge. */
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   Floating actions
   -------------------------------------------------------------------------- */

.fab-stack {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  /* `Frame 3384644` (479:14691), the resting pair's own auto-layout. */
  gap: 9px;
  /* The pressed state's 44px social column and its 50px close button share one
     centre line (both centred on x=123 in 479:14705). */
  justify-items: center;
}

/* Pressed state: `Property 1=Group 6` (479:14705) drops the back-to-top button,
   but it is kept visible here on purpose — going back up stays reachable while
   the channels are open. The arrow is the bottom-most button either way, so the
   close X and the social column above it simply sit one 9px row higher than in
   the design. Deliberate deviation: do not re-add a rule hiding `.fab--top`. */

/* The stack is only offered once the page has scrolled past the hero — on the
   hero itself there is nothing to go back up to. JavaScript adds
   `is-revealed`, so the rule is scoped to `.js`: with
   scripting off the buttons are simply always there. The `js` class is set by
   the blocking flash guard in the head, so the hidden state is painted once
   rather than appearing and then being taken away. */
.js .fab-stack {
  visibility: hidden;
  transform: translateY(12px);
  opacity: 0;
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    visibility var(--dur) var(--ease);
}

.js .fab-stack.is-revealed {
  visibility: visible;
  transform: none;
  opacity: 1;
}

.fab {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background-color: var(--color-deep-velvet-blue);
  color: var(--color-porcelain-ivory);
  text-decoration: none;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.25);
  transition: transform var(--dur) var(--ease);
}

.fab:hover {
  transform: translateY(-2px);
}

.fab img {
  width: 22px;
  height: 22px;
}

.fab--top img {
  width: 16px;
  height: 22px;
}

/* --- The chat button and the channels it opens ---------------------------- */

.fab-chat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

.fab--chat {
  /* The chat glyph and the X occupy the same cell so one can swap for the
     other; `place-items` from `.fab` centres both. */
  cursor: pointer;
  list-style: none;
}

/* `Group 198` (479:14701) is 25.78x22.45, not the square `.fab img` box. */
.fab--chat .fab__icon {
  width: 26px;
  height: 22px;
}

.fab--chat::-webkit-details-marker {
  display: none;
}

.fab__icon,
.fab__x {
  grid-area: 1 / 1;
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.fab-chat[open] .fab__icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

/* 479:14711's `icon` vector is 18.67px. Drawn in CSS like `.lightbox__x`
   rather than exported, so the swap can be animated. Its Figma fill is the
   M3 library's #FEF7FF, which has no counterpart in this palette. */
.fab__x {
  position: relative;
  width: 19px;
  height: 19px;
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.fab__x::before,
.fab__x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-bg);
}

.fab__x::before {
  transform: rotate(45deg);
}

.fab__x::after {
  transform: rotate(-45deg);
}

.fab-chat[open] .fab__x {
  opacity: 1;
  transform: none;
}

.fab-chat__list {
  /* `Frame 3384470` (479:14712): vertical, itemSpacing 12. */
  display: grid;
  gap: 12px;
  /* `Frame 3384470`'s bottom edge (y=811) to the close button's top edge
     (y=831.58) in 479:14705. This is a margin rather than a `gap` on
     `.fab-chat`, because a closed <details> still lays its content slot out as
     a zero-height flex item — a `gap` there would show while it is closed and
     push the resting pair apart. */
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.fab-chat__link {
  /* `Ellipse 4` (479:14714): 44px, white, over the shared two-shadow effect
     style (10/10/20 #98ADD940 plus 0/4/4 #00000040). */
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background-color: var(--color-bg);
  box-shadow:
    10px 10px 20px rgb(152 173 217 / 0.25),
    0 4px 4px rgb(0 0 0 / 0.25);
  transition: transform var(--dur) var(--ease);
}

.fab-chat__link:hover {
  transform: translateY(-2px);
}

/* The column fans out from the chat button, so the nearest channel leads. */
.fab-chat[open] .fab-chat__item {
  animation: fab-chat-rise var(--dur) var(--ease) backwards;
}

.fab-chat[open] .fab-chat__item:nth-last-child(2) {
  animation-delay: 40ms;
}

.fab-chat[open] .fab-chat__item:nth-last-child(3) {
  animation-delay: 80ms;
}

.fab-chat[open] .fab-chat__item:nth-last-child(4) {
  animation-delay: 120ms;
}

@keyframes fab-chat-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.8);
  }
}

/* The global reduce block zeroes durations but not delays, which would leave a
   staggered item hidden by `backwards` fill until its turn came. */
@media (prefers-reduced-motion: reduce) {
  .fab-chat[open] .fab-chat__item {
    animation-delay: 0s !important;
  }
}

@media (min-width: 80em) {
  .fab-stack {
    right: 40px;
    bottom: 40px;
  }
}

/* --------------------------------------------------------------------------
   Floor-plan viewer
   -------------------------------------------------------------------------- */

/* Grounded on the `Type A` popup frame (529:8663, 1442x790): an opaque white
   takeover, not a dimmed panel over the page. Insets below are that frame's
   measurements expressed against its width/height. */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: var(--color-bg);
  overflow: hidden;
}

.lightbox::backdrop {
  background-color: var(--color-bg);
}

/* A mouse open parks focus on the dialog itself (lightbox.js); it is a
   container, not a control, so it draws no ring. Its buttons keep theirs. */
.lightbox:focus {
  outline: none;
}

.lightbox[open],
.lightbox[open]::backdrop {
  animation: lightbox-in var(--dur) var(--ease);
}

@keyframes lightbox-in {
  from {
    opacity: 0;
  }
}

/* Navy on white — the default light focus ring has too little contrast here. */
.lightbox :where(a, button):focus-visible {
  outline-color: var(--color-deep-velvet-blue);
}

/* No padding: the close and arrow buttons are positioned against the sheet
   edge, so the panel's padding box has to be the sheet itself. */
.lightbox__panel {
  position: relative;
  height: 100%;
}

.lightbox__figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  /* 40 / 46 above and below, 69.17 (4.8%) each side. The 56px floor keeps a
     narrow, width-constrained plan clear of the arrow buttons — below roughly
     1170px the percentage alone lets the drawing run under them. */
  gap: clamp(16px, 3.8vh, 30px);
  height: 100%;
  padding: clamp(16px, 5vh, 40px) max(4.8%, 56px) clamp(16px, 5.8vh, 46px);
}

/* `width`/`height: auto` keeps the plan at its natural pixel size; the `max-*`
   rules only shrink it, so it is never interpolated up. The exported plans are
   ~2300-2800px tall, so the fit is always a downscale. */
.lightbox__img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Figma has this label at #000000, not the navy `--color-ink` the rest of the
   page uses, and no project token carries pure black. See docs/figma-source.md. */
.lightbox__caption {
  font-size: clamp(0.875rem, 1.39vw, 1.25rem);
  line-height: 1.2;
  text-align: center;
  color: #000000;
}

/* The map carries no label, so its row must not claim the figure's gap. */
.lightbox__caption:empty {
  display: none;
}

.lightbox__close {
  position: absolute;
  padding: 0;
  top: clamp(12px, 5vh, 40px);
  right: clamp(12px, 2.36vw, 34px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-deep-velvet-blue);
  transition: opacity var(--dur) var(--ease);
}

.lightbox__close:hover {
  opacity: 0.8;
}

.lightbox__x {
  position: relative;
  width: 16px;
  height: 16px;
}

.lightbox__x::before,
.lightbox__x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-bg);
}

.lightbox__x::before {
  transform: rotate(45deg);
}

.lightbox__x::after {
  transform: rotate(-45deg);
}

/* The map opens on the ivory sheet 758:6792 gives it, not the plans' white,
   and bleeds to the sheet's top and bottom instead of being padded. The image
   fill is CROP at 920x790 of the 1442x790 sheet, so it keeps that ratio here
   and `cover` reproduces the crop; the 394x356 mobile component (825:6001) is
   the same picture at its own ratio. Neither has a caption or arrows. */
.lightbox[data-variant="map"],
.lightbox[data-variant="map"]::backdrop {
  background-color: var(--color-porcelain-ivory);
}

/* No caption row to separate, and the gap would otherwise eat 30px of the
   sheet height the map is supposed to fill. */
.lightbox[data-variant="map"] .lightbox__figure {
  gap: 0;
  padding: 0;
}

.lightbox[data-variant="map"] .lightbox__img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 394 / 356;
  object-fit: cover;
}

/* Gallery photos open as a framed panel over the dimmed page rather than on
   the plans' white sheet: the page stays visible behind a dark scrim, the photo
   fills a centred frame inset ~8vh / 10vw from the viewport, and a bare ivory
   X sits inside the photo's top-right corner. No caption — the room name is
   already in the alt text and on the slide. The arrows live in the dark side
   margins. */
.lightbox[data-variant="photo"] {
  --photo-inset-y: clamp(16px, 8vh, 80px);
  --photo-inset-x: clamp(16px, 10vw, 200px);
  background-color: transparent;
}

.lightbox[data-variant="photo"]::backdrop {
  background-color: rgb(0 0 0 / 0.72);
}

.lightbox[data-variant="photo"] .lightbox__figure {
  grid-template-rows: 100%;
  gap: 0;
  padding: var(--photo-inset-y) var(--photo-inset-x);
}

/* Portrait phones show the whole photo at full frame width; `cover` there
   would crop away two-thirds of a landscape room. */
.lightbox[data-variant="photo"] .lightbox__img {
  width: 100%;
  height: auto;
  max-width: none;
  max-height: 100%;
}

/* Landscape screens fill the frame edge to edge; `cover` trims the thin
   overflow instead of leaving bars. */
@media (min-aspect-ratio: 4/3) {
  .lightbox[data-variant="photo"] .lightbox__img {
    height: 100%;
    max-height: none;
    object-fit: cover;
  }
}

.lightbox[data-variant="photo"] .lightbox__caption {
  display: none;
}

.lightbox[data-variant="photo"] .lightbox__close {
  top: calc(var(--photo-inset-y) + clamp(8px, 3vh, 32px));
  right: calc(var(--photo-inset-x) + clamp(8px, 2vw, 32px));
  width: 44px;
  height: 44px;
  background-color: transparent;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.45));
}

.lightbox[data-variant="photo"] .lightbox__x {
  width: 24px;
  height: 24px;
}

.lightbox[data-variant="photo"] .lightbox__x::before,
.lightbox[data-variant="photo"] .lightbox__x::after {
  background-color: var(--color-porcelain-ivory);
}

.lightbox[data-variant="photo"] .lightbox__nav--prev {
  left: max(0px, calc(var(--photo-inset-x) / 2 - 31px));
}

.lightbox[data-variant="photo"] .lightbox__nav--next {
  right: max(0px, calc(var(--photo-inset-x) / 2 - 31px));
}

.lightbox[data-variant="photo"] .lightbox__nav .chevron {
  --chevron-color: var(--color-porcelain-ivory);
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.5));
}

.lightbox[data-variant="photo"] :where(a, button):focus-visible {
  outline-color: var(--color-porcelain-ivory);
}

.lightbox__nav {
  position: absolute;
  padding: 0;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
}

/* 41px against the 1442px frame. */
.lightbox__nav--prev {
  left: clamp(4px, 2.84vw, 41px);
}

.lightbox__nav--next {
  right: clamp(4px, 2.84vw, 41px);
}

.lightbox__nav .chevron {
  --chevron-color: var(--color-deep-velvet-blue);
  --chevron-size: 20px;
  --chevron-weight: 3px;
  width: 44px;
  height: 44px;
}

@media (min-width: 80em) {
  .lightbox__close {
    width: 50px;
    height: 50px;
  }

  .lightbox__x {
    width: 19px;
    height: 19px;
  }

  .lightbox[data-variant="map"] .lightbox__img {
    width: auto;
    height: 100%;
    aspect-ratio: 920 / 790;
  }

  /* Same 40px / 4px arrow3 vector the plan row already uses. */
  .lightbox__nav .chevron {
    --chevron-size: 40px;
    --chevron-weight: 4px;
    width: 62px;
    height: 62px;
  }
}
