/* ============================================================================
   RAIL STORE — COMPONENT STYLES
   Consumes tokens.css only. No brand value is hard-coded in this file.
   Component numbering follows PRD-v1 §5.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);     /* the wall continues past the composition — no
                                     black bands on a window taller than 16:9 */
  color: var(--ink);
  font-family: var(--font-grotesk);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------------------
   THE SITE — fills the viewport. The composition inside it is scaled by --u,
   which is capped at 1vw of a 16:9 box, so the reference's 16:9 relationships
   hold on any window shape without the ticker being pushed off-screen (§8.3).
   ------------------------------------------------------------------------ */
.site {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-site);
  isolation: isolate;
}

/* ---------------------------------------------------------------------------
   5.11 PegboardSurface — the designed ring lattice (F1).
   Token-driven so the surface is brand-swappable (DF4). Two layers: the ring in
   shadow, plus an offset highlight arc reading as the recess lip.
   ------------------------------------------------------------------------ */
.pegboard {
  position: absolute;
  inset: var(--pegboard-inset-top) var(--pegboard-inset-x)
         var(--pegboard-inset-bottom) var(--pegboard-inset-x);
  background-color: var(--surface);
  background-image:
    radial-gradient(circle at 50% 56%,
      transparent 0 var(--pegboard-ring-inner),
      var(--pegboard-ring-lit) var(--pegboard-ring-inner) var(--pegboard-ring-size),
      transparent var(--pegboard-ring-size)),
    radial-gradient(circle at 50% 50%,
      transparent 0 var(--pegboard-ring-inner),
      var(--pegboard-ring) var(--pegboard-ring-inner) var(--pegboard-ring-size),
      transparent var(--pegboard-ring-size));
  background-size: var(--pegboard-pitch-x) var(--pegboard-pitch-y);
  background-position: center top;
  z-index: var(--z-surface);
  pointer-events: none;
}
/* The pegboard must not bleed under the marquee or the header rule area */
.pegboard::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    var(--surface) 0, transparent 6%, transparent 94%, var(--surface) 100%);
}

/* ---------------------------------------------------------------------------
   5.1 SiteHeader — exactly three elements. No cart, search, account, hamburger.
   ------------------------------------------------------------------------ */
