/* ───────────────────────────────────────────────────────────────────────
   Tokens
   Palette: UI/UX Pro Max `colors.csv` — "Architecture / Interior"
            (minimal black + accent gold). Its blue-grey --muted was swapped
            for a true neutral: nothing else on this page is blue.
   Type:    UI/UX Pro Max `typography.csv` — "Magazine Style"
            (Libre Bodoni display + Public Sans text).
   ─────────────────────────────────────────────────────────────────────── */

:root {
  --ink:        #171717;
  --ink-2:      #404040;
  --ink-3:      #6B6B6B;
  --bg:         #FFFFFF;
  --surface:    #FAFAFA;
  --border:     #E5E5E5;
  --border-2:   #EFEFEF;
  --accent:     #A16207;
  --on-dark:    #FFFFFF;
  --on-dark-2:  rgba(255, 255, 255, 0.72);

  --serif: "Libre Bodoni", "Iowan Old Style", Georgia, serif;
  --sans:  "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* spacious scale (density 2/10) */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 40px;
  --s-5: 64px; --s-6: 96px; --s-7: 144px;

  --gutter: 24px;
  --measure: 62ch;
  --rail-w: 206px;
  --rail-pad: 26px;
  --topbar-h: 56px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 240ms;
}

/* ── reset ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--on-dark);
  padding: 12px 20px; font-size: 14px; text-decoration: none;
}
.skip:focus { left: 0; }

/* ── display type ──────────────────────────────────────────────────── */

h1, .route h2, .outro h2, .day-opener h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.04;
}
h1 span, .route h2 span, .outro h2 span { display: block; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ── full-bleed covers ─────────────────────────────────────────────── */

.cover {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #DFDFDF;
}
.cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* a touch of restraint on stock photography */
  filter: saturate(0.92) contrast(1.02);
}
.cover-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,10,0.42) 0%, rgba(10,10,10,0.06) 38%, rgba(10,10,10,0.52) 100%);
}
.hero-veil {
  background:
    linear-gradient(180deg, rgba(10,10,10,0.50) 0%, rgba(10,10,10,0.18) 32%, rgba(10,10,10,0.74) 100%);
}

/* ── hero ──────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: var(--s-5) var(--gutter) calc(var(--s-6) + 10px);
  color: var(--on-dark);
  isolation: isolate;
}
.hero-inner { position: relative; z-index: 1; }
.hero-inner { max-width: 940px; }
.hero-kicker {
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--on-dark-2);
  margin-bottom: var(--s-3);
}
h1 {
  font-size: clamp(2.9rem, 8.4vw, 6.4rem);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.28);
}
h1 span:last-child { font-style: italic; }
.hero-sub {
  margin-top: var(--s-3);
  max-width: 44ch;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--on-dark-2);
}

.hero .statcard {
  position: absolute;
  z-index: 1;
  right: var(--gutter);
  top: clamp(90px, 16vh, 180px);
  width: 290px;
  padding: 22px 24px 18px;
  background: rgba(16, 16, 16, 0.44);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}
.statcard-head {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--on-dark-2);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.statcard dl { margin: 0; }
.statcard div {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.statcard div:last-child { border-bottom: 0; }
.statcard dt { font-size: 13px; color: var(--on-dark-2); }
.statcard dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.hero .scrollcue {
  position: absolute; left: 50%; bottom: 28px;
  width: 22px; height: 38px;
  margin-left: -11px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  z-index: 2;
}
.scrollcue span {
  position: absolute; left: 50%; top: 8px;
  width: 2px; height: 6px; margin-left: -1px;
  background: #fff; border-radius: 1px;
  animation: cue 1.9s var(--ease) infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0; }
  30% { opacity: 1; }
  70% { transform: translateY(13px); opacity: 0; }
}

/* ── route ─────────────────────────────────────────────────────────── */

.route {
  padding: var(--s-7) var(--gutter);
  display: grid;
  gap: var(--s-5);
  max-width: 1280px;
  margin: 0 auto;
}
.route-head { max-width: 560px; }
.route h2 {
  margin: var(--s-2) 0 var(--s-3);
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
}
.route h2 span:last-child { font-style: italic; color: var(--ink-2); }
.route-note { color: var(--ink-3); max-width: 46ch; }

