/* ==========================================================================
   COMPONENTS — reusable parts. Order within each block: layout, box, type,
   colour, motion. Section-specific composition lives in sections.css.
   PHASE 2: everything here renders and is usable without JavaScript.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Links & buttons
   -------------------------------------------------------------------------- */

/* Nav / header link with the underline-on-hover rule the source uses. */
.link {
  position: relative;
  display: inline-block;
  padding-block-end: 2px;
  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;
}

.link::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-fast) var(--ease-css);
}

.link:hover::after,
.link:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* Pill button — "Launch 3D Tour", "View gallery". */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  min-height: 44px;                 /* [SPEC §8] touch target */
  padding: 12px 20px;
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease-css),
              background-color var(--dur-fast) var(--ease-css),
              border-color var(--dur-fast) var(--ease-css);
}

/* Gold is the one hover colour for every pill and round control, on light
   grounds and dark ones alike — navy on gold reads at 5:1. */
.btn:hover,
.btn:focus-visible {
  color: var(--c-navy);
  background: var(--c-gold);
  border-color: var(--c-gold);
}

/* Ghost pill for dark grounds — the hero's call and the menu's. */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  min-height: 48px;
  padding: 0 var(--sp-md);
  border: 1px solid color-mix(in srgb, var(--c-ivory) 55%, transparent);
  border-radius: var(--r-pill);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-ivory);
  transition: background-color var(--dur-fast) var(--ease-css),
              border-color var(--dur-fast) var(--ease-css),
              color var(--dur-fast) var(--ease-css);
}
.btn-ghost svg { width: 24px; height: 10px; flex: none; transition: translate var(--dur-fast) var(--ease-css); }
.btn-ghost:hover,
.btn-ghost:focus-visible { background: var(--c-gold); border-color: var(--c-gold); color: var(--c-navy); }
.btn-ghost:hover svg { translate: 4px 0; }

/* Solid gold pill — the one primary call per view, on dark grounds. */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  min-height: 52px;
  padding: 0 var(--sp-md) 0 var(--sp-lg);
  border-radius: var(--r-pill);
  background: var(--c-gold);
  color: var(--c-navy);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgb(208 173 103 / .22);
  transition: background-color var(--dur-fast) var(--ease-css), box-shadow var(--dur-fast) var(--ease-css);
}
.btn-gold svg { width: 24px; height: 10px; flex: none; transition: translate var(--dur-fast) var(--ease-css); }
.btn-gold:hover,
.btn-gold:focus-visible { background: #f3dfae; box-shadow: 0 14px 40px rgb(208 173 103 / .35); }
.btn-gold:hover svg { translate: 4px 0; }

/* Where we build — names separated by gold beads. */
.places {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-mist);
}
.places li { display: inline-flex; align-items: center; gap: 14px; }
.places li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-gold);
}

/* Breadcrumb — used by the inner pages' banners, where it sits on a plate,
   so it is written for a dark ground. The separator is a pseudo-element so
   the trail reads as one string rather than as a list of stray arrows. */
.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2xs);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-mist);
}

.crumbs__list li + li::before {
  content: "→";
  margin-inline-end: var(--sp-2xs);
}

.crumbs__link { color: var(--c-ivory); transition: color var(--dur-fast) var(--ease-css); }
.crumbs__link:hover { color: var(--c-gold); }

/* Square icon button — slider arrows, popup close, social. */
.btn-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition: color var(--dur-fast) var(--ease-css),
              background-color var(--dur-fast) var(--ease-css),
              border-color var(--dur-fast) var(--ease-css),
              opacity var(--dur-fast) var(--ease-css);
}

.btn-icon:hover,
.btn-icon:focus-visible { color: var(--c-navy); background: var(--c-gold); border-color: var(--c-gold); }
.btn-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.btn-icon.mt-disabled { opacity: .3; pointer-events: none; }

/* MENU burger — the two-line "stairs" mark. */
.burger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-inline: 4px;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.burger__mark { display: block; width: 22px; height: 10px; }
.burger__mark line { stroke: currentColor; stroke-width: 1.5; transition: transform var(--dur-fast) var(--ease-css); }
.burger:hover .burger__mark line:first-child { transform: translateX(4px); }
.burger:hover .burger__mark line:last-child  { transform: translateX(-4px); }

/* --------------------------------------------------------------------------
   3. Marquee  [SPEC §5.5]
   Static and readable with no JS; marquee.js clones the strip and drives it.
   -------------------------------------------------------------------------- */

