/* All Roads: loads after css/site.css. Black page; the roads glow in the colour of how far away they are. */

:root {
  --ink: #f4f1ec;
  --ink-soft: #b3aca3;
  --ink-mute: #736d66;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --bg-elev: #0c0b0a;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --nav-h: 76px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --hot: #ff9a52;
}
body.roads { overflow-x: hidden; }
body.roads .cursor, body.roads .cursor-ring { display: none !important; }
:where(body.roads) canvas { display: block; }

/* ---------- head ---------- */
.u-head { padding: calc(var(--nav-h) + 30px) var(--gutter) 18px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 48px; }
.u-title h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 760; line-height: .9; letter-spacing: -.05em; margin: 0 0 .7rem; }
.u-stats { font-size: 1rem; color: var(--ink-soft); max-width: 38em; }
.u-switch { display: grid; gap: .6rem; justify-items: end; max-width: 720px; }
.u-tabs { display: inline-flex; gap: 26px; }
.u-tabs button { position: relative; padding: 6px 0; font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink-mute); white-space: nowrap; transition: color .2s var(--ease); }
.u-tabs button:hover, .u-tabs button[aria-selected="true"] { color: var(--ink); }
.u-tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--ink); }
.u-desc { font-size: .92rem; line-height: 1.45; color: var(--ink-soft); text-align: right; min-height: 1.5em; max-width: 34em; }
.u-stage { position: relative; }
.u-view { display: none; position: relative; }
.u-view.on { display: block; animation: uIn .6s var(--ease-out) both; }
@keyframes uIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- shared controls ---------- */
.chip-btn, .ctl {
  font-size: .86rem; font-weight: 500; line-height: 1.2;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: .42rem .75rem; color: var(--ink-soft); background: rgba(0, 0, 0, .35);
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease); white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45rem;
}
.chip-btn:hover, .ctl:hover { color: var(--ink); border-color: rgba(255, 255, 255, .34); }
.chip-btn[aria-pressed="true"], .ctl[aria-pressed="true"] { color: #000; background: var(--ink); border-color: var(--ink); }
.ctl svg { width: 16px; height: 16px; }
.lbl { font-size: .84rem; color: var(--ink-mute); }
.p-search { position: relative; }
.p-input, .r-input { width: 100%; font: inherit; font-size: .9rem; color: var(--ink); background: rgba(12, 11, 10, .9); border: 1px solid var(--line-strong); border-radius: 8px; padding: .45rem .75rem; outline: none; }
.p-input:focus, .r-input:focus { border-color: rgba(255, 255, 255, .5); }
.p-drop, .r-drop { position: absolute; left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: .3rem; background: #0c0b0a; border: 1px solid var(--line-strong); border-radius: 10px; display: none; min-width: 240px; }
.r-drop { bottom: calc(100% + 6px); }
.p-drop { top: calc(100% + 4px); }
.p-drop.on, .r-drop.on { display: block; }
.p-drop li, .r-drop li { display: flex; align-items: baseline; gap: .55rem; padding: .45rem .55rem; border-radius: 6px; font-size: .92rem; cursor: pointer; }
.p-drop li small, .r-drop li small { margin-left: auto; font-size: .76rem; color: var(--ink-mute); white-space: nowrap; }
.p-drop li[aria-selected="true"], .p-drop li:hover, .r-drop li[aria-selected="true"], .r-drop li:hover { background: rgba(255, 255, 255, .07); }
.p-drop li.none, .r-drop li.none { color: var(--ink-mute); cursor: default; }

/* ---------- From Rome ---------- */
.r-stage { position: relative; height: max(620px, calc(100svh - var(--nav-h) - 4px)); overflow: hidden; background: #000; }
.r-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.r-canvas:active { cursor: grabbing; }
.r-read { position: absolute; left: var(--gutter); top: 18px; z-index: 2; pointer-events: none; width: 250px; text-shadow: 0 0 10px #000, 0 0 3px #000; }
.r-from { font-size: .95rem; color: var(--ink-soft); }
.r-from b { color: var(--ink); font-weight: 650; }
.r-day { margin-top: .25rem; display: flex; flex-direction: column; }
.r-dn { font-size: clamp(2.2rem, 3.6vw, 3.2rem); font-weight: 760; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.r-at { min-height: 1.4em; margin-top: .3rem; font-size: 1rem; font-weight: 600; color: var(--hot); }
.r-count { font-size: .86rem; color: var(--ink-mute); }
.r-key { margin-top: 1.1rem; }
.r-ramp { position: relative; width: 190px; padding-bottom: 1.2rem; }
.r-ramp i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(to right, #fff4e0, #ffd08a 18%, #ff924a 40%, #e8452c 66%, #9e1f1f); }
.r-ramp span { position: absolute; top: 10px; font-size: .74rem; color: var(--ink-mute); }
.r-k0 { left: 0; }
.r-k1 { right: 0; }
.r-key p { margin: .35rem 0 0; font-size: .82rem; line-height: 1.5; color: var(--ink-mute); max-width: 230px; }
.r-card { position: absolute; right: var(--gutter); top: 18px; z-index: 4; width: 300px; padding: .95rem 1.05rem 1rem; background: rgba(10, 9, 8, .9); border: 1px solid var(--line-strong); border-radius: 12px; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.r-card.on { opacity: 1; transform: none; pointer-events: auto; }
.r-cn { display: block; padding-right: 1.6rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.r-card p { margin: .35rem 0 0; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }
.r-card .r-big { margin-top: .5rem; font-size: 1.9rem; font-weight: 760; letter-spacing: -.04em; line-height: 1; color: var(--hot); }
.r-x { position: absolute; top: .55rem; right: .6rem; width: 28px; height: 28px; font-size: 1.25rem; line-height: 1; color: var(--ink-mute); }
.r-x:hover { color: var(--ink); }
.r-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.r-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: 34px var(--gutter) 16px; background: linear-gradient(to top, rgba(0, 0, 0, .92) 55%, rgba(0, 0, 0, 0)); }
.r-play { width: 40px; height: 34px; justify-content: center; padding: 0; }
.r-scrub { flex: 1 1 260px; min-width: 160px; accent-color: var(--hot); }
.r-search { position: relative; width: 230px; }
.r-sep { width: 6px; }
.r-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding: 30px var(--gutter) 0; }
.r-fact b { display: block; font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: 730; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.r-fact span { display: block; margin-top: .35rem; font-size: .92rem; line-height: 1.5; color: var(--ink-soft); }
.r-note { padding: 22px var(--gutter) 0; margin: 0; font-size: .84rem; line-height: 1.55; color: var(--ink-mute); max-width: 60em; }

/* ---------- What We Know ---------- */
.k-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.2rem; padding: 6px var(--gutter) 14px; }
.k-lenses { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.k-hint { font-size: .84rem; color: var(--ink-mute); }
.k-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; padding: 0 var(--gutter); align-items: start; }
.k-stage { position: relative; height: min(76svh, 820px); min-height: 460px; border-radius: 6px; overflow: hidden; background: #000; }
.k-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.k-canvas:active { cursor: grabbing; }
.k-zoom { position: absolute; left: 12px; bottom: 12px; display: flex; gap: .35rem; }
.k-card { position: absolute; left: 12px; top: 12px; z-index: 3; max-width: 330px; padding: .75rem 2.2rem .8rem .9rem; background: rgba(10, 9, 8, .92); border: 1px solid var(--line-strong); border-radius: 12px; display: none; }
.k-card.on { display: block; }
.k-card b { display: block; font-size: .98rem; font-weight: 650; line-height: 1.3; }
.k-card small { display: block; margin-top: .2rem; font-size: .84rem; line-height: 1.45; color: var(--ink-soft); }
.k-side { position: sticky; top: calc(var(--nav-h) + 16px); display: grid; gap: .2rem; align-content: start; }
.k-lede { margin: 0 0 .5rem; font-size: 1.3rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.k-sub { margin: 0 0 1rem; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.k-h { margin: 1.2rem 0 .5rem; font-size: .84rem; color: var(--ink-mute); }
.k-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-bottom: .9rem; }
.k-stack i { display: block; min-width: 4px; }
.k-stack .c0 { background: #fff; }
.k-stack .c1 { background: rgba(255, 236, 214, .5); }
.k-stack .c2 { background: repeating-linear-gradient(90deg, rgba(255, 236, 214, .55) 0 3px, transparent 3px 6px); }
.k-certs, .k-eras, .k-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.k-cert, .k-era { width: 100%; text-align: left; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: .1rem .6rem; align-items: center; padding: .55rem .65rem; border: 1px solid transparent; border-radius: 10px; transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.k-cert:hover, .k-era:hover { background: rgba(255, 255, 255, .04); }
.k-cert.on, .k-era.on { border-color: var(--line-strong); background: rgba(255, 255, 255, .05); }
.k-cert b, .k-era b { font-size: .95rem; font-weight: 650; color: var(--ink); }
.k-cert em, .k-era em { font-style: normal; font-size: .86rem; color: var(--ink-soft); }
.k-cert small, .k-era small { grid-column: 2 / -1; font-size: .8rem; line-height: 1.45; color: var(--ink-mute); }
.k-sw { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.k-sw.c0 { background: #fff; }
.k-sw.c1 { background: rgba(255, 236, 214, .45); filter: blur(.6px); }
.k-sw.c2 { background: rgba(255, 236, 214, .5); filter: blur(2px); }
.k-tipline { margin: .4rem 0 0; font-size: .8rem; color: var(--ink-mute); }
.k-row { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) 90px 50px; gap: .1rem .6rem; align-items: center; padding: .38rem .5rem; border-radius: 8px; transition: background-color .2s var(--ease); }
.k-row:hover { background: rgba(255, 255, 255, .05); }
.k-row.on { background: rgba(255, 255, 255, .09); }
.k-nm { font-size: .9rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-bar-v { height: 4px; background: rgba(255, 255, 255, .07); border-radius: 2px; overflow: hidden; }
.k-bar-v i { display: block; height: 100%; background: var(--ink-soft); }
.k-km { text-align: right; font-size: .8rem; color: var(--ink-mute); }
.k-row small { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-mute); }
.k-scroll { max-height: 420px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.k-srcs { display: flex; flex-wrap: wrap; gap: .35rem; }
.k-pick { margin: 0 0 1rem; padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: 10px; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }
.k-pick b { display: block; color: var(--ink); font-weight: 650; }
.k-clear { margin-top: .3rem; font-size: .8rem; color: var(--ink-mute); text-decoration: underline; text-underline-offset: 3px; }
.k-time { display: none; padding: 22px 0 0; }
.k-time.on { display: block; }
.k-time .k-h { margin-top: 0; }
.k-time svg { display: block; width: 100%; height: auto; overflow: visible; }
.k-tick { stroke: rgba(255, 255, 255, .07); }
.k-tt { font-size: 11px; fill: var(--ink-mute); }
.k-dot { stroke: #000; stroke-width: .8; cursor: pointer; transition: opacity .2s; }
.k-dot:hover { stroke: #fff; stroke-width: 1.5; }
.k-dot.off { opacity: .22; }
.k-dot.on { stroke: #fff; stroke-width: 1.5; }
.k-dl { font-size: 11px; font-weight: 600; fill: var(--ink-soft); pointer-events: none; paint-order: stroke; stroke: #000; stroke-width: 3px; }

/* ---------- A Journey ---------- */
.t-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.4rem; padding: 6px var(--gutter) 16px; }
.t-pick { display: flex; align-items: flex-end; gap: .5rem; }
.t-f { display: grid; gap: .3rem; width: 230px; }
.t-f .p-input::placeholder { color: var(--ink); opacity: .92; }
.t-f .p-input:focus::placeholder { color: var(--ink-mute); }
.t-swap { height: 36px; width: 38px; padding: 0; justify-content: center; }
.t-presets { display: flex; flex-wrap: wrap; gap: .35rem; max-width: 760px; justify-content: flex-end; }
.t-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; padding: 0 var(--gutter); align-items: start; }
.t-stage { position: relative; height: min(66svh, 700px); min-height: 420px; border-radius: 6px; overflow: hidden; background: #000; }
.t-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.t-canvas:active { cursor: grabbing; }
.t-hud { position: absolute; left: 14px; top: 12px; pointer-events: none; display: flex; align-items: baseline; gap: .7rem; text-shadow: 0 0 8px #000, 0 0 3px #000; }
.t-day { font-size: 1.5rem; font-weight: 740; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.t-here { font-size: .95rem; font-weight: 600; color: var(--hot); }
.t-ctl { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: .8rem; }
.t-go { font-weight: 600; color: var(--ink); border-color: rgba(255, 255, 255, .34); }
.t-hint { font-size: .8rem; color: var(--ink-mute); text-shadow: 0 0 6px #000; }
.t-prof { padding-top: 14px; }
.t-prof svg { display: block; width: 100%; height: auto; overflow: visible; }
.t-area rect { fill: rgba(255, 255, 255, .16); }
.t-band rect.c0 { fill: #fff; }
.t-band rect.c1 { fill: rgba(255, 236, 214, .42); }
.t-band rect.c2 { fill: rgba(255, 236, 214, .16); }
.t-night { stroke: rgba(255, 255, 255, .28); stroke-width: 1; }
.t-night.big { stroke: rgba(255, 255, 255, .6); }
.t-tl { font-size: 10.5px; fill: var(--ink-mute); }
.t-wp { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 2 3; }
.t-wl { font-size: 11px; font-weight: 600; fill: var(--ink-soft); }
.t-ax { font-size: 10.5px; fill: var(--ink-mute); }
.t-head { stroke: var(--hot); stroke-width: 2; }
.t-hit { fill: transparent; cursor: crosshair; }
.t-key { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .5rem 0 0; font-size: .8rem; color: var(--ink-mute); }
.t-key span { display: inline-flex; align-items: center; gap: .4rem; }
.t-key i { width: 14px; height: 6px; border-radius: 2px; }
.t-key i.c0 { background: #fff; }
.t-key i.c1 { background: rgba(255, 236, 214, .42); }
.t-key i.c2 { background: rgba(255, 236, 214, .16); box-shadow: inset 0 0 0 1px rgba(255, 236, 214, .25); }
.t-key i.t-nk { width: 1px; height: 9px; background: rgba(255, 255, 255, .6); }
.t-side { position: sticky; top: calc(var(--nav-h) + 16px); }
.t-big { margin: 0; font-size: clamp(2.2rem, 3.4vw, 3rem); font-weight: 780; letter-spacing: -.045em; line-height: 1; color: var(--hot); }
.t-lede { margin: .35rem 0 .7rem; font-size: 1.05rem; font-weight: 650; line-height: 1.3; }
.t-sub { margin: 0 0 .8rem; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.t-stack { margin: .2rem 0 .6rem; }
.t-list { list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 340px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.t-list li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .32rem .45rem; border-radius: 6px; font-size: .86rem; cursor: pointer; }
.t-list li:hover { background: rgba(255, 255, 255, .05); }
.t-list li.on { background: rgba(255, 154, 82, .14); }
.t-list b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.t-list span { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-list em { font-style: normal; font-size: .78rem; color: var(--ink-mute); }
.t-list li.end b, .t-list li.end span { color: var(--hot); }
.t-fine { margin: .8rem 0 0; font-size: .78rem; color: var(--ink-mute); }

/* ---------- tooltip ---------- */
.u-tip {
  position: fixed; left: 0; top: 0; z-index: 170; pointer-events: none; max-width: 320px;
  background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem .75rem;
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.u-tip.show { opacity: 1; transform: none; }
.u-tip b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.u-tip small { display: block; margin-top: .15rem; font-size: .82rem; line-height: 1.4; color: var(--ink-soft); }

/* ---------- footer ---------- */
.u-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; padding: 1.6rem var(--gutter) 2rem; margin-top: 2.4rem; border-top: 1px solid var(--line); font-size: .86rem; line-height: 1.5; color: var(--ink-mute); }
.u-foot > span { max-width: 46em; }
.u-foot a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.u-foot a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .r-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-wrap, .t-wrap { grid-template-columns: minmax(0, 1fr) 290px; }
  .t-presets { justify-content: flex-start; }
}
@media (max-width: 900px) {
  .u-switch { justify-items: start; }
  .u-desc { text-align: left; }
  .k-wrap, .t-wrap { grid-template-columns: minmax(0, 1fr); }
  .k-side, .t-side { position: static; }
  .k-stage { height: 64svh; min-height: 380px; }
  .t-stage { height: 56svh; min-height: 360px; }
  .k-canvas, .t-canvas { touch-action: pan-y; }
}
@media (max-width: 860px) { :root { --nav-h: 64px; } }
@media (max-width: 760px) {
  .r-stage { height: auto; overflow: visible; display: flex; flex-direction: column; }
  .r-canvas { position: relative; inset: auto; height: 62svh; min-height: 380px; order: 2; touch-action: pan-y; }
  .r-read { position: static; order: 1; width: auto; padding: 0 var(--gutter) 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem 1rem; align-items: end; }
  .r-from { grid-column: 1 / -1; }
  .r-day { margin: 0; }
  .r-at { margin: 0; }
  .r-count { align-self: end; padding-bottom: .35rem; }
  .r-key { grid-column: 1 / -1; margin-top: .5rem; }
  .r-key p { max-width: none; }
  .r-dock { position: static; order: 3; padding: 12px var(--gutter) 0; background: none; }
  .r-search { width: 100%; order: 5; }
  .r-sep { display: none; }
  .r-card { position: static; order: 4; width: auto; margin: 12px var(--gutter) 0; display: none; }
  .r-card.on { display: block; }
  .r-facts { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  .u-switch { width: 100%; }
  .u-tabs { width: 100%; justify-content: space-between; gap: 12px; }
  .u-tabs button { font-size: .95rem; }
  .t-pick { width: 100%; }
  .t-f { width: auto; flex: 1; }
  .t-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .u-view.on { animation: none; } }
