/* Scene 2 — The Journey Begins. Two stations, one badge: entrance check-in
   on the left, video kiosk on the right, a resolve banner that proves the
   backend (not a fixed webpage) decides what happens next, and a journey
   rail underneath. Everything here is scoped under .jn.

   Layout: `.jn-panel-stage` is a fixed-height overlay grid. Every beat in
   a station's timeline (tap, confirm, record, preview, upload, done) is a
   grid item placed in the same cell (grid-area: 1 / 1) instead of being
   stacked in normal flow, so the panel's height is the tallest single
   beat, never the sum of all fifteen steps. journey.js keeps only the
   latest-reached beat opaque via `.jn-stage-super`. */

.jn .scene-scrim {
  background:
    radial-gradient(85% 65% at 20% 18%, rgba(74, 91, 51, .24) 0%, transparent 60%),
    radial-gradient(70% 60% at 84% 28%, rgba(228, 193, 105, .14) 0%, transparent 62%),
    linear-gradient(180deg, #0E100C 0%, #0B0C0A 100%);
}

.jn-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 16px);
}

/* Shared components (chip/pill/panel-title/rail) ship with clamp() minimums
   under 14px for compact contexts elsewhere in the app. Scoped (not global)
   overrides so nothing on this scene ever renders unreadably small. */
.jn .chip        { font-size: clamp(14px, .9vw, 16px); }
.jn .pill        { font-size: clamp(14px, .85vw, 15px); }
.jn .panel-title { font-size: clamp(14px, .85vw, 16px); }
.jn .rail-item   { font-size: clamp(14px, .9vw, 16px); padding: .42em .8em; }
.jn .rail-state  { font-size: clamp(13px, .78vw, 14px); }
.jn .rail        { gap: clamp(6px, .6vw, 12px); }

/* --------------------------------------------------------------------- head */
.jn-head { max-width: 76ch; gap: clamp(4px, .5vh, 8px); }
.jn-tagline { align-self: flex-start; }

/* ----------------------------------------------------------------- stations */
.jn-stations {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 1.6vw, 24px);
}

.jn-panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vh, 16px);
  padding: clamp(10px, 1.1vw, 22px);
  border-top: 3px solid transparent;
  transition: opacity .5s var(--t), filter .5s var(--t);
}
.jn-panel--entrance { border-top-color: rgba(143, 168, 106, .6); }
.jn-panel--kiosk    { border-top-color: rgba(228, 193, 105, .6); }

.jn-panel--locked {
  opacity: .42;
  filter: grayscale(.6) saturate(.7);
}

.jn-panel-head { flex: none; }

.jn-panel-title {
  font-size: clamp(15px, 1.3vw, 24px);
  font-weight: 750;
  letter-spacing: -.01em;
}

/* the overlay stage: every beat shares this one cell */
.jn-panel-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(200px, 23vh, 260px);
  overflow: hidden;
}
.jn-panel-stage > [data-reveal] {
  grid-area: 1 / 1;
  max-width: 100%;
}
.jn-panel-stage > [data-reveal].jn-stage-super {
  opacity: 0 !important;
  pointer-events: none;
}

.jn-confirm { width: min(100%, 360px); text-align: center; }
.jn-detect { font-size: clamp(14px, .98vw, 18px); }
.jn-detect-name { font-weight: 700; color: var(--paper); }
.jn-attendance { font-size: clamp(14px, .9vw, 16px); }

/* --------------------------------------------------------------- connector */
.jn-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 clamp(40px, 5vw, 84px);
}
.jn-connector-inner {
  align-items: center;
  text-align: center;
  color: var(--gold);
}
.jn-connector-inner .jn-icon { animation: jnNudge 2.2s ease-in-out infinite; }
.jn-connector-label {
  font-size: clamp(14px, .7vw, 15px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper-faint);
  white-space: nowrap;
}
@keyframes jnNudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(6px); }
}

/* -------------------------------------------------------------------- icons */
.jn-icon { display: inline-flex; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------ recorder */
.jn-recorder { width: min(100%, 360px); text-align: center; }

.jn-rec-frame {
  position: relative;
  width: min(100%, 250px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: radial-gradient(120% 100% at 50% 20%, #232619 0%, #0E0F0A 72%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  transition: box-shadow .4s var(--t), border-color .4s var(--t);
}
.jn-rec-frame.is-live {
  border-color: rgba(196, 97, 75, .55);
  box-shadow: 0 0 0 1px rgba(196, 97, 75, .35), 0 18px 44px rgba(0, 0, 0, .55);
}

/* the participant's real commitment footage inside the simulated viewfinder */
.jn-rec-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s var(--t);
}
.jn-rec-video.on { opacity: 1; }
.jn-rec-frame > .jn-rec-topbar,
.jn-rec-frame > .jn-rec-camicon { z-index: 2; }

.jn-rec-viewfinder {
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 60% at 50% 55%, rgba(255, 255, 255, .08), transparent 70%);
}

.jn-rec-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(6px, .8vw, 12px);
}

