/* ============================================================
   UNION BLOCK: THE JOURNEY (immersive layer)
   Loads after style.css on index.html only.
   Full-bleed room scenes, scroll-scrub time travel, before/after
   compare sliders, floor dial. Lean, dependency-free.
   ============================================================ */

/* ---------- Real logo in header ---------- */
img.logo-mark { width: auto !important; height: 44px !important; }

/* ---------- Scene system ---------- */
.scene { position: relative; }
.scene-viewport {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  background: var(--pine-deep);
}
.scene--room { height: 148vh; }          /* walk-through rooms: gentle parallax */
.scene--scrub { height: 300vh; }         /* time-travel rooms: long scroll scrub */

.scene-bg { position: absolute; inset: 0; }
.scene-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  will-change: transform, opacity;
}
/* Parallax drift driven by --p (0..1 across the scene's scroll span) */
.scene--room .scene-bg img {
  transform: translate3d(0, calc((var(--p, 0.5) - 0.5) * -5.5%), 0) scale(1.14);
}
/* Scrub crossfade: layer-b (tomorrow) fades in over layer-a (today) */
.scene--scrub .scene-bg .layer-b {
  opacity: calc((var(--p, 0) - 0.22) / 0.5);
}
.scene--scrub .scene-bg img { transform: scale(1.06); }
.scene--scrub .scene-bg .layer-a { transform: scale(calc(1.06 + var(--p, 0) * 0.05)); }

/* Ken Burns for the hero */
.kb img { transform: scale(1.16); }
.kb.in img { transform: scale(1.045); transition: transform 14s cubic-bezier(0.16, 0.6, 0.2, 1); }

/* Legibility scrims */
.scene-scrim { position: absolute; inset: 0; pointer-events: none; }
.scene-scrim::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(21,26,22,0.42) 0%, rgba(21,26,22,0) 26%, rgba(21,26,22,0) 55%, rgba(21,26,22,0.66) 100%);
}

/* ---------- Placards (museum labels that walk with you) ---------- */
.placard {
  position: absolute; z-index: 3;
  left: clamp(18px, 5vw, 72px); bottom: clamp(20px, 6vh, 64px);
  max-width: min(560px, calc(100% - 36px));
  background: linear-gradient(180deg, rgba(251,245,234,0.97), rgba(247,239,224,0.97));
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--brass);
  box-shadow: 0 30px 70px -30px rgba(10, 12, 10, 0.85);
  padding: clamp(20px, 2.6vw, 34px) clamp(22px, 3vw, 40px);
}
.placard .plq-kicker {
  font-family: var(--sans); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--barn);
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem;
}
.placard .plq-kicker::before { content: ""; width: 26px; height: 2px; background: var(--brass); }
.placard h2, .placard h3 { margin-bottom: 0.45em; }
.placard p { font-size: clamp(0.98rem, 1.1vw, 1.08rem); line-height: 1.65; color: var(--ink-soft); }
.placard p:last-child { margin-bottom: 0; }
.placard .plq-hint {
  margin-top: 0.9rem; font-family: var(--sans); font-size: 0.74rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.placard .plq-hint svg { color: var(--brass); }
.placard.plq-right { left: auto; right: clamp(18px, 5vw, 72px); }

@media (max-width: 640px) {
  .placard { left: 12px; right: 12px; bottom: 14px; max-width: none; }
  .placard.plq-right { left: 12px; right: 12px; }
}

/* ---------- Chapter strips (act intros between rooms) ---------- */
.chapter-strip {
  background: linear-gradient(180deg, var(--pine-deep), #1d2c22);
  color: #efe3cc;
  padding-block: clamp(56px, 8vw, 110px);
  position: relative; overflow: hidden;
}
.chapter-strip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    radial-gradient(rgba(231,201,136,0.06) 1px, transparent 1px);
  background-size: 26px 26px;
}
.chapter-strip h2, .chapter-strip h3 { color: #fbf3e2; }
.chapter-strip .lede { color: #ecdcc0; }
.chapter-strip .chapter .num { color: var(--wheat); border-color: var(--wheat); }
.chapter-strip .chapter .label { color: rgba(239,227,204,0.72); }
.chapter-strip .wrap { position: relative; z-index: 1; }

/* Blueprint plate (floor plans as etched drawings) */
.blueprint {
  background: #fbf7ee;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(42,37,33,0.14);
  box-shadow: 0 26px 60px -34px rgba(0,0,0,0.75);
  padding: clamp(10px, 1.4vw, 18px);
}
.blueprint img { width: 100%; height: auto; border-radius: 4px; filter: sepia(0.14) saturate(0.9); }
.blueprint figcaption {
  font-family: var(--sans); font-size: 0.78rem; color: rgba(239,227,204,0.85);
  margin-top: 0.8rem; letter-spacing: 0.02em; text-align: center;
}

/* ---------- Compare slider (Today <-> Tomorrow) ---------- */
.compare-wrap { max-width: 1080px; margin-inline: auto; }
.compare {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(42,37,33,0.16);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none; -webkit-user-select: none;
}
.compare > img, .compare .cmp-top img { display: block; width: 100%; height: auto; }
.compare .cmp-top {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.compare .cmp-top img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.compare .cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; background: rgba(251,245,234,0.9);
  transform: translateX(-1px);
  box-shadow: 0 0 18px rgba(0,0,0,0.55);
  pointer-events: none;
}
.compare .cmp-grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brass); color: #2a2013;
  display: grid; place-items: center;
  border: 2px solid rgba(251,245,234,0.92);
  box-shadow: 0 10px 26px -8px rgba(0,0,0,0.7);
}
.compare .cmp-tag {
  position: absolute; top: 14px; z-index: 2;
  font-family: var(--sans); font-weight: 600; font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 100px;
  background: rgba(21,26,22,0.62); color: #f6ecd8;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.compare .cmp-tag--a { left: 14px; }
.compare .cmp-tag--b { right: 14px; }
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: ew-resize;
}
.compare input[type="range"]:focus-visible ~ .cmp-handle .cmp-grip {
  outline: 3px solid var(--wheat); outline-offset: 3px;
}
.compare-caption {
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-faint);
  text-align: center; margin-top: 0.9rem; letter-spacing: 0.04em;
}
.compare-caption .tag { color: var(--barn); font-weight: 600; }

