/* ============================================================
   GENE HEW v5 — BRAND WORLDS (explore) + full-page site tour
   Drifting marquee wall of self-initiated brand boards, with a
   "fall-in" immersive viewer that floods the screen with each
   board's own dominant color. Vanilla; paired with brandworlds.js.
   ============================================================ */

/* ---- site cards hold FULL-PAGE shots: tour them slower ---- */
.web-shot img { transition: object-position 6.5s ease-in-out; }
.web-card:hover .web-shot img { object-position: 50% 100%; }

/* ---- explore + design sections both host drifting walls ---- */
.explore { padding: clamp(80px, 10vw, 140px) 0; background: var(--green-ghost); overflow: hidden; }
.explore .sec-intro { max-width: 60ch; }
.design { overflow: hidden; }
.design .bw-wall { margin-top: clamp(22px, 2.6vw, 36px); }

/* ---- the drifting wall ---- */
.bw-wall {
  margin-top: clamp(26px, 3vw, 40px);
  display: flex; flex-direction: column; gap: clamp(12px, 1.4vw, 18px);
}
.bw-row { overflow: visible; }
.bw-track {
  display: flex; flex-wrap: wrap; gap: clamp(12px, 1.4vw, 18px); width: 100%;
}

/* enhanced (JS sets .is-live once the marquee clones are in place) */
.bw-wall.is-live {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.bw-wall.is-live .bw-row { overflow: hidden; }
.bw-wall.is-live .bw-track {
  flex-wrap: nowrap; width: max-content;
  will-change: transform;
}

/* ---- tiles ---- */
.bw-tile {
  flex: 0 0 auto; height: clamp(150px, 17vw, 208px); width: auto;
  margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 13px;
  position: relative; overflow: hidden; cursor: pointer; background: #fff;
  box-shadow: 0 1px 2px rgba(11,20,16,0.05);
  transition: transform .5s var(--ease-out), box-shadow .5s ease, opacity .4s ease, filter .4s ease;
}
/* fixed height, natural width: the whole board shows, never cropped */
.bw-tile img { height: 100%; width: auto; display: block; object-fit: contain; transition: transform .7s var(--ease-out); }
.bw-tile .bw-n {
  position: absolute; left: 10px; bottom: 8px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.55); opacity: 0; transition: opacity .35s ease;
}
.bw-tile::after {
  content: ""; position: absolute; inset: 0; z-index: 1; opacity: 0;
  background: linear-gradient(to top, rgba(6,18,12,.5), transparent 55%);
  transition: opacity .35s ease;
}
.bw-row:hover .bw-tile:not(:hover) { opacity: .4; filter: saturate(.7); }
.bw-tile:hover {
  transform: translateY(-7px) scale(1.035); z-index: 3;
  box-shadow: 0 30px 60px -28px color-mix(in oklab, var(--green-deep), transparent 32%);
}
.bw-tile:hover img { transform: scale(1.06); }
.bw-tile:hover .bw-n, .bw-tile:hover::after { opacity: 1; }
.bw-tile:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---- fall-in stage (immersive viewer) ---- */
.bw-stage {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 64px); background: #14201a;
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility .5s ease, background-color .65s ease;
}
.bw-stage.open { opacity: 1; visibility: visible; }
.bw-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 95% at 50% 42%, transparent 28%, rgba(0,0,0,.46));
}
.bw-figure {
  position: relative; z-index: 1; margin: 0; display: flex; flex-direction: column;
  align-items: center; gap: 14px; max-width: min(1100px, 92vw);
}
.bw-figure img {
  max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 10px;
  box-shadow: 0 40px 90px -28px rgba(0,0,0,.6);
  transition: opacity .35s ease, transform .6s var(--ease-out);
}
.bw-cap { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.bw-ctrl {
  position: absolute; z-index: 3; display: grid; place-items: center; cursor: pointer; color: #fff;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .3s ease, transform .3s ease, border-color .3s ease;
}
.bw-ctrl:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
.bw-nav { top: 50%; width: 52px; height: 52px; border-radius: 50%; font-size: 17px; transform: translateY(-50%); }
.bw-nav:hover { transform: translateY(-50%) scale(1.08); }
.bw-prev { left: clamp(10px, 3vw, 40px); }
.bw-next { right: clamp(10px, 3vw, 40px); }
.bw-close { top: clamp(14px, 3vw, 28px); right: clamp(14px, 3vw, 28px); width: 42px; height: 42px; border-radius: 50%; font-size: 19px; }

@media (max-width: 600px) {
  .bw-nav { width: 42px; height: 42px; }
}

/* ---- reduced motion: no drift, static wrapped wall, instant flood ---- */
@media (prefers-reduced-motion: reduce) {
  .bw-wall.is-live { -webkit-mask-image: none; mask-image: none; }
  .bw-wall.is-live .bw-row { overflow: visible; }
  .bw-wall.is-live .bw-track { animation: none; flex-wrap: wrap; width: 100%; }
  .bw-wall.is-live .bw-dup { display: none; }
  .bw-tile, .bw-tile img, .web-shot img, .bw-stage, .bw-figure img { transition: none; }
}

/* ---- analytics sheet: conditional-format heatmap cells ---- */
.sheet .h-hi  { background: color-mix(in oklab, #e0563f, white 60%); }
.sheet .h-mid { background: color-mix(in oklab, #e8a13c, white 64%); }
.sheet .h-lo  { background: color-mix(in oklab, var(--green), white 70%); }
