/* ============================================================
   bermeb.dev - a journey
   washi paper · sumi ink · vermilion · sage
   ============================================================ */

:root {
  --paper:        #f3ead8;
  --paper-deep:   #ece1c9;
  --paper-edge:   #d9cdb0;
  --ink:          #1a1d29;
  --ink-soft:     #3a3d49;
  --ink-faint:    #6b6258;
  --ink-ghost:    #6d614e;
  --vermilion:    #c9442e;
  --vermilion-dk: #a73721;
  --sage:         #7a8771;
  --indigo:       #2a4a6b;

  --rail-width:   220px;
  --content-max:  760px;

  --font-serif:   "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "ss02", "kern";
  -webkit-font-smoothing: antialiased;
}

/* paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at top left, rgba(201,68,46,0.04), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(42,74,107,0.04), transparent 50%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 0 0.3  0 0 0 0.10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

#root { position: relative; z-index: 3; }

/* keyboard focus ring - only shows for keyboard nav, not mouse clicks */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   layout
   ============================================================ */
:root {
  --rail-w-open:      280px;
  --rail-w-collapsed: 56px;
}

.app {
  display: grid;
  grid-template-columns: var(--rail-w-open) 1fr;
  min-height: 100vh;
}
.app[data-rail="collapsed"] {
  grid-template-columns: var(--rail-w-collapsed) 1fr;
}

/* ============================================================
   rail - persistent left-side mini journey map
   ============================================================ */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  grid-column: 1;
  border-right: 1px solid var(--paper-edge);
  padding: 32px 22px 28px 26px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to right, var(--paper-deep), var(--paper) 78%);
  z-index: 10;
  overflow: visible;
  transition: padding 0.55s cubic-bezier(.6,.0,.2,1);
}
.rail.collapsed {
  padding: 18px 6px 18px 6px;
}

/* fold toggle - sits on the inside (right) edge near the top so it's clear
   of the route line and station markers in both folded states */
.rail-toggle {
  position: absolute;
  top: 26px;
  right: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
  box-shadow: 2px 1px 8px -4px rgba(26,29,41,0.18);
  transition: color 0.25s, border-color 0.25s;
  padding: 0;
}
.rail-toggle:hover {
  color: var(--vermilion-dk);
  border-color: var(--vermilion-dk);
}

/* head: brand + tag, left-aligned like a margin annotation */
.rail-head {
  text-align: left;
  margin-bottom: 14px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s, transform 0.45s cubic-bezier(.6,.0,.2,1);
}
.rail.collapsed .rail-head {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.rail-brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  white-space: nowrap;
}
.rail-brand .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--vermilion);
  border-radius: 50%;
  vertical-align: middle;
  margin: -2px 1px 0 1px;
}
.rail-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* map area - holds the topo SVG, route SVG, HTML stop buttons and the train */
.rail-map-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  margin: 8px -6px;
  overflow: hidden;
}
.rail-topo,
.rail-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.rail-topo path {
  fill: none;
  stroke: var(--sage);
  stroke-width: 1;
  opacity: 0.35;
  stroke-dasharray: 2 3;
  transition: opacity 0.4s;
}
.rail.collapsed .rail-topo { opacity: 0; }

.rail-route .route {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  opacity: 0.55;
}
.rail-route .route-traveled {
  fill: none;
  stroke: var(--vermilion);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0.5px var(--vermilion));
}

/* stops - HTML buttons so dots stay perfectly round */
.rail-map-wrap .stop {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--ink-faint);
  font: inherit;
  text-align: left;
  z-index: 3;
  transition: color 0.3s;
}
.rail-map-wrap .stop:hover { color: var(--ink); }
.rail-map-wrap .stop.active { color: var(--ink); }

.rail-map-wrap .stop .dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
  box-shadow: 0 0 0 3px var(--paper);
  transition: all 0.4s cubic-bezier(.6,.0,.2,1);
}
.rail-map-wrap .stop.passed .dot {
  background: var(--vermilion);
  border-color: var(--vermilion-dk);
}
.rail-map-wrap .stop.active .dot {
  background: var(--paper);
  border-color: var(--vermilion-dk);
  width: 14px;
  height: 14px;
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 6px rgba(201,68,46,0.15);
}

.rail-map-wrap .stop .meta {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
  line-height: 1.1;
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.3s, transform 0.45s cubic-bezier(.6,.0,.2,1);
}
.rail-map-wrap .stop .num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-ghost);
}
.rail-map-wrap .stop .label {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 2px;
}
.rail-map-wrap .stop .jp {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-top: 2px;
}

.rail.collapsed .rail-map-wrap .stop .meta {
  opacity: 0;
  pointer-events: none;
  transform: translate(-8px, -50%);
}

/* train - follows scroll position smoothly; no CSS transition on top/left
   because the rAF scroll handler updates the position every frame */
.rail-train {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  transition: width 0.4s, height 0.4s;
  filter: drop-shadow(0 2px 3px rgba(26,29,41,0.18));
  will-change: top, left;
}
.rail-train svg { width: 100%; height: 100%; display: block; }
.rail.collapsed .rail-train { width: 22px; height: 22px; }

/* foot text */
.rail-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-ghost);
  margin-top: auto;
  padding-top: 18px;
  line-height: 1.6;
  text-align: left;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s, transform 0.45s cubic-bezier(.6,.0,.2,1);
}
.rail.collapsed .rail-foot {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}
.rail-foot .ln {
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed var(--paper-edge);
  padding-top: 8px;
  margin-top: 6px;
}

/* spine indicator - visible only in collapsed mode, shows current station
   number + JP vertically at the bottom of the spine */
.rail-spine {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s 0.15s;
}
.rail.collapsed .rail-spine { opacity: 1; }
.rail-spine-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--vermilion-dk);
}
.rail-spine-jp {
  font-size: 9px;
  margin-top: 4px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.1em;
}

/* ============================================================
   main content
   ============================================================ */