.header {
  position: absolute;
  top: var(--header-top-y);
  left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 0 var(--nav-inset);
  z-index: var(--z-header);
  transition: filter var(--dur-overlay) var(--ease-out-quint),
              opacity var(--dur-overlay) var(--ease-out-quint);
}
.header__nav {
  font-size: var(--type-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  line-height: 1;
  padding: var(--sp-2) var(--sp-1);
  margin: calc(var(--sp-2) * -1) calc(var(--sp-1) * -1);
  transition: opacity var(--dur-hover) ease-out;
  white-space: nowrap;
}
.header__nav:hover { opacity: 0.62; }
.header__nav--right { justify-self: end; }

/* R1 — the script voice belongs to the wordmark and nothing else (§3.3, F5). */
.wordmark {
  grid-column: 2;
  display: block;
  font-family: var(--font-script);
  color: var(--ink-strong);
  text-decoration: none;
  text-align: right;
  line-height: 0.82;
  letter-spacing: 0.01em;
  transform: translateY(calc(0.35 * var(--u)));
}
.wordmark__l1 { display: block; font-size: var(--type-wordmark-1); }
/* second line larger and offset right — the evidenced lockup (QA B11) */
.wordmark__l2 {
  display: block;
  font-size: var(--type-wordmark-2);
  transform: translateX(calc(0.55 * var(--u))) translateY(-0.12em);
}

/* ---------------------------------------------------------------------------
   5.2 ClothingRail — static, non-scrolling, N garments side-on at rest (F2/F4).
   ------------------------------------------------------------------------ */
.rail {
  position: absolute;
  left: 50%;
  top: var(--rail-centre-y);
  width: var(--rail-span);
  transform: translateX(-50%);
  height: 0;                          /* the tube is the origin */
  z-index: var(--z-rail);
}

/* Chrome tube — photographic chrome is a real specular (§7.1 A5). Built here
   from layered gradients so the surface stays token-driven. */
.rail__tube {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: var(--rail-tube);
  transform: translateY(-50%);
  border-radius: 999px;
  background:
    linear-gradient(to bottom,
      #b9b7b2 0%, #e9e8e4 16%, #ffffff 30%, #f2f1ed 44%,
      #c9c7c2 58%, #8d8b86 78%, #a8a6a1 92%, #6f6d69 100%);
  box-shadow:
    0 calc(0.10 * var(--u)) calc(0.16 * var(--u)) rgba(0,0,0,0.22),
    0 calc(0.28 * var(--u)) calc(0.60 * var(--u)) rgba(0,0,0,0.13);
}
/* two end brackets only — no intermediates (F10, QA B12) */
.rail__bracket {
  position: absolute;
  top: 50%;
  width: calc(var(--rail-tube) * 1.35);
  height: calc(var(--rail-tube) * 3.1);
  transform: translateY(-42%);
  border-radius: calc(var(--rail-tube) * 0.4);
  background: linear-gradient(to right, #6f6d69 0%, #d9d7d3 42%, #ffffff 55%, #aaa8a3 74%, #6a6864 100%);
  box-shadow: 0 calc(0.16 * var(--u)) calc(0.34 * var(--u)) rgba(0,0,0,0.20);
}
.rail__bracket--l { left: calc(var(--rail-tube) * -1.3); }
.rail__bracket--r { right: calc(var(--rail-tube) * -1.3); }

/* The garment row. --spread is driven from JS; each item's left is a
   percentage of the rail width so the row is self-scaling. */
.rail__row {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 0;
}

.rail__item {
  position: absolute;
  top: 0;
  left: var(--x);
  height: var(--garment-img-h);
  /* The garment is wider than the pitch (a profile view still shows some of the
     body), so the hit area is widened to match the garment rather than the pitch —
     otherwise a hover on the visible edge of a garment would hit nothing. */
  width: calc(var(--garment-pitch) * 1.32);
  transform: translateX(-50%) translateY(0);
  transform-origin: 50% 0;
  border: 0; padding: 0; background: none;
  cursor: pointer;
  z-index: 1;
  transition: left var(--dur-turn) var(--ease-out-quint),
              transform var(--dur-turn) var(--ease-out-quint);
  display: block;
}
/* The two views are stacked and crossfaded — the "matched pair" turn (§6.3).
   Mechanism decision recorded in PRE-BUILD-DECISIONS.md (PBD12). */
.rail__img {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  height: var(--garment-img-h);
  width: auto;
  max-width: none;
  display: block;
  transition: opacity var(--dur-turn) var(--ease-out-quint);
  pointer-events: none;
  -webkit-user-drag: none;
}
.rail__img--side  { opacity: 1; }
.rail__img--front { opacity: 0; }

/* hovered / active item: turns front-on, scales up (QA B15) */
.rail__item.is-face .rail__img--side  { opacity: 0; }
.rail__item.is-face .rail__img--front { opacity: 1; }
.rail__item.is-face {
  transform: translateX(-50%) translateY(calc(var(--garment-img-h) * -0.03))
             scale(1.22);
  z-index: 5;
}

/* 5.13 ImagePlaceholder — reserved-size box, product name, no broken-image icon */
.rail__ph {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  height: var(--garment-img-h);
  width: calc(var(--garment-img-h) * var(--garment-img-ratio-side));
  background: var(--surface-2);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--sp-2);
}
.rail__ph span {
  font-size: var(--type-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
  text-align: center;
}
.rail__item.is-broken .rail__img { display: none; }
.rail__item.is-broken .rail__ph  { display: flex; }

/* 5.8 RailCaption — a small upright grotesque label equal to the product name,
   centred under the hovered garment (F11) */
.rail__caption {
  position: absolute;
  top: calc(var(--garment-img-h) * 0.895);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-caption);
  opacity: 0;
  transition: opacity var(--dur-turn) ease-out;
  pointer-events: none;
}
.rail__caption.is-on { opacity: 1; }

/* ---------------------------------------------------------------------------
   5.6 AvailabilityPill — true pill, light outline, no fill, both states
   ------------------------------------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--pill-width);
  height: var(--pill-height);
  border: var(--border-pill) solid var(--border-color);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-button);
  font-family: var(--font-grotesk);
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-hover) ease-out,
              color var(--dur-hover) ease-out,
              border-color var(--dur-hover) ease-out;
}
.pill:hover { background: var(--ink-strong); color: var(--surface); border-color: var(--ink-strong); }
.pill[aria-disabled="true"], .pill:disabled {
  color: var(--ink-muted);
  border-color: rgba(45,46,55,0.20);
  cursor: default;
  background: transparent;
}
.pill[aria-disabled="true"]:hover, .pill:disabled:hover {
  background: transparent; color: var(--ink-muted); border-color: rgba(45,46,55,0.20);
}

.rail__cta {
  position: absolute;
  left: 50%;
  /* MEASURED: the pill sits centred under the rail with its centre at ≈48 vw%. */
  top: calc(46.7 * var(--u));
  transform: translateX(-50%);
  z-index: var(--z-rail);
}

/* ---------------------------------------------------------------------------
   5.9 ProgressCapsule — decorative, aria-hidden, no progressbar (§5.9, QA F55)
   ------------------------------------------------------------------------ */
.capsule {
  position: absolute;
  left: 50%;
  /* The capsule sits ON the marquee band on the catalogue (F9) — it overlaps the
     bar's upper edge, not floats above it. */
  bottom: calc(var(--marquee-height) - (0.58 * var(--u)));
  width: var(--capsule-w);
  height: var(--capsule-h);
  transform: translateX(-50%);
  background: var(--capsule);
  border-radius: var(--radius-capsule);
  z-index: var(--z-capsule);
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   5.7 MarqueeTicker — slate-indigo, full width, flush to the bottom, square.
   Right->left, linear, ~2.7vw/s (MEASURED). Reduced motion -> static.
   ------------------------------------------------------------------------ */
.marquee {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--marquee-height);
  background: var(--bar);
  border-radius: 0;
  overflow: hidden;
  z-index: var(--z-marquee);
  display: flex;
  align-items: center;
  transition: opacity var(--dur-overlay) var(--ease-out-quint);
}
.marquee__track {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-scroll var(--marquee-duration, 26s) linear infinite;
}
.marquee__track[data-static="true"] { animation: none; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee__group { display: flex; align-items: center; flex: 0 0 auto; }
.marquee__item {
  font-family: var(--font-grotesk);
  font-style: italic;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-marquee);
  font-size: var(--type-marquee);
  color: var(--bar-ink);
  padding: 0 var(--sp-4);
  white-space: nowrap;
}
.marquee__sep {
  color: var(--bar-ink);
  font-size: var(--type-marquee);
  opacity: 0.72;
}
.marquee__trigger {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; letter-spacing: inherit;
  text-transform: inherit; font-style: inherit;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.marquee__trigger:hover { border-bottom-color: currentColor; }

/* ---------------------------------------------------------------------------
   5.10 OverlayBackdrop + overlay state (§3.2, F3).
   The overlay is a STATE of /, not a route. The catalogue layer blurs behind it.
   ------------------------------------------------------------------------ */
.catalog-layer { position: absolute; inset: 0; transition: filter var(--dur-overlay) var(--ease-out-quint), opacity var(--dur-overlay) var(--ease-out-quint), transform var(--dur-overlay) var(--ease-out-quint); }
.site.is-overlay .catalog-layer {
  filter: blur(32px) saturate(0.72);
  opacity: 0.45;
  transform: scale(1.06);
  pointer-events: none;
}
.site.is-overlay .catalog-layer .marquee { opacity: 0; }
.site.is-overlay .header { filter: blur(14px); opacity: 0.45; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  opacity: 0;
  /* The wash sits BEHIND the hero (backgrounds paint behind children) and turns the
     blurred catalogue into the pale field the reference shows, rather than a dark
     blur with visible pegboard banding. */
  background: var(--overlay-wash);
  transition: opacity var(--dur-overlay) var(--ease-out-quint);
  color: var(--ink);
}
.site.is-overlay .overlay { display: block; }
.overlay.is-in { opacity: 1; }

/* 5.12 CloseControl — uppercase micro-label, top right (F3, QA C24) */
.overlay__close {
  position: absolute;
  top: var(--header-top-y);
  right: var(--nav-inset);
  background: none; border: 0; padding: var(--sp-2) var(--sp-1);
  font-family: var(--font-grotesk);
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: opacity var(--dur-hover) ease-out;
}
.overlay__close:hover { opacity: 0.6; }

/* 5.3 ProductHero — the front view, centred. Sized by HEIGHT: against the
   reference's own overlay frame the hero garment spans roughly half the card
   height, which a width-derived box (the PRD's low-confidence 19.9 vw%) cannot
   deliver. */
.overlay__hero {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  height: var(--hero-img-h);
  width: auto;
  display: block;
  transition: opacity var(--dur-copy) ease-out;
}
.overlay__hero.is-swapping { opacity: 0.15; }

/* 5.4 NavControl — default outlined, hover solid dark with inverted arrow */
.overlay__nav {
  position: absolute;
  top: 46%;
  width: var(--control-d);
  height: var(--control-d);
  transform: translateY(-50%);
  border-radius: var(--radius-circle);
  border: var(--border-control) solid var(--border-color);
  background: transparent;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--dur-hover) ease-out, color var(--dur-hover) ease-out, border-color var(--dur-hover) ease-out, opacity var(--dur-hover) ease-out;
}
.overlay__nav svg { width: 34%; height: 34%; display: block; }
.overlay__nav--prev { left: 22.5%; }
.overlay__nav--next { right: 22.5%; }
.overlay__nav:hover:not(:disabled) {
  background: var(--ink-strong); border-color: var(--ink-strong); color: var(--surface);
}
.overlay__nav:disabled {
  opacity: 0.34; cursor: default;
  border-color: rgba(45,46,55,0.22);
}

/* The detail stack — counter, name, pill. Tight gaps (MEASURED, §4.3) */
.overlay__stack {
  position: absolute;
  left: 50%;
  bottom: calc(var(--marquee-height) + (5.4 * var(--u)));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9vw;
  width: max-content;
  max-width: 88%;
  transition: opacity var(--dur-copy) ease-out;
}
.overlay__stack.is-swapping { opacity: 0.15; }

/* 5.5 ProductCounter — NN / N, its own token, lighter than the name */
.overlay__counter {
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-counter);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
/* R3 — italic grotesque, NOT a serif (F5, QA C28) */
.overlay__name {
  font-family: var(--font-grotesk);
  font-style: italic;
  font-weight: 400;
  font-size: var(--type-name);
  color: var(--ink);
  line-height: 1.05;
  text-align: center;
  margin: 0;
}
.overlay__hero-ph {
  position: absolute; left: 50%; top: 47%;
  transform: translate(-50%, -50%);
  height: var(--hero-img-h);
  width: calc(var(--hero-img-h) * var(--garment-img-ratio-front));
  background: var(--surface-2);
  display: none; align-items: flex-end; justify-content: center;
  padding-bottom: var(--sp-3);
}
.overlay__hero-ph span {
  font-size: var(--type-micro); letter-spacing: var(--track-micro);
  text-transform: uppercase; font-weight: 500; color: var(--ink-muted);
  text-align: center;
}
.overlay.is-hero-broken .overlay__hero { display: none; }
.overlay.is-hero-broken .overlay__hero-ph { display: flex; }

/* ---------------------------------------------------------------------------
   Static pages /about and /contact — Menashi original design (§3.3, §3.4).
   No reference-fidelity gate applies.
   ------------------------------------------------------------------------ */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-baseline-y) + 3.4vw) 6vw calc(var(--marquee-height) + 3.4vw);
  z-index: 5;
}
.page__inner { width: min(var(--measure), 100%); margin: 0 auto; }
/* R2 roman at a documented step above the micro-label — NOT the script (§3.3) */
.page__title {
  font-family: var(--font-grotesk);
  font-weight: 500;
  font-size: var(--type-title);
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  margin: 0 0 var(--sp-6);
  line-height: 1.05;
}
.page__prose {
  font-size: var(--type-body);
  line-height: var(--leading-body);
  color: var(--ink);
  margin: 0 0 var(--sp-5);
}
.page__prose:last-of-type { margin-bottom: 0; }
.page__back { margin-top: var(--sp-7); display: inline-block; }

