:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--navy);
  background: var(--canvas);
  --navy: #1d3148;
  --muted: #4c6278;
  --accent: #2e5d86;
  --canvas: #fcfdff;
  --wash: #e8f2fc;
  --line: #dce8f3;
  --blue-border: #b7cde3;
  --radius: 26px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1:focus-visible { outline-offset: 7px; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, .shell { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.topbar-inner { height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; border-radius: 7px; font-size: 1.075rem; font-weight: 720; }
.brand-home-icon {
  display: grid;
  place-items: center;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  border: 1px solid var(--blue-border);
  border-radius: 10px;
  background: var(--wash);
}
.brand-home-icon img { display: block; object-fit: contain; }
.brand:hover .brand-home-icon { border-color: var(--accent); }
.secondary, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 8px 17px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 650;
  font-size: .875rem;
}
.secondary:hover { background: var(--wash); border-color: var(--blue-border); }
.primary { background: var(--navy); border-color: var(--navy); color: white; }
.primary:hover { background: var(--accent); border-color: var(--accent); }

.hero { display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: clamp(32px, 6vw, 90px); padding-top: 40px; }
.hero-copy { min-width: 0; }
h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(3rem, 6.1vw, 5.4rem);
  font-weight: 760;
  line-height: .96;
  letter-spacing: -.083em;
  max-width: 10ch;
}
.subtitle {
  margin-top: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.45vw, 2rem);
  font-style: italic;
  letter-spacing: -.04em;
  color: var(--accent);
}
.intro { margin-top: 25px; max-width: 48ch; font-size: 1rem; line-height: 1.48; color: var(--muted); }
.intro p + p { margin-top: 9px; }
.intro .intro-last { color: var(--navy); font-weight: 700; }

.portrait {
  position: relative;
  isolation: isolate;
  align-self: stretch;
  justify-self: stretch;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 350px;
  border: 1px solid var(--line);
  border-radius: 36px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 49%, #dbeaf8 0 46%, var(--wash) 80%, #f0f7fe);
  transition: background-color .25s, border-color .25s;
}
.portrait img {
  width: min(100%, 400px);
  height: auto;
  display: block;
}
.portrait-sparkles i {
  position: absolute;
  top: 29%;
  left: 16%;
  width: 27px;
  aspect-ratio: 1;
  background: #fafdff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  pointer-events: none;
}
.portrait-sparkles i:nth-child(2) { top: 19%; left: auto; right: 16%; width: 36px; }
.portrait-sparkles i:nth-child(3) { top: 33%; left: auto; right: 12%; width: 16px; }