.jn-rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .25em .65em;
  border-radius: 999px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line-2);
}
.jn-rec-dot {
  width: .6em; height: .6em;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  transition: background .3s var(--t);
}
.jn-rec-label {
  font-size: clamp(14px, .68vw, 15px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.jn-rec-indicator.is-live .jn-rec-dot {
  background: var(--danger);
  animation: jnRecPulse 1.1s ease-out infinite;
}
.jn-rec-indicator.is-live .jn-rec-label { color: #F0A692; }
.jn-rec-indicator.is-stopped .jn-rec-dot { background: var(--gold); }
.jn-rec-indicator.is-stopped .jn-rec-label { color: var(--gold-hi); }
@keyframes jnRecPulse {
  0%   { box-shadow: 0 0 0 0 rgba(196, 97, 75, .6); }
  70%  { box-shadow: 0 0 0 .7em rgba(196, 97, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 97, 75, 0); }
}

.jn-rec-timer {
  font-size: clamp(14px, .8vw, 16px);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--paper-dim);
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: .25em .7em;
}

.jn-rec-camicon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(246, 243, 234, .26);
}

.jn-rec-prompt {
  margin: 0 auto;
  max-width: 40ch;
  text-align: center;
  font-style: italic;
  font-size: clamp(14px, .95vw, 17px);
}

/* ------------------------------------------------------------------- preview */
.jn-preview-group { width: min(100%, 360px); text-align: center; }
.jn-preview { width: 100%; display: grid; gap: .5em; justify-items: center; }
.jn-preview-quote {
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.45;
  color: var(--paper);
  max-width: 42ch;
  font-style: italic;
}

.jn-retake { color: var(--paper-dim); font-size: clamp(14px, .82vw, 15px); }

/* -------------------------------------------------------------------- upload */
.jn-upload-wrap { width: 100%; max-width: 340px; }
.jn-progress {
  height: clamp(8px, .8vh, 12px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  overflow: hidden;
}
.jn-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--grad-gold);
}
.jn-upload-wrap.on .jn-progress-fill {
  width: 100%;
  transition: width 1.5s var(--t) .1s;
}

.jn-success { font-size: clamp(14px, .88vw, 16px); }

/* ------------------------------------------------------------------- resolve */
.jn-resolve {
  position: relative;
  padding: clamp(10px, 1.2vw, 22px);
  border-radius: var(--r-lg);
  border: 1px solid rgba(228, 193, 105, .4);
  background: linear-gradient(165deg, rgba(228, 193, 105, .1), rgba(255, 255, 255, .02));
  animation: jnResolveGlow 3.2s ease-in-out infinite;
}
@keyframes jnResolveGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 193, 105, 0); }
  50%      { box-shadow: 0 0 44px 2px rgba(228, 193, 105, .16); }
}

.jn-resolve-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.4vw, 22px);
  flex-wrap: wrap;
}

.jn-resolve-item {
  display: flex;
  align-items: center;
  gap: clamp(8px, .9vw, 14px);
}
.jn-resolve-icon {
  display: grid;
  place-items: center;
  width: clamp(28px, 2.4vw, 42px);
  height: clamp(28px, 2.4vw, 42px);
  border-radius: 50%;
  border: 1px solid var(--line-2);
  flex: none;
}
.jn-resolve-item.is-done .jn-resolve-icon {
  color: var(--green-hi);
  border-color: rgba(143, 168, 106, .55);
  background: rgba(143, 168, 106, .12);
}
.jn-resolve-item.is-next .jn-resolve-icon {
  color: var(--gold-hi);
  border-color: rgba(228, 193, 105, .55);
  background: rgba(228, 193, 105, .14);
}

.jn-resolve-kicker {
  display: block;
  font-size: clamp(14px, .78vw, 15px);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.jn-resolve-value {
  display: block;
  font-size: clamp(16px, 1.7vw, 30px);
  font-weight: 750;
  letter-spacing: -.015em;
}

.jn-resolve-arrow { color: var(--gold); flex: none; }

.jn-resolve-callout {
  margin: clamp(6px, .9vh, 14px) auto 0;
  text-align: center;
  max-width: 62ch;
  font-size: clamp(15px, 1.2vw, 22px);
}

/* ---------------------------------------------------------------------- rail */
.jn-rail-wrap { display: flex; flex-direction: column; gap: clamp(4px, .6vh, 8px); }
.jn-rail-title { margin-bottom: 0; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .jn-stations { flex-direction: column; }
  .jn-connector { flex: none; padding: 2px 0; }
  .jn-connector-inner { flex-direction: row; gap: .6em; }
  .jn-connector-inner .jn-icon { transform: rotate(90deg); animation: none; }
  .jn-panel-stage { height: clamp(170px, 22vh, 240px); }
}

@media (max-width: 720px) {
  .jn-resolve-row { flex-direction: column; text-align: center; }
  .jn-resolve-arrow { transform: rotate(90deg); }
}
