/* ============================================================
   josephbankole.ca — homepage cinematic experience.
   Linked from index.html ONLY (after style.css).
   Cold open "02:00", hero band, engagement diorama, configurator,
   close band, floating book pill. Promoted from /lab/.

   Scoping rules:
   - No selector here redefines anything in assets/style.css.
     Shared pieces (.wrap, .btn, .btn--ghost, .index, h2, .eyebrow
     scoping, .credrow, .hero-cta, .ctaband, .scrollcue, focus
     styles, @keyframes drop) come from style.css.
   - Shared brand tokens (--navy, --cream, --gold, --serif, --mono,
     --ease...) come from style.css; experience-only values use
     --xp-* names so nothing shifts on other pages or sections.
   - States that only exist once JS runs are gated behind
     body.xp-js (added by experience.js), so no-JS visitors get
     the full static page immediately.
   ============================================================ */

:root {
  --xp-ink: #06121b;            /* near-black navy, terminal bg */
  --xp-phosphor: #d7e2c2;       /* cream with a faint green cast */
  --xp-dim: #96a1a0;
  --xp-gold-deep: #bc913a;
  --xp-faint: rgba(242, 234, 211, 0.14);  /* quieter hairline than --cream-faint */
  --xp-panel: rgba(19, 58, 82, 0.35);
  --xp-ease-expo: cubic-bezier(0.16, 1, 0.3, 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;
}

/* ============================================================
   COLD OPEN "02:00" — JS-only overlay. Hidden by default; JS adds
   .play, so no-JS and reduced-motion visitors never see it.
   ============================================================ */
.cold-open {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(120% 90% at 50% 30%, #0a1a26 0%, var(--xp-ink) 70%);
  display: none; place-items: center;
  opacity: 1; transition: opacity .7s var(--ease);
}
.cold-open.play { display: grid; }
.cold-open.done { opacity: 0; pointer-events: none; }

.co-scanlines {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(to bottom, rgba(215,226,194,.04) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.co-inner {
  width: min(760px, 90vw); display: flex; flex-direction: column; gap: 40px;
  padding: 0 24px;
}

.co-terminal {
  border: 1px solid var(--xp-faint); border-radius: 4px;
  background: rgba(6,18,27,.72); box-shadow: 0 30px 80px rgba(0,0,0,.5);
  overflow: hidden;
}
.co-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--xp-faint);
  background: rgba(242,234,211,.03);
}
.co-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--xp-faint); }
.co-tag {
  margin-left: 8px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--xp-dim);
}
.co-feed {
  font-family: var(--mono); font-size: clamp(11.5px, 2.3vw, 14px); line-height: 1.85;
  color: var(--xp-phosphor); padding: 18px 18px 20px; min-height: 190px;
  text-shadow: 0 0 8px rgba(215,226,194,.18);
}
.co-feed .fl { display: block; white-space: pre-wrap; }
.co-feed .fl b { color: var(--gold); font-weight: 500; }
.co-feed .caret {
  display: inline-block; width: 8px; height: 1.05em; margin-left: 2px;
  vertical-align: text-bottom; background: var(--xp-phosphor);
  animation: xp-blink 1s steps(1) infinite;
}
@keyframes xp-blink { 50% { opacity: 0; } }

.co-headline {
  opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.co-headline.show { opacity: 1; transform: none; }
.co-line { display: block; font-family: var(--serif); font-weight: 330; letter-spacing: -.03em; line-height: 1.02; }
.co-line-1 { font-size: clamp(1.5rem, 5vw, 2.7rem); color: var(--cream); }
.co-line-2 { font-size: clamp(1.5rem, 5vw, 2.7rem); color: var(--cream); margin-top: 4px; position: relative; display: inline-block; }
.co-line-2 em { font-style: italic; color: var(--gold); }
.co-underline {
  position: absolute; left: 0; bottom: -8px; height: 2px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--xp-ease-expo) .35s;
}
.co-headline.show .co-underline { transform: scaleX(1); }

.co-skip {
  position: absolute; top: 22px; right: 22px; z-index: 3;
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--xp-dim); background: transparent; border: 1px solid var(--xp-faint);
  padding: 9px 14px; border-radius: 2px; cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.co-skip:hover { color: var(--cream); border-color: var(--gold-soft); }

/* ============================================================
   HERO BAND — the compressed resting state of the cold open.
   Class is hero-band (NOT .hero) so style.css hero rules, including
   the em::after wipe underline, never double up here.
   ============================================================ */
.hero-band { padding: clamp(72px, 11vh, 130px) 0 clamp(44px, 7vh, 80px); }
.hero-band .eyebrow {
  font-family: var(--mono); letter-spacing: .22em; text-transform: uppercase;
  font-size: 12px; color: var(--gold); margin-bottom: 22px;
}
.hero-h {
  font-family: var(--serif); font-weight: 330;
  font-size: clamp(2.2rem, 6.2vw, 4.4rem); line-height: 1.02; letter-spacing: -.035em;
  max-width: 19ch; position: relative;
}
.hero-h em { font-style: italic; color: var(--cream); }
.hero-underline {
  display: block; height: 2px; width: min(9.5em, 62%); margin-top: 18px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transform: scaleX(1); transform-origin: left; transition: transform 1.1s var(--xp-ease-expo) .2s;
}
.xp-js .hero-underline { transform: scaleX(0); }
.hero-band.lit .hero-underline { transform: scaleX(1); }

