/* Liniennetz – jede App eine Linie, jede Pflichtseite eine Haltestelle. */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("/fonts/barlow-semi-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #0e1b2c;
  --ink-2: #364256;
  --ink-3: #566275;
  --rule: #dfe3e9;
  --line: var(--ink);
  --on-line: var(--bg);

  --sign: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --read: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: max(16px, min(6vw, 96px));
  --content: 1072px;
  --wrap: min(100% - 2 * var(--gutter), var(--content));
  --inset: max(var(--gutter), (100% - var(--content)) / 2);
  --band: 8px;
  --dot: 24px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1522;
    --ink: #eef2f7;
    --ink-2: #c4cdd9;
    --ink-3: #9aa6b7;
    --rule: #22324a;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--read);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--line) 28%, transparent);
  color: var(--ink);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--sign);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--sign);
  font-weight: 600;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* ---------- Kürzel-Plakette ---------- */

.plate {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 3.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 5px;
  background: var(--line);
  color: var(--on-line);
  font: 700 1.375rem/1 var(--sign);
  letter-spacing: 0.01em;
}
.plate-sm {
  min-width: 2.25rem;
  height: 1.75rem;
  font-size: 1rem;
  border-radius: 4px;
}
.plate-xs {
  min-width: 1.75rem;
  height: 1.25rem;
  font-size: 0.8125rem;
  border-radius: 3px;
  padding: 0 0.3rem;
}
.plate-inv {
  background: var(--on-line);
  color: var(--line);
}

/* ---------- Kopfzeile ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--inset);
  padding-top: max(18px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--rule);
  font-family: var(--sign);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  --line: var(--ink);
  --on-line: var(--bg);
}
.brand .plate {
  --line: var(--ink);
  --on-line: var(--bg);
}
.topnav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  font-weight: 600;
  font-size: 1.0625rem;
}
.topnav a {
  text-decoration: none;
  color: var(--ink-2);
  padding: 6px 0;
}
.topnav .lang {
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

/* ---------- Startseite ---------- */

.hero {
  width: var(--wrap);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 112px) 0 clamp(32px, 5vw, 56px);
}
.hero h1 {
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  max-width: 12ch;
}
.lead {
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
  margin-top: 1.25rem;
}

.lines {
  width: var(--wrap);
  margin: 0 auto;
  padding: 0 0 clamp(40px, 6vw, 72px);
}
.lines-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 20px;
}
.lines-head {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 32px;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 10px;
  font-family: var(--sign);
}
.lines-head span {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.line-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.line-row {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  align-items: center;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
}
.line-row:last-child {
  border-bottom: 0;
}
.line-id {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
}
.line-id .plate {
  min-width: 4rem;
  height: 2.75rem;
  font-size: 1.625rem;
}
.line-name {
  font: 700 2.125rem/1 var(--sign);
}
.line-name small {
  display: block;
  margin-top: 6px;
  font: 400 0.9375rem/1.4 var(--read);
  color: var(--ink-3);
}

/* ---------- Linie mit Haltestellen ---------- */

.track ol {
  position: relative;
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
}
.track ol::before {
  content: "";
  position: absolute;
  top: calc(var(--dot) / 2 - var(--band) / 2);
  left: calc(var(--dot) / 2);
  right: calc(var(--dot) / 2);
  height: var(--band);
  border-radius: 4px;
  background: var(--line);
}
.stop {
  position: relative;
  flex: 0 1 auto;
}
.stop:first-child .stop-label,
.stop:first-child > a {
  align-items: flex-start;
}
.stop > a,
.stop.is-plain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 44px;
}
.track.is-soon .stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.stop:first-child > a,
.track.is-soon .stop:first-child {
  align-items: flex-start;
}
.stop:last-child > a,
.track.is-soon .stop:last-child {
  align-items: flex-end;
}
.stop-dot {
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--bg);
  border: 6px solid var(--line);
  transition: background-color 120ms ease;
}
.stop-label {
  font: 600 1.0625rem/1.15 var(--sign);
  color: var(--ink);
  white-space: nowrap;
}
.stop.is-here .stop-dot {
  background: var(--line);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--line);
}
.stop.is-here .stop-label {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--line);
}
@media (hover: hover) and (pointer: fine) {
  .stop > a:hover .stop-dot {
    background: var(--line);
  }
}
.stop > a:focus-visible .stop-dot {
  background: var(--line);
}
.track.is-soon ol::before {
  background: none;
  height: 0;
  top: calc(var(--dot) / 2 - var(--band) / 2);
  border-top: var(--band) dashed var(--rule);
  border-radius: 0;
}
.track.is-soon .stop-dot {
  border-color: var(--rule);
}
.track.is-soon .stop-label {
  color: var(--ink-3);
}

