/*
 * Drival — Startseite.
 *
 * Eine Datei, keine Abhängigkeiten. Bewusst ohne Google Fonts, ohne CDN, ohne
 * eingebettete Karte und ohne Analytics: Jede dieser Einbindungen schickt die
 * IP-Adresse des Besuchers an einen Dritten, bevor er die Datenschutzerklärung
 * gelesen hat. Bei Google Fonts ist genau das abgemahnt worden.
 *
 * Kein Inline-Style irgendwo in der Seite. Die CSP der `.htaccess` erlaubt
 * `style-src 'self'` ohne `'unsafe-inline'` — ein `style="…"`-Attribut würde
 * vom Browser verworfen, und die Seite fiele auseinander, ohne dass jemand
 * einen Fehler sieht.
 *
 * Die Farben sind die der App (`src/theme/index.ts`), damit Seite und App
 * nicht wie zwei Produkte aussehen. Nur dunkel: die App ist es auch.
 */

:root {
  --bg: #0b0f14;
  --surface: #151b23;
  --raised: #1d2530;
  --sunken: #10161d;
  --line: #28313d;
  --line-soft: #1b232c;
  --text: #f2f5f8;
  --muted: #8b97a6;
  --dim: #6e7883;
  --accent: #ff6b2c;
  --accent-bright: #ff8a55;
  --friend: #a78bfa;
  --public: #60a5fa;
  --star: #ffd53d;
  --ok: #34d399;
  --stop: #f43f5e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

.mono { font-family: var(--mono); }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.pretty { text-wrap: pretty; }

/* Sprungmarke für die Tastatur — sichtbar erst beim Fokus. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--accent); color: var(--bg); padding: 12px 20px;
  border-radius: 0 0 10px 0; font-weight: 600;
}
.skip:focus { left: 0; color: var(--bg); }

/* ---------------------------------------------------------------- Kopfzeile */

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px 40px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.is-on { color: var(--text); }

.lang { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.lang button {
  font-family: var(--mono); font-size: 12px; padding: 5px 9px;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.lang button.is-on { background: var(--accent); color: var(--bg); }

.badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--accent);
  border: 1px solid rgba(255, 107, 44, 0.45); border-radius: 999px; padding: 5px 11px;
}

/* -------------------------------------------------------------- Seitentausch
 * Ohne JavaScript stehen alle Abschnitte untereinander und sind lesbar. Erst
 * die Klasse `js` am <html> — vom Skript im Kopf gesetzt — macht Reiter daraus.
 */
.js .page { display: none; }
.js .page.is-on { display: block; }

/* -------------------------------------------------------------------- Typo */

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); margin: 0 0 18px;
}
.kicker.is-dim { color: var(--dim); }

h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.03; font-weight: 700; letter-spacing: -1.5px; margin: 0 0 22px; }
h2 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 700; letter-spacing: -1px; margin: 0 0 16px; max-width: 24ch; }
h3 { font-size: clamp(26px, 3.2vw, 32px); font-weight: 700; letter-spacing: -0.6px; margin: 0 0 14px; }

.lead { font-size: 18px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 64ch; }
.lead.is-large { font-size: 19px; margin-bottom: 32px; max-width: 52ch; }
.note { font-size: 14px; line-height: 1.55; color: var(--dim); max-width: 62ch; }

/* ------------------------------------------------------------------ Knöpfe */

