/* ============================================================
   EpicYolo.Life — scrapbook timeline
   ============================================================ */

:root {
  /* Paper palette — interpolated by JS as you scroll deeper */
  --paper: #f3ead9;
  --paper-fold: #ead9b8;
  --ink: #28201a;
  --ink-soft: #5a4a3a;
  --ink-faded: #8a7560;

  --accent-red: #a83434;
  --accent-blue: #2d5878;
  --accent-yellow: #c69728;
  --accent-amber: #d68a3c;
  --accent-moss: #5a6a3a;

  --tape: rgba(208, 188, 130, 0.55);
  --tape-shadow: rgba(60, 40, 10, 0.18);

  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-serif: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --font-mono: "Special Elite", "Courier New", monospace;
  --font-hand: "Caveat", "Bradley Hand", cursive;

  --grain-opacity: 0.4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.4s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  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.15  0 0 0 0 0.10  0 0 0 0 0.05  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(40, 20, 10, 0.18) 100%);
}

/* ========== MASTHEAD ========== */

.masthead {
  position: relative;
  padding: 56px 64px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  z-index: 10;
}
.masthead .logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
}
.masthead .logo .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent-red);
  border-radius: 50%;
  margin: 0 4px 6px 2px;
  vertical-align: middle;
}
.masthead .tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-top: 6px;
}
.masthead .right {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faded);
  text-align: right;
  line-height: 1.7;
}
.masthead .right .stamp {
  display: inline-block;
  border: 1.5px solid var(--accent-red);
  color: var(--accent-red);
  padding: 4px 10px 3px;
  letter-spacing: 0.22em;
  transform: rotate(-2deg);
  margin-top: 8px;
  opacity: 0.85;
}

/* ========== TIMELINE COLUMN ========== */

.timeline {
  position: relative;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 240px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    currentColor 0 6px,
    transparent 6px 12px
  );
  color: rgba(40, 30, 20, 0.18);
  z-index: 0;
  pointer-events: none;
}

/* ========== ERA DIVIDER ========== */

.era { position: relative; padding: 60px 0 40px; }

.era-divider {
  position: relative;
  text-align: center;
  margin: 40px auto 60px;
  padding: 0 20px;
  z-index: 5;
}
.era-divider .era-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 14px;
}
.era-divider .era-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(56px, 9vw, 124px);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--ink);
}
.era-divider .era-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 14px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}
.era-divider .rule {
  width: 80px;
  height: 1px;
  background: var(--ink-faded);
  margin: 20px auto 0;
  opacity: 0.5;
}

/* ========== ITEM CANVAS ========== */

.canvas { position: relative; width: 100%; min-height: 920px; z-index: 2; }

.item {
  position: absolute;
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.35s ease,
              filter 0.35s ease;
  will-change: transform;
}
.item:hover { z-index: 50; }
.item.linked {
  z-index: 70;
  filter: drop-shadow(0 0 18px rgba(168, 52, 52, 0.42));
}
.item.linked::after {
  content: "";
  position: absolute;
  inset: -16px;
  border: 1px solid rgba(168, 52, 52, 0.62);
  pointer-events: none;
}

