/* ============================================================================
 * sections.css — Studio 72 section library
 * Pairs with assets/sections.js. Swap the tokens; keep the behaviour.
 *
 * Contrast note: every default below is AA-checked against --bg.
 * --muted is #8a8076 (5.11:1), NOT #6b6b6b (3.78:1 — fails).
 * ========================================================================== */

:root {
  --bg: #0b0a09;
  --surface: #131110;
  --text: #f3ede2;
  --muted: #8a8076;              /* AA on --bg and --surface. Do not darken. */
  --stroke: #221f1b;
  --accent: #c2a15a;
  --accent-rgb: 194, 161, 90;
  --accent-ink: #0a0a08;         /* text colour that passes ON --accent */
  --ok: #4caf7d;
  --warn: #e0855e;               /* 4.6:1 on --bg */
  --r: 10px;
  --font-display: 'Chakra Petch', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

html, body { overflow-x: clip; }   /* clip, never hidden — hidden kills sticky */

/* --- no-JS / reduced-motion baseline --------------------------------------
   Content is visible by default. JS adds .js, which is what enables the
   hidden-then-revealed states. A JS failure degrades to a readable page. */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1),
              transform .9s cubic-bezier(.34,1.45,.4,1);
}
.js .reveal.in { opacity: 1; transform: none; }
.js.reduced-motion .reveal { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- accessibility utilities ---------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem; top: 1rem; z-index: 9999; padding: .75rem 1rem;
  background: var(--text); color: var(--bg); border-radius: var(--r);
}
/* The UA focus ring is invisible on dark themes — replace it, never remove it. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- micro-labels: the usual contrast offender ---------------------------- */
.eyebrow {
  font-size: .7rem;              /* not 9px — at 0.3em tracking that is unreadable */
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Text over photography or video needs a guaranteed floor, not a hope. */
.media-overlay { position: relative; }
.media-overlay::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}
.media-overlay > * { position: relative; z-index: 1; }

/* --- nav ------------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--stroke);
}
.nav__menu { display: flex; gap: 1.6rem; align-items: center; }
.nav__toggle { display: none; }
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center;
    background: var(--bg);
    transform: translateY(-100%);
    transition: transform .45s cubic-bezier(.16,1,.3,1);
  }
  .nav.is-open .nav__menu { transform: none; }
}

/* --- marquee -------------------------------------------------------------- */
.marquee { display: flex; overflow: hidden; gap: 0; user-select: none; }
.marquee__row {
  display: flex; gap: 3rem; flex: 0 0 auto; padding-right: 3rem;
  animation: marquee var(--marquee-duration, 28s) linear infinite;
}
@keyframes marquee { to { transform: translateX(-100%); } }
.marquee:hover .marquee__row,
.reduced-motion .marquee__row { animation-play-state: paused; }

/* --- cards + cursor glow --------------------------------------------------- */
.card {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r);
}
[data-glow]::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              rgba(var(--accent-rgb), .18), transparent 62%);
}
[data-glow]:hover::before { opacity: 1; }
[data-glow] > * { position: relative; z-index: 1; }