.main {
  position: relative;
  padding: 0;
  /* grid items default to min-width:auto (= content min-content), which lets the
     1fr track blow out past a narrow viewport and clip text. min-width:0 lets it
     shrink to the viewport so content wraps instead. */
  min-width: 0;
  overflow-wrap: break-word;
}

.station-section {
  min-height: 100vh;
  padding: 110px 80px 110px 80px;
  max-width: calc(var(--content-max) + 160px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-margin-top: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--ink-faint) 0 4px, transparent 4px 9px);
  opacity: 0.5;
}
.section-header .num {
  color: var(--vermilion-dk);
  font-weight: 600;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.015em; }
h1 { font-size: clamp(48px, 6vw, 84px); line-height: 1.02; margin: 0 0 16px; }
h2 { font-size: clamp(34px, 3.4vw, 48px); line-height: 1.08; margin: 0 0 22px; }
h3 { font-size: 22px; line-height: 1.2; margin: 24px 0 12px; }
p  { margin: 0 0 16px; max-width: 64ch; }
em { font-style: italic; color: var(--vermilion-dk); }

/* ============================================================
   00 - departure (hero)
   ============================================================ */
.hero {
  padding-top: 60px;
}
.hero-overline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.hero-overline .red { color: var(--vermilion-dk); }

.boarding-pass {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  display: grid;
  grid-template-columns: 1fr 200px;
  margin-top: 32px;
  margin-bottom: 36px;
  box-shadow:
    0 1px 0 var(--paper-edge),
    0 24px 50px -28px rgba(26,29,41,0.18);
  position: relative;
  max-width: 720px;
}
.boarding-pass::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -8px;
  height: 8px;
  background-image:
    radial-gradient(circle at 4px 0, var(--paper) 3px, transparent 3.5px);
  background-size: 9px 8px;
  background-position: 0 -4px;
  pointer-events: none;
}

.bp-main { padding: 24px 24px 22px; border-right: 1.5px dashed var(--paper-edge); }
.bp-stub { padding: 24px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }

.bp-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.bp-field { display: flex; flex-direction: column; gap: 3px; }
.bp-field .k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}
.bp-field .v {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.bp-route {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.bp-city {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.bp-city .sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 4px;
}
.bp-arrow {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--ink-faint) 0 4px, transparent 4px 8px);
  position: relative;
}
.bp-arrow::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 20px;
  background: var(--paper);
  z-index: 0;
}
.bp-arrow::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 18px;
  background: var(--vermilion);
  z-index: 1;
  /* shinkansen side-profile pictogram, nose pointing right (toward "architect") */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 34'><path d='M6 23 L6 12 Q6 9 10 9 L44 9 C60 10 71 15 78 22 L78 23 Z'/><circle cx='20' cy='27' r='4'/><circle cx='36' cy='27' r='4'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 34'><path d='M6 23 L6 12 Q6 9 10 9 L44 9 C60 10 71 15 78 22 L78 23 Z'/><circle cx='20' cy='27' r='4'/><circle cx='36' cy='27' r='4'/></svg>") center / contain no-repeat;
}

.bp-stub .stamp-circle {
  align-self: flex-end;
}
.bp-stub-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  line-height: 1.7;
}
.bp-stub-meta strong { color: var(--ink); font-weight: 500; }

.hero-photo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--paper-edge);
}
.hero-id {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}
.hero-id .who {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.5;
}
.hero-id .who strong { color: var(--ink); font-weight: 500; display: block; font-size: 12px; }

.hero-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: 6px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 16px 10px 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: all 0.3s;
}
.hero-cta:hover { background: var(--ink); color: var(--paper); }
.hero-cta .arr {
  display: inline-block;
  transition: transform 0.3s;
}
.hero-cta:hover .arr { transform: translateX(4px); }

/* stamps (red ink seal) */
.stamp-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border: 1.8px solid var(--vermilion);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vermilion-dk);
  text-align: center;
  line-height: 1.15;
  transform: rotate(-7deg);
  opacity: 0.85;
  flex-shrink: 0;
  padding: 4px;
}
.stamp-circle.sq {
  border-radius: 4px;
  width: 64px;
  height: 64px;
  transform: rotate(-4deg);
}

/* ============================================================
   01 - authora (featured)
   ============================================================ */
.proj-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.proj-meta .slug { color: var(--vermilion-dk); }
.proj-meta .sep { color: var(--ink-ghost); }
.proj-meta .badge {
  font-size: 9px;
  padding: 3px 7px;
  background: var(--ink);
  color: var(--paper);
  letter-spacing: 0.18em;
}
.proj-stack {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  margin: 4px 0 28px;
}

.arch-card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  padding: 22px 26px 26px;
  margin: 28px 0 32px;
  position: relative;
  box-shadow: 0 14px 30px -22px rgba(26,29,41,0.2);
}
.arch-card::before {
  content: "fig. 1";
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-ghost);
  text-transform: uppercase;
}
.arch-card svg {
  width: 100%;
  height: auto;
  display: block;
}
.arch-card svg path:not([fill]) { fill: none; stroke: var(--ink); stroke-width: 0.9; stroke-linecap: round; stroke-linejoin: round; }
.arch-card svg text { fill: var(--ink); font-family: var(--font-mono); font-weight: 400; }
.arch-card svg .lbl-faint { fill: var(--ink-faint); }
.arch-card svg .lbl-accent { fill: var(--vermilion); }
.arch-card svg .accent path { stroke: var(--vermilion); stroke-width: 1.3; }

/* hand-drawn animation - paths/text default to visible; the ArchCard
   component triggers a Web-Animations-API entry animation on first view,
   but if the JS doesn't fire (slow paint, etc) the diagram stays readable. */