.track-wrap {
  width: var(--wrap);
  margin: 0 auto;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.track-wrap::-webkit-scrollbar {
  display: none;
}
.track-wrap .track ol {
  min-width: 520px;
}
.track-wrap-site .track ol {
  min-width: 300px;
  max-width: 520px;
}

/* ---------- App-Kopfband ---------- */

.masthead {
  background: var(--line);
  color: var(--on-line);
}
.masthead-inner {
  width: var(--wrap);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) 0;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
}
.app-icon {
  width: clamp(64px, 9vw, 96px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 6px 20px -6px rgb(0 0 0 / 0.35), 0 1px 3px rgb(0 0 0 / 0.2);
}
.masthead-name {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  font: 700 clamp(2.5rem, 7vw, 4.75rem)/0.95 var(--sign);
  letter-spacing: -0.01em;
}
.masthead-name a {
  text-decoration: none;
}
.masthead-name .plate {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  height: clamp(2rem, 3.4vw, 2.5rem);
}
.masthead-tag {
  margin: 12px 0 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.4;
  color: var(--on-line);
}
.masthead :focus-visible {
  outline-color: var(--on-line);
}

/* ---------- Inhaltsseiten ---------- */

.page {
  width: var(--wrap);
  margin: 0 auto;
  padding: 0 0 clamp(48px, 7vw, 96px);
}
.split {
  width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: 32px;
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--rule);
}
.page .split {
  width: 100%;
}
.page .split:first-child {
  border-top: 0;
}
.split > h1,
.split > h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.prose {
  max-width: 68ch;
}
.prose > .lead:first-child {
  margin-top: 0;
}
.prose h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 0.75rem;
}
.prose ol,
.prose ul {
  padding-left: 1.25rem;
}
.prose li {
  margin-bottom: 0.4em;
}
.meta {
  font-size: 0.9375rem;
  color: var(--ink-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font: 600 1.125rem/1 var(--sign);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
  user-select: none;
  -webkit-user-select: none;
}
.button:active {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background: color-mix(in srgb, var(--ink) 84%, var(--bg));
  }
}
.text-link {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 1.125rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1.5px dashed var(--ink-3);
  border-radius: 6px;
  font: 600 1.0625rem/1 var(--sign);
  color: var(--ink-2);
}

.notice {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.faq {
  border-bottom: 1px solid var(--rule);
}
.faq:first-child {
  border-top: 1px solid var(--rule);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  font: 600 1.25rem/1.25 var(--sign);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-right: 2.5px solid var(--ink-3);
  border-bottom: 2.5px solid var(--ink-3);
  rotate: 45deg;
  translate: 0 -3px;
  transition: rotate 200ms var(--ease-out), translate 200ms var(--ease-out);
}
.faq[open] summary::after {
  rotate: 225deg;
  translate: 0 3px;
}
.faq p {
  color: var(--ink-2);
  padding-bottom: 8px;
}

.steps li::marker {
  font-family: var(--sign);
  font-weight: 700;
}

.tags {
  list-style: none;
  padding: 0 !important;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  font: 600 1rem/1.4 var(--sign);
  color: var(--ink-3);
}
.tags li {
  margin: 0;
}
.tags {
  column-gap: 20px;
}

/* ---------- Rechtstexte: senkrechte Linie ---------- */

.doc {
  width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 112px);
}
.doc-rail {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.rail-h {
  font: 600 0.875rem/1 var(--sign);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.rail ol {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rail ol::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 6px;
  border-radius: 3px;
  background: var(--line);
}
.rail a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
  min-height: 40px;
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--ink-2);
}
.rail .stop-dot {
  --dot: 20px;
  flex: none;
  border-width: 5px;
}
@media (hover: hover) and (pointer: fine) {
  .rail a:hover {
    color: var(--ink);
  }
  .rail a:hover .stop-dot {
    background: var(--line);
  }
}
.rail a.is-here {
  color: var(--ink);
  font-weight: 600;
}
.rail a.is-here .stop-dot {
  background: var(--line);
}

.doc-body {
  max-width: 68ch;
}
.doc-head {
  margin-bottom: 2.5rem;
}
.doc-head h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  line-height: 1;
}
.doc-head .meta {
  margin-top: 1rem;
}
.doc-section {
  scroll-margin-top: 24px;
}
.doc-section h2 {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  margin: 2.75rem 0 0.875rem;
}
.doc-section:first-of-type h2 {
  margin-top: 0;
}
.doc-section h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
}
.doc-section p,
.doc-section li {
  color: var(--ink-2);
}
.doc-section a {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-decoration-thickness: 2px;
}
.doc-section strong {
  color: var(--ink);
}
.doc-section ul {
  padding-left: 1.25rem;
  margin: 0 0 1em;
}
.doc-section li {
  margin-bottom: 0.35em;
}
.doc-section li::marker {
  color: var(--line);
}
.address {
  font-style: normal;
}

