/* Stories (prospectortrails.com/stories): scroll-driven films. Base tokens, buttons, cards and the deep section come from
   /minerals.css; this adds the film screen (3D set, globe, cast, HUD, film grain) and the hub. Hand-written. */
.film { position: relative; }
.screen { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: radial-gradient(70% 60% at 65% 45%, color-mix(in srgb, var(--c) 9%, transparent), transparent 70%), var(--bg); }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease), filter 1.6s var(--ease); touch-action: pan-y; }
.film.ready .screen[data-view="set"] #set3d, .film.ready .screen[data-view="globe"] #globe3d { opacity: 1; }
.screen[data-era="archive"] #set3d { filter: sepia(.62) saturate(.78) contrast(1.06) brightness(.96); }
.screen.no3d { background: radial-gradient(80% 70% at 70% 40%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), linear-gradient(180deg, #0b1418, #120e0a); }
.glabels, .slabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transition: opacity .8s; }
.glabel, .slabel { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; color: var(--muted); font-family: var(--mono);
  padding: 3px 8px; border-radius: 6px; background: rgba(5, 8, 10, .66); border: 1px solid var(--line); margin: -26px 0 0 8px; }
.glabel b, .slabel b { color: var(--text); font-weight: 500; font-family: Inter, sans-serif; margin-right: 4px; }
.shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 8, 10, .82) 0%, rgba(5, 8, 10, .35) 34%, transparent 56%), linear-gradient(0deg, rgba(5, 8, 10, .7) 0%, transparent 26%), linear-gradient(180deg, rgba(5, 8, 10, .55) 0%, transparent 18%); }
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 18vmax rgba(0, 0, 0, .55); }
.grain { position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.9'/></svg>");
  animation: grain 1s steps(6) infinite; transition: opacity 1.4s; }
.screen[data-era="archive"] .grain { opacity: .2; }
.screen[data-era="archive"] .scratch { opacity: .3; }
.scratch { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s;
  background: linear-gradient(90deg, transparent 0 22%, rgba(255, 245, 220, .16) 22.1%, transparent 22.25%, transparent 71%, rgba(255, 245, 220, .1) 71.08%, transparent 71.2%);
  animation: scratch 2.6s steps(9) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-3%, 9%); } 80% { transform: translate(8%, 2%); } 100% { transform: translate(0, 0); } }
@keyframes scratch { 0% { transform: translateX(0); } 30% { transform: translateX(6%); opacity: .2; } 60% { transform: translateX(-9%); } 100% { transform: translateX(3%); } }
.lb { position: absolute; left: 0; right: 0; height: 9vh; background: #000; z-index: 6; pointer-events: none; transition: transform 1.6s var(--ease) .5s; }
.lb.t { top: 0; } .lb.b { bottom: 0; }
.film.ready .lb.t { transform: translateY(-100%); } .film.ready .lb.b { transform: translateY(100%); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); z-index: 5; }
.progress span { display: block; height: 100%; width: 0; background: var(--c); }
.dots { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: grid; gap: 9px; z-index: 5; }
.dots li { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); transition: transform .3s, background .3s; }
.dots li.on { background: var(--c); transform: scale(1.6); }

