/* The light path: the home page. Evolves the instrument system: ink field, spectrum ruler, one beam.
   Order: hero, record, story (list, then pinned), map, shared bits, reduced motion. */

.lp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lp-h2 { font-family: var(--font-display); font-weight: 300; font-size: var(--step-2); letter-spacing: -0.015em; margin: 0 0 28px; line-height: 1.15; }

/* ---------- 1. hero ---------- */
.lp-hero { --beam: #38ff38; position: relative; isolation: isolate; min-height: min(86svh, 760px); display: grid; grid-template-rows: 1fr auto; overflow: hidden; border-bottom: 1px solid var(--rule); }
.lp-field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; background: #000; cursor: ew-resize; touch-action: pan-y; }
.lp-hero.is-drag .lp-field { cursor: grabbing; }
.lp-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(14, 13, 12, 0.88) 24%, rgba(14, 13, 12, 0.35) 46%, rgba(14, 13, 12, 0) 62%), linear-gradient(0deg, rgba(14, 13, 12, 0.92) 0%, rgba(14, 13, 12, 0) 34%); }
.lp-hero-copy { align-self: center; padding-block: 56px 24px; pointer-events: none; }
.lp-hero-copy .page { display: grid; gap: 14px; }
.lp-hero h1 { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.6rem, 7.4vw, 5.6rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0; max-width: 11ch; }
.lp-sub { margin: 0; font-size: var(--step-1); color: var(--ink-2); max-width: 26ch; }
.lp-ctl { padding-block: 0 28px; }
.lp-ctl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px 36px; align-items: end; }
.lp-ctl-cell { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.lp-ctl-cell label { font-family: var(--font-data); font-size: var(--step--2); color: var(--ink-2); }
.lp-ctl-cell output { font-family: var(--font-mono); font-size: var(--step--1); color: var(--beam); font-variant-numeric: tabular-nums; }
.lp-ctl-cell input { grid-column: 1 / -1; }
.lp-ctl-hint { margin: 0; font-family: var(--font-data); font-size: var(--step--2); color: var(--muted); max-width: 34ch; justify-self: end; text-align: right; }

.lp-hero input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; --fill: 50%; }
.lp-hero input[type="range"]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--beam) var(--fill), var(--rule-2) var(--fill)); }
.lp-hero input[type="range"]::-moz-range-track { height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--beam) var(--fill), var(--rule-2) var(--fill)); }
.lp-hero input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 2px solid var(--bg); margin-top: -8px; box-shadow: 0 0 0 1px var(--beam); }
.lp-hero input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--beam); }
.lp-hero input[type="range"]:focus-visible { outline: none; }
.lp-hero input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); }
.lp-hero input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); }

