/* Farben und Regeln aus docs/design/Designsystem.md: eine Tinte, ein Akzent, höchstens Gewicht Medium,
   keine Schatten, keine Karten in Karten. */
:root {
  color-scheme: light dark;
  --ink: #17212b;
  --ink-secondary: #5b6671;
  --paper: #f6f3ec;
  --surface: #ebe9e3;
  --hairline: #dcd6ca;
  --accent: #0b6e79;
  --on-accent: #ffffff;
  --map-land: #efeade;
  --map-green: #dfe5d2;
  --map-water: #c3dbe2;
  --map-road: #ffffff;
  --line-1: #0072b2;
  --line-2: #e69f00;
  --line-3: #009e73;
  --stop-fill: #ffffff;
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 26px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebee;
    --ink-secondary: #9aa4ae;
    --paper: #11161c;
    --surface: #1c2229;
    --hairline: #2a313a;
    --accent: #4cc3cc;
    --on-accent: #0b1418;
    --map-land: #171e25;
    --map-green: #1b2a27;
    --map-water: #16303b;
    --map-road: #2b343e;
    --line-1: #3a9fd8;
    --stop-fill: #11161c;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 500; }

.skip { position: absolute; left: -999em; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 2; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Kopf und Fuss */
.site-head { padding: 22px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-size: 20px; font-weight: 500; letter-spacing: 0.04em; }
.brand svg { width: 30px; height: 30px; }
.mark-stops { fill: var(--paper); stroke: currentColor; }
.mark-node { stroke: var(--accent); }
.site-nav { display: flex; gap: 6px; }
.site-nav a { color: var(--ink-secondary); text-decoration: none; padding: 9px 14px; border-radius: 999px; font-size: 15px; }
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }

main { flex: 1; }

.site-foot { border-top: 1px solid var(--hairline); margin-top: 88px; padding: 28px 0 40px; color: var(--ink-secondary); font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-secondary); }

/* Startseite */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 40px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 58px); line-height: 1.08; font-weight: 500; letter-spacing: -0.015em; }
.hero p { margin-top: 20px; font-size: 19px; color: var(--ink-secondary); max-width: 30em; }
.actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; align-items: center; }
.button { display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px; border-radius: var(--radius-m);
  background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 500; }
.button:hover { filter: brightness(1.07); }
.note { font-size: 14px; color: var(--ink-secondary); }

