/* ==========================================================================
   Campaign hero — the default landing view of the homepage.

   A single full-bleed photograph with the copy laid over it. The E-COMMERCE
   hero (.hp-*) is the other view; both stay mounted and `html[data-home-view]`
   decides which one is displayed.

   All selectors are prefixed .cmp-* (or .view-toggle) so they cannot collide
   with styles.css or hero-preview.css — same convention hero-preview.css
   states for itself.
   ========================================================================== */

/* ── View switching ───────────────────────────────────────────────────────
   `display: none` rather than `visibility: hidden` so the inactive hero is
   out of the accessibility tree AND out of tab order. It also keeps
   nav-theme.js correct for free: a display:none element reports an all-zero
   getBoundingClientRect(), so its `r.bottom > 0` test fails and a hidden
   [data-theme="light"] hero stops driving the sidebar colour.
   The attribute is set by an inline <head> script before first paint, so a
   returning visitor never sees the wrong hero flash.

   Campaign is the CSS default rather than an attribute-gated state, so a
   visitor whose JavaScript never runs still gets one coherent hero instead of
   both stacked. The attribute only ever has to override in one direction. */
.hp-root { display: none; }
html[data-home-view="ecommerce"] .hp-root { display: block; }
html[data-home-view="ecommerce"] .cmp-root { display: none; }

/* ── Root ────────────────────────────────────────────────────────────────── */
.cmp-root {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh; /* svh so the iOS URL bar doesn't crop the frame */
  overflow: hidden;
  background-color: #0d0d0d; /* shows while the photo decodes */
  font-family: 'Inter', sans-serif;
  color: #fff;
}

/* ── The photograph ──────────────────────────────────────────────────────── */
.cmp-media,
.cmp-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cmp-media img {
  object-fit: cover;
  /* Anchor near the BOTTOM of the frame. The look-book sells the outfit, and
     the shoes sit at the bottom edge of the 1920x1280 renders — at 42% a
     1920x1030 window cropped them clean off (founder report, 2026-08-27).
     85% keeps the shoes and the pavement while the cap still clears the top
     at that viewport; the dead rows above the menu board absorb the crop.
     Mobile is unaffected: the 900x1200 portrait crop overflows horizontally,
     never vertically, so the Y value is inert there. */
  object-position: center 85%;
  display: block;
}

/* Scrim. A flat overlay either kills the photograph or leaves the CTA
   unreadable, because the frame is dark at the bottom left and bright in the
   shop window. Gradient up from the corner the copy occupies instead. */
.cmp-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.34) 42%, rgba(0, 0, 0, 0) 74%),
    linear-gradient(to right, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

/* ── Overlay copy ────────────────────────────────────────────────────────── */
.cmp-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 48px 88px;
}

.cmp-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 18px;
}

.cmp-headline {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(34px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 20px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  /* Wide enough that the copy breaks only at its own <br>, not mid-phrase.
     The measure is set per-element rather than on .cmp-overlay so the body
     copy can keep a readable 42ch while the display type runs long. */
  max-width: 20ch;
}

.cmp-sub {
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 30px;
  max-width: 42ch;
}

.cmp-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 15px 28px;
  border-radius: 9999px;
  background: #fff;
  color: #0d0d0d;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;
}

.cmp-cta:hover { background: rgba(255, 255, 255, 0.86); transform: translateY(-1px); }
.cmp-cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ── Hero wrapper ─────────────────────────────────────────────────────────
   Positioning context for the view toggle only. Deliberately NO overflow,
   transform, filter or z-index: the e-commerce hero's mobile bleed
   (margin-bottom:-50px into the stats strip) needs an unclipped ancestor, and
   its fixed video modal must not gain a transformed containing block. */
.home-hero { position: relative; }

/* ── CAMPAIGN | E-COMMERCE toggle ─────────────────────────────────────────
   Absolute inside .home-hero, not fixed — it belongs to the hero and scrolls
   away with it instead of floating over pricing and the footer. Top-centre on
   desktop: the logo owns the top left (.hp-header), the burger + socials own
   the top right (.social-sidebar). z-index below the sidebar (200) and far
   below #fullscreenMenu (500). */