.arch-card svg path[data-draw] {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.arch-card svg text {
  opacity: 1;
}
.arch-card[data-drawn] svg path[data-draw] {
  animation: handDraw 1100ms cubic-bezier(.45,.05,.35,1) forwards;
}
/* text intentionally not animated - always visible. */
@keyframes handDraw {
  0%   { stroke-dashoffset: 1; }
  /* tiny tremor mid-stroke so it feels hand-drawn */
  60%  { stroke-dashoffset: 0.35; transform: translate(0.3px, -0.15px); }
  80%  { stroke-dashoffset: 0.1; transform: translate(-0.2px, 0.1px); }
  100% { stroke-dashoffset: 0;  transform: translate(0, 0); }
}
@keyframes inkFade {
  0%   { opacity: 0; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

.decisions {
  list-style: none;
  padding: 0;
  margin: 16px 0 28px;
}
.decisions li {
  position: relative;
  padding: 12px 0 12px 26px;
  border-bottom: 1px dashed var(--paper-edge);
}
.decisions li:last-child { border-bottom: none; }
.decisions li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 22px;
  width: 8px;
  height: 8px;
  background: var(--vermilion);
  transform: rotate(45deg);
}
.decisions strong { font-weight: 600; color: var(--ink); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
.link-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s;
}
.link-pill:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.link-pill::before { content: "→"; }

/* ============================================================
   02 - now (next destinations)
   ============================================================ */
.now-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--paper-edge);
}
.now-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--paper-edge);
  position: relative;
}
.now-item .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--vermilion-dk);
  padding-top: 4px;
}
.now-item h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0 0 4px;
}
.now-item p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.now-item::after {
  content: "→ next";
  position: absolute;
  right: 0;
  top: 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-ghost);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
}
.now-item:hover::after { opacity: 1; }

/* Departure board - section 03 (Now). Old-school split-flap aesthetic
   on warm paper. Track / destination / platform / status. */
.board {
  margin-top: 36px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  box-shadow: 0 18px 36px -28px rgba(26,29,41,0.35), inset 0 0 0 6px var(--paper);
  position: relative;
  max-width: 980px;
}
.board::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 22px);
  opacity: 0.7;
}
.board-head, .board-row, .board-foot {
  display: grid;
  grid-template-columns: 1.2fr 4fr 0.9fr 1fr;
  gap: 18px;
  align-items: start;
  padding: 18px 26px;
  border-bottom: 1px dashed var(--paper-edge);
}
.board-head {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 22px;
  background: rgba(26,29,41,0.025);
}
.board-row {
  position: relative;
  transition: background 0.3s ease, transform 0.4s cubic-bezier(.4,.05,.2,1);
  opacity: 0;
  transform: translateY(10px);
  animation: boardRowIn 0.55s cubic-bezier(.4,.05,.2,1) forwards;
  animation-delay: calc(var(--row, 0) * 0.12s + 0.1s);
}
.station-section[data-in-view] .board-row { animation-play-state: running; }
.board-row:hover { background: rgba(201,68,46,0.04); }
.board-row::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 4px; height: 60%;
  background: var(--vermilion);
  transform: translateY(-50%) scaleY(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}
.board-row:hover::before { transform: translateY(-50%) scaleY(1); }
@keyframes boardRowIn { to { opacity: 1; transform: translateY(0); } }
.b-track {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 8px;
}
.b-dest { display: grid; gap: 4px; }
.b-code {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--vermilion-dk);
  border: 1px solid var(--vermilion);
  padding: 2px 6px;
  width: max-content;
  border-radius: 2px;
  margin-bottom: 4px;
}
.b-name {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0;
  color: var(--ink);
}
.b-body {
  font-size: 13px;
  font-family: var(--font-sans, system-ui);
  color: var(--ink-soft);
  max-width: 52ch;
}
.b-plat {
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--ink);
  padding-top: 6px;
}
.b-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 14px;
}
.b-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2c8a4a;
  box-shadow: 0 0 0 3px rgba(44,138,74,0.18);
  animation: pulseDot 2.2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(44,138,74,0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(44,138,74,0.05); }
}
.board-foot {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--ink-ghost);
  padding: 12px 26px;
  border-bottom: none;
  background: rgba(26,29,41,0.03);
}
.b-blink {
  color: var(--vermilion-dk);
  animation: blinkBoard 1.4s steps(2, end) infinite;
}
@keyframes blinkBoard { 50% { opacity: 0.15; } }

/* ============================================================
   03 - projects (postcards)
   ============================================================ */
.postcards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 12px;
}
.postcard {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  padding: 26px 28px;
  position: relative;
  box-shadow: 0 12px 24px -22px rgba(26,29,41,0.25);
  transition: transform 0.4s cubic-bezier(.6,.0,.2,1), box-shadow 0.4s, border-color 0.4s;
}
.station-section[data-in-view] .postcard:hover {
  transform: translateY(-6px) rotate(-0.4deg) !important;
  box-shadow: 0 28px 48px -22px rgba(26,29,41,0.35);
  border-color: var(--vermilion-dk);
}
.station-section[data-in-view] .postcard:nth-child(even):hover {
  transform: translateY(-6px) rotate(0.4deg) !important;
}
.postcard.small { padding: 22px 24px; }
.postcard h3 { margin: 8px 0 10px; font-size: 26px; }
.postcard .pstack {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 0;
}
.postcard .worth {
  font-style: italic;
  color: var(--ink-faint);
  font-size: 14.5px;
  margin-top: 8px;
  border-left: 2px solid var(--vermilion);
  padding-left: 12px;
}
.postcard .pmeta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  display: flex;
  gap: 10px;
  align-items: center;
}
.postcard .pmeta .slug { color: var(--vermilion-dk); }
.postcard-stamp {
  position: absolute;
  top: 18px;
  right: 22px;
}
.postcard-stamp .stamp-circle { width: 56px; height: 56px; font-size: 8.5px; }

/* ============================================================
   04 - stack (luggage stickers)
   ============================================================ */
.stack-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px 24px;
  margin-top: 14px;
  border-top: 1px solid var(--paper-edge);
  padding-top: 18px;
}
.stack-grid dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vermilion-dk);
  padding-top: 6px;
}
.stack-grid dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--paper-edge);
}
.stack-grid dd:last-of-type { border-bottom: none; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 11px;
  border: 1px solid var(--paper-edge);
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0.02em;
  transition: all 0.25s;
  cursor: default;
}
.chip:hover {
  border-color: var(--vermilion-dk);
  color: var(--vermilion-dk);
  transform: translateY(-1px) rotate(-1deg);
}