/* the cast: characters along the bottom of the screen */
.cast { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(120px, 23vh, 200px); pointer-events: none; z-index: 3; overflow: visible; }
.cast-back .drop { transition: opacity .9s; opacity: .95; }
.cast-floor { fill: #0a0d0e; }
.cast .glint { animation: glint 1.4s ease-in-out infinite; }
.cast .blades { animation: spin 5s linear infinite; }
.cast .bubble { animation: pop .45s var(--ease) both; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .4)); }
@keyframes glint { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.9); } }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.h-slate { position: absolute; left: 24px; top: 78px; display: flex; gap: 12px; align-items: center; font: 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.h-slate b { color: #05080a; background: var(--c); padding: 2px 7px; border-radius: 4px; font-weight: 500; }
.h-slate i { font-style: normal; color: var(--faint); }
.h-slate .h-place:empty { display: none; }
.h-right { position: absolute; right: 44px; top: 86px; width: min(320px, 34vw); text-align: right; display: grid; justify-items: end; gap: 6px; }
.h-year { font-family: var(--head); font-weight: 700; font-size: clamp(64px, 9vw, 136px); line-height: .9; letter-spacing: -.05em; color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--c) 85%, white); opacity: 0; transform: translateY(10px); transition: opacity .8s, transform .8s var(--ease); font-variant-numeric: tabular-nums; }
.h-year.on { opacity: .95; transform: none; }
.h-count { opacity: 0; transition: opacity .6s; }
.h-count.on { opacity: 1; }
.h-count b { display: block; font-family: var(--head); font-size: clamp(26px, 2.8vw, 40px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); text-shadow: 0 2px 20px rgba(0, 0, 0, .6); }
.h-count span { display: block; font-size: 12.5px; color: #cfd8d5; max-width: 260px; margin-left: auto; line-height: 1.35; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.h-chart { width: 100%; margin: 10px 0 0; padding: 10px 12px 4px; border-radius: 12px; background: rgba(5, 8, 10, .84); border: 1px solid var(--line); opacity: 0; transition: opacity .6s; position: relative; }
.h-chart.on { opacity: 1; }
.h-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.h-chart .axis { stroke: var(--line2); } .h-chart .tick { fill: var(--faint); font: 10px var(--mono); } .h-chart .headlbl { fill: var(--text); font: 500 12px var(--mono); }
.h-chart .cross, .h-chart .tip { display: none; }
.h-chart-note { font-size: 11px; color: #c3ccc9; max-width: 300px; text-shadow: 0 1px 8px rgba(0, 0, 0, .95), 0 0 2px rgba(0, 0, 0, .9); }
/* soft scrim behind the right-hand readouts so they stay legible over bright scenes (snow, salt flats) */
.h-right::before { content: ""; position: absolute; inset: -40px -44px -30px -60px; z-index: -1; background: radial-gradient(closest-side, rgba(5, 8, 10, .55), transparent); pointer-events: none; }
.h-cap { position: absolute; right: 44px; bottom: calc(clamp(120px, 23vh, 200px) + 18px); text-align: right; max-width: min(420px, 40vw); opacity: 0; transform: translateX(14px); transition: opacity .6s, transform .6s var(--ease); }
.h-cap.on { opacity: 1; transform: none; }
.h-cap b { display: inline-block; font-family: var(--head); font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; letter-spacing: -.02em; background: var(--c); color: #05080a; padding: 2px 10px; border-radius: 4px; }
.h-cap span { display: block; margin-top: 6px; font-size: 14px; color: #dfe7e4; text-shadow: 0 1px 10px rgba(0, 0, 0, .9); }
.h-gauge { position: absolute; right: 36px; top: 40%; height: 18%; width: 140px; opacity: 0; transition: opacity .6s; }
.h-gauge.on { opacity: 1; }
.h-g-bar { position: absolute; right: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--line2); }
.h-g-bar i { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 2px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.h-gauge ol { position: absolute; inset: 0; }
.h-gauge li { position: absolute; right: 10px; transform: translateY(-50%); font: 10.5px var(--mono); color: var(--muted); white-space: nowrap; }
.h-gauge li::after { content: ""; position: absolute; right: -10px; top: 50%; width: 8px; height: 1px; background: var(--muted); }
.h-gauge > b { position: absolute; right: 12px; bottom: -26px; font: 500 13px var(--mono); color: var(--text); white-space: nowrap; }

/* the reels (chapters) scroll over the screen */
.reels { position: relative; margin-top: -100vh; margin-top: -100svh; z-index: 5; pointer-events: none; }
.reel { min-height: 118vh; display: flex; align-items: center; padding: 110px 24px 80px; max-width: 1180px; margin: 0 auto; }
.reel > * { pointer-events: auto; }
.reel.hero { min-height: 100vh; min-height: 100svh; position: relative; align-items: center; }
.hero-copy { max-width: 640px; }
.hero-copy h1 { font-size: clamp(42px, 6.6vw, 86px); line-height: 1; letter-spacing: -.045em; text-shadow: 0 4px 40px rgba(0, 0, 0, .5); }
.hero-copy h1 .w { display: inline-block; opacity: 0; transform: translateY(.4em) rotate(2deg); filter: blur(8px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); }
.film.ready .hero-copy h1 .w { opacity: 1; transform: none; filter: none; }
.hero-copy .lead { text-shadow: 0 2px 20px rgba(0, 0, 0, .7); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 28px; max-width: 620px; }
.kpi { border-left: 2px solid var(--c); padding: 4px 0 4px 12px; }
.kpi b { display: block; font-family: var(--head); font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.scroll-cue { position: absolute; left: 24px; bottom: calc(clamp(120px, 23vh, 200px) + 20px); width: 26px; height: 42px; border: 1.5px solid var(--line2); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--c); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
.reel .card { width: min(450px, 100%); max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; border-radius: var(--r); padding: 24px 24px 20px; opacity: .3; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reel.on .card { opacity: 1; transform: none; }
.step { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c); margin-bottom: 10px; }
.card h2 { font-size: clamp(25px, 2.8vw, 33px); line-height: 1.1; margin-bottom: 12px; }
.card > p { color: #c9d4d0; font-size: 15.5px; margin-bottom: 10px; }
.card .big { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 6px; }
.card .big div { flex: 1 1 120px; border-top: 1px solid var(--line2); padding-top: 8px; }
.card .big b { display: block; font-family: var(--head); font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--c); }
.card .big span { font-size: 12.5px; color: var(--muted); }
.cite { font-size: 12px; color: var(--faint); margin-top: 12px; line-height: 1.45; }
.cite a { color: var(--muted); }
.then-now { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 12px; background: var(--line); border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.then-now > div { background: rgba(5, 8, 10, .7); padding: 9px 11px; }
.then-now .hd { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--c); }
.then-now .hd + .hd { color: var(--lime); }

/* deep section additions */
.tline { margin: 18px 0 8px; border-left: 2px solid var(--line2); }
.tline li { position: relative; padding: 0 0 14px 18px; color: #c9d4d0; font-size: 14.5px; }
.tline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c); }
.tline b { font-family: var(--mono); color: var(--text); font-weight: 500; margin-right: 8px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-family: var(--head); font-size: 16.5px; }
.faq details p { margin-top: 8px; color: #c9d4d0; font-size: 14.5px; }
.facts-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.facts-t td { border-top: 1px solid var(--line); padding: 7px 0; vertical-align: top; }
.facts-t td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 10px; }
.facts-t td:first-child { color: var(--muted); }
.why { margin-top: 26px; padding: 18px 20px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 6%, transparent); }
.why h3 { margin: 0 0 8px; font-size: 17px; }
.why li { padding-left: 18px; position: relative; color: #c9d4d0; font-size: 14.5px; margin: 6px 0; }
.why li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.more-st { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 60px; }

/* story cards (hub and "more stories") */
.scard { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 230px; padding: 18px; border-radius: 16px; text-decoration: none; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); background: linear-gradient(180deg, transparent 30%, rgba(5, 8, 10, .92) 90%), radial-gradient(90% 80% at 70% 20%, color-mix(in srgb, var(--k) 45%, transparent), transparent 70%), #0b1013;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.scard:hover, .scard:focus-visible { transform: translateY(-4px); border-color: color-mix(in srgb, var(--k) 60%, transparent); box-shadow: 0 20px 50px -22px var(--k); }
.scard .yr { position: absolute; top: 14px; right: 16px; font: 500 12px var(--mono); color: var(--k); letter-spacing: .06em; }
.scard .art { position: absolute; inset: 0 0 34% 0; width: 100%; height: 66%; z-index: -1; opacity: .85; transition: transform .6s var(--ease); }
.scard::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 8, 10, .92) 0%, rgba(5, 8, 10, .55) 38%, transparent 62%); }
.scard:hover .art { transform: scale(1.05); }
.hub-grid .scard:first-child .art { inset: 0 0 0 40%; width: 60%; height: 100%; }
.scard h3 { font-size: 21px; line-height: 1.12; }
.scard p { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.scard .tag { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--k); margin-bottom: 6px; }

/* hub */
.shero { position: relative; min-height: 92vh; min-height: 92svh; display: flex; align-items: center; overflow: hidden; }
.shero .cast { height: clamp(130px, 26vh, 220px); }
.shero-copy { position: relative; z-index: 4; padding-top: 70px; padding-bottom: 200px; }
.shero h1 { font-size: clamp(44px, 7.4vw, 96px); line-height: .98; letter-spacing: -.045em; max-width: 900px; }
.shero .lead { max-width: 640px; }
.shero-sky { position: absolute; inset: 0; background: radial-gradient(60% 50% at 70% 30%, rgba(220, 255, 60, .12), transparent 70%), radial-gradient(50% 60% at 20% 80%, rgba(95, 224, 200, .1), transparent 70%); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding-bottom: 40px; }
.hub-grid .scard { min-height: 340px; }
.hub-grid .scard:first-child { grid-column: span 2; min-height: 380px; }
.hub-grid .scard:first-child h3 { font-size: 32px; }
.era-line { margin: 70px 0 30px; }
.era-line ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line2); }
.era-line li { padding: 14px 14px 0 0; position: relative; font-size: 13.5px; color: var(--muted); }
.era-line li::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--lime)); }
.era-line b { display: block; font: 500 15px var(--mono); color: var(--text); }