.marquee {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.marquee__inner { display: flex; flex: none; }

.marquee__part {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--sp-lg);
  padding-inline-end: var(--sp-lg);
  white-space: nowrap;
}

.marquee__word {
  font-family: var(--font-display);
  font-size: var(--fs-display-lg);
  font-weight: var(--fw-medium);
  line-height: 1.1;                 /* room for the serif's descenders */
  letter-spacing: var(--ls-display);
  text-transform: none;
}
/* The separator dot carries the accent, not the colour of the words. */
.marquee__glyph { flex: none; width: .14em; height: .14em; color: var(--c-gold); }

/* --------------------------------------------------------------------------
   4. Numbered plan hotspots  [SPEC §4.10, §4.13]
   Absolute pins over the plan image; a legend list carries the same numbers
   so the content is complete without hover, and readable at ≤640px.
   -------------------------------------------------------------------------- */

.plan { position: relative; }

.legend {
  display: grid;
  grid-template-columns: repeat(var(--legend-cols, 1), minmax(0, 1fr));
  gap: var(--sp-2xs) var(--sp-md);
  align-content: start;
}

/* Split lists read down the first column and then the second (Location keys
   1-6 / 7-12), which is how the source sets them. Multi-column is the one
   flow mode that does that without hard-coding a row count per list; it
   balances the columns by height, so a long entry can move the split by one. */

@media (max-width: 639px) {
  /* [SPEC §8] plans become a scrollable image with a tappable legend below */
  .plan { overflow-x: auto; overscroll-behavior-x: contain; }
}

/* --------------------------------------------------------------------------
   6. Slider  [SPEC §7.1]
   CSS-only fallback: the track scrolls horizontally with snap points, so all
   slides are reachable before slider.js upgrades it.
   -------------------------------------------------------------------------- */

/* min-width:0 stops the flex track from forcing the slider wider than its
   grid cell, which would push the page into horizontal overflow. */
.slider { --slides-desktop: 1; position: relative; min-width: 0; }

.slider__viewport { overflow: hidden; }