/* ---------- 404 ---------- */

.hero-404 .lost .plate {
  min-width: 5rem;
  height: 3.5rem;
  font-size: 2.25rem;
}

/* ---------- Fußzeile ---------- */

.footer {
  border-top: 3px solid var(--ink);
  width: var(--wrap);
  margin: 0 auto;
  padding: 40px 0;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.footer-h {
  font: 600 0.875rem/1 var(--sign);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-list li {
  margin-bottom: 4px;
}
.footer-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  text-decoration: none;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
@media (hover: hover) and (pointer: fine) {
  .footer-list a:hover,
  .topnav a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
}
.footer-fine {
  margin: 32px 0 0;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* ---------- Schmal ---------- */

@media (max-width: 860px) {
  .line-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .split,
  .doc {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .doc {
    gap: 32px;
  }
  .doc-rail {
    position: static;
    max-height: none;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 640px) {
  .topnav a:not(.lang):not(:first-child) {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* Auf der Startseite läuft die Linie senkrecht */
  .line-row .track ol {
    flex-direction: column;
    gap: 2px;
  }
  .line-row .track ol::before {
    top: calc(var(--dot) / 2);
    bottom: calc(var(--dot) / 2);
    left: calc(var(--dot) / 2 - var(--band) / 2);
    right: auto;
    width: var(--band);
    height: auto;
  }
  .line-row .track.is-soon ol::before {
    width: 0;
    border-top: 0;
    border-left: var(--band) dashed var(--rule);
  }
  .line-row .stop > a,
  .line-row .track.is-soon .stop {
    flex-direction: row;
    align-items: center !important;
    gap: 16px;
    min-height: 48px;
  }
  .line-row .stop-label {
    font-size: 1.1875rem;
  }
  .line-name {
    font-size: 1.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button,
  .faq summary::after {
    transition: none;
  }
  .button:active {
    transform: none;
  }
}

/* Inhaltsverzeichnis: Überschrift ist auf breiten Bildschirmen nur Beschriftung */
.rail-box > summary {
  list-style: none;
}
.rail-box > summary::-webkit-details-marker {
  display: none;
}
@media (min-width: 861px) {
  .rail-box > summary {
    pointer-events: none;
  }
}
@media (max-width: 860px) {
  .rail-box > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
  }
  .rail-box > summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    rotate: 45deg;
    translate: 0 -3px;
    transition: rotate 200ms var(--ease-out), translate 200ms var(--ease-out);
  }
  .rail-box[open] > summary::after {
    rotate: 225deg;
    translate: 0 3px;
  }
  .rail-box[open] > summary {
    margin-bottom: 12px;
  }
}

/* App-Linie auf dem Handy: vier Haltestellen passen ohne Scrollen, ab fünf scrollt die Leiste */
@media (max-width: 640px) {
  .track-wrap .track ol {
    min-width: 0;
  }
  .track-wrap .track ol:has(> li:nth-child(5)) {
    min-width: 440px;
  }
  .track-wrap .stop-label {
    font-size: 0.9375rem;
  }
  .track-wrap .stop > a {
    gap: 8px;
  }
}

/* Funktionsliste: schlichte Liste, Ringe bleiben echten Haltestellen vorbehalten */
.feature-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 0 2rem;
}
.feature-list li {
  position: relative;
  padding: 6px 0 6px 26px;
  margin: 0;
  font-size: 1.125rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(6px + 0.8em - 5px);
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--line);
}

/* Endstation: letzte Haltestelle als Querbalken */
.track ol > .stop:last-child .stop-dot {
  border-radius: 6px;
  width: calc(var(--dot) + 6px);
}

/* Weiter zur nächsten Haltestelle */
.next-stop {
  margin-top: clamp(48px, 7vw, 80px);
  border-top: 3px solid var(--line);
  padding-top: 20px;
}
.next-stop a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  font: 500 clamp(1.25rem, 2.4vw, 1.625rem)/1.2 var(--sign);
  color: var(--ink-2);
}
.next-stop .stop-dot {
  flex: none;
}
.next-line strong {
  font-weight: 700;
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .next-stop a:hover .stop-dot {
    background: var(--line);
  }
}
.next-stop a:focus-visible .stop-dot {
  background: var(--line);
}
@media (max-width: 860px) {
  .lines-head {
    grid-template-columns: 1fr 1fr;
  }
  .lines-head span:last-child {
    text-align: right;
  }
}
@media (max-width: 640px) {
  .line-row .track ol > .stop:last-child .stop-dot {
    width: var(--dot);
  }
}