.chapters { margin-top: 40px; }
.chapters-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.chapters-heading h2 { font-size: clamp(1.5rem, 3vw, 2.13rem); line-height: 1.1; letter-spacing: -.055em; font-weight: 750; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.peach { --paper: #fff0e8; --edge: #f4dfd2; --art: #df896c; --art-light: #ffd1b9; --ink: #723a2d; }
.lilac { --paper: #f3edfd; --edge: #e8dcf6; --art: #9474cc; --art-light: #d7c3f6; --ink: #553d80; }
.mint { --paper: #eaf6ef; --edge: #d9eae0; --art: #68a487; --art-light: #b7dfc7; --ink: #32644d; }
.chapter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: end;
  position: relative;
  min-height: 152px;
  gap: 8px;
  padding: 84px 17px 17px 20px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--paper);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.chapter-card:hover { transform: translateY(-4px); box-shadow: 0 8px 21px #1d314810; border-color: var(--art); }
.chapter-card[aria-current] { border-color: var(--art); box-shadow: inset 0 0 0 1px var(--art); }
.card-copy { display: flex; flex-direction: column; gap: 3px; z-index: 1; }
.card-copy strong { font-size: clamp(1.1rem, 2vw, 1.34rem); letter-spacing: -.045em; line-height: 1.15; }
.card-copy > span { font-size: .875rem; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.card-action { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: #ffffffb8; }
.card-action::before { content: ""; width: 7px; height: 7px; border-top: 1.6px solid; border-right: 1.6px solid; transform: translateX(-1px) rotate(45deg); }

.card-art { position: absolute; top: 13px; right: 23px; width: 116px; height: 73px; pointer-events: none; }
.card-art i { position: absolute; display: block; }
.route .shape-one {
  width: 100px; height: 27px; top: 38px; left: 2px;
  border-radius: 50%; transform: rotate(-12deg);
  background: linear-gradient(155deg, #ffdbbd 15%, #eaaa86 90%);
  box-shadow: 0 4px 0 #d89273;
}
.route .shape-two {
  width: 49px; height: 27px; top: 32px; left: 23px;
  border: 4px dashed #fff8f1; border-right: 0; border-radius: 50%; transform: rotate(-18deg);
}
.route .shape-three {
  width: 28px; height: 36px; top: 5px; left: 74px;
  border-left: 3px solid #ab6048; border-radius: 2px;
}
.route .shape-three::before {
  content: ""; display: block; height: 19px; background: linear-gradient(125deg,#ffcaa8,#d87960);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.spark i {
  clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
  background: linear-gradient(145deg, #fff 5%, var(--art-light) 35%, var(--art) 85%);
}
.spark .shape-one { width: 65px; height: 65px; left: 28px; top: 4px; transform: rotate(12deg); }
.spark .shape-two { width: 26px; height: 26px; left: 6px; top: 8px; transform: rotate(-12deg); }
.spark .shape-three { width: 25px; height: 25px; right: 0; top: 39px; transform: rotate(17deg); }
.horizon .shape-one { width: 37px; height: 37px; left: 54px; top: 8px; border-radius: 50%; background: linear-gradient(145deg,#fff3bd,#edce77); }
.horizon .shape-two { width: 72px; height: 36px; left: 7px; top: 34px; border-radius: 80% 85% 13% 19%; transform: rotate(-7deg); background: linear-gradient(152deg,#bce3c7,#7cb898); }
.horizon .shape-three { width: 65px; height: 39px; left: 50px; top: 32px; border-radius: 85% 85% 23% 12%; transform: rotate(10deg); background: linear-gradient(150deg,#a5d6b7,#63a587); }
.horizon .shape-three::before { content: ""; position: absolute; bottom: 1px; left: 13px; width: 28px; height: 27px; border: 3px solid #e1f3e5; border-right: 0; border-bottom: 0; border-radius: 48% 0 0; transform: rotate(20deg); }

footer { margin-top: 24px; padding: 16px 0 25px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.chapter-title { font-size: clamp(2.6rem, 5vw, 4.55rem); }
.chapter-description { color: var(--accent); margin-top: 12px; font-size: 1.12rem; overflow-wrap: anywhere; }
.stop-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.stop { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; background: #fff; color: var(--navy); min-height: 40px; font-size: .875rem; }
.stop:hover, .stop[aria-pressed="true"] { border-color: var(--blue-border); background: var(--wash); }
.stop-detail { margin-top: 10px; min-height: 109px; background: #fbfdff; border: 1px solid var(--line); border-radius: 17px; padding: 13px 15px; }
.stop-detail h2 { font-size: 1.14rem; letter-spacing: -.025em; }
.placeholder { font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.stop-text { margin-top: 4px; line-height: 1.4; color: var(--muted); }
.chapter-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
body[data-scene="peach"] .portrait { border-color: #efcfc1; }
body[data-scene="lilac"] .portrait { border-color: #d7c1ed; }
body[data-scene="mint"] .portrait { border-color: #c3e1cb; }
body[data-scene="lilac"] .portrait-sparkles i { background: #efe5ff; }
body[data-scene="mint"] .portrait-sparkles i { background: #e2fbec; }

footer p { overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .topbar-inner, .shell { width: calc(100% - 48px); }
  .hero { gap: 24px; padding-top: 32px; }
  .portrait { min-height: 265px; border-radius: 26px; }
  .chapter-card { padding-inline: 14px; }
  .card-art { right: 13px; }
}
@media (max-width: 740px) {
  .chapter-grid { grid-template-columns: 1fr; gap: 10px; }
  .chapter-card { min-height: 104px; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; padding: 13px 14px 13px 16px; }
  .card-copy { padding-right: 91px; }
  .card-art { top: 14px; right: 50px; transform: scale(.74); transform-origin: right center; }
}
@media (max-width: 620px) {
  .topbar-inner, .shell { width: calc(100% - 36px); }
  .topbar-inner { height: 63px; }
  .hero { grid-template-columns: 1fr; gap: 23px; }
  h1 { font-size: clamp(2.95rem, 12vw, 4.55rem); }
  .intro { margin-top: 19px; }
  .portrait { min-height: 0; }
  .portrait img { width: min(76%, 300px); }
  .chapters { margin-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .chapter-card:hover { transform: none; }
}

/* The opening scene keeps the avatar and its dialogue on a single canvas. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.scene-pattern { display: none; }
body[data-scene="home"] {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  background: var(--canvas);
}
[data-scene="home"] .scene-pattern {
  display: block;
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 42%, #0001 9%, #000 68%, #0005 100%);
}
.scene-pattern i {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: clamp(42px, 5.3vw, 88px);
  height: clamp(33px, 4.1vw, 63px);
  border-radius: 22%;
  background: #e6eff9;
  opacity: .26;
  transform: rotate(var(--turn));
}
.scene-pattern .scene-dot { border-radius: 50%; width: clamp(30px, 3.2vw, 51px); }
[data-scene="home"] .topbar { border: 0; }
[data-scene="home"] .topbar-inner { height: 64px; }
[data-scene="home"] .shell { max-width: 860px; padding-bottom: 20px; }
[data-scene="home"] .hero {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 5px;
  padding-top: clamp(12px, 3.5vh, 37px);
}
[data-scene="home"] .hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 550px);
}
.speech {
  position: relative;
  padding: 21px 25px 19px;
  border-radius: 27px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 10px 38px #1d31480b, 0 2px 6px #1d314808;
}
.speech::after {
  content: "";
  position: absolute;
  left: calc(50% - 9px);
  bottom: -7px;
  width: 16px;
  aspect-ratio: 1;
  border: solid var(--line);
  border-width: 0 1px 1px 0;
  border-radius: 0 0 5px;
  background: #fff;
  transform: rotate(45deg);
}
[data-intro="playing"] .speech { animation: speech-enter 480ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes speech-enter {
  0%, 25% { opacity: 0; transform: translateY(9px) scale(.97); }
  100% { opacity: 1; transform: none; }
}
.speech-copy p {
  position: relative;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  margin-top: 6px;
}
.speech-copy .speech-title {
  margin-top: 0;
  color: var(--navy);
  font-size: clamp(1.43rem, 3.5vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1.1;
}
.speech-copy .speech-subtitle { color: var(--accent); font-family: Georgia, serif; font-style: italic; margin: 3px 0 9px; }
.speech-copy .speech-last { color: var(--navy); font-weight: 700; }
.line-space { visibility: hidden; }
.line-text { position: absolute; inset: 0; }
.typing::after { content: ""; display: inline-block; vertical-align: -.1em; width: 1px; height: 1em; margin-left: 2px; background: var(--accent); }

[data-scene="home"] .portrait {
  position: relative;
  width: min(49vw, 218px);
  min-height: 0;
  aspect-ratio: 1;
  justify-self: center;
  justify-items: center;
  align-self: center;
  border: 0;
  overflow: visible;
  background: transparent;
  margin-top: 11px;
}
[data-scene="home"] .portrait::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 61%;
  height: 9%;
  left: 19.5%;
  bottom: 3%;
  border-radius: 50%;
  background: #1d314824;
  filter: blur(4px);
}
[data-scene="home"] .portrait .portrait-cutout { width: 100%; }
[data-scene="home"] .portrait-sparkles { display: none; }

.profile-overview {
  max-width: 620px;
  margin: 8px auto 23px;
  padding: 0 clamp(2px, 2vw, 14px);
}
.profile-overview h2 {
  margin-bottom: 5px;
  font-size: 1.08rem;
  letter-spacing: -.025em;
}
.profile-overview p {
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
}
.profile-expertise {
  margin-top: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.profile-expertise summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 7px 12px;
  list-style: none;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 690;
  cursor: pointer;
  border-radius: inherit;
}
.profile-expertise summary::-webkit-details-marker { display: none; }
.profile-expertise summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.profile-expertise[open] summary::after { transform: translateY(2px) rotate(225deg); }
.profile-expertise summary:hover { background: var(--wash); }
.profile-expertise dl {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 11px 12px 14px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
  line-height: 1.45;
}
.profile-expertise dt { font-weight: 690; }
.profile-expertise dd { margin: 2px 0 0; color: var(--muted); }
#road-start { margin-top: 13px; }

[data-scene="home"] .chapters { max-width: 570px; margin: 8px auto 0; }
[data-scene="home"] .chapters-heading { justify-content: center; gap: 0; margin-bottom: 13px; }
[data-scene="home"] .chapters-heading h2 {
  font-size: .96rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--muted);
}
[data-scene="home"] .chapter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 5vw, 42px); }
[data-scene="home"] .chapter-card {
  aspect-ratio: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 9px;
  border-radius: 26%;
  box-shadow: 0 9px 16px #1d314810, 0 2px 4px #1d31480b;
  text-align: center;
}
[data-scene="home"] .chapter-card:hover { transform: translateY(-7px) scale(1.03); box-shadow: 0 16px 27px #1d314818; }
[data-scene="home"] .chapter-card[aria-current] { transform: none; }
[data-scene="home"] .card-art { position: relative; inset: auto; flex: 0 0 69px; margin-top: -6px; transform: scale(.74); transform-origin: center; }
[data-scene="home"] .card-copy { padding: 0; gap: 4px; }
[data-scene="home"] .card-copy strong {
  font-size: clamp(.65rem, 2.4vw, .975rem);
  white-space: nowrap;
}
[data-scene="home"] .card-description { font-size: clamp(.65rem, 1.35vw, .72rem); white-space: nowrap; }
[data-scene="home"] .card-action { display: none; }
[data-intro="complete"] .chapters-heading { animation: options-enter 340ms both; }
[data-intro="complete"] .chapter-card {
  --arrival: 0ms;
  animation: options-enter 500ms cubic-bezier(.22,.85,.25,1) var(--arrival) both,
    bubble-float 1.65s ease-in-out calc(500ms + var(--arrival)) 2;
}
[data-intro="complete"] .chapter-card:nth-child(2) { --arrival: 80ms; }
[data-intro="complete"] .chapter-card:nth-child(3) { --arrival: 160ms; }
@keyframes options-enter {
  from { opacity: 0; translate: 0 14px; scale: .94; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes bubble-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
[data-scene="home"] footer { max-width: 570px; margin: 21px auto 0; padding: 0; border-top: 0; text-align: center; }
[data-intro="playing"] footer { visibility: hidden; }

@media (min-width: 471px) and (max-height: 790px) {
  [data-scene="home"] .topbar-inner { height: 56px; }
  [data-scene="home"] .hero { padding-top: 15px; }
  [data-scene="home"] .portrait { width: 184px; }
  [data-scene="home"] .chapters { max-width: 475px; }
  [data-scene="home"] .card-art { flex-basis: 60px; transform: scale(.65); }
}
@media (max-width: 470px) {
  [data-scene="home"] .topbar-inner { height: 61px; }
  [data-scene="home"] .hero { padding-top: 22px; }
  [data-scene="home"] .chapter-grid { gap: clamp(14px, 4.5vw, 21px); }
  .speech { padding: 17px 17px 15px; border-radius: 21px; }
  [data-scene="home"] .chapter-card { padding: 7px 4px; }
  [data-scene="home"] .card-art { flex-basis: 39px; height: 39px; transform: scale(.48); transform-origin: center top; }
  [data-scene="home"] .card-copy > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-intro] .speech, [data-intro] .chapters-heading, [data-intro] .chapter-card { animation: none; }
  [data-scene="home"] .chapter-card:hover { transform: none; }
}

[hidden] { display: none !important; }
.chapter-dock { padding: 5px 0; }
.topbar:has(.chapter-dock:not([hidden])) {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f3f8fdea;
  backdrop-filter: blur(13px);
}
.topbar:has(.chapter-dock:not([hidden])) .topbar-inner { height: auto; min-height: 65px; }
.chapter-dock .chapter-grid { display: flex; gap: 6px; }
.chapter-dock .chapter-card {
  --dock-size: clamp(50px, 8vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: var(--dock-size);
  height: var(--dock-size);
  min-height: 0;
  padding: 3px 4px 5px;
  border-radius: 20%;
  box-shadow: 0 3px 8px #1d314810;
  text-align: center;
  transform-origin: top left;
}
.chapter-dock .chapter-card:hover { transform: translateY(-2px); }
.chapter-dock .card-art {
  position: relative; inset: auto; flex: 0 0 22px; width: 116px; height: 22px;
  margin: 0 -29px;
  transform: scale(.29);
  transform-origin: center top;
}
.chapter-dock .card-copy { width: 100%; padding: 0; gap: 0; }
.chapter-dock .card-copy strong { font-size: .5625rem; line-height: 1.06; letter-spacing: -.025em; }
.chapter-dock .card-copy > span, .chapter-dock .card-action { display: none; }
.speech-departure { position: fixed; z-index: 3; pointer-events: none; }

/* Move shared elements into the road scene in a single transition. */
.road-view-switch .portrait, .road-view-switch .road-avatar { view-transition-name: traveller; }
.road-view-switch .speech { view-transition-name: intro-dialogue; }
.road-view-switch .profile-overview { view-transition-name: road-profile; }
.road-view-switch [data-destination="the-road-so-far"] { view-transition-name: road-chapter-card; }
.road-view-switch [data-destination="my-view-on-ai"] { view-transition-name: ai-chapter-card; }
.road-view-switch [data-destination="the-road-ahead"] { view-transition-name: ahead-chapter-card; }
.road-view-switch::view-transition-group(*) {
  animation-duration: 440ms;
  animation-timing-function: cubic-bezier(.22, .72, .24, 1);
}
.road-view-switch::view-transition-old(intro-dialogue) { animation: dialogue-away 210ms ease-out both; }
.road-view-switch::view-transition-new(road-profile) { animation: profile-in 250ms ease-out 170ms both; }
.road-view-switch::view-transition-group(intro-dialogue) { z-index: 1; }
.road-view-switch::view-transition-group(traveller) { z-index: 2; }
.road-view-switch::view-transition-group(road-chapter-card),
.road-view-switch::view-transition-group(ai-chapter-card),
.road-view-switch::view-transition-group(ahead-chapter-card) { z-index: 3; }
@keyframes dialogue-away {
  to { opacity: 0; transform: translateY(-7px) scale(.99); }
}
@keyframes profile-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

body[data-scene="road"] { position: relative; isolation: isolate; min-height: 100svh; background: var(--canvas); overflow-x: clip; }
[data-scene="road"] .scene-pattern {
  display: block; position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 50%, #0001 12%, #000b 82%);
}
[data-scene="road"] .shell { max-width: 1030px; }
.road-module { padding-top: clamp(17px, 3.3vh, 34px); }
.road-module h1 {
  max-width: none;
  font-size: clamp(1.7rem, 4.8vw, 2.85rem);
  letter-spacing: -.045em;
  line-height: 1.04;
}
.road-track {
  --road-start: 15%;
  --road-destination: 75%;
  --traveller-size: clamp(128px, 23vw, 185px);
  position: relative;
  margin-top: 10px;
  min-height: clamp(220px, 29vh, 248px);
  overflow: clip visible;
}
.road-world {
  position: absolute;
  inset: 0;
  transform: translateX(var(--road-camera, 0%));
}
.road-scenery {
  position: absolute;
  bottom: 28px;
  left: 0;
  width: var(--road-length, 100%);
  height: 72px;
  opacity: .8;
  background:
    radial-gradient(ellipse 20px 11px at 61px 48px, #cddff1 70%, transparent 76%) 0 0 / 195px 72px,
    radial-gradient(ellipse 24px 13px at 96px 46px, #e8eee1 70%, transparent 76%) 0 0 / 161px 72px,
    radial-gradient(ellipse 37px 9px at 37px 63px, #e0edf8 69%, transparent 75%) 0 0 / 126px 72px;
}
.road-world::before, .road-world::after {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 0;
  width: var(--road-length, 100%);
  height: 13px;
  border-radius: 999px;
  background: #d7e7f5;
}
.road-world::after {
  bottom: 26px;
  height: 1px;
  background: repeating-linear-gradient(90deg, #fcfeff 0 10px, transparent 10px 19px);
}
.road-marker {
  position: absolute;
  display: grid;
  place-items: center;
  bottom: 13px;
  z-index: 1;
  width: 28px;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid #7197bb;
  border-radius: 50%;
  background: #fbfdff;
  color: var(--navy);
  font-size: .75rem;
  font-weight: 720;
  transform: translateX(-50%);
  opacity: 0;
  translate: 0 8px;
  scale: .8;
  visibility: hidden;
  transition: opacity .42s ease, translate .42s ease, scale .42s ease, box-shadow .25s ease, background-color .25s ease;
}
.road-marker[data-revealed] { opacity: 1; translate: 0 0; scale: 1; visibility: visible; }
.road-marker[aria-current="step"] { box-shadow: 0 0 0 4px #deebf7; background: #cfdfef; }
.road-marker:hover:not([aria-disabled="true"]) { background: #cfdfef; }
.road-marker[aria-disabled="true"], .road-controls button[aria-disabled="true"] { cursor: default; }
.road-controls button[aria-disabled="true"] { opacity: .53; }
.road-avatar {
  position: absolute;
  left: calc(var(--road-start) - var(--traveller-size) / 2);
  bottom: 35px;
  width: var(--traveller-size);
  aspect-ratio: 1;
  transform-origin: left top;
}
[data-phase="arrived"] .road-avatar { left: calc(var(--road-destination) - var(--traveller-size) / 2); }
.road-avatar::after {
  content: ""; position: absolute; z-index: -1; left: 31%; right: 31%; bottom: 5%; height: 8%;
  border-radius: 50%; background: #1d314830; filter: blur(4px);
}
.road-front, .road-side { position: absolute; inset: 0; width: 100%; height: 100%; }
.road-front { object-fit: contain; transition: opacity 190ms ease-in-out; }
.road-side {
  --walk-sheet: url("assets/rebecka-walk.png");
  opacity: 0;
  transition: opacity 190ms ease-in-out;
}
[data-direction="left"] .road-side { scale: -1 1; }
.road-side::before, .road-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--walk-sheet) no-repeat 0 0 / 200% 200%;
  transition: opacity 120ms ease-in-out;
}
.road-side::after { opacity: 0; background-position: 0 100%; }
.road-track:not([data-phase="ready"]) .road-side { opacity: 1; }
.road-track:not([data-phase="ready"]) .road-front { opacity: 0; }
[data-phase="walking"] .road-side::before, [data-phase="walking"] .road-side::after { transition-delay: 105ms; }
[data-phase="walking"] .road-side::before { opacity: 0; }
[data-phase="walking"] .road-side::after, [data-phase="settling"] .road-side::after {
  animation: walking var(--walk-cycle, 640ms) steps(1, end) 105ms infinite,
    step-rise calc(var(--walk-cycle, 640ms) / 2) ease-in-out 105ms infinite;
}
[data-phase="walking"] .road-side::after {
  opacity: 1;
}
[data-phase="settling"] .road-side::before, [data-phase="settling"] .road-side::after {
  transition-duration: 215ms;
}
[data-phase="settling"] .road-side::after {
  animation-play-state: paused;
}
@keyframes walking {
  0%, 50% { background-position: 0 100%; }
  25% { background-position: 100% 0; }
  75% { background-position: 100% 100%; }
}
@keyframes step-rise {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}
.road-content { display: grid; }
.road-content > * { grid-area: 1 / 1; min-width: 0; }
.road-content.is-resizing { overflow: clip; }
.road-arrival { min-height: 126px; }
.road-content:has(.profile-overview:not([hidden])) #road-project-view { pointer-events: none; }
.road-content:has(.profile-overview:not([hidden])) .road-arrival { min-height: 0; }
.road-stop {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: min(650px, 100%);
  margin-inline: auto;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: #fbfdff;
  box-shadow: 0 9px 22px #1d31480d;
}
.road-stop-marker { flex: 0 0 11px; aspect-ratio: 1; margin-top: 7px; border-radius: 50%; background: #7197bb; box-shadow: 0 0 0 5px var(--wash); }
.road-stop h2 { font-size: 1.3rem; letter-spacing: -.04em; }
.road-stop-meta { color: var(--muted); font-size: .875rem; margin-bottom: 4px; }
.road-stop-role { font-size: .875rem; font-weight: 650; color: var(--navy); margin: 3px 0 7px; }
.road-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 11px; }
.road-controls button { min-height: 38px; padding-inline: 12px; }
.road-count { min-width: 46px; text-align: center; color: var(--muted); font-size: .875rem; }
.road-next-modules { max-width: 650px; margin: 20px auto 0; text-align: center; }
.road-next-modules h2 { font-size: 1rem; margin-bottom: 9px; }
.road-next-modules div { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.road-next-modules a {
  padding: 10px 15px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--paper);
  font-size: .9rem;
  font-weight: 650;
}
.road-next-modules a:hover { border-color: var(--ink); }
[data-scene="road"] footer { margin-top: 12px; }

@media (max-width: 620px) {
  .road-track { min-height: clamp(165px, 28vh, 205px); }
}
@media (max-width: 380px) {
  .topbar:has(.chapter-dock:not([hidden])) .topbar-inner { min-height: 0; flex-wrap: wrap; gap: 5px; padding-block: 7px; }
  .chapter-dock { margin-left: auto; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  [data-phase="walking"] .road-side::after, [data-phase="settling"] .road-side::after { animation: none; }
  .chapter-dock .chapter-card:hover { transform: none; }
}