/* detector strip: what a screen at the far right would read, as a plotted curve */
.lp-det { position: absolute; top: 0; bottom: 0; right: 0; width: 64px; height: 100%; z-index: 0; pointer-events: none; display: none; }
.lp-hero.is-gl .lp-det, .lp-hero.is-2d .lp-det { display: block; }
@media (min-width: 701px) { .lp-ctl-hint { margin-right: 64px; } }
/* the rail: one thin beam from the hero down the left edge into the story, so the page reads as a single path */
.lp-hero::after { content: ""; position: absolute; z-index: 1; left: 11px; bottom: 0; width: 2px; height: 46%; pointer-events: none; background: linear-gradient(180deg, transparent, var(--beam)); }
.lp-record { position: relative; }
.lp-record::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; pointer-events: none; background: linear-gradient(180deg, var(--lp-b1, #38ff38), var(--lp-b0, #8a38ff)); opacity: 0.85; }

/* without JavaScript or WebGL the hero is a dark panel with the headline; the sliders do nothing, so hide them */
.lp-hero:not(.is-gl):not(.is-2d) .lp-ctl { display: none; }
.lp-hero:not(.is-gl):not(.is-2d) .lp-field { display: none; }

@media (max-width: 700px) {
  .lp-hero { min-height: 0; grid-template-rows: auto auto auto; }
  .lp-field { position: relative; inset: auto; grid-row: 1; height: 38svh; min-height: 220px; z-index: 0; }
  .lp-hero::before, .lp-hero::after { display: none; }
  .lp-hero.is-gl .lp-det, .lp-hero.is-2d .lp-det { display: none; }
  .lp-hero-copy { grid-row: 2; padding-block: 28px 8px; pointer-events: auto; }
  .lp-ctl { grid-row: 3; padding-block: 8px 24px; }
  .lp-ctl-row { grid-template-columns: 1fr; gap: 4px; }
  .lp-ctl-hint { justify-self: start; text-align: left; }
}

/* ---------- 2. record ---------- */
.lp-record { padding-block: 64px 28px; }
.lp-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 56px; }
.lp-num { position: relative; margin: 0; padding: 22px 20px 20px; background: var(--surface); border: 1px solid var(--rule);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.lp-num::before, .lp-num::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1px solid var(--rule-2); }
.lp-num::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.lp-num::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.lp-num dt { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.lp-num dd { margin: 12px 0 0; font-size: var(--step--1); line-height: 1.45; color: var(--ink-2); }

.lp-rec-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.lp-years { width: 100%; min-width: 0; border-collapse: collapse; font-size: var(--step--1); }
.lp-years th, .lp-years td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-top: 1px solid var(--rule); }
.lp-years tr:last-child th, .lp-years tr:last-child td { border-bottom: 1px solid var(--rule); }
.lp-years th[scope="row"] { font-family: var(--font-mono); font-weight: 400; color: var(--muted); white-space: nowrap; font-size: var(--step--2); padding-top: 16px; }
.lp-years td:nth-child(2) { color: var(--ink-2); white-space: nowrap; }
.lp-years td:nth-child(3) { color: var(--ink); }
.lp-now th[scope="row"] { color: var(--accent); }
.lp-years a { color: var(--ink); text-underline-offset: 3px; }

.lp-ticket { position: relative; padding: 24px 22px 22px; background: var(--surface); border: 1px solid var(--rule-2);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%); }
.lp-ticket::before { content: ""; position: absolute; left: -9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--rule-2); }
.lp-tk-k { margin: 0 0 8px; font-family: var(--font-data); font-size: var(--step--2); color: var(--accent); }
.lp-ticket h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; }
.lp-ticket p { margin: 0 0 14px; font-size: var(--step--1); color: var(--ink-2); line-height: 1.5; }
.lp-tk-d { margin: 0 0 18px; display: grid; gap: 6px; border-top: 1px dashed var(--rule-2); padding-top: 12px; }
.lp-tk-d div { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-data); font-size: var(--step--2); }
.lp-tk-d dt { color: var(--muted); }
.lp-tk-d dd { margin: 0; color: var(--ink); }

@media (max-width: 900px) {
  .lp-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-rec-cols { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 520px) {
  .lp-years th[scope="row"], .lp-years td:nth-child(2) { white-space: normal; }
  .lp-years, .lp-years tbody, .lp-years tr, .lp-years th, .lp-years td { display: block; }
  .lp-years tr { padding: 12px 0; border-top: 1px solid var(--rule); }
  .lp-years th, .lp-years td { border: 0 !important; padding: 2px 0; }
}

/* ---------- 3. story, as a plain list (default, and the whole story with reduced motion) ---------- */
.lp-story { --beam: #8a38ff; position: relative; padding-block: 24px 40px; border-top: 1px solid var(--rule); }
.lp-story-head { padding-top: 48px; }
.lp-world { list-style: none; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)); max-width: 1152px; display: grid; gap: 0; }
.lp-ch { --c: #8a38ff; position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: center; padding: 36px 0 36px 28px; border-left: 2px solid var(--c); margin-left: 4px; }
.lp-ch::before { content: ""; position: absolute; left: -6px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--c); }
.lp-optic { width: 100%; height: auto; overflow: visible; }
.lp-optic * { vector-effect: non-scaling-stroke; }
.lp-optic .lp-stub, .lp-optic .lp-ray, .lp-optic .lp-fan path { fill: none; stroke: var(--c); stroke-width: 1.6; stroke-linecap: round; }
.lp-optic .lp-fan path { stroke-opacity: 0.75; }
.lp-optic .lp-dash { stroke-dasharray: 3 7; }
.lp-optic .lp-solid, .lp-optic .lp-solid * { fill: var(--ink-2); stroke: none; }
.lp-optic path.lp-solid { fill: var(--ink-2); fill-opacity: 0.9; }
.lp-optic .lp-dot, .lp-optic .lp-nodes circle { fill: var(--c); stroke: none; }
.lp-txt { max-width: 46ch; }
.lp-k { margin: 0 0 6px; font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); }
.lp-txt h3 { font-family: var(--font-display); font-weight: 300; font-size: var(--step-3); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 14px; }
.lp-txt p:not(.lp-k) { margin: 0 0 14px; color: var(--ink-2); font-size: var(--step-0); line-height: 1.55; }
.lp-txt a { font-family: var(--font-data); font-size: var(--step--1); color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--c); text-decoration-thickness: 2px; }
.lp-hud { display: none; }

