/* ==========================================================================
   Blitz — index-only showpiece styles ("The Factory Wakes Up").
   Shared scene components live in site.css; this file is loaded by index.html
   only, right after site.css.
   ========================================================================== */

/* ---------- hero: the factory at night ---------- */
.hero-night { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 4rem); }
@supports (height: 100svh) { .hero-night { min-height: calc(100svh - 4rem); } }
.hero-scene { position: absolute; inset: 0; }
.hero-poster { width: 100%; height: 100%; display: block; }
.hero-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.hero-scene.three-on canvas { opacity: 1; }
.hero-scene.three-on .hero-poster { opacity: 0; transition: opacity 1.2s ease; }
.hero-grade { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(23,19,14,.94) 0%, rgba(23,19,14,.72) 38%, rgba(23,19,14,.28) 68%, rgba(23,19,14,.12) 100%),
  linear-gradient(0deg, rgba(23,19,14,.55) 0%, rgba(23,19,14,0) 30%); }
.hero-content { z-index: 1; }

/* landscape poster by default; the portrait one takes over on phones (media query,
   not Tailwind utilities, so it can't lose a specificity tie with .hero-poster) */
.hero-poster-tall { display: none; }
/* breakpoint aligned with the Three.js small-screen gate (hero-factory.js, 700px) so the
   portrait poster is exactly what shows whenever the 3D scene is off — no crop band */
@media (max-width: 700px) {
  .hero-poster-wide { display: none; }
  .hero-poster-tall { display: block; }
  /* vertical grade: clear through the upper-middle so the centred core glows,
     darker top (nav contrast) and bottom (headline + buttons) */
  .hero-grade { background:
    linear-gradient(180deg, rgba(23,19,14,.55) 0%, rgba(23,19,14,.18) 22%, rgba(23,19,14,.10) 42%, rgba(23,19,14,.55) 72%, rgba(23,19,14,.9) 100%); }
}

/* poster: sensors wake one by one, data streams rise, the mind forms */
.hp-dot { fill: #FF6B2C; opacity: 0;
  animation: hp-on .5s ease-out var(--d, 0s) forwards, hp-breathe 3.2s ease-in-out calc(var(--d, 0s) + .6s) infinite; }