/* Portrait compare pairs stay a sane height */
.compare--portrait { max-width: 760px; margin-inline: auto; }

/* ---------- Floor dial (fixed wayfinder) ---------- */
.floor-dial {
  position: fixed; right: clamp(10px, 1.6vw, 26px); top: 50%;
  transform: translateY(-50%); z-index: 55;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 8px;
  background: rgba(42,37,33,0.78);
  border: 1px solid rgba(231,201,136,0.25);
  border-radius: 100px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.floor-dial.visible { opacity: 1; pointer-events: auto; }
.floor-dial a {
  position: relative; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  color: rgba(246,236,216,0.55); text-decoration: none;
}
.floor-dial a .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; transition: transform 0.25s ease, background 0.25s ease;
}
.floor-dial a.active { color: var(--wheat); }
.floor-dial a.active .dot { transform: scale(1.7); }
.floor-dial a .tip {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: rgba(42,37,33,0.92); color: #f6ecd8;
  padding: 5px 10px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.floor-dial a:hover .tip, .floor-dial a:focus-visible .tip { opacity: 1; }
@media (max-width: 1100px) { .floor-dial { display: none; } }

/* ---------- Hero over-scene tweaks ---------- */
.hero--journey .hero-inner { padding-block: clamp(120px, 22vh, 230px); }
.hero--journey { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Artifact plate (newspaper) ---------- */
.artifact { position: relative; }
.artifact .frame { transform: rotate(-1.1deg); }
.artifact::after {
  content: ""; position: absolute; inset: auto 8% -14px 8%; height: 26px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(42,37,33,0.28), transparent 70%);
  z-index: -1;
}

/* ---------- Two-up room plates ---------- */
.room-plates { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 34px); }
@media (max-width: 720px) { .room-plates { grid-template-columns: 1fr; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .scene--room { height: auto; min-height: 100svh; }
  .scene--room .scene-bg img { transform: none; }
  .kb img, .kb.in img { transform: none; transition: none; }
  .scene--scrub { height: auto; }
  .scene--scrub .scene-viewport { position: relative; height: auto; }
  .scene--scrub .scene-bg { position: relative; }
  .scene--scrub .scene-bg img { position: relative; opacity: 1 !important; transform: none; height: auto; }
  .scene--scrub .scene-bg .layer-a { display: none; }
}