@media (max-width: 640px) {
  .lp-ch { grid-template-columns: 1fr; gap: 16px; padding-left: 20px; }
  .lp-optic { max-width: 220px; }
}

/* ---------- 3b. story, pinned and panned (class added by JavaScript, never with reduced motion) ---------- */
.lp-on { padding: 0; }
.lp-on .lp-story-head { position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding-top: 22px; pointer-events: none; }
.lp-on .lp-story-head .lp-h2 { font-family: var(--font-data); font-size: var(--step--2); font-weight: 500; color: var(--muted); letter-spacing: 0.01em; margin: 0; }
.lp-on .lp-track { height: 380svh; position: relative; }
.lp-on .lp-stage { position: sticky; top: var(--lp-top, 0px); height: calc(100svh - var(--lp-top, 0px)); overflow: hidden; background: radial-gradient(120% 70% at 50% 38%, #12110f 0%, var(--bg) 70%); }
.lp-on .lp-world { position: absolute; inset: 0; display: flex; max-width: none; margin: 0; padding: 0; will-change: transform; }
.lp-on .lp-beam { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 1; }
.lp-on .lp-ch { flex: 0 0 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; position: relative; padding: 56px 0 var(--lp-hudh, 100px); margin: 0; border: 0; height: 100%; z-index: 2; box-sizing: border-box; }
.lp-on .lp-ch::before { display: none; }
.lp-on .lp-optic { position: static; justify-self: center; align-self: stretch; width: min(30vw, 300px); height: auto; min-height: 0; opacity: calc(0.25 + var(--a, 1) * 0.75); }
.lp-on .lp-optic .lp-stub { display: none; }
.lp-on .lp-txt { position: static; align-self: end; margin-left: max(16px, calc((100vw - 1120px) / 2)); padding-top: 12px; min-height: var(--lp-txth, 0); box-sizing: content-box; width: min(520px, calc(100vw - 32px)); max-width: none; opacity: var(--a, 1); transform: translateX(calc(var(--d, 0) * -14vw)); }
.lp-on .lp-ch:not(.is-on) .lp-txt a { visibility: hidden; }
.lp-on .lp-txt h3 { font-size: clamp(2rem, 4.6vw, 3.6rem); margin-bottom: 10px; }
/* the glass: a fresnel rim in the beam's colour, a faint refracted core, a thin specular edge */
.lp-optic .lp-glass { fill: url(#lp-glass); stroke: url(#lp-spec); stroke-width: 1.2; }
.lp-optic .lp-rim { fill: none; stroke: var(--c); stroke-opacity: 0.5; stroke-width: 4; stroke-linejoin: round; }
.lp-optic .lp-inner { fill: none; stroke: var(--c); stroke-opacity: 0.25; stroke-width: 1; }
.lp-optic .lp-band { fill: var(--c); fill-opacity: 0.4; }
.lp-optic .lp-band2 { fill-opacity: 0.12; }
.lp-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.lp-on .lp-hud { display: flex; flex-direction: column; justify-content: flex-end; position: absolute; z-index: 3; inset: 0; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 18px; pointer-events: none; }
.lp-nm { position: absolute; right: max(16px, calc((100vw - 1120px) / 2)); top: 52px; margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -0.03em; color: var(--beam); font-variant-numeric: tabular-nums; opacity: 0.9; }
.lp-hud-row { display: flex; gap: 8px; width: 100%; max-width: 1120px; margin: 0 auto; pointer-events: auto; }
.lp-hud button { appearance: none; flex: 1 1 0; min-width: 0; min-height: 44px; display: grid; gap: 2px; text-align: left; padding: 8px 12px; background: rgba(22, 21, 19, 0.7); color: var(--ink-2); border: 1px solid var(--rule); border-top: 2px solid var(--rule-2); border-radius: 0; cursor: pointer; font: inherit; transition: color 200ms var(--ease-out), border-color 200ms var(--ease-out), background-color 200ms var(--ease-out); }
.lp-hud button b { font-family: var(--font-data); font-weight: 500; font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-hud button span { font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); }
.lp-hud button[aria-current="true"] { color: var(--ink); border-top-color: var(--beam); background: var(--surface); }
.lp-hud button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .lp-hud button:hover { color: var(--ink); border-top-color: var(--ink-2); } }

@media (max-width: 640px) {
  .lp-on { --lp-hudh: 80px; }
  .lp-on .lp-optic { width: min(52vw, 220px); }
  .lp-on .lp-txt p:not(.lp-k) { font-size: var(--step--1); }
  .lp-nm { top: 44px; right: 16px; font-size: 2rem; }
  .lp-hud button span { display: none; }
  .lp-hud button b { font-size: var(--step--2); }
}
@media (max-height: 600px) { .lp-on .lp-ch { padding-top: 44px; } .lp-on .lp-txt h3 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin-bottom: 6px; } .lp-on .lp-txt p:not(.lp-k) { font-size: var(--step--1); line-height: 1.45; margin-bottom: 8px; } }
@media (max-height: 560px) { .lp-on .lp-txt p:not(.lp-k) { display: none; } }

/* ---------- 4. work map ---------- */
.lp-work { padding-block: 72px 56px; border-top: 1px solid var(--rule); }
.lp-map { position: relative; --c: var(--ink-2); }
.lp-map-svg { display: none; }
.lp-map.is-built .lp-map-svg { display: block; }
.lp-map-svg svg { display: block; width: 100%; height: auto; overflow: visible; }
.lp-map-read { margin: 14px 0 0; min-height: 3.2em; font-size: var(--step--1); color: var(--ink-2); display: none; }
.lp-map.is-built .lp-map-read { display: block; }
.lp-map-read b { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); color: var(--ink); margin-right: 8px; }
.lp-edge { stroke-width: 1; stroke-opacity: 0.28; transition: stroke-opacity 200ms var(--ease-out); }
.lp-bridge { fill: none; stroke: var(--rule-2); stroke-width: 1; stroke-dasharray: 2 6; }
.lp-core { opacity: 0.7; }
.lp-gname { font-family: var(--font-data); font-size: 13px; font-weight: 500; opacity: 0.85; transition: opacity 200ms var(--ease-out); }
.lp-hit { fill: transparent; }
.lp-dot { fill: var(--c); transition: r 160ms var(--ease-out), opacity 200ms var(--ease-out); }
.lp-label { font-family: var(--font-data); font-size: 13px; fill: var(--ink-2); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; transition: fill 200ms var(--ease-out), opacity 200ms var(--ease-out); }
.lp-g a { cursor: pointer; outline: none; }
.lp-g a:focus-visible .lp-hit { stroke: var(--focus); stroke-width: 2; fill: rgba(240, 165, 72, 0.08); }
.lp-map.has-focus .lp-g:not(.is-lit) .lp-dot, .lp-map.has-focus .lp-g:not(.is-lit) .lp-label, .lp-map.has-focus .lp-g:not(.is-lit) { opacity: 0.35; }
.lp-g.is-lit .lp-label { fill: var(--ink); }
.lp-g.is-lit .lp-dot { r: 5; }
.lp-map.has-focus .lp-edges .lp-edge { stroke-opacity: 0.1; }
.lp-map-read.is-on span { color: var(--ink-2); }

.lp-listbox { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 14px; }
.lp-listbox summary { cursor: pointer; font-family: var(--font-data); font-size: var(--step--1); color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.lp-listbox summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.lp-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px 32px; }
.lp-list h3 { font-family: var(--font-data); font-weight: 500; font-size: var(--step--1); color: var(--muted); margin: 0 0 6px; }
.lp-list a { display: block; padding: 6px 0; font-size: var(--step--1); color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); min-height: 36px; }
.lp-list a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .lp-list a:hover { color: var(--accent); } }
.lp-lab-slot[hidden] { display: none; }
.lp-lab-slot { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.lp-lab-slot p { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: var(--step-0); }
.lp-lab-go { display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px; background: var(--accent); border: 1px solid var(--accent); color: #140a07; font-weight: 500; text-decoration: none; border-radius: 2px; }
.lp-lab-go:hover { background: var(--signal); border-color: var(--signal); }
.lp-lab-go:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

@media (max-width: 640px) {
  .lp-map-svg, .lp-map.is-built .lp-map-svg, .lp-map.is-built .lp-map-read { display: none; }
}

/* ---------- reduced motion: no pan, no sweep, no counting; every state is shown at once ---------- */
@media (prefers-reduced-motion: reduce) {
  .lp-hud button, .lp-edge, .lp-dot, .lp-label, .lp-gname { transition: none; }
}

/* the photon portrait, small, beside the years */
.lp-rec-side { display: grid; gap: 28px; align-content: start; }
.lp-portrait { max-width: 240px; }
.lp-portrait canvas { aspect-ratio: 4 / 5; }
@media (max-width: 760px) { .lp-portrait { max-width: 200px; } }