@media (max-width: 900px) {
  /* the opening caption would sit on top of the hero headline on a phone */
  .screen[data-reel="open"] .h-cap, .screen[data-reel="open"] .h-count { visibility: hidden; }
  .shade { background: linear-gradient(0deg, rgba(5, 8, 10, .85) 0%, rgba(5, 8, 10, .2) 45%, transparent 60%), linear-gradient(180deg, rgba(5, 8, 10, .6) 0%, transparent 22%); }
  .reel { align-items: flex-end; padding: 90px 14px 40px; min-height: 120vh; }
  .reel.hero { align-items: flex-end; padding-bottom: calc(clamp(90px, 15vh, 120px) + 40px); }
  .reel .card { max-height: 56vh; padding: 18px 18px 14px; }
  .card > p { font-size: 15px; }
  .cast { height: clamp(86px, 15vh, 120px); }
  .h-slate { top: 66px; left: 14px; font-size: 10.5px; gap: 8px; }
  .h-slate i { display: none; }
  .h-right { right: 16px; top: 90px; width: 52vw; gap: 2px; }
  .h-year { font-size: clamp(46px, 13vw, 72px); }
  .h-count b { font-size: 22px; }
  .h-count span { font-size: 11.5px; }
  .h-chart { padding: 6px 8px 2px; }
  .h-chart-note { display: none; }
  .h-cap { left: 14px; right: auto; top: 92px; bottom: auto; text-align: left; max-width: 44vw; transform: translateX(-10px); }
  .h-cap b { font-size: 15px; }
  .h-cap span { font-size: 12.5px; }
  .h-gauge { right: 22px; top: 40%; height: 22%; }
  .h-gauge li span { display: none; }
  .h-gauge li::after { display: none; }
  .h-gauge > b { font-size: 11.5px; }
  .dots { display: none; }
  .scroll-cue { display: none; }
  .hub-grid .scard:first-child { grid-column: auto; }
  .lb { height: 6vh; }
}
@media (max-width: 420px) { .h-right { width: 56vw; } .kpis { grid-template-columns: repeat(2, 1fr); } .hero-copy h1 { font-size: 40px; } }
@media (prefers-reduced-motion: reduce) {
  .grain, .scratch, .scroll-cue span, .cast .glint, .cast .blades { animation: none; }
  .hero-copy h1 .w { transition: none; opacity: 1; transform: none; filter: none; }
  .lb { display: none; }
  .reel .card { transition: none; }
}
