/*
 * DECAVERA / Journey: the second landing page.
 * A 3D walk along the production line of HVJ-001. The scene sits behind the
 * page; every word and number is ordinary HTML in the scrolling column.
 * Always dark, in the site's navy, teal and orange.
 */

:root {
  --j-bg: #06142A;
  --j-navy: #081D3A;
  --j-ink: #EAF2F7;
  --j-ink-2: rgba(234, 242, 247, .78);
  --j-ink-3: rgba(234, 242, 247, .64);
  --j-teal: #2DD4BF;
  --j-teal-2: #14B8A6;
  --j-orange: #FF8C1A;
  --j-line: rgba(94, 234, 212, .24);
  --j-glass: rgba(8, 29, 58, .74);
  --j-glass-soft: rgba(8, 29, 58, .56);
  --j-panel: rgba(6, 20, 42, .55);
  --j-panel-strong: rgba(6, 20, 42, .86);
  --j-edge: rgba(234, 242, 247, .14);
  --j-edge-strong: rgba(234, 242, 247, .35);
  --j-track: rgba(234, 242, 247, .16);
  --j-gap-ink: #FFC48A;
  --j-gap-label: #FFD3A6;
  --j-bar-fade: rgba(6, 20, 42, .9);
  --j-bar-clear: rgba(6, 20, 42, 0);
  --j-halo: rgba(6, 20, 42, .95);
  --j-static: #0F4C63;
  --j-shadow: rgba(0, 0, 0, .75);
  --j-e: cubic-bezier(.2, .7, .2, 1);
}

/* Daylight: light glass, dark ink. Set by the page from the visitor's clock
   or the light switch (data-j-light on <html>). */
html[data-j-light="day"] {
  --j-bg: #E6F0F5;
  --j-ink: #081D3A;
  --j-ink-2: #34495F;
  --j-ink-3: #4F6379;
  --j-teal: #0F4C63;
  --j-teal-2: #14B8A6;
  --j-orange: #A04A07;
  --j-line: rgba(15, 76, 99, .22);
  --j-glass: rgba(255, 255, 255, .84);
  --j-glass-soft: rgba(255, 255, 255, .74);
  --j-panel: rgba(255, 255, 255, .72);
  --j-panel-strong: rgba(255, 255, 255, .92);
  --j-edge: rgba(8, 29, 58, .14);
  --j-edge-strong: rgba(8, 29, 58, .3);
  --j-track: rgba(8, 29, 58, .14);
  --j-gap-ink: #8A3E05;
  --j-gap-label: #8A3E05;
  --j-bar-fade: rgba(234, 243, 247, .92);
  --j-bar-clear: rgba(234, 243, 247, 0);
  --j-halo: rgba(255, 255, 255, .95);
  --j-static: #BFE0F1;
  --j-shadow: rgba(8, 29, 58, .28);
}
html[data-j-light="day"] .j-bar .word { background-color: var(--j-ink); }
html[data-j-light="day"] .j-bar .mark { background-image: var(--logo-mark); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--j-bg);
  color: var(--j-ink);
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.j-skip {
  position: fixed; left: 12px; top: -60px; z-index: 50;
  padding: 10px 16px; border-radius: 8px;
  background: var(--j-teal); color: var(--j-bg);
  font-weight: 800; text-decoration: none;
  transition: top .2s;
}
.j-skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.j-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: linear-gradient(180deg, var(--j-bar-fade), var(--j-bar-clear));
}
.j-bar .logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.j-bar .mark { width: 30px; height: 30px; background: var(--logo-mark-dark, var(--logo-mark)) center/contain no-repeat; }
.j-bar .word {
  display: block; height: 14px; width: calc(14px * var(--word-ratio, 6.7));
  background-color: var(--j-ink);
  -webkit-mask: var(--logo-word) left center/contain no-repeat;
  mask: var(--logo-word) left center/contain no-repeat;
}
.j-bar-links { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 600; }
.j-bar-links > a:not(.j-btn) { text-decoration: none; color: var(--j-ink-2); }
.j-bar-links > a:not(.j-btn):hover { color: var(--j-ink); }