.routemap { width: 100%; height: auto; max-height: 78vh; display: block; margin: 0 auto; overflow: visible; }
.route-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 2400ms cubic-bezier(0.33, 0.1, 0.2, 1);
}
.route.in .route-line { stroke-dashoffset: 0; }

.stop { cursor: pointer; }
.stop-halo { fill: var(--accent); opacity: 0; transition: opacity var(--dur) var(--ease); }
.stop:hover .stop-halo, .stop:focus-visible .stop-halo { opacity: 0.14; }
.stop-dot {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 2.2;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 520ms var(--ease), fill var(--dur) var(--ease);
}
.route.in .stop-dot { transform: scale(1); }
.stop:hover .stop-dot, .stop:focus-visible .stop-dot { fill: var(--accent); stroke: var(--accent); }
.stop-label {
  font-family: var(--sans);
  font-size: 30px; font-weight: 500;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--bg); stroke-width: 7px; stroke-linejoin: round;
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.stop-days {
  font-family: var(--sans);
  font-size: 22px; font-weight: 300;
  fill: var(--ink-3);
  paint-order: stroke;
  stroke: var(--bg); stroke-width: 6px; stroke-linejoin: round;
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.route.in .stop-label, .route.in .stop-days { opacity: 1; }

/* staggered dot/label entrance */
.route.in .stop:nth-child(2)  .stop-dot { transition-delay: 160ms; }
.route.in .stop:nth-child(3)  .stop-dot { transition-delay: 320ms; }
.route.in .stop:nth-child(4)  .stop-dot { transition-delay: 480ms; }
.route.in .stop:nth-child(5)  .stop-dot { transition-delay: 640ms; }
.route.in .stop:nth-child(6)  .stop-dot { transition-delay: 800ms; }
.route.in .stop:nth-child(7)  .stop-dot { transition-delay: 960ms; }
.route.in .stop:nth-child(8)  .stop-dot { transition-delay: 1120ms; }
.route.in .stop:nth-child(9)  .stop-dot { transition-delay: 1280ms; }
.route.in .stop:nth-child(10) .stop-dot { transition-delay: 1440ms; }
.route.in .stop .stop-label, .route.in .stop .stop-days { transition-delay: 900ms; }

/* ── days ──────────────────────────────────────────────────────────── */

.day { position: relative; }

/* The photo sits still while the white panel rises over it. Sticky +
   transform only: no scroll listener, no parallax maths, no jank. */
.day .cover {
  position: sticky;
  top: 0;
  height: 100svh;
  inset: auto;
}
.day-opener {
  position: relative;
  z-index: 1;
  margin-top: -100svh;
  height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gutter) clamp(72px, 13vh, 140px);
  color: var(--on-dark);
  pointer-events: none;
}
.day-opener-inner { max-width: 820px; }
.day-kicker {
  display: block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--on-dark-2);
  margin-bottom: 18px;
}
.day-opener h2 {
  font-size: clamp(2.3rem, 6.4vw, 4.6rem);
  text-shadow: 0 2px 36px rgba(0, 0, 0, 0.3);
}
.day-blurb {
  margin-top: 22px;
  max-width: 40ch;
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  color: var(--on-dark-2);
}

.day-body {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.14);
  padding: var(--s-6) var(--gutter) var(--s-6);
}
.day-body-inner { max-width: 760px; margin: 0 auto; }

.segment + .segment { margin-top: var(--s-5); }
.segment-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: var(--s-3);
}
.segment-rule { flex: 0 0 34px; height: 1px; background: var(--ink); opacity: 0.35; }
.segment-name {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--ink-2);
}