/* ============================================================
   05 - about (journal)
   ============================================================ */
.journal {
  position: relative;
  padding-left: 0;
  max-width: 62ch;
}
.journal p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.journal p strong { color: var(--ink); font-weight: 500; }
.journal-dateline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* ============================================================
   06 - contact (postcard send)
   ============================================================ */
.contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  margin-top: 14px;
  max-width: 700px;
  position: relative;
  box-shadow: 0 16px 36px -26px rgba(26,29,41,0.25);
}
.contact-left { padding: 28px 28px; border-right: 1.5px dashed var(--paper-edge); }
.contact-right { padding: 28px 28px; }

.contact-left p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0;
}
.contact-rows { display: flex; flex-direction: column; gap: 14px; }
.contact-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.contact-row .k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.contact-row a {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--paper-edge);
  padding-bottom: 2px;
  transition: all 0.25s;
  width: fit-content;
}
.contact-row a:hover {
  color: var(--vermilion-dk);
  border-color: var(--vermilion-dk);
}

.terminus {
  margin-top: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.terminus .line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--ink-faint) 0 5px, transparent 5px 10px);
}
.terminus .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--vermilion);
}

/* colophon — transparency credit for the design tool */
.colophon {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-ghost);
}
.colophon a {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--paper-edge);
  padding-bottom: 1px;
  transition: color 0.25s, border-color 0.25s;
}
.colophon a:hover {
  color: var(--vermilion-dk);
  border-color: var(--vermilion);
}

/* ============================================================
   reveal animations - content is visible by default. When a
   section gets [data-in-view], a one-shot keyframe animation
   plays. Keyframes (not transitions) survive React re-renders
   that briefly retoggle styles.
   ============================================================ */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes revealFromLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes revealFromRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes revealTilt {
  from { opacity: 0; transform: translateY(30px) rotate(-1.2deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}
@keyframes revealBoardingPass {
  from { opacity: 0; transform: translateY(40px) rotate(-0.6deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}
@keyframes revealPostcardOdd {
  from { opacity: 0; transform: translateX(-30px) translateY(20px) rotate(-0.8deg); }
  to   { opacity: 1; transform: translate(0,0) rotate(0); }
}
@keyframes revealPostcardEven {
  from { opacity: 0; transform: translateX( 30px) translateY(20px) rotate( 0.8deg); }
  to   { opacity: 1; transform: translate(0,0) rotate(0); }
}
@keyframes revealChip {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

/* Entry animations removed - they kept getting frozen at currentTime 0
   due to interaction with React re-renders + parallax scroll handler.
   Content is visible by default; motion comes from hover states,
   the parallax landscape, and the arch-diagram hand-drawing. */

/* Re-enabled scroll-triggered reveals on station content. Trigger uses the
   [data-in-view] attribute (not className) so React reconciliation can't
   strip it; the keyframe-based animation survives re-renders because
   `forwards` locks the final state. Content is still visible by default
   so anything that fails to animate just appears in-place. */
.station-section h2,
.station-section > p,
.station-section .section-header {
  /* visible by default - animation just adds motion */
}
.station-section[data-in-view] .section-header {
  animation: revealFromLeft 0.7s cubic-bezier(.2,.7,.2,1) 0.05s backwards;
}
.station-section[data-in-view] h2 {
  animation: revealUp 0.8s cubic-bezier(.2,.7,.2,1) 0.18s backwards;
}
.station-section[data-in-view] > p {
  animation: revealUp 0.8s cubic-bezier(.2,.7,.2,1) 0.32s backwards;
}

/* ============================================================
   passing landscape - a faint horizon that drifts as you scroll,
   gives the page a feeling of motion through countryside
   ============================================================ */
.landscape {
  position: fixed;
  left: var(--rail-width);
  right: 0;
  bottom: 0;
  height: 80px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.18;
  overflow: hidden;
}
.landscape svg {
  position: absolute;
  bottom: 0;
  height: 80px;
  width: 200%;
  display: block;
  transform: translateX(var(--lx, 0px));
  transition: transform 0.15s linear;
}
.landscape .far  { opacity: 0.55; }
.landscape .mid  { opacity: 0.80; bottom: -6px; }
.landscape .near { opacity: 1.00;  bottom: -2px; }

@media (max-width: 900px) { .landscape { display: none; } }

/* shinkansen arrival flash - a thin red horizon line that sweeps */
.arrival-pulse {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: var(--vermilion);
  opacity: 0;
  transform-origin: left;
  pointer-events: none;
}
.station-section[data-in-view] .arrival-pulse {
  animation: sweep 1.2s cubic-bezier(.2,.7,.2,1) 0.05s forwards;
}
@keyframes sweep {
  0% { opacity: 0; transform: scaleX(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: scaleX(1); }
}

/* journey map overlay (toggle) */
.map-cluster {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
}
.map-hint {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  padding: 9px 14px 9px 13px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 8px 22px -10px rgba(26,29,41,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  animation: hintBob 2.6s ease-in-out infinite;
}
.map-hint::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--paper);
  border-right: 1px solid var(--paper-edge);
  border-top: 1px solid var(--paper-edge);
}
.map-hint .kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  color: var(--ink);
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: 0;
  box-shadow: 0 2px 0 var(--ink);
}
.map-hint .dim { color: var(--ink-faint); }
.map-hint.dismissed { opacity: 0; pointer-events: none; transform: translateX(8px); transition: all 0.4s; }
@keyframes hintBob {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-4px); }
}
.map-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px -8px rgba(26,29,41,0.4);
  transition: all 0.3s;
  position: relative;
}
.map-toggle:hover { transform: scale(1.06); }
.map-toggle::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--vermilion);
  opacity: 0;
  animation: ringPulse 2.4s ease-out infinite;
}
@keyframes ringPulse {
  0%   { transform: scale(0.85); opacity: 0; }
  30%  { opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}

.journey-map {
  position: fixed;
  inset: 0;
  background: rgba(243,234,216,0.96);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  perspective: 1800px;
}
.journey-map.open { opacity: 1; pointer-events: auto; }

/* Paper-map open: simulate accordion folds - the inner panel
   unfolds in distinct stages (vertical strip → half → full width,
   then horizontal halves unfold) like a real road map being opened.
   3 vertical crease lines and 1 horizontal crease appear during
   the unfold and fade as the paper smooths flat. */
.journey-map-inner {
  width: 100%;
  max-width: min(96vw, 2050px);
  position: relative;
  perspective: 2600px;
  perspective-origin: 50% 50%;
  opacity: 0;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  grid-template-rows: auto auto 1fr;
  column-gap: 64px;
  align-items: center;
}
/* Reveal sequence: backdrop fades in over 0.4s with nothing inside;
   then the folded paper appears (closed state visible briefly);
   then the panels unfold slowly so the fold motion is luxurious. */
.journey-map.open .journey-map-inner {
  animation: mapShellShow 0.35s ease 0.45s forwards;
}
.journey-map:not(.open) .journey-map-inner {
  animation: mapShellHide 0.25s ease 1.6s forwards;
}
@keyframes mapShellShow { to { opacity: 1; } }
@keyframes mapShellHide { to { opacity: 0; } }

/* tri-fold panels */
.fold-stage {
  display: flex;
  width: 100%;
  transform-style: preserve-3d;
}
.fold-panel {
  flex: 0 0 25%;
  position: relative;
  overflow: hidden;
  background: var(--paper);
  box-shadow: inset 0 0 30px rgba(26,29,41,0.04);
}
.fold-panel-inner {
  width: 400%;
  position: relative;
  backface-visibility: hidden;
}
.fold-panel.p1 { transform-origin: right center; }
.fold-panel.p2 { transform-origin: right center; }
.fold-panel.p3 { transform-origin: left center; }
.fold-panel.p4 { transform-origin: left center; }
.fold-panel.p1 .fold-panel-inner { transform: translateX(0); }
.fold-panel.p2 .fold-panel-inner { transform: translateX(-25%); }
.fold-panel.p3 .fold-panel-inner { transform: translateX(-50%); }
.fold-panel.p4 .fold-panel-inner { transform: translateX(-75%); }

/* CLOSED state - outer panels (p1, p4) folded inward, COVERING the middle pair.
   translateZ nudges them in front of p2/p3 so their opaque paper hides the SVG
   underneath; the SVG itself is hidden from the back via .fold-panel-inner's
   backface-visibility. */
.fold-panel.p1 { transform: translateZ(1px) rotateY(180deg); }
.fold-panel.p4 { transform: translateZ(1px) rotateY(-180deg); }

/* OPEN state - gate fold opens from middle outward, slow + deliberate.
   Delay sits AFTER the inner-shell reveal so the folded paper is visible
   for a beat before unfolding. */
.journey-map.open .fold-panel.p1 {
  animation: panelL-open 1.1s cubic-bezier(.32,.05,.2,1) 0.85s forwards;
}
.journey-map.open .fold-panel.p4 {
  animation: panelR-open 1.1s cubic-bezier(.32,.05,.2,1) 0.85s forwards;
}
.journey-map:not(.open) .fold-panel.p1 {
  animation: panelL-close 0.7s cubic-bezier(.55,.0,.55,1) 0s forwards;
}
.journey-map:not(.open) .fold-panel.p4 {
  animation: panelR-close 0.7s cubic-bezier(.55,.0,.55,1) 0s forwards;
}
@keyframes panelL-open  { 0% { transform: rotateY(180deg); }  100% { transform: rotateY(0deg); } }
@keyframes panelR-open  { 0% { transform: rotateY(-180deg); } 100% { transform: rotateY(0deg); } }
@keyframes panelL-close { 0% { transform: rotateY(0deg); }    100% { transform: rotateY(180deg); } }
@keyframes panelR-close { 0% { transform: rotateY(0deg); }    100% { transform: rotateY(-180deg); } }

/* crease lines between each pair of adjacent panels once unfolded */
.fold-panel.p1::before,
.fold-panel.p2::before,
.fold-panel.p3::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(26,29,41,0.05) 6%,
    rgba(26,29,41,0.22) 50%,
    rgba(26,29,41,0.05) 94%,
    transparent 100%);
  z-index: 2;
  pointer-events: none;
}