.j-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--j-e), background .2s, border-color .2s;
}
.j-btn:hover { transform: translateY(-2px); }
.j-btn-1 { background: #FF7A00; color: var(--j-navy); }
.j-btn-2 { border-color: var(--j-edge-strong); color: var(--j-ink); }
.j-btn-2:hover { border-color: var(--j-teal); }
a:focus-visible, .j-btn:focus-visible { outline: 3px solid var(--j-teal); outline-offset: 3px; }

/* ---------- the light switch: auto, day, dusk, night ---------- */
.j-light {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--j-edge-strong); border-radius: 999px;
  background: var(--j-panel);
}
.j-light button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 32px; min-height: 32px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--j-ink-2); cursor: pointer;
}
.j-light button svg { width: 15px; height: 15px; flex: none; }
.j-light button[aria-pressed="true"] { background: var(--j-teal); color: var(--j-bg); }
.j-light button:focus-visible { outline: 3px solid var(--j-teal-2); outline-offset: 2px; }

/* ---------- the 3D stage behind the page ---------- */
.j-stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.j-canvas { display: block; width: 100%; height: 100%; }
.j-poster { display: none; }

/* ---------- labels beside the objects, and entries flying into the passport ---------- */
.j-labels { position: absolute; inset: 0; pointer-events: none; }
.j-label {
  position: absolute; left: 0; top: 0;
  margin-top: -16px;
  padding: 7px 12px 7px 26px;
  border: 1px solid var(--j-line);
  border-radius: 999px;
  background: var(--j-panel-strong);
  box-shadow: 0 10px 24px -14px var(--j-shadow);
  font-size: 12.5px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  color: var(--j-ink);
  opacity: 0;
  will-change: transform, opacity;
}
.j-label::before {
  content: ""; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--j-teal);
}
.j-label::after {
  content: ""; position: absolute; left: 50%; bottom: -16px;
  width: 1px; height: 16px; background: linear-gradient(var(--j-teal), transparent);
}
.j-label[data-tone="gap"] { border-color: color-mix(in srgb, var(--j-orange) 60%, transparent); color: var(--j-gap-label); }
.j-label[data-tone="gap"]::before { background: var(--j-orange); }
.j-label[data-tone="gap"]::after { background: linear-gradient(var(--j-orange), transparent); }
.j-label[data-tone="part"]::before { background: transparent; border: 2px solid var(--j-teal); border-radius: 2px; width: 6px; height: 6px; }
.j-fly { position: fixed; z-index: 16; margin: 0; pointer-events: none; }
.j-fly::after { display: none; }
.j-readout.is-filed { animation: j-filed .6s var(--j-e); }
@keyframes j-filed {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .55); }
  100% { box-shadow: 0 0 0 14px rgba(45, 212, 191, 0); }
}