.view-toggle {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 190;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 9999px;
  background: rgba(20, 20, 20, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.view-toggle-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 9999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap; /* "E-COMMERCE" must not break inside the pill */
  transition: background 0.25s ease, color 0.25s ease;
}

.view-toggle-btn:hover { color: #fff; }
.view-toggle-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.view-toggle-btn[aria-pressed="true"] { background: #fff; color: #0d0d0d; }

/* On the e-commerce view the page behind the toggle is a light cream hero, so
   the dark glass pill has to invert or it reads as a smudge. Driven by the
   same root attribute rather than a scroll listener — the hero below is always
   light, so there is nothing to detect. */
html[data-home-view="ecommerce"] .view-toggle {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(0, 0, 0, 0.10);
}
html[data-home-view="ecommerce"] .view-toggle-btn { color: rgba(0, 0, 0, 0.55); }
html[data-home-view="ecommerce"] .view-toggle-btn:hover { color: #0d0d0d; }
html[data-home-view="ecommerce"] .view-toggle-btn[aria-pressed="true"] { background: #0d0d0d; color: #fff; }

/* ── Look-book rail ──────────────────────────────────────────────────────
   5 slots x 2 garment swatches, bottom-right over the photo — the overlay
   copy owns the bottom-left. Clicking a swatch swaps the hero to the
   pre-rendered combination (lookbook.js). */
.cmp-rail {
  position: absolute;
  right: 40px;
  bottom: 72px;
  z-index: 2;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 15, 15, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* A <button> so the rail can collapse on mobile; on desktop it is inert and
   styled as a plain label. */
.cmp-rail-title {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 10px;
  cursor: default;
  pointer-events: none;
}

.cmp-rail-slots { display: flex; gap: 14px; }

.cmp-rail-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.cmp-rail-name {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.cmp-swatch {
  appearance: none;
  padding: 0;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f2f0ec;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cmp-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-swatch:hover { transform: translateY(-1px); }
.cmp-swatch:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cmp-swatch[aria-pressed="true"] { border-color: #fff; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet  ≤ 1023 px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .cmp-overlay { padding: 0 32px 72px; max-width: none; }
  .cmp-rail { right: 24px; bottom: 56px; }
  .cmp-swatch { width: 42px; height: 42px; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile  ≤ 767 px
   ════════════════════════════════════════════════════════════
   Note: this hero deliberately does NOT copy .hp-root's mobile
   `overflow-y: visible` bleed. That exists so the cut-out model can dip into
   the stats strip below; here it would just leak the photograph. */
@media (max-width: 767px) {
  /* Extra bottom padding so the copy block clears the bottom-anchored toggle. */
  .cmp-overlay { padding: 0 20px 96px; }

  /* Rail: collapsed to a tappable pill so it never covers Ida's face. The
     title button toggles .open (lookbook.js); the expanded strip drops in
     under the pill and scrolls horizontally. */
  .cmp-rail {
    right: 12px;
    left: auto;
    bottom: auto;
    top: 96px;
    padding: 0;
    max-width: calc(100vw - 24px);
  }
  .cmp-rail-title {
    pointer-events: auto;
    cursor: pointer;
    margin: 0;
    padding: 10px 16px;
    color: #fff;
  }
  .cmp-rail-title::after { content: " +"; }
  .cmp-rail.open .cmp-rail-title::after { content: " –"; }
  .cmp-rail-slots { display: none; }
  .cmp-rail.open .cmp-rail-slots {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 12px 12px;
    scrollbar-width: none;
  }
  .cmp-rail-slots::-webkit-scrollbar { display: none; }
  .cmp-swatch { width: 40px; height: 40px; }
  .cmp-headline { font-size: clamp(30px, 8.6vw, 44px); }
  .cmp-sub { font-size: 15px; margin-bottom: 24px; }
  .cmp-cta { padding: 14px 24px; font-size: 12px; }

  /* Bottom-centre on phones. The e-commerce hero's top strip is fully
     occupied at this width (logo, view-all, nav-row, title, CTA stack from
     18px to 300px — measured), so the pill moves to the one band that is
     free in BOTH modes. In e-commerce it sits over the model's shins:
     .hp-model-wrap is pointer-events:none, so clicks land on the pill, and
     the glass backdrop keeps it legible. */
  .view-toggle { top: auto; bottom: 22px; padding: 3px; }
  .view-toggle-btn { padding: 8px 14px; font-size: 10px; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .cmp-cta { transition: none; }
  .view-toggle-btn { transition: none; }
}