.geo-actions {
  position: absolute;
  right: 0;
  top: -26px;
  z-index: 4;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.item:hover .geo-actions,
.item:focus-within .geo-actions,
.item.expanded-source .geo-actions,
.item.linked .geo-actions {
  opacity: 1;
  transform: translateY(0);
}
.geo-link {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px 2px;
  border: 1px solid rgba(40, 32, 26, 0.28);
  background: rgba(251, 245, 230, 0.92);
  box-shadow: 0 4px 12px rgba(60, 40, 20, 0.16);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.geo-link:hover,
.geo-link:focus-visible {
  border-color: var(--accent-red);
  color: var(--accent-red);
  outline: none;
}

/* ========== POLAROID ========== */

.polaroid {
  width: 280px;
  background: #fbf5e6;
  padding: 14px 14px 50px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 14px 28px -10px rgba(60, 40, 20, 0.35),
    0 2px 6px rgba(40, 20, 10, 0.18);
}
.polaroid .photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  background:
    repeating-linear-gradient(135deg, rgba(120, 100, 80, 0.16) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #4a3f33 0%, #2c241d 100%);
  position: relative;
  overflow: hidden;
}
.polaroid .photo.landscape { aspect-ratio: 4 / 3; }
.polaroid .photo.portrait { aspect-ratio: 3 / 4; }
.polaroid .photo .ph-image,
.polaroid .photo .ph-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.04);
}
.polaroid .photo .ph-video {
  background: #17120e;
  filter: saturate(0.95) contrast(1.02);
}
.polaroid .photo .ph-label {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(245, 232, 200, 0.55);
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  white-space: pre-line;
}
.polaroid .photo .ph-stamp {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 220, 160, 0.7);
  text-transform: uppercase;
}
.polaroid .photo .ph-play {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 244, 212, 0.86);
  text-transform: uppercase;
  background: rgba(22, 16, 12, 0.55);
  padding: 4px 6px;
}
.video-polaroid .caption::before {
  content: "VIDEO ";
  font-family: var(--font-mono);
  font-size: 14px;
  vertical-align: 0.08em;
}
.polaroid .caption {
  margin-top: 12px;
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 1.1;
  color: var(--ink);
}
.polaroid .loc {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-faded);
  text-transform: uppercase;
}

/* tape */
.tape {
  position: absolute;
  width: 90px;
  height: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 50%, rgba(0, 0, 0, 0.04) 100%),
    var(--tape);
  border-left: 1px dashed rgba(110, 90, 40, 0.18);
  border-right: 1px dashed rgba(110, 90, 40, 0.18);
  box-shadow: 0 4px 8px -4px var(--tape-shadow);
  pointer-events: none;
}
.tape.top { top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg); }
.tape.tl { top: -8px; left: -12px; transform: rotate(-22deg); }
.tape.tr { top: -8px; right: -12px; transform: rotate(20deg); }

/* ========== NOTE ========== */