.moments { border-left: 1px solid var(--border); margin-left: 7px; }
.moment {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0 26px;
  padding: 0 0 var(--s-4) 34px;
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
  will-change: opacity, transform;
}
.moment.in { opacity: 1; transform: none; }
.moment:last-child { padding-bottom: 0; }
.moment::before {
  content: "";
  position: absolute; left: -4px; top: 11px;
  width: 7px; height: 7px;
  background: var(--bg);
  border: 1px solid var(--ink-3);
  border-radius: 50%;
}
.moment-time {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding-top: 5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.moment-main h4 {
  font-size: 1.16rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  line-height: 1.35;
}
.moment-main p {
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 0.97rem;
  max-width: var(--measure);
  white-space: pre-line;
}

/* ── outro ─────────────────────────────────────────────────────────── */

.outro {
  position: relative; z-index: 3;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--s-7) var(--gutter);
}
.outro-inner { max-width: 760px; margin: 0 auto; }
.outro h2 {
  margin: var(--s-2) 0 var(--s-3);
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
}
.outro h2 span:last-child { font-style: italic; color: var(--ink-2); }
.outro-body { color: var(--ink-2); max-width: var(--measure); }
.outro-stats {
  display: flex; flex-wrap: wrap; gap: var(--s-5);
  margin: var(--s-5) 0 0;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.outro-stats dt {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
}
.outro-stats dd {
  margin: 8px 0 0;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ── footer ────────────────────────────────────────────────────────── */

.foot {
  position: relative; z-index: 3;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.64);
  padding: var(--s-5) var(--gutter);
  font-size: 14px;
}
.foot-inner { max-width: 760px; margin: 0 auto; }
.foot-note { max-width: 52ch; }
.credits { margin-top: var(--s-3); }
.credits summary {
  cursor: pointer;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}
.credits ul { margin-top: var(--s-2); }
.credits li { padding: 6px 0; font-size: 13px; line-height: 1.5; }
.credits p { margin-top: var(--s-2); font-size: 13px; }
.credits a { color: rgba(255, 255, 255, 0.84); }

/* ── the day rail (desktop) ────────────────────────────────────────── */

.rail {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: calc(var(--rail-w) + var(--rail-pad) + 28px);
  padding: 26px 28px 26px var(--rail-pad);
  display: none;
  opacity: 0;
  transition: opacity 400ms var(--ease);
  pointer-events: none;
}
/* The ground the dates stand on. A pale wash that is solid under the text and
   dissolves to nothing on its right edge, so the rail reads over a dark
   photograph without drawing a box on the page. */
.rail::before {
  content: "";
  position: absolute;
  inset: -18px -10px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.90) 0%,
    rgba(255, 255, 255, 0.86) 52%,
    rgba(255, 255, 255, 0.60) 76%,
    rgba(255, 255, 255, 0) 100%);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  /* one soft ellipse: solid where the dates are, gone by every edge */
  mask-image: radial-gradient(125% 58% at 0% 50%, #000 52%, rgba(0,0,0,0.55) 76%, transparent 100%);
  -webkit-mask-image: radial-gradient(125% 58% at 0% 50%, #000 52%, rgba(0,0,0,0.55) 76%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
.rail.show { opacity: 1; pointer-events: auto; }
.rail-progress {
  position: absolute; left: var(--rail-pad); top: 30px; bottom: 30px;
  width: 1px; background: var(--border);
}
.rail-progress-fill {
  display: block; width: 1px; height: 0;
  background: var(--ink);
  transition: height 180ms linear;
}
.rail ol { padding-left: 16px; }
.rail li { height: 27px; display: flex; align-items: center; }
.rail a {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none;
  width: 100%;
}
.rail-num {
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
.rail-meta {
  display: flex; align-items: baseline; gap: 8px;
  min-width: 0;
  opacity: 0;
  transform: translate3d(-6px, 0, 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.rail-dow { font-size: 11px; color: var(--ink-3); }
.rail-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* days already travelled stay legible — that is the whole point */
.rail li.past .rail-num { opacity: 1; color: var(--ink-2); }
.rail li.current .rail-num { opacity: 1; color: var(--ink); font-weight: 600; }
.rail li.current .rail-meta { opacity: 1; transform: none; }
.rail li:hover .rail-num, .rail a:focus-visible .rail-num { opacity: 1; color: var(--ink); }
.rail li:hover .rail-meta { opacity: 0.72; transform: none; }

@media (min-width: 1180px) {
  .rail { display: block; }
  /* the headline keeps clear of the rail rather than running beneath it */
  .day-opener { padding-left: calc(var(--rail-w) + var(--rail-pad) + 64px); }
  .route, .outro { padding-left: calc(var(--rail-w) + var(--rail-pad) + 64px); }
}

/* ── the day bar (mobile & tablet) ─────────────────────────────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border-2);
  transform: translate3d(0, -100%, 0);
  transition: transform 320ms var(--ease);
  padding-top: env(safe-area-inset-top);
}
.topbar.show { transform: none; }
.topbar-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: transparent; }
.topbar-line-fill { display: block; height: 1px; width: 0; background: var(--ink); transition: width 180ms linear; }
.topbar-inner {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
}
.topbar-day {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  padding-right: 2px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.topbar-day b { color: var(--ink); font-weight: 600; }
.topbar-track {
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 26px), transparent 100%);
  margin-left: 2px;
}
.topbar-track::-webkit-scrollbar { display: none; }
.topbar-pills { display: flex; gap: 6px; padding: 0 16px 0 20px; }
.pill {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.pill.past { opacity: 1; color: var(--ink-2); border-color: var(--border); }
.pill.current {
  opacity: 1;
  color: var(--on-dark);
  background: var(--ink);
  border-color: var(--ink);
  font-weight: 500;
}
@media (min-width: 1180px) {
  .topbar { display: none; }
}

/* ── small screens ─────────────────────────────────────────────────── */

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .hero .statcard {
    position: relative;
    right: auto; top: auto;
    width: 100%;
    margin-top: var(--s-4);
  }
  .hero { display: block; }
  .hero-inner { padding-top: 20vh; }
  .hero { padding-bottom: var(--s-5); }
  .scrollcue { display: none; }
  .route { padding-top: var(--s-6); padding-bottom: var(--s-6); gap: var(--s-3); }
  .routemap { max-height: none; }
  .stop-label { font-size: 40px; }
  .stop-days { font-size: 30px; }
  .day-body { padding-top: var(--s-5); padding-bottom: var(--s-5); }
  .moment {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-left: 26px;
  }
  .moment-time { text-align: left; padding-top: 0; }
  .outro-stats { gap: var(--s-4); }
}

/* ── motion preferences ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .moment { opacity: 1; transform: none; }
  .route-line { stroke-dashoffset: 0; }
  .stop-dot { transform: scale(1); }
  .stop-label, .stop-days { opacity: 1; }
  .day .cover { position: relative; height: 62svh; }
  .day-opener { margin-top: -62svh; height: 62svh; }
}

/* ── print ─────────────────────────────────────────────────────────── */

@media print {
  .rail, .topbar, .scrollcue, .cover { display: none !important; }
  .day-opener { margin: 0; height: auto; color: var(--ink); padding: var(--s-4) 0 0; }
  .day-opener h2, h1 { text-shadow: none; }
  .day-body { box-shadow: none; padding: var(--s-3) 0; }
  .moment { opacity: 1; transform: none; }
}

/* ── the route as a chain (narrow screens) ─────────────────────────── */

.routechain { display: none; }

@media (max-width: 860px) {
  .routemap { display: none; }
  .routechain { display: block; padding: var(--s-2) 0 0 2px; }
  .chainstop { position: relative; }
  .chainstop a {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: baseline;
    gap: 0 14px;
    padding: 0 0 26px;
    text-decoration: none;
  }
  .chainstop:last-child a { padding-bottom: 0; }
  /* the line between one dot and the next */
  .chainstop:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 5px; top: 13px; bottom: -3px;
    width: 1px;
    background: var(--border);
  }
  .chaindot {
    grid-row: span 2;
    width: 11px; height: 11px;
    margin-top: 6px;
    border: 1px solid var(--ink-3);
    border-radius: 50%;
    background: var(--bg);
    position: relative; z-index: 1;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  }
  .chainstop a:active .chaindot { background: var(--accent); border-color: var(--accent); }
  .chainname {
    font-size: 1.22rem;
    font-weight: 500;
    letter-spacing: -0.012em;
    color: var(--ink);
    line-height: 1.3;
  }
  .chainday {
    grid-column: 2;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--ink-3);
    margin-top: 2px;
  }
  /* a place already seen once, met again on the way back */
  .chainstop.again .chainname { color: var(--ink-3); font-weight: 400; }
}

/* ── back to the top ───────────────────────────────────────────────── */

.totop {
  position: fixed;
  left: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 45;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.1);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.94);
  pointer-events: none;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease),
              background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.totop svg { width: 17px; height: 17px; display: block; }

/* clear of the rail's scrim on wide screens */
@media (min-width: 1180px) {
  .totop { left: 28px; bottom: 28px; }
}
@media (max-width: 860px) {
  .totop { left: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
}
@media print { .totop { display: none !important; } }