.field { margin-bottom: var(--sp-5); }
.field__label {
  display: block;
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}
.field__input, .field__area {
  width: 100%;
  font-family: var(--font-grotesk);
  font-size: var(--type-body);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  padding: var(--sp-2) 0;
  border-radius: 0;
  transition: border-color var(--dur-hover) ease-out;
}
.field__input:focus, .field__area:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
.field__area { resize: vertical; min-height: 6.5em; line-height: 1.5; }
.field__err {
  display: block;
  font-size: var(--type-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: #8C2F2F;
  margin-top: var(--sp-2);
  min-height: 1em;
}
.field.is-invalid .field__input, .field.is-invalid .field__area { border-bottom-color: #8C2F2F; }

.form__actions { margin-top: var(--sp-6); display: flex; align-items: center; gap: var(--sp-4); }
.form__banner {
  border: var(--border-pill) solid rgba(140,47,47,0.42);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  font-size: var(--type-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: #8C2F2F;
}
.form__success { text-align: left; }
.form__success h2 {
  font-family: var(--font-grotesk); font-weight: 500;
  font-size: var(--type-title); color: var(--ink-strong);
  margin: 0 0 var(--sp-4);
}
.form__success p { font-size: var(--type-body); line-height: var(--leading-body); margin: 0; }

/* 5.14 NewsletterSignup — a dialog, reusing the contact form logic */
.dialog {
  position: absolute; inset: 0; z-index: var(--z-dialog);
  display: none; align-items: center; justify-content: center;
  background: rgba(27,30,45,0.34);
}
.dialog.is-open { display: flex; }
.dialog__card {
  background: var(--surface);
  padding: 3.6vw 3.2vw;
  width: min(38vw, 92%);
  border: 1px solid rgba(45,46,55,0.16);
  box-shadow: 0 1.4vw 3.4vw rgba(0,0,0,0.20);
}
.dialog__title {
  font-family: var(--font-grotesk); font-weight: 500;
  font-size: var(--type-title); color: var(--ink-strong);
  margin: 0 0 var(--sp-4);
}
.dialog__body {
  font-size: var(--type-body); line-height: var(--leading-body);
  color: var(--ink); margin: 0 0 var(--sp-6);
}

/* ---------------------------------------------------------------------------
   Focus system (§8.4, QA F49) — one consistent ring, never animated
   ------------------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
  transition: none;
}
.rail__item:focus-visible { outline-offset: calc(var(--sp-2) * -1); }

.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;
}

/* ---------------------------------------------------------------------------
   REDUCED MOTION (§8.4, §6.7, QA D42/F51) — the marquee stops, the garment turn
   becomes an instant side->front swap, the overlay crossfades <=100ms.
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none !important; }
  .marquee { overflow-x: hidden; }
  .rail__item,
  .rail__img,
  .rail__caption,
  .overlay,
  .overlay__hero,
  .overlay__stack,
  .catalog-layer,
  .header {
    transition-duration: 1ms !important;
  }
  .rail__item.is-face { transform: translateX(-50%); }
}

/* ---------------------------------------------------------------------------
   RESPONSIVE — §8.3. BELOW --bp-desktop THIS IS MENASHI NEW DESIGN, not a
   reproduction. Desktop only is reference-faithful (QA E47).
   ------------------------------------------------------------------------ */

/* Tablet 768-1199 — held composition, 16:9 lock released */
@media (max-width: 1199px) {
  .site {
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }
  .pegboard { position: fixed; }
  .header {
    position: fixed;
    top: 24px;
    padding: 0 24px;
    background: var(--surface);
  }
  .header::after {
    content: ""; position: absolute; left: 0; right: 0; top: 100%;
    height: 96px; background: var(--surface); pointer-events: none;
  }
  .wordmark { min-height: 34px; transform: none; }
  .wordmark__l2 { transform: translateX(0.4em) translateY(-0.12em); }
  .rail {
    position: relative;
    top: auto; left: auto;
    transform: none;
    width: 100%;
    margin: 132px 0 0;
    padding: 0 6vw;
    height: auto;
  }
  .rail__tube, .rail__row { position: relative; }
  .rail__row { display: flex; justify-content: center; align-items: flex-start; column-gap: 1.2vw; }
  .rail__item {
    position: relative;
    left: auto;
    transform: none;
    width: auto;
    height: calc(var(--garment-band-h) * 1.5);
    transition: transform var(--dur-turn) var(--ease-out-quint);
  }
  .rail__img, .rail__ph { height: calc(var(--garment-band-h) * 1.5); }
  .rail__item.is-face { transform: translateY(-3%) scale(1.12); }
  .rail__caption, .rail__cta { position: relative; top: auto; left: auto; transform: none; }
  .rail__caption { margin-top: 24px; text-align: center; }
  .rail__cta { display: flex; justify-content: center; margin: 40px 0 120px; }
  .capsule { position: fixed; bottom: 42px; }
  .marquee { position: fixed; height: 30px; }
  .page { position: relative; inset: auto; padding: 180px 8vw 140px; min-height: 100vh; }
  .overlay { position: fixed; }
  .dialog__card { width: min(70vw, 92%); padding: 48px 40px; }
  .overlay__hero, .overlay__hero-ph { height: calc(var(--garment-band-h) * 1.6); }
  .overlay__nav { width: 44px; height: 44px; }
  .overlay__nav--prev { left: 6vw; }
  .overlay__nav--next { right: 6vw; }
  .overlay__stack { bottom: 120px; gap: 12px; }
}

/* Mobile <768 — a DOCUMENTED DIVERGENCE: vertically scrolling, rail becomes a
   snap strip, no hamburger (§8.3, QA E46) */
@media (max-width: 767px) {
  .header { padding: 0 20px; }
  .wordmark { max-width: 28vw; min-height: 28px; }
  .wordmark__l1 { font-size: 15px; }
  .wordmark__l2 { font-size: 21px; }
  .rail { margin-top: 118px; padding: 0; }
  .rail__tube { margin: 0 20px; }
  .rail__row {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    column-gap: 14px;
    padding: 0 31vw;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rail__row::-webkit-scrollbar { display: none; }
  .rail__item { scroll-snap-align: center; flex: 0 0 auto; height: 46vw; }
  .rail__img, .rail__ph { height: 46vw; }
  .rail__item.is-face { transform: translateY(-2%) scale(1.08); }
  .overlay__hero, .overlay__hero-ph { height: 52vw; }
  .overlay__nav { width: 48px; height: 48px; }
  .overlay__nav--prev { left: 12px; }
  .overlay__nav--next { right: 12px; }
  .overlay__close { font-size: 12px; }
  .overlay__stack { bottom: calc(26px + 84px); gap: 10px; padding: 0 16px; width: 100%; max-width: 100%; }
  .overlay__name { font-size: 20px; }
  .pill { min-width: 168px; height: 38px; }
  .capsule { bottom: 34px; width: 28px; height: 5px; }
  .marquee { height: 26px; }
  .marquee__item { font-size: 12px; padding: 0 12px; }
  .page { padding: 140px 20px 120px; }
  .page__title { font-size: 30px; }
  .dialog { position: fixed; }
  .dialog__card { width: calc(100% - 32px); padding: 32px 20px; }
  /* every control at least 44x44 */
  .header__nav { padding: 14px 8px; margin: -14px -8px; }
  .marquee__trigger { padding: 8px 0; }
}

/* The mobile/tablet page must be able to scroll; desktop may not (§8.3, QA D35) */
@media (max-width: 1199px) {
  html, body { overflow-x: hidden; overflow-y: auto; }
}
@media (min-width: 1200px) {
  html, body { overflow: hidden; height: 100%; }
}