/* ---------- hover hint, and the cursor while pointing or dragging ---------- */
.j-tip {
  position: fixed; left: 0; top: 0; z-index: 18; pointer-events: none;
  padding: 6px 10px; border-radius: 8px;
  background: var(--j-teal); color: var(--j-navy);
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  opacity: 0; transition: opacity .15s;
}
.j-tip.is-on { opacity: 1; }
body.j-pointing { cursor: pointer; }
body.j-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* ---------- scrolling content ---------- */
.j-main { position: relative; z-index: 2; }
.j-stop {
  min-height: 115vh;
  display: flex; align-items: center;
  padding: 96px clamp(16px, 6vw, 96px);
}
.j-intro { min-height: 100vh; }
.j-hall { min-height: 140vh; }
.j-end { min-height: 120vh; display: flex; align-items: center; justify-content: center; padding: 96px 16px 140px; position: relative; z-index: 2; }
.j-end .j-card { text-align: left; }
.j-card {
  width: min(460px, 100%);
  padding: 26px 26px 24px;
  border: 1px solid var(--j-line);
  border-radius: 18px;
  background: var(--j-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 70px -30px var(--j-shadow);
}
.j-card-wide { width: min(560px, 100%); }
.j-intro .j-card { background: var(--j-glass-soft); }
.j-kicker {
  display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--j-teal);
}
.j-num { color: var(--j-orange); letter-spacing: .05em; }
.j-card h1, .j-card h2 { margin: 14px 0 0; letter-spacing: -.03em; line-height: 1.08; text-wrap: balance; }
.j-card h1 { font-size: clamp(36px, 5vw, 60px); }
.j-card h2 { font-size: clamp(26px, 2.8vw, 36px); }
.j-card > p:not(.j-kicker):not(.j-note):not(.j-cue) { margin: 14px 0 0; color: var(--j-ink-2); font-size: 16px; line-height: 1.66; }
.j-cue { margin: 22px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--j-orange); }
.j-cue::after { content: " ↓"; }

.j-entries, .j-gates { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 8px; }
.j-entries li, .j-gates li {
  position: relative;
  padding: 11px 14px 11px 34px;
  border: 1px solid var(--j-edge);
  border-radius: 12px;
  background: var(--j-panel);
  font-size: 13px; line-height: 1.45; color: var(--j-ink-3);
}
.j-entries b, .j-gates b { display: block; font-size: 15px; color: var(--j-ink); }
.j-entries li::before, .j-gates li::before {
  content: ""; position: absolute; left: 14px; top: 16px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--j-teal);
}
[data-tone="part"]::before { background: transparent !important; border: 2px solid var(--j-teal); border-radius: 2px !important; width: 7px !important; height: 7px !important; }
[data-tone="gap"]::before { background: var(--j-orange) !important; }
.j-entries li[data-tone="gap"] { border-color: color-mix(in srgb, var(--j-orange) 45%, transparent); color: var(--j-gap-ink); }
.j-gates span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--j-teal); }
.j-gates b { margin-top: 3px; }
.j-note { margin: 16px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--j-ink-3); }
.j-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.j-foot { position: relative; z-index: 2; display: flex; gap: 18px; padding: 0 clamp(16px, 6vw, 96px) 28px; font-size: 13px; font-weight: 600; }
.j-foot a { color: var(--j-ink-2); text-underline-offset: 3px; }
.j-foot span { color: var(--j-ink-3); }

/* ---------- passport readout ---------- */
.j-readout {
  position: fixed; right: clamp(16px, 3vw, 40px); bottom: clamp(16px, 3vw, 32px); z-index: 15;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--j-line); border-radius: 14px;
  background: var(--j-glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.j-readout-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--j-teal); }
.j-readout-head b { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--j-ink-2); white-space: nowrap; }
.j-readout-head b span { font-size: 20px; font-weight: 800; color: var(--j-ink); font-variant-numeric: tabular-nums; }
.j-readout-bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 10px; }
.j-readout-bar i { height: 6px; border-radius: 3px; background: var(--j-track); transition: background .4s; }
.j-readout-bar i.is-ok { background: var(--j-teal-2); }
.j-readout-bar i.is-fail { background: var(--j-orange); }
.j-readout-latest { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--j-ink-2); min-height: 38px; }
.j-readout-latest b { color: var(--j-ink); }