/* crease lines - 3 vertical (at 25%/50%/75%) + 1 horizontal (50%).
   They appear during the unfold and fade out once the paper is flat. */
.journey-map-inner .creases { display: none; }
.journey-map-close {
  position: absolute;
  top: 26px;
  right: 28px;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.journey-map-title {
  grid-column: 1 / -1;
  font-family: var(--font-serif);
  font-size: 36px;
  margin-bottom: 6px;
  font-weight: 400;
}
.journey-map-sub {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 28px;
}

.jm-svg-wrap { grid-column: 1; grid-row: 3; }

/* annotated itinerary list - the added value over the rail: each stop gets a
   description + a content tag, and the whole row is a jump target. */
.jm-legend {
  grid-column: 2;
  grid-row: 3;
  list-style: none;
  margin: 0;
  padding: 0 0 0 44px;
  border-left: 1px dashed var(--paper-edge);
  display: flex;
  flex-direction: column;
}
.jm-leg button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 12px 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition: background 0.25s, padding 0.25s;
}
.jm-leg button:hover {
  background: rgba(201,68,46,0.05);
  padding-left: 12px;
  padding-right: 12px;
}
.jm-leg-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-ghost);
}
.jm-leg.passed .jm-leg-num { color: var(--vermilion-dk); }
.jm-leg.active .jm-leg-num { color: var(--vermilion-dk); font-weight: 500; }
.jm-leg-body { min-width: 0; }
.jm-leg-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.jm-leg-label {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.jm-leg.active .jm-leg-label { color: var(--vermilion-dk); }
.jm-leg-jp {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-ghost);
}
.jm-leg-desc {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jm-leg-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--paper-edge);
  padding: 4px 8px;
  white-space: nowrap;
  background: var(--paper);
}
.jm-leg.active .jm-leg-tag {
  color: var(--vermilion-dk);
  border-color: var(--vermilion-dk);
}
@media (max-width: 920px) {
  .journey-map-inner { grid-template-columns: 1fr; }
  .jm-svg-wrap { grid-column: 1; grid-row: 3; }
  .jm-legend {
    grid-column: 1;
    grid-row: 4;
    border-left: none;
    border-top: 1px dashed var(--paper-edge);
    padding: 24px 0 0;
    margin-top: 26px;
  }
}