.hero-feed {
  margin-top: 34px; display: flex; flex-direction: column; gap: 3px;
  width: fit-content; max-width: 100%;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--cream-dim);
  border-left: 2px solid var(--gold-soft); padding: 4px 0 4px 16px;
}
.hero-feed b { color: var(--gold); font-weight: 500; }
.hero-band .hero-cta { margin-top: 34px; }
.hero-band .scrollcue { margin-top: 32px; }

/* ============================================================
   ACT 2 · WATCH AN ENGAGEMENT RUN
   Without JS the section is a normal static block (no 300vh scroll
   distance, no pin, cards fully visible, scrubber hidden).
   ============================================================ */
.act2 { position: relative; padding: 0; }
.act2-pin { padding: clamp(56px, 8vw, 110px) 0; }
.xp-js .act2-scroll { height: 300vh; }
.xp-js .act2-pin {
  position: sticky; top: 0; height: 100vh; min-height: 640px; padding: 0;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
/* width:100% matters: inside the flex-column pin, a .wrap with auto
   side margins would otherwise shrink to fit-content and float centre */
.act2-head { margin-bottom: clamp(28px, 5vh, 60px); width: 100%; }
.act2-head h2 { max-width: 14ch; }
.act2-sub { color: var(--cream-dim); margin-top: 14px; max-width: 46ch; font-size: 1.05rem; }

.diorama { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }

/* rail */
.rail { position: relative; height: 2px; margin: 8px 6% 0; }
.rail-line { position: absolute; inset: 0; background: var(--xp-faint); }
.rail-fill {
  position: absolute; inset: 0; background: linear-gradient(90deg, var(--xp-gold-deep), var(--gold));
  transform: scaleX(var(--p)); transform-origin: left;
  box-shadow: 0 0 14px rgba(201,161,74,.5);
}
.rail-pulse {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-faint), 0 0 22px 4px rgba(201,161,74,.7);
  will-change: transform;
}

/* stations */
.stations {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px;
  margin: 34px 0 0;
}
.station { position: relative; text-align: left; }
.st-node {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--xp-faint); background: var(--navy-deep);
  font-family: var(--mono); font-size: 11px; color: var(--xp-dim);
  transition: border-color .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease), background .4s var(--ease);
}
.st-name {
  font-family: var(--serif); font-weight: 360; font-size: 1.25rem; letter-spacing: -.01em;
  margin: 14px 0 10px; color: var(--cream-dim); transition: color .4s var(--ease);
}
.st-card {
  border: 1px solid var(--xp-faint); border-left: 2px solid var(--xp-faint);
  border-radius: 3px; background: var(--xp-panel); padding: 14px 14px 15px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--cream);
  transition: opacity .5s var(--ease), transform .5s var(--ease), border-color .5s var(--ease);
}
.xp-js .st-card { opacity: .32; transform: translateY(10px); }
.st-card p { margin: 0; }
.st-card p + p { margin-top: 7px; }
.st-card .st-dim { color: var(--xp-dim); }

.station.lit .st-node {
  border-color: var(--gold); color: var(--gold); background: var(--navy-deep);
  box-shadow: 0 0 0 4px var(--gold-faint);
}
.station.lit .st-name { color: var(--cream); }
.station.lit .st-card { opacity: 1; transform: none; border-left-color: var(--gold); }

/* scrubber — a JS instrument, hidden until JS arrives */
.scrub { display: none; margin: clamp(30px, 5vh, 54px) 6% 0; }
.xp-js .scrub { display: block; }
.scrub-track {
  position: relative; height: 34px; cursor: grab; touch-action: none;
  display: flex; align-items: center;
}
.scrub-track:active { cursor: grabbing; }
.scrub-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px;
  transform: translateY(-50%); background: var(--xp-faint); border-radius: 2px;
}
.scrub-fill {
  position: absolute; left: 0; top: 50%; height: 3px; width: 100%;
  transform: translateY(-50%) scaleX(var(--p)); transform-origin: left;
  background: var(--gold-soft); border-radius: 2px;
}
.scrub-ticks { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; }
.scrub-ticks i { width: 1px; height: 9px; background: var(--xp-faint); }
.scrub-handle {
  position: absolute; left: 0; top: 50%; width: 20px; height: 20px;
  margin: -10px 0 0 -10px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,.4), 0 0 0 4px var(--gold-faint);
  will-change: transform; cursor: grab;
}
.scrub-foot {
  display: flex; align-items: center; justify-content: space-between; margin-top: 14px;
}
.scrub-hint { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--xp-dim); }
.replay {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cream-dim); background: transparent; border: 1px solid var(--xp-faint);
  padding: 8px 13px; border-radius: 2px; cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.replay:hover { color: var(--gold); border-color: var(--gold-soft); }

