/* The Life Manual — home page, v2 "The Road".
   Styles only #hero, #road (with the #days index), #journey and #how. Tokens, shell and .btn come from site.css;
   everything here has its own fallbacks so the page stands even while site.css is being rewritten. */

/* Type: the faces are declared once, in site.css, which every page loads first. */

#hero, #road, #journey, #how {
  --hf-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --hf-body: "Lora", "Iowan Old Style", Georgia, serif;
  --hf-ui: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --h-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --h-paper: #F7F6F1;
  --h-deep: #EFEBE1;
  --h-navy: #14263F;
  --h-navy2: #26415F;
  --h-gold: #C4A05A;
  --h-gold2: #E3CF9E;
  --h-gold-deep: #9C7A3C;
  --h-bg: var(--bg, #F7F6F1);
  --h-fg: var(--fg, #26313F);
  --h-fg2: var(--fg2, #5E6875);
  --h-line: var(--line, #D8D4C8);
  --h-head: var(--heading, #14263F);
  --h-gutter: clamp(1rem, 4vw, 3rem);
  --h-wide: 76rem;
  --h-top: var(--topbar-h, 3.5rem);
}
.page-home main { overflow-x: clip; }

.hd-title, .sec-title, .road-title, .hero-title {
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
}

/* =================================================================== HERO: the sky at this hour */

#hero {
  /* dawn is the default; site.css's --sky-* tokens win when defined */
  --h-sky-a: var(--sky-a, #0F1B33);
  --h-sky-b: var(--sky-b, #2C3558);
  --h-sky-c: var(--sky-c, #9A6C6B);
  --h-sky-d: var(--sky-d, #E8B86A);
  --h-sun-a: var(--sun-a, #F3E3B6);
  --h-sun-b: var(--sun-b, #D8B673);
  --h-sun-c: var(--sun-c, #B98F45);
  --h-land-a: #1D2140;
  --h-land-b: #0D1629;
  --h-land-near: #0B1426;
  --h-halo: 0.34;
  --h-stars: 0.28;
  --sun-x: 1180px;
  --sun-y: 716px;
  --sun-show: 1;
  --rise-from: 150px;
  --h-text: #F6F2E8;
  --h-text2: rgba(246, 242, 232, 0.8);

  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(36rem, calc(100svh - var(--h-top)), 64rem);
  display: flex; flex-direction: column; justify-content: center;
  background: var(--h-sky-a);
  color: var(--h-text);
}
:root[data-daypart="day"] #hero {
  --h-sky-a: var(--sky-a, #14263F);
  --h-sky-b: var(--sky-b, #2B4A73);
  --h-sky-c: var(--sky-c, #6F8FB8);
  --h-sky-d: var(--sky-d, #B9C9DC);
  --h-sun-a: var(--sun-a, #FBF4DF);
  --h-sun-b: var(--sun-b, #F6EBCB);
  --h-sun-c: var(--sun-c, #E3CF9E);
  --h-land-a: #34506F;
  --h-land-b: #1A2F4B;
  --h-land-near: #172A44;
  --h-halo: 0.42;
  --h-stars: 0;
  --sun-x: 1250px;
  --sun-y: 262px;
  --rise-from: 300px;
}
:root[data-daypart="dusk"] #hero {
  --h-sky-a: var(--sky-a, #1A1830);
  --h-sky-b: var(--sky-b, #3A3556);
  --h-sky-c: var(--sky-c, #9C5B5C);
  --h-sky-d: var(--sky-d, #E3A868);
  --h-sun-a: var(--sun-a, #F5D9A8);
  --h-sun-b: var(--sun-b, #E0A868);
  --h-sun-c: var(--sun-c, #C4735A);
  --h-land-a: #241E38;
  --h-land-b: #120F22;
  --h-land-near: #100D1E;
  --h-stars: 0.12;
  --sun-x: 1120px;
  --sun-y: 668px;
  --rise-from: -40px; /* at dusk the sun settles rather than rises */
}
:root[data-daypart="night"] #hero {
  --h-sky-a: var(--sky-a, #05091A);
  --h-sky-b: var(--sky-b, #0B1730);
  --h-sky-c: var(--sky-c, #14263F);
  --h-sky-d: var(--sky-d, #1A3050);
  --h-land-a: #0B1529;
  --h-land-b: #050A18;
  --h-land-near: #040816;
  --h-stars: 1;
  --sun-show: 0;
}

.hero-sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hs-a { stop-color: var(--h-sky-a); }
.hs-b { stop-color: var(--h-sky-b); }
.hs-c { stop-color: var(--h-sky-c); }
.hs-d { stop-color: var(--h-sky-d); }
.hs-sa { stop-color: var(--h-sun-a); }
.hs-sb { stop-color: var(--h-sun-b); }
.hs-sc { stop-color: var(--h-sun-c); }
.hs-ha { stop-color: var(--h-sun-a); stop-opacity: var(--h-halo); }
.hs-hb { stop-color: var(--h-sun-b); stop-opacity: calc(var(--h-halo) * 0.3); }
.hs-hc { stop-color: var(--h-sun-b); stop-opacity: 0; }
.hs-la { stop-color: var(--h-land-a); }
.hs-lb { stop-color: var(--h-land-b); }

.hero-stars { fill: #E3CF9E; opacity: var(--h-stars); transition: opacity 0.9s var(--h-ease); }
.hero-bright path { stroke: #E3CF9E; }
.hero-sunpos { transform: translate(var(--sun-x), var(--sun-y)); opacity: var(--sun-show); }
.hero-rays path { stroke: var(--h-sun-b); stroke-width: 1; stroke-linecap: round; opacity: 0.5; }
.hero-land { transform: translateX(var(--sun-x)); }
.hl-hills { fill: var(--h-land-a); opacity: 0.9; }
.hl-near { fill: var(--h-land-near); opacity: 0.65; }
.hl-road { fill: var(--h-sun-b); opacity: 0.08; }
.hl-edge { fill: none; stroke: var(--h-sun-b); stroke-width: 1; opacity: 0.55; }
.hl-furrows { fill: none; stroke: var(--h-sun-b); stroke-width: 0.8; stroke-linecap: round; opacity: 0.16; }
.hl-horizon { stroke: var(--h-gold); stroke-width: 1; opacity: 0.8; }
:root[data-daypart="night"] .hl-edge { opacity: 0.3; }
:root[data-daypart="night"] .hl-road { opacity: 0.04; }

/* The one orchestrated moment: the sun rises once. */
@media (prefers-reduced-motion: no-preference) {
  .hero-sunrise { animation: hero-rise 1.9s var(--h-ease) 0.15s both; }
  .hero-halo { animation: hero-glow 2.4s var(--h-ease) 0.3s both; }
  :root[data-daypart="night"] .hero-stars { animation: hero-glow 1.6s var(--h-ease) 0.2s both; }
}
@keyframes hero-rise { from { transform: translateY(var(--rise-from)); } to { transform: none; } }
@keyframes hero-glow { from { opacity: 0; } }

.hero-inner {
  position: relative;
  width: 100%; max-width: calc(var(--h-wide) + 2 * var(--h-gutter));
  margin: 0 auto; padding: clamp(3rem, 9vh, 7rem) var(--h-gutter) clamp(10rem, 30vh, 17rem);
}
.hero-title {
  margin: 0; max-width: 11ch;
  font: 300 clamp(3.4rem, 9.6vw, 9rem)/0.93 var(--hf-display);
  letter-spacing: -0.025em; color: var(--h-text);
  text-wrap: balance;
}
.hero-tag {
  margin: clamp(1rem, 2.4vh, 1.6rem) 0 0;
  font: italic 300 clamp(1.25rem, 2.2vw, 1.75rem)/1.3 var(--hf-display);
  color: var(--h-gold2);
}
.hero-prog { font-style: normal; font-weight: 400; }
.hero-dash { opacity: 0.7; }
.hero-lede {
  max-width: 31rem; margin: clamp(1.25rem, 3vh, 2rem) 0 0;
  font: 400 clamp(1rem, 1.25vw, 1.125rem)/1.7 var(--hf-body); color: var(--h-text2);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(1.75rem, 4vh, 2.5rem); }
#hero .btn { font-family: var(--hf-ui); font-weight: 500; }
#hero .btn-ghost { color: var(--h-text); border-color: rgba(227, 207, 158, 0.7); background: rgba(5, 9, 26, 0.12); }
#hero .btn-ghost:hover { background: rgba(227, 207, 158, 0.14); }
#hero .btn:focus-visible { outline: 2px solid var(--h-gold2); outline-offset: 3px; }
.hero-progress { margin: 1rem 0 0; max-width: 34rem; font: 400 0.8125rem/1.6 var(--hf-ui); color: var(--h-text2); }
.hero-progress[hidden] { display: none; }
.hero-by { margin: 1.5rem 0 0; font: 400 0.8125rem/1.4 var(--hf-ui); color: var(--h-text2); opacity: 0.8; }

@media (max-aspect-ratio: 6/5) {
  #hero { --sun-x: 930px; }
  :root[data-daypart="day"] #hero { --sun-x: 960px; --sun-y: 560px; --rise-from: 160px; }
  :root[data-daypart="dusk"] #hero { --sun-x: 900px; }
}
@media (max-width: 560px) {
  #hero { --sun-x: 860px; }
  :root[data-daypart="dusk"] #hero { --sun-x: 840px; }
  .hero-inner { padding-top: 2.5rem; padding-bottom: 15rem; }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* =================================================================== THE ROAD */

#road {
  --rd-bg: var(--h-bg);
  --rd-ink: #26415F;
  --rd-surface: #F0EBDE;
  --rd-stone: #F9F8F4;
  --rd-fg: var(--h-fg);
  --rd-fg2: var(--h-fg2);
  --rd-gold: #C4A05A;
  --rd-num: #14263F;
  position: relative;
  background: var(--rd-bg);
  color: var(--rd-fg);
  border-bottom: 1px solid var(--h-line);
}
:root[data-theme="night"] #road {
  --rd-ink: #A9B8CA;
  --rd-surface: #172B46;
  --rd-stone: #1B3252;
  --rd-num: #F3F0E8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #road {
    --rd-ink: #A9B8CA;
    --rd-surface: #172B46;
    --rd-stone: #1B3252;
    --rd-num: #F3F0E8;
  }
}

.road-runway { position: relative; }
.road-stage {
  position: relative; overflow: hidden;
  height: clamp(32rem, 82svh, 54rem);
}
.road-sky { position: absolute; inset: 0; background: var(--rd-bg); }
.road-scroller {
  position: absolute; inset: 0;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--h-line) transparent;
}
.road-track { position: relative; height: 100%; aspect-ratio: 4400 / 900; }
.road-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }

/* Pinned: the section becomes a runway; the stage stays put while the scene travels past. */
#road.is-pinned .road-stage {
  position: sticky; top: var(--h-top);
  height: calc(100svh - var(--h-top));
}
#road.is-pinned .road-scroller { overflow: clip; }
#road.is-pinned .road-track { transform: translate3d(calc(var(--p, 0) * var(--pan, 0) * -1px), 0, 0); will-change: transform; }
#road.is-pinned .road-far { transform: translate3d(calc(var(--p, 0) * var(--pan, 0) * 0.3px), 0, 0); }
#road.is-pinned .road-mid { transform: translate3d(calc(var(--p, 0) * var(--pan, 0) * 0.12px), 0, 0); }
#road.is-pinned .road-sunwrap { transform: translate3d(0, calc(var(--p, 0) * -40%), 0); }

@supports (animation-timeline: view()) {
  #road.is-pinned .road-runway { view-timeline: --road block; view-timeline-inset: var(--h-top) 0; }
  #road.is-pinned .road-track { animation: rd-pan linear both; animation-timeline: --road; animation-range: contain 0% contain 100%; }
  #road.is-pinned .road-far { animation: rd-far linear both; animation-timeline: --road; animation-range: contain 0% contain 100%; }
  #road.is-pinned .road-mid { animation: rd-mid linear both; animation-timeline: --road; animation-range: contain 0% contain 100%; }
  #road.is-pinned .road-sunwrap { animation: rd-climb linear both; animation-timeline: --road; animation-range: contain 0% contain 100%; }
}
@keyframes rd-pan { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(var(--pan, 0) * -1px), 0, 0); } }
@keyframes rd-far { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(var(--pan, 0) * 0.3px), 0, 0); } }
@keyframes rd-mid { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(var(--pan, 0) * 0.12px), 0, 0); } }
@keyframes rd-climb { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -40%, 0); } }

/* the sun ahead: it does not travel with the land; it climbs as the reader travels */
.road-sunwrap { position: absolute; inset: 0; pointer-events: none; }
.road-sun {
  position: absolute; left: 82%; top: 59%;
  height: 34%; width: auto; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  overflow: visible;
}
.rs-rays path { stroke: var(--rd-gold); stroke-width: 1; stroke-linecap: round; opacity: 0.62; fill: none; }
.rs-ring { fill: none; stroke: var(--rd-gold); stroke-width: 0.8; opacity: 0.55; }

/* overlay: the heading and the signboard */
.road-overlay {
  position: absolute; inset: 0; pointer-events: none;
  padding: clamp(1.5rem, 5vh, 3.25rem) max(var(--h-gutter), calc((100% - var(--h-wide)) / 2));
}
.road-overlay { display: flex; flex-direction: column; align-items: flex-start; }
.road-head { max-width: 27rem; }
@media (min-width: 1200px) {
  .road-overlay { flex-direction: row; align-items: flex-start; gap: clamp(2rem, 4vw, 4rem); }
  .road-overlay .road-sign { margin-top: 0.6rem; }
}
.road-title {
  margin: 0; font: 300 clamp(2.6rem, 5.2vw, 4.5rem)/1 var(--hf-display);
  letter-spacing: -0.02em; color: var(--h-head);
}
.road-lede {
  margin: 0.9rem 0 0; font: italic 400 clamp(1rem, 1.2vw, 1.0625rem)/1.6 var(--hf-body); color: var(--rd-fg2);
}
.road-sign {
  margin-top: clamp(1.1rem, 3vh, 2rem);
  width: min(22rem, 100%);
  padding: 0.9rem 1.1rem 1rem;
  background: color-mix(in srgb, var(--rd-bg) 86%, transparent);
  border: 1px solid var(--h-line); border-radius: 6px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.road-sign[hidden] { display: none; }
.road-sign p { margin: 0; }
.rs-k { display: flex; gap: 0.9rem; font: 500 0.75rem/1.3 var(--hf-ui); color: var(--rd-fg2); font-variation-settings: "opsz" 14; }
.rs-day { color: var(--h-head); }
.rs-title { margin-top: 0.35rem !important; font: 400 1.6rem/1.1 var(--hf-display); color: var(--h-head); letter-spacing: -0.01em; }
.rs-sub { margin-top: 0.3rem !important; font: italic 400 0.9375rem/1.45 var(--hf-body); color: var(--rd-fg2); text-wrap: pretty; }
.rs-sub:empty { display: none; }
.rs-meta { margin-top: 0.65rem !important; display: grid; gap: 0.15rem; font: 400 0.8125rem/1.4 var(--hf-ui); color: var(--rd-fg); }
.rs-meta span:empty { display: none; }
.rs-state { margin-top: 0.6rem !important; font: 500 0.75rem/1.3 var(--hf-ui); color: var(--rd-fg2); display: flex; align-items: center; gap: 0.45rem; }
.rs-state::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; border: 1px solid currentColor; }
.road-sign.is-live .rs-state { color: var(--h-head); }
.road-sign.is-live .rs-state::before { background: var(--rd-gold); border-color: var(--rd-gold); }
.road-sign.is-soon .rs-title { color: var(--rd-fg2); }

.road-hint {
  position: absolute; right: max(var(--h-gutter), calc((100% - var(--h-wide)) / 2)); bottom: clamp(1rem, 3vh, 2rem);
  margin: 0; display: none; align-items: center; gap: 0.6rem;
  font: 500 0.75rem/1 var(--hf-ui); color: var(--rd-fg2);
  transition: opacity 0.5s var(--h-ease);
}
.road-hint i { display: block; width: 2.5rem; height: 1px; background: var(--rd-fg2); position: relative; }
.road-hint i::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1px solid var(--rd-fg2); border-right: 1px solid var(--rd-fg2); transform: rotate(45deg); }
#road.is-pinned .road-hint { display: flex; }
#road.is-moving .road-hint { opacity: 0; }

/* ---- the scene's line language */
.rd-stars { display: none; fill: #E3CF9E; }
:root[data-theme="night"] .rd-stars { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rd-stars { display: inline; } }
.rd-birds { fill: none; stroke: var(--rd-ink); stroke-width: 1; stroke-linecap: round; opacity: 0.55; }
.rd-ridge-fill { fill: var(--rd-bg); stroke: var(--rd-ink); stroke-width: 1.1; stroke-linejoin: round; }
.rd-ridge-hatch { fill: none; stroke: var(--rd-ink); stroke-width: 0.75; stroke-linecap: round; opacity: 0.32; }
.rd-ridge[data-stage="7"] .rd-ridge-fill { stroke-opacity: 0.35; }
.rd-ridge[data-stage="6"] .rd-ridge-fill { stroke-opacity: 0.42; }
.rd-ridge[data-stage="5"] .rd-ridge-fill { stroke-opacity: 0.5; }
.rd-ridge[data-stage="4"] .rd-ridge-fill { stroke-opacity: 0.58; }
.rd-ridge[data-stage="3"] .rd-ridge-fill { stroke-opacity: 0.66; }
.rd-ridge[data-stage="2"] .rd-ridge-fill { stroke-opacity: 0.74; }
.rd-ridge[data-stage="1"] .rd-ridge-fill { stroke-opacity: 0.82; }
.rd-ground { fill: var(--rd-bg); }
.rd-horizon { stroke: var(--rd-ink); stroke-width: 0.9; opacity: 0.45; }
.rd-stage { fill: var(--rd-ink); font-family: var(--hf-display); }
.rd-stage-n { font-size: 30px; font-weight: 300; fill: var(--rd-gold); }
.rd-stage-name { font-size: 17px; font-style: italic; font-weight: 400; }

.rd-furrow { fill: none; stroke: var(--rd-ink); stroke-width: 0.9; opacity: 0.2; }
.rd-tree { fill: var(--rd-bg); stroke: var(--rd-ink); stroke-width: 1; stroke-linejoin: round; }
.rd-trunk { fill: none; stroke: var(--rd-ink); stroke-width: 1.2; }
.rd-tree-hatch { fill: none; stroke: var(--rd-ink); stroke-width: 0.7; opacity: 0.5; stroke-linecap: round; }

.rd-road { fill: var(--rd-surface); }
.rd-stipple { fill: none; stroke: var(--rd-ink); stroke-width: 1.5; stroke-linecap: round; opacity: 0.3; }
.rd-rut { fill: none; stroke: var(--rd-ink); stroke-width: 0.9; opacity: 0.12; }
.rd-edge { fill: none; stroke: var(--rd-ink); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.rd-path { fill: none; stroke: var(--rd-gold); stroke-width: 1.4; stroke-linejoin: round; opacity: 0.85; transform: translateY(2.5px); }
.rd-tuft { fill: none; stroke: var(--rd-ink); stroke-width: 0.9; stroke-linecap: round; opacity: 0.7; }
.rd-pebble ellipse { fill: var(--rd-stone); stroke: var(--rd-ink); stroke-width: 0.8; }
.rd-fg { fill: none; stroke: var(--rd-ink); stroke-width: 0.8; stroke-linecap: round; opacity: 0.28; }
.rd-week line { stroke: var(--rd-gold); stroke-width: 1.2; }
.rd-week-n { font: 500 15px var(--hf-ui); fill: var(--rd-fg); }
.rd-week-name { font: italic 400 17px var(--hf-display); fill: var(--rd-fg2); }
.rd-goal-name { font: 300 38px var(--hf-display); fill: var(--h-head); letter-spacing: -0.01em; }
.rd-goal-gloss { font: italic 400 17px var(--hf-body); fill: var(--rd-fg2); }

/* milestones */
.rd-ms { outline: none; }
.rd-ms.is-live { cursor: pointer; }
.ms-hit { fill: transparent; }
.ms-halo { fill: var(--rd-gold); opacity: 0; transition: opacity 0.35s var(--h-ease); }
.ms-shadow { fill: var(--rd-ink); opacity: 0.14; }
.ms-stone { fill: var(--rd-stone); stroke: var(--rd-ink); stroke-width: 1.3; transition: stroke 0.16s, stroke-width 0.16s; }
.ms-hatch { fill: none; stroke: var(--rd-ink); stroke-width: 0.8; opacity: 0.45; stroke-linecap: round; }
.ms-n { font: 400 21px var(--hf-display); fill: var(--rd-num); font-variant-numeric: lining-nums; }
.rd-ms.is-soon .ms-stone { stroke-opacity: 0.5; }
.rd-ms.is-soon .ms-hatch { opacity: 0.22; }
.rd-ms.is-soon .ms-n { fill: var(--rd-fg2); opacity: 0.85; }
.ms-tick { display: none; }
.ms-tick circle { fill: var(--rd-gold); }
.ms-tick path { fill: none; stroke: #14263F; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rd-ms.is-done .ms-tick { display: inline; }
.rd-ms.is-current .ms-stone { stroke: var(--rd-gold); stroke-width: 2.2; }
.rd-ms.is-current .ms-halo { opacity: 0.16; }
.rd-ms.is-active .ms-halo { opacity: 0.2; }
.rd-ms.is-live:hover .ms-stone, .rd-ms.is-live:focus-visible .ms-stone { stroke: var(--rd-gold); stroke-width: 2.2; }
.rd-ms:focus-visible .ms-halo { opacity: 0.3; stroke: var(--rd-num); stroke-width: 1.2; stroke-dasharray: 3 3; }

/* the Traveller */
.rd-cart { transition: transform 0.9s var(--h-ease); pointer-events: none; }
.cart-shadow { fill: var(--rd-ink); opacity: 0.12; }
.cv-body, .cv-seat, .cv-fig, .cv-head, .cv-wheel { fill: var(--rd-stone); stroke: var(--rd-ink); stroke-width: 1.3; stroke-linejoin: round; }
.cv-spokes { stroke: var(--rd-ink); stroke-width: 0.8; }
.cv-hub { fill: var(--rd-gold); }
.cv-dot { fill: var(--rd-gold); }

/* the vertical road (phones) */
.road-vwrap { display: none; }
.road-vertical { display: block; width: 100%; max-width: 28rem; height: auto; margin: 0 auto; overflow: visible; }
.rv-ridge { fill: none; stroke: var(--rd-ink); stroke-width: 1; opacity: 0.55; }
.rv-stage .rd-stage-n { font-size: 22px; }
.rv-stage .rd-stage-name { font-size: 14px; }
.rv-week .rd-week-n { font-size: 13px; }
.rv-week .rd-week-name { font-size: 16px; }
.rv-title { font: 400 17px var(--hf-display); fill: var(--h-head); }
.rd-ms.is-soon .rv-title { fill: var(--rd-fg2); opacity: 0.85; }
.rv-value { font: 400 12px var(--hf-ui); fill: var(--rd-fg2); }
.rv-sub { font: 400 12px var(--hf-ui); fill: var(--rd-fg2); }   /* the day's subtitle; 12px is build.py ROAD_TAG_SIZE (Hindi re-wrap) */
.rv-lead { stroke: var(--rd-ink); stroke-width: 0.8; stroke-dasharray: 1 3; opacity: 0.4; }
.rv-gloss { font-size: 14px; }
.rd-ms.is-current .rv-title { fill: var(--h-head); }
.rv-sun .rs-disc { fill: #D8B673; }

@media (max-width: 760px), (max-height: 540px) {
  .road-stage { height: auto; overflow: visible; }
  .road-sky, .road-sunwrap, .road-scroller, .road-sign, .road-hint { display: none !important; }
  .road-overlay { position: static; padding: clamp(3.5rem, 12vw, 5rem) var(--h-gutter) 1.5rem; pointer-events: auto; }
  .road-vwrap { display: block; padding: 0 var(--h-gutter) 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  #road .road-track, #road .road-far, #road .road-mid, #road .road-sunwrap { animation: none !important; }
  .rd-cart { transition: none; }
}

/* ---- the index of days (#days): the plain list everything else can rest on */
.road-index {
  max-width: calc(var(--h-wide) + 2 * var(--h-gutter)); margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--h-gutter) clamp(4rem, 8vw, 6.5rem);
}
.ri-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--h-line); }
.ri-h { margin: 0; font: 400 clamp(1.5rem, 2.4vw, 1.9rem)/1.15 var(--hf-display); color: var(--h-head); letter-spacing: -0.01em; }
.ri-note { margin: 0; font: 400 0.875rem/1.5 var(--hf-ui); color: var(--h-fg2); }
.ri-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(1.5rem, 3.5vw, 3.5rem); }
.ri-week-h { margin: 1.5rem 0 0.6rem; display: flex; align-items: baseline; gap: 0.6rem; font-weight: 400; }
.ri-week-n { font: 500 0.8125rem/1.3 var(--hf-ui); color: var(--h-fg2); }
.ri-week-name { font: italic 400 1.125rem/1.3 var(--hf-display); color: var(--h-head); }
.ri-list { list-style: none; margin: 0; padding: 0; }
.ri + .ri { border-top: 1px solid color-mix(in srgb, var(--h-line) 70%, transparent); }
.ri-link { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.2rem 0.5rem; padding: 0.6rem 0; color: inherit; text-decoration: none; }
.ri-n {
  position: relative; align-self: start; justify-self: start;
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  font: 300 1.05rem/1 var(--hf-display); font-variant-numeric: lining-nums; color: var(--h-head);
  border: 1px solid transparent;
}
.ri-body { display: grid; gap: 0.1rem; min-width: 0; }
.ri-title { font: 400 1.0625rem/1.3 var(--hf-display); color: var(--h-head); }
.ri-sub { font: italic 400 0.875rem/1.45 var(--hf-body); color: var(--h-fg2); }
.ri-tag { margin-top: 0.15rem; font: 400 0.8125rem/1.45 var(--hf-body); color: var(--h-fg); text-wrap: pretty; }
a.ri-link .ri-title { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: text-decoration-color 0.16s; }
a.ri-link:hover .ri-title, a.ri-link:focus-visible .ri-title { text-decoration-color: var(--h-gold); }
a.ri-link:focus-visible { outline: 2px solid var(--h-gold); outline-offset: 2px; border-radius: 4px; }
a.ri-link .ri-n { border-color: color-mix(in srgb, var(--h-gold) 70%, transparent); }
.ri.is-soon .ri-link { opacity: 0.62; }
.ri.is-current .ri-n { border-color: var(--h-gold); background: var(--h-gold); color: #14263F; }
.ri.is-done .ri-n::after {
  content: ""; position: absolute; right: -0.3rem; top: -0.3rem; width: 0.8rem; height: 0.8rem; border-radius: 50%;
  background: var(--h-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%2314263F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
@media (max-width: 900px) {
  .ri-cols { grid-template-columns: minmax(0, 1fr); }
}

/* =================================================================== shared section frame */

#journey, #how { padding: clamp(5rem, 10vw, 9rem) 0; }
#how { padding-bottom: 0; border-top: 1px solid var(--h-line); }
.sec-wrap { max-width: calc(var(--h-wide) + 2 * var(--h-gutter)); margin: 0 auto; padding: 0 var(--h-gutter); }
.sec-head { max-width: 44rem; }
.sec-title {
  margin: 0; font: 300 clamp(2.4rem, 4.6vw, 3.75rem)/1.02 var(--hf-display);
  letter-spacing: -0.02em; color: var(--h-head);
}
.sec-head::after {
  content: ""; display: block; width: 3.5rem; height: 1px; margin-top: 1.75rem; background: var(--h-gold);
  transform-origin: left center;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sec-head::after { animation: sec-rule linear both; animation-timeline: view(); animation-range: entry 20% cover 35%; }
  }
}
@keyframes sec-rule { from { transform: scaleX(0); } }
.sec-lede { margin: 1.1rem 0 0; font: italic 400 clamp(1.0625rem, 1.3vw, 1.1875rem)/1.65 var(--hf-body); color: var(--h-fg2); max-width: 40rem; }

/* =================================================================== JOURNEY: the plate and its marginalia */

.jlayout {
  display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(15rem, 1fr);
  gap: clamp(2rem, 4.5vw, 4.5rem); align-items: start; margin-top: clamp(2.5rem, 5vw, 4rem);
}
.jplate { margin: 0; min-width: 0; }
.jframe { background: var(--h-deep); border-radius: 6px; padding: clamp(0.6rem, 1.6vw, 1.4rem); }
:root[data-theme="night"] .jframe { background: #1B3252; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .jframe { background: #1B3252; } }
.jframe > .jol { border-radius: 3px; }   /* the Version 4 scene (journey/journey.css) draws its own paper plate */
.jplate figcaption { display: flex; gap: 0.75rem; align-items: baseline; margin-top: 0.85rem; font: 400 0.8125rem/1.45 var(--hf-ui); color: var(--h-fg2); }
.jplate-n { flex: none; font: italic 400 0.95rem/1 var(--hf-display); color: var(--h-head); }

.jpanel {
  position: sticky; top: calc(var(--h-top) + 2rem);
  display: flex; flex-direction: column; gap: 2rem; min-width: 0;
  padding-left: clamp(1.25rem, 2.5vw, 2.25rem); border-left: 1px solid var(--h-line);
}
.jdetails { min-height: 17rem; }
.jdetail[hidden] { display: none; }
.jname { margin: 0 0 0.6rem; font: 300 clamp(1.9rem, 2.6vw, 2.4rem)/1.05 var(--hf-display); letter-spacing: -0.015em; color: var(--h-head); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0; }
.jgloss { margin: 0 0 1rem; font: italic 400 1.0625rem/1.55 var(--hf-body); color: var(--h-fg2); }
.jtext { margin: 0 0 1.1rem; font: 400 1rem/1.72 var(--hf-body); color: var(--h-fg); }
.jtaught { margin: 0; font: 500 0.8125rem/1.4 var(--hf-ui); color: var(--h-fg2); }
.jtaught a { color: var(--h-head); text-decoration: underline; text-decoration-color: var(--h-gold); text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.jtaught a:hover { text-decoration-thickness: 2px; }

.jlist, .jsub { list-style: none; margin: 0; padding: 0; }
.jlist { border-top: 1px solid var(--h-line); }
.jlist > li { border-bottom: 1px solid var(--h-line); }
.jsub { display: grid; grid-template-columns: 1fr 1fr; padding: 0 0 0.45rem 1.4rem; }
.jitem {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  padding: 0.6rem 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: 400 0.9375rem/1.3 var(--hf-ui); color: var(--h-fg2);
}
.jsub .jitem { font-size: 0.875rem; padding-block: 0.35rem; }
.jitem::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1px solid currentColor; transition: background 0.2s, border-color 0.2s; }
.jitem:hover { color: var(--h-head); }
.jitem.is-selected { color: var(--h-head); font-weight: 500; }
.jitem.is-selected::before { background: var(--h-gold); border-color: var(--h-gold); }
.jitem:focus-visible { outline: 2px solid var(--h-gold); outline-offset: 2px; border-radius: 3px; }

@media (max-width: 960px) {
  .jlayout { grid-template-columns: minmax(0, 1fr); }
  .jpanel { position: static; border-left: 0; padding-left: 0; gap: 1.25rem; }
  .jdetails { order: 1; min-height: 0; }
  .jlist {
    order: 0; display: flex; gap: 0.5rem; overflow-x: auto; border: 0; padding: 0.15rem 0.1rem 0.5rem;
    scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .jlist::-webkit-scrollbar { display: none; }
  .jlist > li, .jgroup, .jsub { display: contents; border: 0; }
  .jitem, .jsub .jitem {
    flex: none; width: auto; padding: 0.45rem 0.9rem; border: 1px solid var(--h-line); border-radius: 999px;
    min-height: 2.75rem; font-size: 0.875rem; white-space: nowrap; scroll-snap-align: center;
  }
  .jitem::before { display: none; }
  .jitem.is-selected { border-color: var(--h-gold); box-shadow: inset 0 0 0 0.5px var(--h-gold); }
}
@media (max-width: 640px) {
  /* the scene's phone layout was set for the whole screen width (360–390 px) */
  .jframe { margin: 0 calc(-1 * var(--h-gutter)); padding: 0; border-radius: 0; }
  .jframe > .jol { border-radius: 0; }
}

/* =================================================================== HOW: the shape of a day */

.how-seq { position: relative; margin-top: clamp(3rem, 6vw, 5rem); --arc-h: clamp(6rem, 9vw, 8.5rem); }
.how-arc { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: var(--arc-h); overflow: visible; }
.ha-line { fill: none; stroke: var(--h-head); stroke-width: 1; opacity: 0.35; vector-effect: non-scaling-stroke; }
.ha-horizon { stroke: var(--h-gold); stroke-width: 1; vector-effect: non-scaling-stroke; }
.movements {
  list-style: none; margin: 0; padding: var(--arc-h) 0 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem;
}
.mv { position: relative; display: grid; justify-items: center; align-content: start; text-align: center; padding-top: 1.75rem; }
.mv::before {
  content: ""; position: absolute; left: 50%;
  top: calc(var(--y) * var(--arc-h) - var(--arc-h));
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--h-bg); border: 1px solid var(--h-head);
}
.mv:first-child::before { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--h-gold); border-color: var(--h-gold); box-shadow: 0 0 0 6px color-mix(in srgb, var(--h-gold) 18%, transparent); }
.mv:last-child::before {
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 0; border-radius: 50%;
  background: transparent; box-shadow: inset -4px -2px 0 0 var(--h-head);
}
.mv-n { font: 200 clamp(3rem, 5vw, 4.5rem)/1 var(--hf-display); color: var(--h-head); font-variant-numeric: lining-nums; font-variation-settings: "opsz" 144, "SOFT" 100; }
.mv-t { margin-top: 0.9rem; font: 400 1.125rem/1.25 var(--hf-display); color: var(--h-head); text-wrap: balance; }
.mv-d { margin-top: 0.5rem; max-width: 15rem; font: 400 0.9375rem/1.55 var(--hf-body); color: var(--h-fg2); text-wrap: pretty; }

.how-notes {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(3.5rem, 6vw, 5rem); padding-top: 1.5rem; border-top: 1px solid var(--h-line);
}
.how-notes p { margin: 0; font: 400 0.9375rem/1.6 var(--hf-body); color: var(--h-fg2); }
.how-notes a { color: var(--h-head); text-decoration: underline; text-decoration-color: var(--h-gold); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.how-notes a:hover { text-decoration-thickness: 2px; }
.how-night { font-style: italic !important; }

.how-band { margin-top: clamp(2.5rem, 5vw, 4.5rem); line-height: 0; pointer-events: none; }
.how-band img {
  display: block; width: 100%; height: auto; aspect-ratio: 2172 / 350; object-fit: cover; object-position: right bottom;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%);
  mask-image: linear-gradient(to right, transparent, #000 10%);
}
:root[data-theme="night"] .how-band img { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.95); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .how-band img { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.95); mix-blend-mode: screen; } }

@media (max-width: 1100px) {
  .how-arc { display: none; }
  .movements { padding-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
  .mv { justify-items: start; text-align: left; padding-top: 0; }
  .mv::before { display: none; }
  .mv-d { max-width: none; }
  .how-notes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .movements { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .mv { grid-template-columns: 3.25rem minmax(0, 1fr); column-gap: 0.75rem; }
  .mv-n { grid-row: span 2; font-size: 2.75rem; }
  .mv-t { margin-top: 0.2rem; }
  .mv-d { margin-top: 0.3rem; }
}

@media print {
  #road .road-runway, .how-band { display: none; }
}