.map { width: 100%; height: auto; display: block; border-radius: var(--radius-l); border: 1px solid var(--hairline); }
.map .land { fill: var(--map-land); }
.map .green { fill: var(--map-green); }
.map .water { fill: none; stroke: var(--map-water); stroke-width: 26; stroke-linecap: round; }
.map .road { fill: none; stroke: var(--map-road); stroke-width: 7; stroke-linecap: round; }
.map .line { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.map .l1 { stroke: var(--line-1); }
.map .l2 { stroke: var(--line-2); }
.map .l3 { stroke: var(--line-3); }
.map .stop { fill: var(--stop-fill); stroke-width: 4; }
.map .s1 { stroke: var(--line-1); }
.map .s2 { stroke: var(--line-2); }
.map .s3 { stroke: var(--line-3); }
.map .hub { fill: var(--stop-fill); stroke: var(--accent); stroke-width: 6; }
.map .bus rect { fill: #17212b; stroke: #ffffff; stroke-width: 3; }
.map .bus text { fill: #ffffff; font-size: 14px; font-weight: 500; }
.map .b1 { offset-path: path("M 52 330 C 120 320 150 262 214 244 S 322 214 352 160 S 430 92 506 86"); }
.map .b2 { offset-path: path("M 92 74 C 150 112 188 150 214 244 S 300 298 372 292 S 470 250 512 196"); }
.map .b3 { offset-path: path("M 262 372 C 250 306 224 276 214 244 S 250 168 262 156 S 300 74 330 44"); }
.map .bus { offset-rotate: auto; opacity: 0; }
.map .b1 { animation: ride 14s ease-in-out 1.8s infinite alternate, appear 0.4s ease 1.8s forwards; }
.map .b2 { animation: ride 18s ease-in-out 2.4s infinite alternate, appear 0.4s ease 2.4s forwards; }
.map .b3 { animation: ride 12s ease-in-out 3s infinite alternate, appear 0.4s ease 3s forwards; }
/* An jedem Halt kurz stehen bleiben. */
@keyframes ride {
  0%, 6% { offset-distance: 2%; }
  34%, 42% { offset-distance: 36%; }
  64%, 72% { offset-distance: 68%; }
  96%, 100% { offset-distance: 98%; }
}
@keyframes appear { to { opacity: 1; } }

.map .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s ease-out forwards; }
.map .pop circle { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pop 0.45s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.map .draw.d1 { animation-delay: 0.1s; }
.map .draw.d2 { animation-delay: 0.45s; }
.map .draw.d3 { animation-delay: 0.8s; }
.map .pop.d1 circle { animation-delay: 1.2s; }
.map .pop.d2 circle { animation-delay: 1.5s; }
.map .pop.d3 circle { animation-delay: 1.8s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }

/* Der Knoten, an dem sich alles trifft. */
.map .ring { fill: none; stroke: var(--accent); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ring 3.6s ease-out 2s infinite; }
.map .ring.later { animation-delay: 3.8s; }
@keyframes ring { 0% { transform: scale(1); opacity: 0.8; } 70%, 100% { transform: scale(3); opacity: 0; } }
.map .people circle { fill: var(--ink-secondary); animation: board 7s ease-in-out infinite; opacity: 0; }
.map .people circle:nth-child(2) { animation-delay: 0.5s; }
.map .people circle:nth-child(3) { animation-delay: 1.1s; }
@keyframes board { 0% { opacity: 0; transform: translateY(8px); } 20%, 60% { opacity: 1; transform: none; }
  75%, 100% { opacity: 0; transform: translate(14px, -22px); } }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 88px; }
.features div { border-top: 1px solid var(--hairline); padding-top: 20px; }
.features h2 { font-size: 19px; font-weight: 500; }
.features p { margin-top: 8px; color: var(--ink-secondary); font-size: 16px; }

/* Kleine Bilder zu den drei Teilen des Spiels */
.icon { display: block; width: 150px; height: 60px; margin-bottom: 14px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon .track { stroke: var(--hairline); stroke-width: 4; }
.draw-icon .route { stroke: var(--line-1); stroke-width: 4; stroke-dasharray: 1; animation: route 5s ease-in-out infinite; }
.draw-icon circle { fill: var(--stop-fill); stroke: var(--line-1); stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.draw-icon .n1 { animation: stop-in 5s ease infinite; }
.draw-icon .n2 { animation: stop-mid 5s ease infinite; }
.draw-icon .n3 { animation: stop-out 5s ease infinite; }
@keyframes route { 0%, 8% { stroke-dashoffset: 1; opacity: 1; } 60%, 88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes stop-in { 0%, 4% { transform: scale(1); } 10% { transform: scale(1.4); } 16%, 100% { transform: scale(1); } }
@keyframes stop-mid { 0%, 30% { transform: scale(1); } 36% { transform: scale(1.4); } 42%, 100% { transform: scale(1); } }
@keyframes stop-out { 0%, 56% { transform: scale(1); } 62% { transform: scale(1.4); } 68%, 100% { transform: scale(1); } }

.clock-icon .face { stroke: var(--ink); stroke-width: 2.5; }
.clock-icon .ticks { stroke: var(--ink-secondary); stroke-width: 2; }
.clock-icon .hand { stroke: var(--accent); stroke-width: 3; transform-origin: 24px 24px; animation: tick 6s steps(12, end) infinite; }
.clock-icon .pin { fill: var(--ink); }
.clock-icon .pulse rect { fill: var(--line-3); }
.clock-icon .pulse { opacity: 0.2; animation: arrive 6s ease-in-out infinite; }
.clock-icon .p2 { animation-delay: 2s; }
.clock-icon .p3 { animation-delay: 4s; }
@keyframes tick { to { transform: rotate(360deg); } }
@keyframes arrive { 0%, 33% { opacity: 1; } 50%, 100% { opacity: 0.2; } }

.charge-icon .body { stroke: var(--ink); stroke-width: 2.5; }
.charge-icon .windows { stroke: var(--ink-secondary); stroke-width: 5; }
.charge-icon .wheel { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.charge-icon .cell, .charge-icon .tip { stroke: var(--ink); stroke-width: 2.5; }
.charge-icon .bar { fill: var(--accent); opacity: 0; animation: charge 4.5s ease infinite; }
.charge-icon .q2 { animation-delay: 0.8s; }
.charge-icon .q3 { animation-delay: 1.6s; }
@keyframes charge { 0% { opacity: 0; } 12%, 60% { opacity: 1; } 75%, 100% { opacity: 0; } }

/* Abschnitte gleiten beim Scrollen herein, wo der Browser das ohne Skript kann. */
@supports (animation-timeline: view()) {
  .features div, .promise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}

.brand .mark-node { transform-box: fill-box; transform-origin: center; transition: transform 0.3s ease; }
.brand:hover .mark-node { transform: scale(1.25); }

/* Seite nicht gefunden: der Bus fährt vorbei. */
.lost { display: block; width: 100%; max-width: 520px; height: auto; margin-top: 32px; }
.lost .track { stroke: var(--hairline); stroke-width: 5; stroke-linecap: round; }
.lost .sign { fill: var(--stop-fill); stroke: var(--accent); stroke-width: 4; }
.lost .coach rect { fill: var(--ink); }
.lost .coach .windows { stroke: var(--paper); stroke-width: 7; stroke-linecap: round; }
.lost .coach { animation: pass 5s linear infinite; }
@keyframes pass { from { transform: translateX(-140px); } to { transform: translateX(560px); } }

.promise { margin-top: 56px; background: var(--surface); border-radius: var(--radius-l); padding: 32px; }
.promise h2 { font-size: 22px; font-weight: 500; }
.promise p { margin-top: 8px; color: var(--ink-secondary); max-width: 40em; }

/* Textseiten */
.page { max-width: 760px; padding-top: 32px; }
.page h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
.page .lead { margin-top: 14px; color: var(--ink-secondary); font-size: 19px; }
.page h2 { margin-top: 48px; font-size: 23px; line-height: 1.3; font-weight: 500; scroll-margin-top: 16px; }
.page h3 { margin-top: 28px; font-size: 18px; font-weight: 500; }
.page h4 { margin-top: 20px; font-size: 17px; font-weight: 500; }
.page p { margin-top: 14px; }
.page ul, .page ol { margin-top: 14px; padding-left: 22px; }
.page li { margin-top: 6px; }
.page li::marker { color: var(--ink-secondary); }
.page hr { border: 0; border-top: 1px solid var(--hairline); margin-top: 40px; }
.page code { font: 0.88em ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface); padding: 1px 5px; border-radius: 5px;
  overflow-wrap: anywhere; }
.page a { overflow-wrap: anywhere; }
.page pre { margin-top: 18px; background: var(--surface); border-radius: var(--radius-s); padding: 16px; overflow-x: auto; }
.page pre code { background: none; padding: 0; white-space: pre; overflow-wrap: normal; }

.table { margin-top: 18px; overflow-x: auto; }
.table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--hairline); }
.table th { font-weight: 500; color: var(--ink-secondary); }

.toc { margin-top: 32px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 14px 0; }
.toc summary { cursor: pointer; color: var(--ink-secondary); min-height: 32px; }
.page .toc ul { list-style: none; padding-left: 0; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; font-size: 15px; }

.contact { margin-top: 32px; background: var(--surface); border-radius: var(--radius-l); padding: 28px; }
.page .contact h2 { margin-top: 0; }
.contact .button { margin-top: 20px; overflow-wrap: anywhere; }

.faq { margin-top: 18px; border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0; min-height: 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: var(--ink-secondary); }

address { font-style: normal; margin-top: 14px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 16px; }
  .features { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 56px; }
  .page .toc ul { columns: 1; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 18px; }
  .site-nav a { padding: 8px 10px; }
  .promise, .contact { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .map .bus, .map .pop circle, .map .draw, .map .ring, .map .people circle, .icon *, .lost .coach, .features div, .promise,
  .brand .mark-node { animation: none !important; transition: none !important; }
  .map .draw { stroke-dashoffset: 0; }
  .map .pop circle { transform: none; }
  .map .bus { opacity: 1; }
  .map .b1 { offset-distance: 66%; }
  .map .b2 { offset-distance: 70%; }
  .map .b3 { offset-distance: 22%; }
  .charge-icon .bar, .clock-icon .pulse, .map .people circle { opacity: 1; }
  .draw-icon .route { stroke-dasharray: none; }
  .lost .coach { transform: translateX(300px); }
}
