/* Manrope (SIL Open Font License), served from this site: no Google Fonts request. */
@font-face {
  font-family: Manrope;
  src: url('fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f4f3ef;
  --bg-2: #e6e5df;
  --ink: #0b0b0c;
  --muted: #5b5d63;
  --card: rgba(255, 255, 255, 0.8);
  --card-solid: #ffffff;
  --line: rgba(11, 11, 12, 0.1);
  --accent: #14b57a;
  --on-accent: #0b0b0c;
  --shadow: 0 18px 50px -20px rgba(20, 20, 30, 0.35);
  --radius: 22px;
  --font: Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e0f11;
    --bg-2: #1a1b20;
    --ink: #f2f2ee;
    --muted: #a3a5ab;
    --card: rgba(24, 25, 29, 0.8);
    --card-solid: #18191d;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #2bd98f;
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e0f11;
  --bg-2: #1a1b20;
  --ink: #f2f2ee;
  --muted: #a3a5ab;
  --card: rgba(24, 25, 29, 0.8);
  --card-solid: #18191d;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #2bd98f;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 20%, var(--bg) 40%, var(--bg-2) 100%) fixed;
  background-color: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- loading ---------- */
.loader {
  position: fixed; z-index: 14; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; gap: 10px; justify-items: center; font-size: 14px; font-weight: 700; color: var(--muted);
  transition: opacity 0.5s;
}
.loader i { display: block; width: 180px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.loader b { display: block; height: 100%; width: calc(var(--p, 0.05) * 100%); background: var(--accent); transition: width 0.2s; }
.loader.done { opacity: 0; pointer-events: none; }
body.classic .loader { display: none; }
@media (min-width: 761px) { .loader { left: calc(50% - 200px); } }

/* ---------- header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 68px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: block; height: 24px; color: var(--ink); }
.brand svg { height: 100%; width: auto; display: block; fill: currentColor; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.chip, .icon-btn, .btn {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.chip { height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.chip:hover, .icon-btn:hover, .btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.chip.solid, .icon-btn.solid, .btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:disabled { opacity: 0.35; cursor: default; transform: none; }
#themeBtn .i-sun { display: none; }
[data-theme='dark'] #themeBtn .i-sun { display: block; }
[data-theme='dark'] #themeBtn .i-moon { display: none; }

/* ---------- route menu: the road Vyn drives ---------- */
.route { position: fixed; z-index: 15; left: 24px; top: 50%; transform: translateY(-50%); }
.route ol { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 6px; }
.route ol::before {
  content: ''; position: absolute; left: 13px; top: 16px; bottom: 16px; width: 4px; border-radius: 4px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 8px, transparent 8px 14px);
  opacity: 0.18;
}
.route-stop {
  position: relative; display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 6px 10px 6px 4px; cursor: pointer; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.route-stop .dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; position: relative;
  background: var(--bg); border: 3px solid var(--line);
  transition: transform 0.3s cubic-bezier(.3,1.6,.5,1), background 0.3s, border-color 0.3s;
}
.route-stop.seen .dot { border-color: var(--ink); }
.route-stop:hover { color: var(--ink); }
.route-stop:hover .dot { transform: scale(1.15); }
.route-stop .lbl {
  transition: transform 0.2s; padding: 3px 10px; border-radius: 999px;
  background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.route-stop:hover .lbl { transform: translateX(3px); }
/* The current stop wears Vyn's face. */
.route-stop[aria-current] { color: var(--ink); }
.route-stop[aria-current] .dot { background: var(--accent); border-color: var(--accent); transform: scale(1.35); }
.route-stop[aria-current] .dot::before, .route-stop[aria-current] .dot::after {
  content: ''; position: absolute; top: 5px; width: 4px; height: 6px; border-radius: 3px; background: #0b0b0c;
  animation: blink 4s infinite;
}
.route-stop[aria-current] .dot::before { left: 4px; }
.route-stop[aria-current] .dot::after { right: 4px; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.15); } }

/* ---------- speech bubble ---------- */
.bubble {
  position: fixed; left: 0; top: 0; z-index: 18; max-width: 330px;
  padding: 16px 18px 14px; border-radius: 20px;
  background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform-origin: var(--tail, 30px) 100%;
  transition: opacity 0.25s;
  --tail: 30px;
}
.bubble.show { opacity: 1; pointer-events: auto; }
.bubble::after {
  content: ''; position: absolute; bottom: -9px; left: calc(var(--tail) - 10px);
  border: 10px solid transparent; border-bottom: 0; border-top-color: var(--ink);
}
.bubble p { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 600; min-height: 1.45em; }
.bubble-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bubble .chip { height: 34px; font-size: 13px; background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); backdrop-filter: none; }
.bubble .chip.solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.bubble .chip:hover { border-color: var(--bg); }