.note {
  width: 220px;
  padding: 20px 18px 22px;
  background: #f3da7c;
  font-family: var(--font-hand);
  font-size: 20px;
  line-height: 1.25;
  color: #3a2a14;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 10px 16px -8px rgba(80, 60, 20, 0.4);
  position: relative;
}
.note.blue { background: #c9dee8; color: #1c2b3a; }
.note.pink { background: #e9c5c0; color: #3a201c; }
.note.green { background: #cdd9b5; color: #2a321a; }
.note .meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(60, 40, 10, 0.6);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.note.long-note {
  min-height: 170px;
}
.note.long-note .body {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-more {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(60, 40, 10, 0.18);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ========== BOARDING PASS ========== */

.boarding {
  width: 360px;
  background: #f6f0df;
  font-family: var(--font-mono);
  color: #1a1410;
  display: flex;
  box-shadow:
    0 12px 22px -10px rgba(60, 40, 20, 0.4),
    0 0 0 1px rgba(60, 40, 20, 0.06);
  position: relative;
}
.boarding::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 70%;
  width: 1px;
  background-image: radial-gradient(circle, #1a1410 0 1.2px, transparent 1.5px);
  background-size: 1px 6px;
  background-repeat: repeat-y;
  opacity: 0.5;
}
.boarding .stub-main { flex: 1; padding: 16px 18px; }
.boarding .stub-side { width: 30%; padding: 16px 14px; background: #ede4ce; }
.boarding .airline {
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-red);
  border-bottom: 1.5px solid var(--accent-red);
  padding-bottom: 6px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}
.boarding .route {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.boarding .route .iata {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  font-weight: 600;
  font-style: normal;
}
.boarding .route .arrow {
  flex: 1;
  height: 1px;
  background: currentColor;
  position: relative;
  opacity: 0.5;
}
.boarding .route .arrow::after {
  content: "✈";
  position: absolute;
  top: -8px;
  right: -2px;
  font-size: 11px;
  opacity: 0.9;
}
.boarding .row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(40, 20, 10, 0.65);
  margin-top: 8px;
}
.boarding .row .val {
  color: #1a1410;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.boarding .stub-side .seat {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(40, 20, 10, 0.6);
}
.boarding .stub-side .seatnum {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

/* ========== MAP CLIP ========== */

.mapclip {
  width: 300px;
  background: #e6dfc8;
  padding: 14px;
  box-shadow: 0 12px 22px -10px rgba(60, 40, 20, 0.4);
  position: relative;
}
.mapclip .frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #d9d0b1;
  position: relative;
  overflow: hidden;
}
.mapclip .frame svg { width: 100%; height: 100%; display: block; }
.mapclip .label {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
}

/* ========== WEATHER ========== */

.weather {
  width: 200px;
  background: #e7e1d0;
  padding: 14px 16px 18px;
  box-shadow: 0 8px 16px -8px rgba(40, 30, 10, 0.3);
  font-family: var(--font-mono);
  color: #1a1410;
}
.weather .city {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.weather .temp {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 0.9;
  font-weight: 500;
}
.weather .temp sup { font-size: 22px; vertical-align: super; }
.weather .cond {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 8px;
  color: var(--ink-soft);
}

/* ========== RECEIPT ========== */

.receipt {
  width: 240px;
  background: #faf3e1;
  padding: 18px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #1a1410;
  line-height: 1.55;
  box-shadow: 0 10px 18px -10px rgba(40, 20, 10, 0.35);
  position: relative;
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - 8px),
    92% 100%, 84% calc(100% - 8px), 76% 100%, 68% calc(100% - 8px),
    60% 100%, 52% calc(100% - 8px), 44% 100%, 36% calc(100% - 8px),
    28% 100%, 20% calc(100% - 8px), 12% 100%, 4% calc(100% - 8px), 0 100%
  );
}
.receipt .head {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(40, 20, 10, 0.3);
}
.receipt .line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.receipt .line span:first-child { flex: 1; min-width: 0; }
.receipt .line span:last-child { flex-shrink: 0; white-space: nowrap; }
.receipt .total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(40, 20, 10, 0.3);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

/* ========== NOW PLAYING ========== */

.np {
  width: 240px;
  background: #1a1410;
  color: #f0e6d0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.5);
  border: 1px solid #3a2e22;
}
.np .head {
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8a7560;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.np .head .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-amber);
  display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}
.np .track {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.15;
  color: #f0e6d0;
}
.np .artist {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c69728;
  margin-top: 4px;
}
.np .bar {
  margin-top: 12px;
  height: 2px;
  background: #3a2e22;
  position: relative;
}
.np .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  background: var(--accent-amber);
}
.np .time {
  margin-top: 6px;
  font-size: 9px;
  color: #8a7560;
  letter-spacing: 0.18em;
  display: flex;
  justify-content: space-between;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ========== REFLECTION ========== */

.reflection {
  width: 380px;
  padding: 28px 30px 32px;
  background: #f1e8d3;
  box-shadow:
    0 14px 26px -12px rgba(60, 40, 20, 0.4),
    0 0 0 1px rgba(60, 40, 20, 0.05);
  position: relative;
}
.reflection.wide { width: 460px; }
.reflection .quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
  color: var(--ink);
}
.reflection .quote::before {
  content: "\201C";
  font-size: 60px;
  line-height: 0;
  color: var(--accent-red);
  margin-right: 4px;
  vertical-align: -18px;
  opacity: 0.6;
}
.reflection .footer {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faded);
  display: flex;
  justify-content: space-between;
}
.reflection .footer .more {
  color: var(--accent-red);
  border-bottom: 1px solid currentColor;
}

/* ========== STAMP ========== */

.stamp-el {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
  padding: 7px 14px 5px;
  opacity: 0.82;
  background: rgba(255, 245, 220, 0.2);
  display: inline-block;
}
.stamp-el.blue { border-color: var(--accent-blue); color: var(--accent-blue); }
.stamp-el.amber { border-color: var(--accent-amber); color: var(--accent-amber); }

/* ========== TICKET ========== */

.ticket {
  width: 260px;
  background: #ede2c4;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink);
  border-left: 4px double var(--accent-red);
  box-shadow: 0 10px 18px -10px rgba(40, 20, 10, 0.35);
}
.ticket .title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0;
  font-style: italic;
  margin-bottom: 8px;
  color: var(--ink);
  text-transform: none;
}
.ticket .row {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ========== SCORECARD ========== */

.scorecard {
  width: 260px;
  padding: 20px 22px 22px;
  background: #efe1bd;
  color: #251b13;
  border: 1px solid rgba(70, 49, 27, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 16px 24px -16px rgba(45, 28, 14, 0.52);
  font-family: var(--font-mono);
}
.scorecard.green { background: #d7e0c2; }
.scorecard.pink { background: #ecd1ce; }
.score-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(37, 27, 19, 0.58);
}
.score-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 50px;
  line-height: 0.92;
}
.score-max {
  font-family: var(--font-mono);
  font-size: 15px;
  color: rgba(37, 27, 19, 0.58);
}
.score-text {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.25;
}
.score-meta {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(70, 49, 27, 0.18);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(37, 27, 19, 0.55);
}

/* ========== LIST PAPER ========== */

.list {
  width: 320px;
  background: #f6efd9;
  padding: 18px 18px 22px 38px;
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
  position: relative;
  box-shadow: 0 10px 18px -10px rgba(40, 20, 10, 0.35);
}
.list::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 28px;
  width: 1px;
  background: rgba(200, 60, 60, 0.45);
}
.list .head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 8px;
  margin-left: -10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(40, 30, 20, 0.2);
}
.list ul { list-style: none; margin: 0; padding: 0; }
.list li {
  position: relative;
  padding: 5px 0 6px 4px;
  border-bottom: 1px solid rgba(60, 100, 130, 0.18);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.list li:last-child { border-bottom: none; }
.list li.done {
  text-decoration: line-through;
  text-decoration-color: rgba(168, 52, 52, 0.7);
  opacity: 0.7;
}
.list li::before {
  content: "\2610";
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}
.list li.done::before { content: "\2713"; color: var(--accent-red); opacity: 1; }

/* ========== EXPANDED / ZOOM ========== */

#stage-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, 0);
  pointer-events: none;
  z-index: 200;
  transition: background 0.45s ease;
}
#stage-overlay.active {
  background: rgba(20, 14, 10, 0.78);
  pointer-events: all;
  cursor: zoom-out;
  backdrop-filter: blur(2px);
}