/* ---------- station rail ---------- */
.j-rail { position: fixed; right: clamp(16px, 3vw, 40px); top: 50%; transform: translateY(-58%); z-index: 15; }
.j-rail ol { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 4px; border-radius: 14px; background: var(--j-panel); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.j-rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  min-height: 24px; padding: 2px 0;
  font-size: 12px; font-weight: 700; color: var(--j-ink-3); text-decoration: none;
  text-shadow: 0 1px 6px var(--j-halo), 0 0 2px var(--j-halo);
}
.j-rail a::after { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--j-edge-strong); transition: background .3s, border-color .3s; }
.j-rail a span, .j-rail a { transition: color .3s; }
.j-rail a.is-past::after { background: var(--j-teal-2); border-color: var(--j-teal-2); }
.j-rail a.is-here { color: var(--j-ink); }
.j-rail a.is-here::after { background: var(--j-orange); border-color: var(--j-orange); }

/* ---------- loader: only while scripts run and the scene is not ready ---------- */
.j-loader {
  position: fixed; inset: 0; z-index: 30;
  display: none; place-content: center; justify-items: center; gap: 14px;
  background: var(--j-bg);
  font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--j-teal);
}
.j-js:not(.j-live):not(.j-static) .j-loader { display: grid; }
.j-loader p { margin: 0; }
.j-loader-bar { display: block; width: 180px; height: 3px; border-radius: 2px; background: var(--j-track); overflow: hidden; }
.j-loader-bar i { display: block; width: 40%; height: 100%; background: var(--j-teal); animation: j-load 1.1s ease-in-out infinite; }
@keyframes j-load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- static version: no WebGL, reduced motion, or no scripts ---------- */
.j-static .j-canvas, .j-static .j-labels, html:not(.j-js) .j-canvas, html:not(.j-js) .j-labels { display: none; }
.j-static .j-stage, html:not(.j-js) .j-stage { background: radial-gradient(circle at 75% 45%, var(--j-static) 0%, var(--j-bg) 60%); }
.j-static .j-poster, html:not(.j-js) .j-poster { display: block; position: absolute; right: 8vw; top: 50%; transform: translateY(-50%); width: min(38vw, 520px); opacity: .9; }
.j-static .j-stop, html:not(.j-js) .j-stop { min-height: auto; padding-block: 96px 24px; }
.j-static .j-intro, html:not(.j-js) .j-intro { min-height: 80vh; }

@media (max-width: 900px) {
  .j-rail { display: none; }
  .j-bar-links > a:not(.j-btn) { display: none; }
  .j-bar-links { gap: 8px; }
  .j-light button { padding: 0 8px; }
  .j-light button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .j-bar .word { display: none; }
}
@media (max-width: 560px) {
  /* The closing card carries the demo link; the bar keeps logo and light. */
  .j-bar .j-btn-1 { display: none; }
  .j-btn { padding: 10px 14px; font-size: 12px; min-height: 40px; }
  .j-stop { align-items: center; padding: 96px 16px 120px; min-height: 135vh; }
  .j-end { min-height: 110vh; align-items: flex-start; padding-top: 18vh; }
  .j-actions .j-btn { flex: 1 1 auto; }
  .j-intro { align-items: center; min-height: 100vh; padding-bottom: 96px; }
  .j-card { padding: 18px 16px; }
  .j-card h2 { font-size: 24px; }
  .j-card > p:not(.j-kicker):not(.j-note):not(.j-cue) { font-size: 14.5px; line-height: 1.6; margin-top: 10px; }
  .j-entries, .j-gates { margin-top: 14px; gap: 6px; }
  .j-entries li, .j-gates li { padding: 9px 12px 9px 30px; }
  .j-entries li::before, .j-gates li::before { left: 12px; top: 14px; }
  .j-readout { left: 16px; right: 16px; bottom: 12px; width: auto; padding: 10px 14px; }
  .j-readout-latest { min-height: 0; }
  .j-static .j-poster { right: -10vw; width: 70vw; opacity: .25; }
  .j-label { font-size: 12px; padding: 6px 10px 6px 22px; }
  .j-label::before { left: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .j-loader-bar i { animation: none; transform: none; width: 100%; }
  .j-readout.is-filed { animation: none; }
  .j-btn, .j-readout-bar i { transition: none; }
}