.hp-halo { fill: none; stroke: #FF6B2C; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: hp-ring 3.2s ease-out calc(var(--d, 0s) + .5s) infinite; }
.hp-stream { fill: none; stroke: #FF6B2C; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 3 15; opacity: 0;
  animation: hp-fade .9s ease var(--d, 0s) forwards, hp-flow 1.5s linear var(--d, 0s) infinite; }
.hp-core { transform-box: fill-box; transform-origin: center; animation: hp-corebreathe 5.5s ease-in-out 2s infinite; }
.hp-core-dot { animation: hp-breathe 2.6s ease-in-out infinite; }
@keyframes hp-on { to { opacity: 1; } }
@keyframes hp-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes hp-ring { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3.4); } }
@keyframes hp-fade { to { opacity: .5; } }
@keyframes hp-flow { to { stroke-dashoffset: -18; } }
@keyframes hp-corebreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* floating HUD */
.hud-stack { display: grid; gap: 14px; max-width: 340px; margin-left: auto; }
.hud-card { background: rgba(33,27,20,.78); border: 1px solid rgba(250,248,244,.12); border-radius: 18px;
  padding: 16px 20px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.hud-1 { transform: translateX(-26px); }
.hud-2 { transform: translateX(18px); }
.hud-3 { transform: translateX(-8px); }
.hud-jarvis { transform: translateX(34px); border-color: rgba(255,107,44,.35); }
@media (max-width: 1280px) { .hud-1, .hud-2, .hud-3, .hud-jarvis { transform: none; } }

/* scroll cue */
.scroll-cue { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1; }
.sc-line { width: 1px; height: 34px; background: linear-gradient(180deg, #FF6B2C, transparent);
  transform-origin: top; animation: sc-drop 2.2s ease-in-out infinite; }
@keyframes sc-drop { 0% { transform: scaleY(.15); opacity: 0; } 35% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- logbook (problem section) ---------- */
.logbook { max-width: 430px; margin-left: auto; background: #211B14; border: 1px solid rgba(250,248,244,.12);
  border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.logbook-head { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px;
  background: rgba(250,248,244,.05); border-bottom: 1px solid rgba(250,248,244,.1); color: rgba(250,248,244,.55); }
.logbook-lines { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 158px; }
.lb-line { font: 400 15px/1.5 "Geist Mono", monospace; color: rgba(250,248,244,.8); }
.lb-line s { color: rgba(250,248,244,.4); }
.lb-smudge { color: rgba(250,248,244,.45); font-style: italic; }
.lb-dim { color: rgba(250,248,244,.45); }
.lb-caret { display: inline-block; width: 8px; height: 17px; background: #FF6B2C; vertical-align: -3px;
  margin-left: 2px; animation: lb-blink 1s steps(1) infinite; }
@keyframes lb-blink { 50% { opacity: 0; } }
.logbook-foot { padding: 10px 18px 14px; border-top: 1px dashed rgba(250,248,244,.14);
  color: #FF6B2C; letter-spacing: .06em; }
@media (max-width: 1023px) { .logbook { margin-left: 0; } }

/* ---------- dawn band: the lights come on ---------- */
.dawn-band { position: relative; height: 34vh; min-height: 200px; overflow: hidden; }
.dawn-glow { position: absolute; left: 50%; bottom: -40%; width: 120vw; height: 80%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center bottom, rgba(255,107,44,.32), rgba(255,107,44,.08) 45%, transparent 70%); }

/* ---------- Senses -> Memory -> Mind scrollytelling stage ---------- */
.how-stage { margin-bottom: 3.5rem; }
.stage-rail { display: none; }
.stage-acts { display: grid; gap: 36px; }
.stage-act { display: grid; gap: 20px; align-items: center; margin: 0; }
@media (min-width: 768px) { .stage-act { grid-template-columns: 1.15fr 1fr; gap: 36px; } }
.act1-svg { width: 100%; height: auto; display: block; }
.a1-ring { transform-box: fill-box; transform-origin: center; opacity: 0; animation: hp-ring 2.6s ease-out 1s infinite; }
.a1-ring2 { animation-delay: 2.3s; }

/* pinned mode (added by home.js on lg+ with GSAP and motion allowed) */
.how-stage.is-pinned { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; min-height: 70vh; }
.how-stage.is-pinned .stage-rail { position: relative; display: flex; flex-direction: column; gap: 26px;
  padding-left: 18px; align-self: center; }
.rail-line { position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: #E7E1D6; border-radius: 2px; }
.rail-prog { position: absolute; left: 0; top: 0; width: 2px; height: 0%; background: #E0531F; border-radius: 2px; }
.rail-item { font-size: 11px; letter-spacing: .14em; color: #6E6D65; transition: color .3s ease; white-space: nowrap; }
.rail-item.is-on { color: #E0531F; font-weight: 600; }
.how-stage.is-pinned .stage-acts { position: relative; min-height: 440px; }
.how-stage.is-pinned .stage-act { position: absolute; inset: 0; margin: auto 0; height: fit-content; }

/* ---------- reduced motion: everything settles into its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  .hp-dot { opacity: 1; animation: none; }
  .hp-halo { display: none; }
  .hp-stream { opacity: .4; animation: none; }
  .hp-core, .hp-core-dot { animation: none; }
  .sc-line { animation: none; }
  .lb-caret { display: none; }
  .a1-ring, .a1-ring2 { animation: none; opacity: .35; }
  .hero-scene canvas { display: none; }
  .hero-scene.three-on .hero-poster { opacity: 1; }
}