.jm-svg-wrap { position: relative; }
.jm-svg { width: 100%; height: auto; display: block; }
.jm-svg .route { fill: none; stroke: var(--ink-faint); stroke-width: 1.2; stroke-dasharray: 4 5; }
.jm-svg .route-traveled { fill: none; stroke: var(--vermilion); stroke-width: 1.5; }
.jm-svg .stop circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; cursor: pointer; transition: all 0.3s; }
.jm-svg .stop.passed circle { fill: var(--vermilion); stroke: var(--vermilion); }
.jm-svg .stop.active circle { fill: var(--paper); stroke: var(--vermilion); stroke-width: 2; r: 9; }
.jm-svg .stop:hover circle { stroke: var(--vermilion); }
.jm-svg .stop text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink); pointer-events: none; }
.jm-svg .stop text.num { fill: var(--vermilion); font-size: 9px; letter-spacing: 0.15em; }
.jm-svg .stop text.jp { fill: var(--ink-faint); font-size: 9px; letter-spacing: 0.2em; }
.jm-svg .topo path { fill: none; stroke: var(--ink-ghost); stroke-width: 0.5; opacity: 0.3; }

/* ============================================================
   small screens
   ============================================================ */
/* tablet - auto-collapse the rail by default, but let user override to open */
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--rail-w-collapsed) 1fr; }
  .app[data-rail="collapsed"] { grid-template-columns: var(--rail-w-collapsed) 1fr; }
  .app[data-rail="open"] { grid-template-columns: var(--rail-w-open) 1fr; }
}

/* phone - hide the rail entirely */
@media (max-width: 700px) {
  .app,
  .app[data-rail="open"],
  .app[data-rail="collapsed"] { grid-template-columns: 1fr; }
  .rail { display: none; }
  .station-section { padding: 80px 28px; min-height: auto; }
  h1 { font-size: 44px; }
  .boarding-pass { grid-template-columns: 1fr; }
  .bp-main { border-right: none; border-bottom: 1.5px dashed var(--paper-edge); }
  .contact-card { grid-template-columns: 1fr; }
  .contact-left { border-right: none; border-bottom: 1.5px dashed var(--paper-edge); }
}


/* ============================================================
   papers - bound research as paper cards
   ============================================================ */
.papers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 36px;
  max-width: 900px;
}
.paper-card {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--paper-edge);
  border-radius: 4px;
  padding: 36px 40px 36px 44px;
  box-shadow: 0 18px 36px -28px rgba(26,29,41,0.30), 0 2px 0 rgba(26,29,41,0.04);
  transition: transform 0.4s cubic-bezier(.6,.0,.2,1), box-shadow 0.4s, border-color 0.4s;
}
.paper-card::before {
  content: "";
  position: absolute;
  left: 16px; top: 22px; bottom: 22px;
  width: 2px;
  background: var(--vermilion);
  opacity: 0.5;
}
.paper-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 44px -22px rgba(26,29,41,0.32);
  border-color: var(--vermilion-dk);
}
.paper-corner {
  position: absolute;
  top: 0; right: 0;
  width: 38px; height: 38px;
  background: linear-gradient(225deg, var(--paper) 0%, var(--paper) 48%, var(--paper-edge) 50%, rgba(26,29,41,0.06) 100%);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  pointer-events: none;
}
.paper-stamp {
  position: absolute;
  top: 22px; right: 56px;
  transform: rotate(8deg);
}
.paper-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; gap: 10px; align-items: baseline;
  margin-bottom: 12px;
}
.paper-meta .slug { color: var(--vermilion-dk); }
.paper-card h3 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 110px 8px 0;
}
.paper-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  margin: 6px 0 14px 0;
  max-width: 60ch;
}
.paper-stack {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-ghost);
  margin: 0 0 22px 0;
}
.paper-body h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vermilion-dk);
  margin: 18px 0 8px 0;
  font-weight: 500;
}
.paper-body p {
  font-size: 15px;
  line-height: 1.65;
  max-width: 65ch;
  margin: 0 0 6px 0;
}
.paper-body ul { list-style: none; padding: 0; margin: 0; }
.paper-body li {
  font-size: 14.5px;
  line-height: 1.6;
  padding: 4px 0 4px 18px;
  position: relative;
  max-width: 65ch;
}
.paper-body li::before { content: "-"; position: absolute; left: 0; color: var(--vermilion-dk); }
.paper-verdict { font-family: var(--font-serif); font-style: italic; }


/* ============================================================
   right-margin shadow figures
   themed silhouettes that fill the empty space to the right of
   each section's content. paper-toned, large, low opacity - they
   anchor the right column visually without competing for focus.
   ============================================================ */
.section-shadow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink);
  opacity: 0.085;
  z-index: 0;
  display: none;
  /* per-type rules below set width (clamp) + aspect-ratio + right offset */
  right: -260px;
}
.section-shadow svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* fade in alongside the section's other reveal animations */
.station-section[data-in-view] .section-shadow {
  animation: shadowFadeIn 1.4s cubic-bezier(.2,.7,.2,1) 0.4s backwards;
}
@keyframes shadowFadeIn {
  from { opacity: 0; transform: translateY(-50%) translateX(40px); }
  to   { opacity: 0.085; transform: translateY(-50%) translateX(0); }
}

/* per-type: size scales with viewport width via clamp() so the scenery keeps
   growing on 2K/4K monitors instead of capping. aspect-ratio (matched to each
   SVG's viewBox) keeps them undistorted while only width is driven. negative
   `right` (also vw-scaled) lets them bleed into the right gutter - deeper on
   wider screens. */