.slider__track {
  display: flex;
  gap: var(--grid-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.slider__slide {
  flex: 0 0 calc((100% - (var(--slides-desktop) - 1) * var(--grid-gap)) / var(--slides-desktop));
  scroll-snap-align: start;
}

.slider__controls {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.slider__count {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

@media (max-width: 639px) { .slider { --slides-desktop: 1.2; } }  /* [SPEC §8] */

/* --------------------------------------------------------------------------
   7. Tabs / accordion  [SPEC §7.4]
   No-JS default: every panel is visible and stacked. tabs.js hides all but
   the active one, so the content is never unreachable.
   -------------------------------------------------------------------------- */

.tabs__tab {
  min-height: 44px;
  padding-block: 10px;
  border-bottom: 1px solid transparent;
  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-muted);
  transition: color var(--dur-fast) var(--ease-css),
              border-color var(--dur-fast) var(--ease-css);
}

.tabs__tab[aria-selected="true"],
.tabs__tab:hover { color: var(--fg-title); border-color: var(--c-gold); }   /* [SPEC §8] */

/* --------------------------------------------------------------------------
   8. Popup  [SPEC §7.3]
   No-JS default: a plain anchored section, reachable via :target and readable
   inline. popup.js converts it to a modal.
   -------------------------------------------------------------------------- */

.popup {
  position: relative;
  padding-block: var(--sp-xl);
  background: var(--c-ivory);
  color: var(--fg-default);
}

/* --------------------------------------------------------------------------
   9. Forms  [SPEC §7.5]
   Transparent inputs, 1px bottom rule, uppercase micro labels.
   -------------------------------------------------------------------------- */

.form { display: grid; gap: var(--sp-md); }

/* --------------------------------------------------------------------------
   10. Custom cursor  [SPEC §5.6] — above 1200px only, positioned by cursor.js
   -------------------------------------------------------------------------- */

.help-pop {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: var(--z-cursor);
  display: none;
  place-items: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-gold);
  color: var(--c-navy);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width var(--dur-fast) var(--ease-css),
              height var(--dur-fast) var(--ease-css);
}

/* Hover state: the dot grows into a label chip over links and controls. */
.help-pop.is-hover { width: 56px; height: 56px; }
.help-pop:empty.is-hover { width: 34px; height: 34px; }

@media (min-width: 1201px) and (pointer: fine) {
  .help-pop { display: grid; }
}

@media (prefers-reduced-motion: reduce) { .help-pop { display: none; } }

/* --------------------------------------------------------------------------
   11. Scroll lock  [SPEC §7.2, §7.3]
   Applied by lenis.js while the menu or a modal is open. A class rather than
   an inline style so the rule stays in the stylesheet.
   -------------------------------------------------------------------------- */

.is-locked,
.is-locked body { overflow: hidden; }
/* No pull-to-refresh or bounce while locked: on a phone, swiping down on the
   open menu at the top of a page would otherwise reload the whole page. */
.is-locked { overscroll-behavior: none; }
/* Desktop scrollbars take width; hiding one would slide the page (and the
   bars over it) sideways under the opening menu. lenis.js measures it into
   --sbw and the space is held. Phones have overlay scrollbars: 0px, no-op. */
.is-locked body,
.is-locked .s-header,
.is-locked .s-header-sticky { padding-inline-end: var(--sbw, 0px); }

/* --------------------------------------------------------------------------
   12. Fullscreen menu open state  [SPEC §7.2]
   The panel is `hidden` until menu.js opens it; these are the properties
   GSAP animates against.
   -------------------------------------------------------------------------- */

.stairs-nav .menu__item { will-change: transform, clip-path; }

/* --------------------------------------------------------------------------
   13. Char-rise split text  [SPEC §5.1]
   SplitType wraps each line in .line and each glyph in .char. The line box
   must clip so glyphs translated to y:120% are hidden until they rise.
   Set here rather than inline from JS, per the no-inline-styles rule.
   -------------------------------------------------------------------------- */

.is-split .line { overflow: hidden; }
.is-split .word { display: inline-block; }   /* keeps words unbreakable */
.is-split .char { display: inline-block; will-change: transform; }

/* --------------------------------------------------------------------------
   14. Slide-mask clip  [SPEC §5.2]
   The <clipPath> lives in a zero-size <svg id="clip-defs"> that
   anim-slidemask.js appends; only the path's `d` attribute changes per frame.
   The class is what applies the clip, so no inline style is needed.
   -------------------------------------------------------------------------- */

/* §5.5 — the marquee strips animate continuously, so they are the one place
   a permanent will-change is justified. */
.marquee__part { will-change: transform; }

/* --------------------------------------------------------------------------
   15. Enhanced states  [SPEC §7.1, §7.3, §7.4]
   Everything above renders and is usable with no JavaScript. These rules only
   apply once the matching module has upgraded the component, so the no-JS
   fallback is never the thing that breaks.
   -------------------------------------------------------------------------- */

/* Slider: JS drives the track by transform, so drop the scroll-snap fallback. */
.slider.is-enhanced .slider__track {
  overflow: visible;
  scroll-snap-type: none;
  cursor: grab;
  touch-action: pan-y;
}

.slider.is-enhanced.is-dragging .slider__track { cursor: grabbing; }
.slider.is-enhanced .slider__slide { scroll-snap-align: none; }

/* Popups: inline sections until popup.js promotes them to modals. */

.gallery img.is-current { outline: 2px solid var(--c-gold); outline-offset: 4px; }

/* --------------------------------------------------------------------------
   16. Page load & transition  [SPEC §5.9]
   >=980px only. The body is hidden only while .is-loading is on <html>, and
   page.js guarantees that class is removed — including on a 5s safety timer —
   so a stalled decode can never leave a blank page.
   -------------------------------------------------------------------------- */

.progress-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: var(--z-progress);
  height: 2px;
  background: var(--c-gold);
  transform-origin: left center;
  pointer-events: none;
}

body { transition: opacity 200ms linear; }

@media (min-width: 980px) {
  .is-loading body { opacity: 0; }
}

/* §5.8 — promoted only while a reveal is in flight. */
.is-revealing { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .is-loading body { opacity: 1; }
  body { transition: none; }
}

/* --------------------------------------------------------------------------
   17. Contrast and target-size corrections  [SPEC §10, WCAG 2.2]
   -------------------------------------------------------------------------- */

/* Slider dots are 6px by design; the button gives them a 24px hit area. */
.slider__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: none;
  border-radius: 50%;
}

.slider__dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .3;
  transition: opacity var(--dur-fast) var(--ease-css);
}

.slider__dot.is-active::after { opacity: 1; }