/* --- carousel -------------------------------------------------------------- */
[data-carousel-track] { position: relative; }
[data-carousel-track] > * {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1);
  transform: translateY(8px);
}
[data-carousel-track] > .is-active { position: relative; opacity: 1; visibility: visible; transform: none; }
.carousel__dot {
  width: 8px; height: 8px; padding: 0; border-radius: 50%;
  border: 1px solid var(--muted); background: transparent; cursor: pointer;
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.carousel__dot.is-on { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }

/* --- tabs ------------------------------------------------------------------ */
[role="tab"] {
  background: none; border: 0; border-bottom: 1px solid transparent;
  color: var(--muted); cursor: pointer; padding: .6rem .2rem; font: inherit;
  transition: color .3s ease, border-color .3s ease;
}
[role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
[role="tabpanel"] { opacity: 0; transition: opacity .55s ease; }
[role="tabpanel"].is-active { opacity: 1; }
[role="tabpanel"][hidden] { display: none; }

/* --- overlay: modal + slide-in panel --------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; opacity: 0;
  background: rgba(0,0,0,.72);
  transition: opacity .35s ease;
}
.overlay.is-open { opacity: 1; }
.overlay[hidden] { display: none; }
.overlay__panel {
  background: var(--surface); overflow-y: auto;
  transform: translateY(14px) scale(.97);
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.overlay.is-open .overlay__panel { transform: none; }
/* slide-in drawer variant */
.overlay--drawer { justify-content: flex-end; }
.overlay--drawer .overlay__panel {
  width: min(560px, 100%); height: 100%; border-radius: 0;
  transform: translateX(100%);
}
.overlay--drawer.is-open .overlay__panel { transform: none; }
.overlay--drawer[data-side="left"] { justify-content: flex-start; }
.overlay--drawer[data-side="left"] .overlay__panel { transform: translateX(-100%); }
.overlay--drawer[data-side="left"].is-open .overlay__panel { transform: none; }
/* centred modal variant */
.overlay--modal { align-items: center; justify-content: center; padding: 1.2rem; }
.overlay--modal .overlay__panel {
  width: min(900px, 100%); max-height: 88vh; border-radius: var(--r);
}
/* stat bars inside a panel, animated by CSS on open */
.statbar { height: 3px; background: var(--stroke); border-radius: 2px; overflow: hidden; }
.statbar > i {
  display: block; height: 100%; width: 0; background: var(--accent);
  transition: width .8s cubic-bezier(.16,1,.3,1) .15s;
}
.overlay.is-open .statbar > i { width: var(--val, 0%); }

/* --- booking --------------------------------------------------------------- */
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cal__dows, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__dows { color: var(--muted); font-size: .65rem; text-align: center; letter-spacing: .1em; }
.cal__day {
  aspect-ratio: 1; border: 1px solid var(--stroke); border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.cal__day:hover:not(:disabled) { border-color: var(--accent); }
.cal__day.is-today { border-color: var(--accent); color: var(--accent); }
.cal__day.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal__day.is-off, .cal__day:disabled { opacity: .3; cursor: not-allowed; }
.cal__pad { aspect-ratio: 1; }
.slot__group { color: var(--muted); font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; margin: 1rem 0 .5rem; }
.slot__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.slot {
  padding: .6rem .4rem; border: 1px solid var(--stroke); border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: .8rem; cursor: pointer;
}
.slot.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot.is-off, .slot:disabled { opacity: .3; cursor: not-allowed; }
.slot__hint { color: var(--muted); font-size: .85rem; }
.booking__status { min-height: 1.4em; font-size: .9rem; }
.booking__status.is-warn { color: var(--warn); }
.booking__status.is-ok { color: var(--ok); }
form.is-sent .booking__fields { display: none; }

/* 16px minimum on mobile or iOS zooms the whole page on focus */
input, select, textarea {
  font: inherit; font-size: 16px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 8px; padding: .8rem 1rem;
}
@media (min-width: 768px) { input, select, textarea { font-size: .9rem; } }
label { display: block; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }

/* --- configurator ---------------------------------------------------------- */
/* A <button> does NOT inherit colour or font. Left alone on a dark card it
   renders as near-black system text — a 1.1:1 contrast failure that looks
   like a styling slip and reads as unusable. */
[data-option] {
  cursor: pointer;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  transition: border-color .25s ease, background .25s ease;
}
[data-option][aria-pressed="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), .09); }
[data-config-lines] { list-style: none; margin: 0; padding: 0; }
[data-config-lines] li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--stroke); }
[data-config-lines] li.is-empty { color: var(--muted); border-bottom: 0; }
.config__ghost {
  position: fixed; z-index: 200; pointer-events: none; margin: 0;
  animation: config-fly .72s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes config-fly {
  45%  { transform: translate(calc(var(--dx) * .45), calc(var(--dy) * .45 - 60px)) scale(.55); opacity: .9; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

/* --- horizontal scroll ----------------------------------------------------- */
[data-hscroll-track] {
  display: flex;
  transition: transform .75s cubic-bezier(.16,1,.3,1);
}
[data-hscroll-track] > * { flex: 0 0 100vw; }
[data-hscroll].is-pinned > [data-hscroll-track] {
  position: sticky; top: 0; height: 100svh; align-items: center;
}
/* below the breakpoint (and under reduced motion) it is a native swipe strip */
[data-hscroll]:not(.is-pinned) > [data-hscroll-track] {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  transform: none !important;
}
[data-hscroll]:not(.is-pinned) > [data-hscroll-track] > * {
  flex-basis: 86vw; scroll-snap-align: center;
}

/* --- steps: pinned stat-reveal ---------------------------------------------
   The Relats pattern: the section is tall (60–90vh per step), the stage is
   sticky, and .is-active swaps the jumbo claims. */
[data-steps-stage] {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; place-items: center;
}
[data-step] {
  grid-area: 1 / 1;
  opacity: 0; transform: translateY(22px) scale(.985);
  transition: opacity .55s ease, transform .7s cubic-bezier(.05,.76,.38,1.015);
  /* that bezier's 1.015 overshoot is lifted from a shipped award site */
  text-align: center; pointer-events: none;
}
[data-step].is-active { opacity: 1; transform: none; pointer-events: auto; }
[data-step] .jumbo {
  font-size: clamp(3rem, 11vw, 10rem); line-height: .92; letter-spacing: -.02em;
}

/* --- fx-layer host ----------------------------------------------------------
   The CSS fallback IS the design: when WebGL is missing, reduced, or the
   valve floors out, this gradient is what users see. Always set it. */
[data-fx="background"] {
  background:
    radial-gradient(90% 70% at 62% 38%, rgba(var(--accent-rgb), .12), transparent 60%),
    linear-gradient(178deg, var(--bg) 0%, var(--surface) 55%, var(--bg) 100%);
}
.fx-media-wrap > canvas { border-radius: inherit; }

/* --- filter grid ----------------------------------------------------------- */
[data-filter-cat] { cursor: pointer; }
[data-filter-cat][aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
[data-item][hidden] { display: none; }