/* 00 - shinkansen exits to the right; nose pokes off the viewport */
.shadow-train {
  width: clamp(720px, 58vw, 1320px);
  aspect-ratio: 19 / 6;
  right: clamp(-460px, -17vw, -300px);
  top: 46%;
  opacity: 0.1;
}
.station-section[data-in-view] .shadow-train {
  animation: trainEnter 1.6s cubic-bezier(.2,.7,.2,1) 0.4s backwards;
}
@keyframes trainEnter {
  from { opacity: 0; transform: translateY(-50%) translateX(-80px); }
  to   { opacity: 0.1; transform: translateY(-50%) translateX(0); }
}

/* 01 - pen, mid-section, tilted */
.shadow-pen {
  width: clamp(380px, 28vw, 620px);
  aspect-ratio: 11 / 12;
  right: clamp(-220px, -9vw, -120px);
  transform: translateY(-50%) rotate(-12deg);
}
@keyframes shadowFadeInPen {
  from { opacity: 0; transform: translateY(-50%) rotate(-12deg) translateX(40px); }
  to   { opacity: 0.085; transform: translateY(-50%) rotate(-12deg) translateX(0); }
}
.station-section[data-in-view] .shadow-pen {
  animation: shadowFadeInPen 1.4s cubic-bezier(.2,.7,.2,1) 0.4s backwards;
}

/* 02 - books, larger stack, slight push right */
.shadow-books {
  width: clamp(460px, 36vw, 820px);
  aspect-ratio: 12 / 11;
  right: clamp(-280px, -12vw, -170px);
}

/* 03 - torii gate, vermilion ink, large and centered */
.shadow-torii {
  width: clamp(460px, 36vw, 820px);
  aspect-ratio: 1 / 1;
  right: clamp(-240px, -10vw, -130px);
  color: var(--vermilion-dk);
  opacity: 0.12;
}
@keyframes shadowFadeInTorii {
  from { opacity: 0; transform: translateY(-50%) translateX(40px); }
  to   { opacity: 0.12; transform: translateY(-50%) translateX(0); }
}
.station-section[data-in-view] .shadow-torii { animation: shadowFadeInTorii 1.4s cubic-bezier(.2,.7,.2,1) 0.4s backwards; }

/* 04 - postcards, big fanned stack */
.shadow-postcards {
  width: clamp(480px, 38vw, 860px);
  aspect-ratio: 12 / 11;
  right: clamp(-300px, -13vw, -180px);
}

/* 05 - scroll + papers */
.shadow-scroll {
  width: clamp(440px, 34vw, 780px);
  aspect-ratio: 11 / 12;
  right: clamp(-260px, -11vw, -150px);
}

/* 06 - suitcase, large */
.shadow-suitcase {
  width: clamp(460px, 36vw, 800px);
  aspect-ratio: 12 / 11;
  right: clamp(-280px, -12vw, -170px);
}

/* 07 - sakura tree, fills the right side at full height */
.shadow-sakura {
  width: clamp(540px, 46vw, 1040px);
  aspect-ratio: 1 / 1;
  right: clamp(-260px, -10vw, -140px);
  color: var(--vermilion-dk);
  opacity: 0.13;
}
@keyframes shadowFadeInSakura {
  from { opacity: 0; transform: translateY(-50%) translateX(40px) scale(0.96); }
  to   { opacity: 0.13; transform: translateY(-50%) translateX(0) scale(1); }
}
.station-section[data-in-view] .shadow-sakura { animation: shadowFadeInSakura 1.6s cubic-bezier(.2,.7,.2,1) 0.4s backwards; }

/* prevent the overflowing shadows from causing horizontal scroll */
html, body { overflow-x: clip; }
.main { overflow-x: clip; }

/* show only when there's actual room to the right of the content column */
@media (min-width: 1180px) {
  .section-shadow { display: block; }
}
/* 2K and up - let the scenery read a touch stronger so it doesn't get lost
   in the larger expanse */
@media (min-width: 2200px) {
  .section-shadow  { opacity: 0.11; }
  .shadow-train    { opacity: 0.12; }
  .shadow-torii,
  .shadow-sakura   { opacity: 0.16; }
}

/* respect reduced-motion - kill decorative + entrance motion. All content is
   visible by default, so disabling these animations is safe. journey.js also
   skips the parallax drift and the Authora hand-draw when reduced motion is set;
   the rail train still tracks scroll (functional, not decorative). */
@media (prefers-reduced-motion: reduce) {
  .station-section[data-in-view] .section-shadow,
  .station-section[data-in-view] .shadow-train,
  .station-section[data-in-view] .shadow-pen,
  .station-section[data-in-view] .shadow-torii,
  .station-section[data-in-view] .shadow-sakura,
  .station-section[data-in-view] .section-header,
  .station-section[data-in-view] h2,
  .station-section[data-in-view] > p,
  .station-section[data-in-view] .arrival-pulse,
  .arch-card[data-drawn] svg path[data-draw],
  .map-hint,
  .map-toggle::after,
  .b-dot,
  .b-blink {
    animation: none !important;
  }
  /* board rows start at opacity:0 for their entrance - reveal them statically */
  .board-row { opacity: 1 !important; transform: none !important; animation: none !important; }
  /* itinerary: appear flat instead of performing the 3D paper fold */
  .journey-map.open .journey-map-inner { animation: none; opacity: 1; }
  .fold-panel { animation: none !important; }
  .journey-map.open .fold-panel { transform: none; }
}

/* ============================================================
   MOBILE OPTIMIZATION
   Everything below is additive and only takes effect <= 700px
   (where the vertical rail is hidden). Desktop is untouched.
   ============================================================ */

/* arch diagram swipe wrapper + hint - inert on desktop */
.arch-scroll { }
.arch-hint { display: none; }

/* mobile journey bar - hidden until phone widths */
.railbar { display: none; }

