/* PaperJourney presentation only. The scene occupies the shared full-height
   pin; editorial surfaces move over it without changing its dimensions. */
.paper-journey {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  --pj-edge: clamp(22px, 3vw, 52px);
}
.paper-journey .viewport { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; background: #101109; }
.paper-journey .viewport canvas { display: block; width: 100%; height: 100%; }
.paper-journey .viewport-frame, .paper-journey .edge, .paper-journey .viewport-note { display: none; }

/* Square-edged editorial sheet, flush to the side of the screen. No scene
   tint, backdrop filter, rounded card, or space reserved beneath it. */
.paper-journey .rail {
  position: absolute; top: 50%; left: 0; z-index: 3;
  width: clamp(310px, 28vw, 448px); max-height: calc(100% - 180px);
  padding: clamp(28px, 3vw, 48px);
  background: #eeebe2f7; color: var(--ink-text);
  transform: translate3d(-110%, -50%, 0); visibility: hidden;
  pointer-events: none; will-change: transform, opacity;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #8d897b transparent;
}
.paper-journey .rail[data-side="right"] { left: auto; right: 0; }
.paper-journey .rail[data-visible="true"] { visibility: visible; pointer-events: auto; }
.paper-journey .rail-body { max-width: 34em; outline-offset: 10px; }
.paper-journey .chapter-mark {
  display: flex; align-items: center; gap: 12px; margin: 0 0 30px;
  font-size: 10px; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted);
}
.paper-journey .chapter-mark i { width: 30px; height: 1px; background: var(--accent-ink); }
.paper-journey #chapter-index { color: var(--accent-ink); }
.paper-journey .chapter { display: none; }
.paper-journey .chapter.is-live { display: block; }
.paper-journey .chapter .label { display: none; }
.paper-journey .rail[data-chapter="0"] .chapter .label {
  display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 18px;
}
.paper-journey .chapter h1 {
  margin: 0 0 22px; font: 400 clamp(36px, 3.4vw, 54px)/1.04 var(--font-display);
  letter-spacing: -.025em; color: var(--ink-text); text-wrap: balance;
}
.paper-journey .chapter h1 em { font-family: var(--font-italic); font-size: .93em; letter-spacing: -.04em; }
.paper-journey .pj-break-space { display: none; }
.paper-journey .chapter p.text { margin: 0; font-size: clamp(14px, 1.08vw, 16px); line-height: 1.75; color: var(--ink-body); }
.paper-journey .chapter ul {
  display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 0; margin: 26px 0 0; list-style: none;
  font-size: 9px; line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted);
}
/* The opening is a signature, with supporting copy reserved for later chapters. */
.paper-journey .rail[data-chapter="0"] .text { display: none; }
.paper-journey .rail[data-chapter="0"] h1 br { display: none; }
.paper-journey .rail[data-chapter="0"] .pj-break-space { display: inline; }
.paper-journey .rail[data-chapter="0"] .chapter-mark { margin-bottom: 22px; }
/* The plan fills the centre here. Its introduction fits above the upper
   left wall, then leaves before the first wall begins to rise. */
.paper-journey .rail[data-dock="top"] { top: var(--pj-edge); padding: 24px 28px; }
.paper-journey .rail[data-chapter="2"] .chapter-mark { margin-bottom: 14px; }
.paper-journey .rail[data-chapter="2"] h1 { font-size: 32px; margin-bottom: 14px; }
.paper-journey .rail[data-chapter="2"] h1 br { display: none; }
.paper-journey .rail[data-chapter="2"] .pj-break-space { display: inline; }
.paper-journey .rail[data-chapter="2"] .chapter ul { display: none; }
.paper-journey .rail[data-chapter="2"] .text { font-size: 13px; line-height: 1.6; }

.paper-journey .project { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.paper-journey .project[hidden], .paper-journey .cta[hidden] { display: none; }
.paper-journey .project-code { margin: 0 0 10px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.paper-journey .project h2 { font: 400 28px/1.15 var(--font-display); margin: 0 0 10px; }
.paper-journey .project-meta { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--ink-body); }
.paper-journey .link { font-size: 13px; color: var(--ink-text); padding-bottom: 5px; border-bottom: 1px solid var(--accent-ink); }
.paper-journey .link span { margin-left: 10px; }
.paper-journey .cta { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.paper-journey .cta span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-muted); }
.paper-journey .cta em { font: normal 27px/1.2 var(--font-display); overflow-wrap: anywhere; }