body.expanded .item:not(.expanded-source) {
  filter: blur(2px) brightness(0.6);
  pointer-events: none;
}
body.expanded .masthead,
body.expanded .era-divider,
body.expanded .rail {
  opacity: 0.15;
  transition: opacity 0.45s ease;
}

.expanded-source {
  z-index: 210;
  transform-origin: center center;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.reader-open .expanded-source {
  filter: drop-shadow(0 14px 22px rgba(20, 14, 10, 0.28));
}
.reader-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 230;
  width: min(620px, calc(100vw - 40px));
  max-height: min(76vh, 760px);
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  overflow: auto;
  padding: 34px 38px 38px;
  background: #f5ecd8;
  color: #2d2118;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.62) inset,
    0 34px 80px rgba(12, 8, 5, 0.5);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reader-panel.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}
.reader-close {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: rgba(45, 33, 24, 0.72);
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.reader-meta {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(45, 33, 24, 0.58);
}
.reader-panel h2 {
  margin: 0 36px 18px 0;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.05;
}
.reader-body {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.55;
}
.reader-body p {
  margin: 0 0 1em;
}
.reader-body p:last-child {
  margin-bottom: 0;
}

/* ========== SCROLL HINT ========== */

.scroll-hint {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faded);
  z-index: 100;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.4s ease;
}
body.scrolled .scroll-hint { opacity: 0; }
.scroll-hint .arrow {
  display: block;
  margin-top: 8px;
  text-align: center;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ========== RAIL ========== */

.rail {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faded);
  text-align: right;
  transition: opacity 0.4s ease;
}
.rail .entry {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: color 0.3s ease, opacity 0.3s ease;
  justify-content: flex-end;
  opacity: 0.5;
}
.rail .entry-main {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 0;
}
.rail .entry-title {
  max-width: 168px;
  overflow-wrap: anywhere;
}
.rail .entry-date {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--ink-faded);
}
.rail .entry:hover,
.rail .entry.active { color: var(--ink); opacity: 1; }
.rail .entry:hover .entry-date,
.rail .entry.active .entry-date { color: var(--ink-soft); }
.rail .entry .tick {
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
  transition: width 0.3s ease, background 0.3s ease;
}
.rail .entry.active .tick { width: 32px; background: var(--accent-red); }