/* ---------- panel with the stop's content ---------- */
.panel {
  position: fixed; z-index: 16; right: 24px; top: 50%; transform: translateY(-50%);
  width: min(400px, 34vw); max-height: calc(100dvh - 110px); overflow: auto; overscroll-behavior: contain;
  background: var(--card); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 26px 0;
}
.stop { display: none; animation: rise 0.45s cubic-bezier(.2,.8,.2,1); }
.stop.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.kicker { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.stop h1, .stop h2 { margin: 0 0 14px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.stop h2 { font-size: 26px; }
.stop h1 { font-size: 34px; }
.stop p, .stop li { font-size: 15px; line-height: 1.55; color: var(--muted); }
.stop ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.stop li { position: relative; padding-left: 22px; }
.stop li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); }
.lead { font-size: 17px !important; color: var(--ink) !important; }
.hero-mark { display: block; width: 190px; height: auto; fill: currentColor; margin: 4px 0 22px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: 15px; text-decoration: none; }
.tiles { display: grid; gap: 8px; margin-bottom: 8px; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.tile b { font-size: 15px; }
.tile span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.foot { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 22px; font-size: 13px; color: var(--muted); }
.note { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* In the tour, Vyn says the .say line in the bubble; keep it for screen readers. */
.stop .say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.panel-nav {
  position: sticky; bottom: 0; margin: 18px -26px 0; padding: 14px 26px 14px;
  background: linear-gradient(to bottom, transparent, var(--card-solid) 30%);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; }
/* Imprint and privacy are one click away on every screen. */
.legal-links { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; }
body.classic .panel-nav { position: static; margin: 24px 0 0; padding: 0; background: none; }

/* ---------- language menu ---------- */
.lang { position: relative; }
.lang summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; min-width: 150px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.lang a { display: block; padding: 8px 12px; border-radius: 9px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--ink); }
.lang a:hover { background: var(--line); }
.lang a[aria-current] { color: var(--accent); }
.count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- look around ---------- */
.free-hint {
  position: fixed; z-index: 18; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(12px); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.free-hint[hidden] { display: none; }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }
body.free .panel, body.free .bubble, body.free #freeBtn { display: none; }

/* ---------- read as page ---------- */
body.classic { overflow: auto; }
body.classic #scene, body.classic .route, body.classic .bubble, body.classic [data-tour-only], body.classic .free-hint { display: none !important; }
body.classic .top { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.classic .panel {
  position: static; transform: none; width: min(720px, 100% - 32px); max-height: none; overflow: visible;
  margin: 0 auto; padding: 100px 0 60px; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.classic .stop { display: block; animation: none; padding: 40px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
body.classic .stop .say {
  position: static; width: auto; height: auto; clip: auto; white-space: normal;
  font-size: 17px; color: var(--ink); font-weight: 600; margin: 0 0 16px; padding-left: 16px; border-left: 3px solid var(--accent);
}
body.classic .stop .say::before { content: 'Vyn: '; color: var(--accent); }
body.classic .hero h1 { font-size: clamp(36px, 7vw, 56px); }
body.classic .hero-mark { width: 240px; }
body.classic .tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ---------- phones and narrow windows ---------- */
@media (max-width: 760px) {
  .top { height: 56px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .route { background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 82%, transparent), transparent); }
  .brand { height: 20px; }
  #freeBtn { display: none; }
  .chip { height: 36px; padding: 0 13px; font-size: 13px; }
  .icon-btn { width: 38px; height: 38px; }

  .route { left: 0; right: 0; top: 56px; transform: none; }
  .route ol { flex-direction: row; gap: 0; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .route ol::-webkit-scrollbar { display: none; }
  .route ol::before { left: 28px; right: 28px; top: 15px; bottom: auto; width: auto; height: 3px; background: repeating-linear-gradient(to right, var(--ink) 0 8px, transparent 8px 14px); }
  .route li { flex: none; scroll-snap-align: center; }
  .route-stop { flex-direction: column; gap: 4px; padding: 4px 8px; font-size: 11px; min-width: 58px; }
  .route-stop .dot { width: 20px; height: 20px; }
  .route-stop:hover .lbl { transform: none; }
  .route-stop .lbl { padding: 1px 6px; }

  .bubble { display: none; }
  .panel {
    left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto;
    max-height: min(52dvh, 460px); border-radius: var(--radius) var(--radius) 0 0; border-width: 1px 0 0;
    padding: 18px 16px 0;
  }
  .panel-nav { margin: 12px -16px 0; padding: 10px 16px calc(8px + env(safe-area-inset-bottom)); }
  .legal-links { margin-top: 6px; font-size: 11px; }
  .top-actions { gap: 6px; }
  .lang summary { padding: 0 11px; }
  .stop h2 { font-size: 21px; margin-bottom: 10px; }
  .stop h1 { font-size: 26px; }
  .hero-mark { width: 130px; margin: 0 0 14px; }
  .stop p, .stop li { font-size: 14px; }
  .cta { margin-top: 14px; }
  .btn { height: 42px; padding: 0 18px; font-size: 14px; }
  /* No bubble on phones: Vyn's line leads the sheet instead. */
  body:not(.classic) .stop .say {
    position: relative; width: auto; height: auto; clip: auto; white-space: normal;
    margin: 0 0 12px; padding: 10px 12px 10px 46px; border-radius: 14px;
    background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px;
  }
  body:not(.classic) .stop .say::before {
    content: ''; position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%;
    background: radial-gradient(circle at 35% 42%, #0b0b0c 0 2.4px, transparent 2.6px), radial-gradient(circle at 65% 42%, #0b0b0c 0 2.4px, transparent 2.6px), var(--accent);
  }
  .free-hint { bottom: calc(16px + env(safe-area-inset-bottom)); font-size: 12px; max-width: calc(100% - 24px); white-space: normal; }
  body.classic .panel { padding-top: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- plain pages: imprint, privacy ---------- */
body.doc { overflow: auto; }
body.doc .top { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.doc-main { width: min(760px, 100% - 32px); margin: 0 auto; padding: 96px 0 48px; }
.doc-main .back { font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none; }
.doc-main .back:hover { color: var(--ink); }
.doc-main h1 { font-size: clamp(32px, 6vw, 46px); letter-spacing: -0.02em; margin: 18px 0 18px; }
.doc-main h2 { font-size: 19px; margin: 34px 0 8px; }
.doc-main p, .doc-main li { font-size: 16px; line-height: 1.65; color: var(--muted); }
.doc-main strong { color: var(--ink); }
.doc-main a { color: var(--ink); }
.doc-main ul { padding-left: 22px; }
.doc-main code { font-size: 14px; }
.doc-main .binding, .doc-main .updated { font-size: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.doc-main .updated { border: 0; padding: 0; }
.doc-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.doc-foot a { color: var(--muted); }