/* ============================================================
   ACT 3 · SCOPE YOUR BUILD
   ============================================================ */
.act3-sub { color: var(--cream-dim); margin-top: 16px; font-size: 1.1rem; max-width: 52ch; }

.configurator { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }

.config-form { display: flex; flex-direction: column; gap: 30px; }
.q { border: 0; margin: 0; padding: 0; }
.q legend {
  font-family: var(--serif); font-weight: 360; font-size: 1.3rem; letter-spacing: -.01em;
  color: var(--cream); margin-bottom: 16px; display: flex; align-items: baseline; gap: 12px;
  padding: 0;
}
.q-n {
  font-family: var(--mono); font-size: 11px; color: var(--gold);
  border: 1px solid var(--gold-soft); border-radius: 50%;
  width: 24px; height: 24px; display: inline-grid; place-items: center; flex: none;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--cream-dim); background: var(--xp-panel);
  border: 1px solid var(--xp-faint); border-radius: 2px;
  padding: 11px 15px; cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .1s var(--ease);
}
.chip:hover { color: var(--cream); border-color: var(--gold-soft); }
.chip:active { transform: scale(.97); }
.chip[aria-checked="true"] {
  color: var(--navy); background: var(--gold); border-color: var(--gold); font-weight: 500;
}

.sketch {
  border: 1px solid var(--xp-faint); border-radius: 4px;
  background: linear-gradient(180deg, var(--xp-panel), rgba(7,28,43,.55));
  padding: clamp(24px, 3vw, 34px); position: sticky; top: 92px;
}
.sketch-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px;
}
.sketch-read {
  font-family: var(--serif); font-weight: 350; font-size: 1.3rem; line-height: 1.32;
  letter-spacing: -.01em; color: var(--cream); min-height: 3.4em;
  transition: opacity .3s var(--ease);
}
.sketch-read.swap { opacity: 0; }
.weeks { margin: 24px 0 26px; display: flex; flex-direction: column; gap: 16px; }
.week { border-top: 1px solid var(--xp-faint); padding-top: 16px; }
.week-n {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 8px;
}
.week p { font-size: .98rem; color: var(--cream-dim); line-height: 1.55; }
.sketch-cta { width: 100%; text-align: center; }
.sketch-cta.ready { box-shadow: 0 0 0 4px var(--gold-faint); }

/* ============================================================
   CLOSE — the Act 4 line inside the standard consultation band
   ============================================================ */
.ctaband .close-line {
  font-style: italic; font-size: clamp(1.7rem, 4.4vw, 3rem); line-height: 1.1;
  letter-spacing: -.02em; max-width: 20ch; margin: 0 auto 18px;
}
.close-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FLOATING BOOK PILL — appears once the hero scrolls away (JS)
   ============================================================ */
.book-pill {
  position: fixed; right: clamp(16px, 3vw, 30px); bottom: clamp(16px, 3vw, 30px); z-index: 90;
  font-family: var(--grotesque); font-weight: 600; font-size: 14px;
  background: var(--gold); color: var(--navy); padding: 12px 18px; border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.book-pill.show { opacity: 1; transform: none; pointer-events: auto; }
.book-pill:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(201,161,74,.28); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .configurator { grid-template-columns: 1fr; }
  .sketch { position: static; }
}

@media (max-width: 760px) {
  /* Act 2 goes vertical */
  .xp-js .act2-scroll { height: 420vh; }
  .xp-js .act2-pin { justify-content: flex-start; padding-top: clamp(20px, 5vh, 40px); overflow-y: hidden; }
  .act2-head { margin-bottom: 24px; }
  .diorama { display: grid; grid-template-columns: 22px 1fr; gap: 0 18px; align-items: start; }
  .act2-head { grid-column: 1 / -1; }
  .rail { grid-column: 1; grid-row: 2; width: 2px; height: auto; align-self: stretch; margin: 6px 0 0; min-height: 46vh; }
  .rail-fill { transform: scaleY(var(--p)); transform-origin: top; background: linear-gradient(180deg, var(--xp-gold-deep), var(--gold)); }
  .rail-pulse { top: 0; left: 50%; margin: -6px 0 0 -6px; }
  .stations { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; gap: 14px; margin: 0; }
  .station { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
  .st-node { grid-row: span 2; align-self: start; }
  .st-name { margin: 0; }
  .st-card { grid-column: 2; }
  .scrub { grid-column: 1 / -1; grid-row: 3; margin: 30px 0 0; }
}

@media (max-width: 420px) {
  .co-feed { min-height: 168px; }
  .hero-feed { font-size: 11.5px; }
  .book-pill { font-size: 13px; padding: 11px 16px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .cold-open { display: none !important; }
  .hero-underline, .co-underline { transition: none; }
  .co-feed .caret { animation: none; }
  .xp-js .st-card { opacity: 1; transform: none; transition: none; }
  .station .st-node, .station .st-name { transition: none; }
  .rail-fill, .scrub-fill { transition: none; }
  .book-pill { transition: none; }
}