/* ========== FOOTER ========== */

.foot {
  text-align: center;
  margin-top: 80px;
  padding: 40px 20px 80px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faded);
  position: relative;
  z-index: 2;
}
.foot .rule {
  width: 60px;
  height: 1px;
  background: var(--ink-faded);
  margin: 0 auto 18px;
  opacity: 0.5;
}

/* small screens — basic graceful degradation */
@media (max-width: 900px) {
  .rail { display: none; }
  .masthead {
    display: grid;
    padding: 36px 24px 10px;
    gap: 16px;
  }
  .masthead .logo {
    font-size: clamp(42px, 14vw, 58px);
    line-height: 0.92;
  }
  .masthead .tagline,
  .masthead .right {
    max-width: 100%;
    font-size: 10px;
    letter-spacing: 0.14em;
    line-height: 1.65;
  }
  .masthead .right {
    text-align: left;
  }
  .masthead .right .stamp {
    max-width: 100%;
    white-space: normal;
  }
  .timeline {
    padding: 0 18px 180px;
  }
  .era {
    padding: 34px 0 36px;
  }
  .era-divider {
    margin: 28px auto 38px;
    padding: 0;
  }
  .era-divider .era-title {
    font-size: clamp(48px, 16vw, 72px);
  }
  .era-divider .era-sub {
    font-size: 10px;
    letter-spacing: 0.14em;
    max-width: calc(100vw - 48px);
    overflow-wrap: anywhere;
  }
  .canvas { min-height: auto; }
  .item {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    margin: 20px 0;
    transform: none !important;
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .item > * {
    margin-left: auto;
    margin-right: auto;
  }
  .polaroid,
  .boarding,
  .mapclip,
  .weather,
  .receipt,
  .np,
  .note,
  .reflection,
  .reflection.wide,
  .ticket,
  .scorecard,
  .list {
    max-width: calc(100vw - 48px);
  }
  .polaroid {
    width: min(320px, calc(100vw - 72px)) !important;
  }
  .boarding,
  .mapclip,
  .weather,
  .receipt,
  .np,
  .note,
  .reflection,
  .reflection.wide,
  .ticket,
  .scorecard,
  .list {
    width: min(100%, calc(100vw - 48px)) !important;
  }
  .reader-panel {
    width: calc(100vw - 28px);
    max-height: 78vh;
    padding: 28px 24px 30px;
  }
  .reader-panel h2 {
    font-size: 28px;
  }
  .reader-body {
    font-size: 19px;
  }
  .scroll-hint {
    display: none;
  }
}