/* Minimal, independent wayfinding; it yields with the panels for the reveal. */
.paper-journey .rail-top {
  position: absolute; inset: var(--pj-edge) var(--pj-edge) auto; z-index: 4;
  display: flex; align-items: start; justify-content: space-between; gap: 24px;
  color: var(--ink-text); opacity: 0;
}
.paper-journey .brand { font: 400 28px/.85 var(--font-display); letter-spacing: -.02em; background: #eeebe2f7; padding: 12px 14px; }
.paper-journey .brand span { display: block; margin-top: 10px; font: 400 9px/1.2 var(--font-text); letter-spacing: .17em; text-transform: uppercase; }
.paper-journey .rail-nav { display: flex; flex-wrap: wrap; gap: 24px; background: #eeebe2f7; padding: 4px 14px; }
.paper-journey .rail-nav button { min-height: 32px; font-size: 12px; }
.paper-journey .rail-nav button:hover { text-decoration: underline; text-underline-offset: 5px; }
.paper-journey .rail-foot {
  position: absolute; inset: auto var(--pj-edge) var(--pj-edge); z-index: 4;
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  color: #fff; mix-blend-mode: difference;
}
.paper-journey .cue { display: flex; align-items: center; gap: 12px; min-height: 36px; font-size: 9px; letter-spacing: .15em; text-transform: uppercase; }
.paper-journey .cue-dot { display: block; width: 1px; height: 26px; background: currentColor; }
.paper-journey .progress { width: 190px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 14px; }
.paper-journey .ticks { grid-column: 1 / -1; display: flex; gap: 6px; }
.paper-journey .ticks button { flex: 1; height: 28px; font-size: 0; position: relative; }
.paper-journey .ticks button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: currentColor; opacity: .4; }
.paper-journey .ticks button.active::after, .paper-journey .ticks button:hover::after { opacity: 1; height: 2px; }
.paper-journey .bar { height: 1px; background: #ffffff50; position: relative; }
.paper-journey .bar i { position: absolute; inset: 0 auto 0 0; background: #fff; }
.paper-journey .counter { font-size: 9px; letter-spacing: .12em; margin: 0; }
.paper-journey .counter b { margin-right: 7px; font-weight: 400; }

#fallback, .no-js {
  position: absolute; z-index: 30; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: min(680px, 90vw); padding: 22px 26px; background: #24251d; border: 1px solid var(--line);
  font-size: 15px; line-height: 1.7; color: var(--body);
}
.no-js { top: 4vh; bottom: auto; max-height: 92vh; overflow: auto; }
.no-js h2 { font: 400 30px var(--font-display); margin: 0 0 14px; color: var(--paper); }
.no-js p { margin: 0 0 10px; }
#fallback a, .no-js a { color: var(--paper); border-bottom: 1px solid var(--accent); }
#fallback p { margin: 0; }

@media (max-width: 900px) and (orientation: portrait) {
  .paper-journey { --pj-edge: 22px; }
  .paper-journey .rail, .paper-journey .rail[data-side="right"] {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-height: 42%;
    padding: 22px 26px max(24px, env(safe-area-inset-bottom));
    transform: translate3d(0, 110%, 0);
  }
  .paper-journey .rail[data-dock="top"] { top: auto; }
  .paper-journey .chapter-mark { font-size: 9px; margin-bottom: 14px; }
  .paper-journey .chapter h1 { font-size: clamp(29px, 7.8vw, 42px); margin-bottom: 14px; }
  .paper-journey .chapter h1 br { display: none; }
  .paper-journey .pj-break-space { display: inline; }
  .paper-journey .chapter p.text { font-size: 13px; line-height: 1.65; }
  .paper-journey .chapter ul { display: none; }
  .paper-journey .rail[data-chapter="0"] .chapter .label { margin-bottom: 12px; }
  .paper-journey .rail[data-chapter="0"] h1 { margin-bottom: 0; }
  .paper-journey .project { margin-top: 16px; padding-top: 14px; }
  .paper-journey .project h2 { font-size: 24px; }
  .paper-journey .project-code { display: none; }
  .paper-journey .project-meta { font-size: 12px; margin-bottom: 10px; }
  .paper-journey .rail[data-chapter="4"] .text { display: none; }
  .paper-journey .cta { margin-top: 16px; padding-top: 14px; }
  .paper-journey .cta span { display: none; }
  .paper-journey .cta em { font-size: 24px; }
  .paper-journey .brand { font-size: 24px; }
  .paper-journey .rail-nav { gap: 15px; }
  .paper-journey .rail-nav button { font-size: 11px; }
  .paper-journey .rail-nav button:not(.is-accent) { display: none; }
  .paper-journey .progress { width: 140px; }
  .paper-journey .cue { max-width: 150px; font-size: 8px; line-height: 1.6; text-align: left; }
}
@media (max-height: 650px) and (orientation: landscape) {
  .paper-journey { --pj-edge: 18px; }
  .paper-journey .rail { width: 36vw; min-width: 270px; max-height: calc(100% - 112px); padding: 22px 26px; }
  .paper-journey .chapter-mark { margin-bottom: 16px; font-size: 9px; }
  .paper-journey .chapter h1 { font-size: 32px; margin-bottom: 16px; }
  .paper-journey .chapter p.text { font-size: 13px; line-height: 1.6; }
  .paper-journey .chapter ul { display: none; }
  .paper-journey .brand { font-size: 24px; }
  .paper-journey .project { margin-top: 16px; padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .paper-journey .rail { will-change: opacity; } }
html:not(.js) .paper-journey { position: relative; height: 100vh; height: 100svh; }