@media (max-width: 700px) {
  /* ---------- top journey bar (horizontal mirror of the rail) ---------- */
  .railbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 50px;
    padding: 0 16px;
    background: linear-gradient(to bottom, var(--paper-deep), var(--paper));
    border-bottom: 1px solid var(--paper-edge);
    z-index: 20;
    box-shadow: 0 6px 16px -12px rgba(26,29,41,0.4);
  }
  .railbar-head {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    max-width: 46%;
    overflow: hidden;
    white-space: nowrap;
  }
  .railbar-head .num {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--vermilion-dk);
    font-weight: 500;
  }
  .railbar-head .label {
    font-family: var(--font-serif);
    font-size: 15px;
    letter-spacing: 0.01em;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .railbar-head .jp {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--ink-ghost);
  }
  .railbar-track {
    position: relative;
    flex: 1;
    height: 28px;
    margin-right: 4px;
  }
  .railbar-line {
    position: absolute;
    left: 4px; right: 4px;
    top: 50%;
    height: 0;
    border-top: 1px dashed var(--ink-faint);
    opacity: 0.55;
  }
  .railbar-traveled {
    position: absolute;
    left: 0;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background: var(--vermilion);
    border-radius: 2px;
    width: 0;
  }
  .railbar-stop {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
  }
  .railbar-stop .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--paper);
    border: 1.5px solid var(--ink-faint);
    box-shadow: 0 0 0 2px var(--paper);
    transition: all 0.3s cubic-bezier(.6,.0,.2,1);
  }
  .railbar-stop.passed .dot {
    background: var(--vermilion);
    border-color: var(--vermilion-dk);
  }
  .railbar-stop.active .dot {
    background: var(--paper);
    border-color: var(--vermilion-dk);
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px rgba(201,68,46,0.15);
  }
  .railbar-train {
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(26,29,41,0.25));
  }
  .railbar-train svg { width: 100%; height: 100%; display: block; }

  /* push content clear of the fixed bar; land jumps below it */
  .main { padding-top: 50px; }
  .station-section { scroll-margin-top: 56px; }

  /* ---------- tighter rhythm + larger tap targets ---------- */
  .station-section { padding: 56px 22px; }
  .link-pill { padding: 10px 14px; }

  /* ---------- hero / boarding pass ---------- */
  .boarding-pass { margin-top: 24px; }
  .bp-row { grid-template-columns: 1fr 1fr; gap: 14px; }
  .bp-city { font-size: 26px; }

  /* ---------- departure board - restack rows, drop the header ---------- */
  .board { max-width: 100%; }
  .board-head { display: none; }
  .board-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: baseline;
    padding: 16px 18px;
  }
  .board-foot { padding: 12px 18px; gap: 10px; }
  .b-dest { flex: 1 0 100%; gap: 4px; }
  .b-name { font-size: 19px; }
  .b-track, .b-plat, .b-status { padding-top: 0; }
  .b-track { font-size: 10px; }
  .b-plat { font-size: 14px; letter-spacing: 0.06em; }
  .b-status { font-size: 10px; gap: 6px; }

  /* ---------- postcards - keep the stamp clear of the title ---------- */
  .postcard { padding: 22px 20px; }
  .postcard h3 { font-size: 23px; margin-right: 52px; }
  .postcard .pmeta { flex-wrap: wrap; margin-right: 52px; }
  .postcard-stamp { top: 16px; right: 16px; }
  .postcard-stamp .stamp-circle { width: 44px; height: 44px; font-size: 7.5px; }

  /* ---------- paper cards - reduce padding, shrink + move the stamp ---------- */
  .paper-card { padding: 24px 22px 24px 26px; }
  .paper-card::before { left: 10px; }
  .paper-card h3 { font-size: 22px; margin-right: 56px; }
  .paper-stamp { top: 18px; right: 16px; }
  .paper-stamp .stamp-circle { width: 46px; height: 46px; font-size: 8px; }
  .paper-lede { font-size: 16px; }

  /* ---------- toolkit - single column ---------- */
  .stack-grid { grid-template-columns: 1fr; gap: 2px 0; }
  .stack-grid dt { padding-top: 16px; }
  .stack-grid dd { padding-bottom: 16px; }

  /* ---------- architecture diagram - swipe to pan ---------- */
  .arch-card { padding: 16px 14px 18px; margin: 24px 0 8px; }
  .arch-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .arch-card svg { width: 640px; min-width: 640px; max-width: none; }
  .arch-hint {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-ghost);
    text-align: right;
    margin: 0 0 26px;
  }

  /* ---------- itinerary toggle + overlay ---------- */
  /* the "press M" hint is meaningless on touch; the button is tap-discoverable */
  .map-hint { display: none; }
  .journey-map { padding: 16px; }
  .journey-map-title { font-size: 26px; }
  .journey-map-sub { margin-bottom: 18px; }
  .journey-map-close { top: 16px; right: 16px; }
}

/* ============================================================
   PRINT - clean, ink-friendly layout (recruiters save to PDF)
   ============================================================ */
@media print {
  html, body { background: #fff !important; color: var(--ink); }
  body::before, body::after { display: none !important; }

  /* drop all navigation + decoration chrome */
  .rail, .railbar, .landscape, .map-cluster, .journey-map,
  .section-shadow, .arrival-pulse, .arch-hint { display: none !important; }

  /* single full-width column, normal flow */
  .app, .app[data-rail="open"], .app[data-rail="collapsed"] { display: block !important; }
  .main { padding: 0 !important; min-width: 0; }
  .station-section {
    min-height: auto !important;
    max-width: none !important;
    padding: 22px 0 !important;
    display: block !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  h1 { font-size: 40px; }
  h2, h3 { page-break-after: avoid; break-after: avoid; }

  /* keep cards/blocks from splitting across pages; drop screen shadows */
  .boarding-pass, .arch-card, .board, .postcard, .paper-card, .contact-card {
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* a printed copy is useless without the URLs - append them to project links */
  a { color: var(--ink); }
  .link-pill::before { content: "" !important; }
  .link-pill[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.82em;
    color: var(--ink-faint);
  }
}