.btn {
  display: inline-block; border: 0; border-radius: 10px;
  padding: 15px 26px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-bright); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #4a5560; color: var(--text); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* ------------------------------------------------------------------ Raster */

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 56px; align-items: center; }
.split.is-top { align-items: start; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.card h4 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.card p { font-size: 16px; line-height: 1.55; color: var(--muted); margin: 0; }
.card .num-badge { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; color: var(--accent); margin-bottom: 14px; }
.card.is-wide h4 { font-size: 22px; margin-bottom: 10px; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.stat.is-accent { border-color: var(--accent); }
.stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-size: 36px; font-weight: 700; letter-spacing: -1px; }
.stat.is-accent .stat-value { color: var(--accent); }
.stat-unit { font-size: 16px; font-weight: 500; color: var(--muted); }

.bullets { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.bullets li { display: flex; gap: 12px; align-items: baseline; font-size: 16px; line-height: 1.5; color: #c8d0d8; }
.bullets li::before { content: "—"; font-family: var(--mono); font-size: 13px; color: var(--accent); }

.aside {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; font-size: 14px; line-height: 1.55; color: var(--muted);
}

/* ------------------------------------------------------- Telefon-Nachbauten
 * Kein Bildschirmfoto: Die Zahlen darauf sollen dieselben sein wie im Text
 * daneben, und ein Foto veraltet mit der nächsten Fassung.
 */
.phone {
  border: 1px solid var(--line); border-radius: 34px; padding: 9px;
  background: var(--surface); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  width: 318px; max-width: 100%;
}
.screen { background: var(--bg); border-radius: 26px; overflow: hidden; padding-bottom: 14px; }
.sbar { display: flex; justify-content: space-between; padding: 11px 16px 7px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.shead { padding: 2px 16px 12px; }
.stitle { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.smeta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.smap { margin: 0 12px 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #10161d 0%, #0d1218 55%, #111820 100%); }
.smap svg { display: block; width: 100%; height: auto; }
.stiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 12px; }
.stiles.is-three { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tile { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.stiles.is-three .tile { padding: 11px 9px; }
.tlabel { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.stiles.is-three .tlabel { font-size: 9px; }
.tvalue { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.stiles.is-three .tvalue { font-size: 19px; }
.tunit { font-size: 12px; font-weight: 500; color: var(--muted); }
.tsub { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 3px; }

.chartbox { margin: 12px 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.chartbox svg { display: block; width: 100%; height: auto; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.chart-head .mono { font-size: 10px; font-weight: 400; color: var(--muted); }
.chart-foot { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; }

.sideshare { margin: 12px 12px 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sideshare-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.sidebar-track { display: flex; height: 8px; border-radius: 999px; overflow: hidden; }
.sidebar-left { background: var(--accent); }
.sidebar-right { background: #4b8bf5; }
.sideshare-note { font-size: 10px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

.slist-title { padding: 14px 16px 6px; font-size: 12px; font-weight: 600; }
.slist { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.srow-head { display: flex; justify-content: space-between; align-items: baseline; }
.srow-dir { font-size: 13px; font-weight: 600; }
.srow-dir.is-left { color: var(--accent); }
.srow-dir.is-right { color: #4b8bf5; }
.srow-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 5px; }
.sfoot { padding: 12px 16px 0; font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* -------------------------------------------------------------- Streckenkarte */

.mapwrap { position: relative; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }

.mapbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.mapbar-spacer { flex: 1; min-width: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; border-radius: 999px; padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid currentColor;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.chip.is-own { color: var(--accent); }
.chip.is-friend { color: var(--friend); }
.chip.is-public { color: var(--public); }
.chip[aria-pressed="false"] { color: var(--dim); background: transparent; border-color: var(--line); }
.chip[aria-pressed="false"] .dot { background: #3a424d; }

.stars-filter { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.stars-filter button {
  font-family: var(--mono); font-size: 12px; padding: 5px 11px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.stars-filter button.is-on { background: var(--accent); color: var(--bg); }

/* Kein Beschnitt: Das Seitenverhaeltnis der Flaeche ist das der Zeichnung,
   deshalb passt "meet" auf jeder Breite genau — Karlsruhe und Stuttgart
   fallen nicht heraus, sobald das Fenster schmaler wird. */
.mapsurface { position: relative; aspect-ratio: 1160 / 520; min-height: 260px; background: #0e141a; }
.mapsurface svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route { cursor: pointer; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route.is-hidden { display: none; }

.mappill {
  position: absolute; font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: rgba(11, 15, 20, 0.85); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px;
}
.mappill.is-left { left: 16px; top: 16px; }
.mappill.is-right { right: 16px; top: 16px; }

/* Unten rechts, nicht unten links: Links liegen die Strecken um Bad Herrenalb
   und der Nordschwarzwald — das Fenster wuerde sie zudecken.
   44px und nicht 16px Abstand nach unten: Dort steht der Quellenvermerk von
   OpenStreetMap, und den verlangt die Lizenz sichtbar. Aufgefallen ist das erst
   am 18.09.2026 — vorher lag die Karte ueber dem Fenster (doppelte Kennung
   `karte`, siehe drival.js), und es war gar nicht zu sehen. */
.mapcard {
  position: absolute; right: 16px; bottom: 44px; width: 320px; max-width: calc(100% - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.mapcard[hidden] { display: none; }
.mapcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mapcard-name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.mapcard-stars { font-size: 12px; color: var(--star); white-space: nowrap; }
.mapcard-stars .off { color: #3a424d; }
.mapcard-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
/* Hoechstens so hoch, dass das Fenster die Karte nicht zudeckt; der Rest
   scrollt im Fenster. `pre-line`, weil Kommentare Zeilenumbrueche haben
   duerfen, und `anywhere`, weil ein langes Wort sonst die Breite sprengt. */
.mapcard-comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; max-height: 180px; overflow-y: auto; }
.mapcard-comments[hidden] { display: none; }
.mapcard-comments-title { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.mapcard-comment { font-size: 13px; line-height: 1.45; margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.mapcard-comment.is-empty { color: var(--muted); }
.mapcard-comment time { display: block; font-family: var(--mono); font-size: 11px; color: var(--dim); }
/* Auf dem Telefon ist die Karte kaum 260px hoch. Mit 180px Kommentaren deckte
   das Fenster sie ganz zu. */
@media (max-width: 600px) {
  .mapcard-comments { max-height: 88px; }
}
.mapcard-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.mapcard-src { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 12px; }
.mapcard-src .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mapcard-demo { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-left: auto; }

.legend { display: flex; align-items: center; gap: 16px; background: var(--sunken); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-top: 18px; }
.legend span { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.ramp { flex: 1; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #4b8bf5 0%, #8ed14b 25%, #ffd53d 50%, #ff8a1f 75%, #ff3b1f 100%); }

/* --------------------------------------------------------------------- FAQ */

.faq { display: flex; flex-direction: column; gap: 12px; max-width: 900px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.faq-q {
  width: 100%; display: flex; gap: 16px; align-items: baseline; justify-content: space-between;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  padding: 22px 24px; font-size: 18px; font-weight: 600;
}
.faq-item:hover { border-color: #3a424d; }
.faq-sign { font-family: var(--mono); font-size: 16px; color: var(--accent); }
.faq-a { padding: 0 24px 22px; font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0; }
.faq-a[hidden] { display: none; }

.support {
  max-width: 900px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 30px;
}
.support h4 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.support p { font-size: 16px; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------- Abschluss, Fuß */

.cta { border-top: 1px solid var(--line); background: #0d1218; }
.cta-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.cta p { font-size: 17px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 56ch; }

.site-footer {
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center;
  padding-top: 32px; padding-bottom: 32px;
}
.site-footer .brand img { width: 24px; height: 24px; border-radius: 7px; }
.site-footer .who { font-size: 14px; color: var(--dim); }
.site-footer nav { display: flex; gap: 22px; font-size: 14px; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); }

/* --------------------------------------------------------------- Abstände */

.sec { padding-top: 72px; padding-bottom: 32px; }
.sec-hero { padding-top: 80px; padding-bottom: 40px; }
.sec-mid { padding-top: 24px; padding-bottom: 24px; }
.sec-end { padding-top: 40px; padding-bottom: 96px; }
.sec-tight { padding-top: 8px; padding-bottom: 40px; }

.center { display: flex; justify-content: center; }

/* ------------------------------------------------------------- Schmale Geräte */

@media (max-width: 640px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .site-header { padding: 12px 20px; gap: 12px; }
  .nav { order: 3; width: 100%; }
  .split { gap: 32px; }
  /* Auf dem Telefon wird die Karte flach; das schwebende Fenster wuerde sie
     zudecken und steht deshalb darunter. */
  .mapcard { position: static; width: auto; max-width: none; border-radius: 0; border-width: 1px 0 0; }
  .mappill { font-size: 11px; padding: 5px 10px; }
  .sec, .sec-hero { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Quelle im schwebenden Fenster — die Farbe kommt aus der Klasse, nicht aus
   einem Inline-Style: `style-src 'self'` verbietet Letzteres. */
.mapcard-src.is-own { color: var(--accent); }
.mapcard-src.is-friend { color: var(--friend); }
.mapcard-src.is-public { color: var(--public); }

/* ------------------------------------------------------------- Echte Karte
 * MapLibre bringt eigene Klassen mit; hier wird nur nachgezogen, was sonst
 * hell auf dunkel stünde.
 */
.mapcanvas { position: absolute; inset: 0; }
.mapbar-note { font-size: 12px; color: var(--muted); }
.chip.is-static { cursor: default; }

.mapstate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: min(34rem, calc(100% - 32px)); margin: 0; z-index: 2;
  background: rgba(11, 15, 20, 0.9); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 18px;
  font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center;
  pointer-events: none;
}
.mapstate[hidden] { display: none; }

.maplibregl-ctrl-group {
  background: var(--surface) !important;
  border: 1px solid var(--line);
  box-shadow: none !important;
}
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-group button span { filter: invert(1) brightness(1.6); }
.maplibregl-ctrl-attrib {
  background: rgba(11, 15, 20, 0.85) !important;
  color: var(--muted); font-size: 11px;
}
.maplibregl-ctrl-attrib a { color: var(--muted); }
.maplibregl-ctrl-attrib-button { filter: invert(1) brightness(1.6); }
