/* ==========================================================================
   TrainWebSolutions · Unterseite Webdesign (webdesign.html, Wunsch 03.11.: eine Seite, die Google lesen kann)
   Baut auf css/seiten.css auf. Neue Browser-Technik, jeweils mit Rückfall (Stand 03.11.2026):
   – scroll-getriebene Animationen (animation-timeline: scroll()/view()): Strecke am Rand, Abschnitte erscheinen
   – CSS random(): Sterne und Stadtlichter im Kopf liegen bei jedem Besuch anders (sonst js/webdesign-seite.js)
   – View Transitions zwischen den Seiten mit :navigation-source für den angeklickten Link
   ========================================================================== */

:root { --web: #b896ff; --web-rgb: 184, 150, 255; --web-verlauf: linear-gradient(100deg, #8cc0e6 0%, #b896ff 45%, #e0a070 95%); --breit: 1240px; }

/* ---------- Seitenwechsel: die Marke gleitet mit, der angeklickte Link wird zur Überschrift der neuen Seite ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.wd .brand { view-transition-name: marke; }
.wd-held h1 { view-transition-name: titel; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .7, .1, 1); }
/* der angeklickte Link (Chrome 156): leuchtet auf und bleibt so, bis die neue Seite steht – eigene Regel, damit
   Browser ohne :navigation-source nur diese eine verwerfen */
.wd a:navigation-source { color: #fff; border-color: rgba(var(--web-rgb), .9); box-shadow: 0 0 0 1px rgba(var(--web-rgb), .45), 0 0 34px rgba(var(--web-rgb), .45); }

/* ---------- Kopfzeile ---------- */
.wd-web { background: linear-gradient(90deg, #8cc0e6, #b896ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wd .topnav a:hover { color: var(--ink); }
.wd .kicker { color: var(--web); }
.wd em { background: var(--web-verlauf); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Kopf mit Himmel ---------- */
.wd-held { position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: clamp(120px, 18vh, 180px) var(--pad) clamp(70px, 10vh, 110px); overflow: hidden; }
.wd-held::before { content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(70% 55% at 78% 8%, rgba(var(--web-rgb), .16), transparent 70%), radial-gradient(60% 40% at 15% 100%, rgba(224, 160, 112, .08), transparent 70%); }
.wd-held__inhalt { position: relative; width: 100%; max-width: var(--breit); margin: 0 auto; }
.wd-held h1 { font-size: clamp(3rem, 7.6vw, 7.8rem); line-height: .92; letter-spacing: -.055em; font-weight: 500; max-width: 13ch; }
.wd-held h1 em { display: block; }
.wd-lead { margin-top: 28px; max-width: 640px; font-size: clamp(16.5px, 1.35vw, 19.5px); line-height: 1.58; color: var(--ink-2); }
.wd-merkmale { list-style: none; margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.wd-merkmale li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.wd-merkmale i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* Himmel: oben Sterne (i), unter dem Horizont Stadtlichter (b). Ohne Verteilung (weder random() noch Skript) bleibt er
   unsichtbar, sonst stünden alle Lichter auf einem Fleck */
.wd-himmel { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.6s var(--ease); }
.wd-himmel.ist-verteilt { opacity: 1; }
.wd-himmel::after { content: ''; position: absolute; left: -10%; right: -10%; top: 82%; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--web-rgb), .35) 30%, rgba(224, 160, 112, .3) 70%, transparent); box-shadow: 0 0 40px 10px rgba(var(--web-rgb), .08); }
.wd-himmel i, .wd-himmel b { position: absolute; display: block; left: 50%; top: 30%; width: 2px; aspect-ratio: 1; border-radius: 50%; background: rgba(243, 240, 232, .9); animation: wd-flimmern 4s ease-in-out infinite alternate; }
.wd-himmel i:nth-child(5n + 2) { background: #8cc0e6; }
.wd-himmel i:nth-child(7n + 3) { background: #b896ff; }
.wd-himmel b { border-radius: 1px; background: #e0a070; box-shadow: 0 0 6px rgba(224, 160, 112, .7); opacity: .7; animation-name: wd-fenster; }
.wd-himmel b:nth-child(3n) { background: #ffe2b8; box-shadow: 0 0 6px rgba(255, 226, 184, .6); }
.wd-himmel b:nth-child(4n + 1) { background: #8cc0e6; box-shadow: 0 0 6px rgba(140, 192, 230, .6); }
@keyframes wd-flimmern { from { opacity: .95; } to { opacity: .15; } }
@keyframes wd-fenster { 0%, 70% { opacity: .75; } 100% { opacity: .3; } }
/* CSS random(): jedes Licht würfelt Lage, Größe und Takt selbst – ohne eine Zeile Skript */
@supports (left: random(0%, 100%)) {
  .wd-himmel { opacity: 1; }
  .wd-himmel i { left: random(0%, 100%); top: random(2%, 78%); width: random(1px, 2.6px); animation-duration: random(2.5s, 7s); animation-delay: random(-7s, 0s); }
  .wd-himmel b { left: random(0%, 100%); top: random(84%, 98%); width: random(2px, 4px); animation-duration: random(5s, 12s); animation-delay: random(-12s, 0s); }
}

/* ---------- Abschnitte ---------- */
.wd-abschnitt { max-width: calc(var(--breit) + 2 * var(--pad)); margin: 0 auto; padding: clamp(80px, 13vh, 150px) var(--pad) 0; }
.wd-abschnitt h2 { font-size: clamp(2.3rem, 4.6vw, 4.4rem); line-height: .98; letter-spacing: -.05em; font-weight: 500; max-width: 18ch; }
.wd-abschnitt h2 em { display: block; }

.wd-karten { list-style: none; margin-top: clamp(36px, 5vh, 56px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wd-karte { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 24px 24px; border-radius: 22px; overflow: hidden; background: linear-gradient(170deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)); border: 1px solid var(--line); transition: border-color .4s, box-shadow .5s; }
.wd-karte::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; background: radial-gradient(420px circle at 30% 0%, rgba(var(--web-rgb), .16), transparent 60%); transition: opacity .5s; }
.wd-karte:hover { border-color: rgba(var(--web-rgb), .45); box-shadow: 0 30px 70px rgba(0, 0, 0, .4), 0 0 40px rgba(var(--web-rgb), .12); }
.wd-karte:hover::after { opacity: 1; }
.wd-karte b { font-size: 21px; font-weight: 500; letter-spacing: -.02em; hyphens: manual; }
.wd-karte > span:not(.wd-nr) { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.wd-nr { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--web); }
.wd-karte--gross { grid-row: span 2; justify-content: flex-end; min-height: 300px; background: radial-gradient(120% 90% at 100% 0%, rgba(var(--web-rgb), .2), transparent 60%), linear-gradient(170deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)); }
.wd-karte--gross b { font-size: clamp(30px, 3vw, 44px); letter-spacing: -.04em; }
.wd-karte--app { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 6px 24px; padding-block: 22px; }
.wd-karte--app .wd-nr { grid-column: 1; }
.wd-karte--app b { grid-column: 1; grid-row: 2; }
.wd-karte--app > span:not(.wd-nr) { grid-column: 2; grid-row: 1 / span 2; align-self: center; max-width: 560px; }
.wd-karte--app a { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-size: 14.5px; color: var(--ink); border-bottom: 1px solid rgba(var(--web-rgb), .5); white-space: nowrap; }

.wd-gruppen { list-style: none; margin-top: clamp(36px, 5vh, 56px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.wd-gruppen li { padding: 24px 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.wd-gruppen li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.wd-gruppen b { font-size: 20px; font-weight: 500; letter-spacing: -.02em; hyphens: manual; }
.wd-gruppen span { font-size: 15px; line-height: 1.55; color: var(--ink-2); }

.wd-beweis { padding: clamp(28px, 4vw, 54px); border-radius: 28px; position: relative; overflow: hidden; background: linear-gradient(140deg, rgba(var(--web-rgb), .1), rgba(224, 160, 112, .06) 60%, rgba(140, 192, 230, .06)); border: 1px solid rgba(var(--web-rgb), .22); }
.wd-beweis > p:not(.kicker) { margin-top: 18px; max-width: 640px; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.wd-fakten { list-style: none; margin: 30px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.wd-fakten li { padding: 16px 16px 0 0; }
.wd-fakten b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.wd-fakten span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: var(--ink-3); }
.wd-zur-fahrt { margin-top: 30px; }

.wd-ablauf { list-style: none; margin-top: clamp(40px, 6vh, 64px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; position: relative; }
.wd-ablauf::before { content: ''; position: absolute; left: 0; right: 0; top: 17px; height: 2px; background: linear-gradient(90deg, #8cc0e6, #b896ff, #e0a070); opacity: .5; }
.wd-ablauf li { position: relative; padding-top: 46px; }
.wd-ablauf li > span { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #0b0a12; border: 2px solid var(--web); font-family: var(--mono); font-size: 12px; color: var(--ink); box-shadow: 0 0 18px rgba(var(--web-rgb), .4); }
.wd-ablauf b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.wd-ablauf small { display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

.wd-technik { list-style: none; margin-top: clamp(32px, 4.5vh, 48px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wd-technik li { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
.wd-technik b { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--web); }
.wd-technik span { font-size: 15px; line-height: 1.55; color: var(--ink-2); }

.wd-kontakt { padding-bottom: 20px; }
.wd-kontakt > div { padding: clamp(32px, 5vw, 64px); border-radius: 28px; border: 1px solid rgba(var(--web-rgb), .22); background: radial-gradient(80% 120% at 100% 0%, rgba(var(--web-rgb), .16), transparent 60%), rgba(255, 255, 255, .02); }
.wd-fuss { max-width: calc(var(--breit) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad) 40px; }
.wd-fuss .footer { margin-top: 70px; }

/* ---------- Scroll-getrieben: Abschnitte erscheinen, der Kopf tritt beim Weiterscrollen zurück ---------- */
@keyframes wd-auf { from { opacity: 0; translate: 0 48px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes wd-zurueck { to { opacity: .15; translate: 0 -60px; filter: blur(2px); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .wd-auf { animation: wd-auf linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
    .wd-held__inhalt { animation: wd-zurueck linear both; animation-timeline: scroll(root); animation-range: 0 85vh; }
  }
}

/* ---------- Strecke am Rand: Gleis, gefahrener Teil, Halte, Zug ---------- */
.wd-strecke { display: none; }
@keyframes wd-fahrt { from { scale: 1 0; } to { scale: 1 1; } }
@keyframes wd-zugfahrt { to { translate: 0 calc(100vh - 190px); } }
@keyframes wd-halt-licht { to { border-color: var(--web); background: var(--web); box-shadow: 0 0 12px rgba(var(--web-rgb), .9); } }
@keyframes wd-halt-name { to { color: var(--ink); } }
@supports (animation-timeline: scroll()) {
  .wd-strecke { display: block; position: fixed; z-index: 35; top: 120px; bottom: 70px; right: clamp(14px, 1.6vw, 28px); width: 12px; pointer-events: none; }
  .wd-strecke__gleis, .wd-strecke__fahrt { position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; border-radius: 2px; }
  .wd-strecke__gleis { background: repeating-linear-gradient(180deg, rgba(243, 240, 232, .18) 0 6px, transparent 6px 10px); }
  .wd-strecke__fahrt { background: linear-gradient(180deg, #8cc0e6, #b896ff 55%, #e0a070); transform-origin: 50% 0; animation: wd-fahrt linear both; animation-timeline: scroll(root); }
  .wd-strecke__zug { position: absolute; left: 1px; top: -10px; width: 10px; height: 20px; border-radius: 5px; background: #f3f0e8; box-shadow: 0 0 10px rgba(255, 255, 255, .9), 0 0 26px rgba(var(--web-rgb), .8); animation: wd-zugfahrt linear both; animation-timeline: scroll(root); }
  .wd-strecke__halte { list-style: none; position: absolute; inset: 0; }
  .wd-strecke__halte li { position: absolute; top: var(--p, 0%); right: 0; display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; translate: 0 -50%; }
  .wd-strecke__halte i { display: block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(243, 240, 232, .35); background: var(--bg); }
  .wd-strecke__halte span { display: none; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
  /* jeder Halt leuchtet, sobald der Zug ihn erreicht: kurzes Stück der Scroll-Zeitleiste ab seiner Lage (--p) */
  .wd-strecke__halte i, .wd-strecke__halte span { animation: wd-halt-licht linear both; animation-timeline: scroll(root); animation-range: var(--p, 0%) calc(var(--p, 0%) + .6%); }
  .wd-strecke__halte span { animation-name: wd-halt-name; }
}
@media (min-width: 1500px) { .wd-strecke__halte span { display: block; } }

/* ---------- schmaler ---------- */
@media (max-width: 1100px) {
  .wd-karten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wd-karte--gross { grid-column: 1 / -1; grid-row: auto; min-height: 220px; }
  .wd-gruppen, .wd-fakten, .wd-ablauf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wd-gruppen li:nth-child(3) { padding-left: 0; border-left: 0; }
  .wd-ablauf { row-gap: 30px; }
  .wd-ablauf::before { display: none; }
  .wd-tel { display: none; }
}
@media (max-width: 860px) {
  .wd-nav { display: none; }
  .wd-technik { grid-template-columns: 1fr; }
  /* Handy: die Strecke liegt waagrecht in einem schmalen, abgedunkelten Streifen am unteren Rand */
  @supports (animation-timeline: scroll()) {
    .wd-strecke { top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; width: auto; height: 12px; }
    .wd-strecke::before { content: ''; position: fixed; z-index: -1; left: 0; right: 0; bottom: 0; height: calc(28px + env(safe-area-inset-bottom, 0px)); background: rgba(5, 7, 10, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
    .wd-strecke__gleis, .wd-strecke__fahrt { left: 0; right: 0; top: 5px; bottom: auto; width: auto; height: 2px; }
    .wd-strecke__gleis { background: repeating-linear-gradient(90deg, rgba(243, 240, 232, .18) 0 6px, transparent 6px 10px); }
    .wd-strecke__fahrt { background: linear-gradient(90deg, #8cc0e6, #b896ff 55%, #e0a070); transform-origin: 0 50%; animation-name: wd-fahrt-quer; }
    .wd-strecke__zug { top: 1px; left: -10px; width: 20px; height: 10px; animation-name: wd-zugfahrt-quer; }
    .wd-strecke__halte li { top: 0; left: var(--p, 0%); right: auto; translate: -50% 0; }
    .wd-strecke__halte i { width: 10px; height: 10px; margin-top: 1px; }
  }
}
@keyframes wd-fahrt-quer { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes wd-zugfahrt-quer { to { translate: calc(100vw - 32px) 0; } }
@media (max-width: 640px) {
  .wd-karten, .wd-gruppen, .wd-fakten, .wd-ablauf { grid-template-columns: 1fr; }
  .wd-gruppen li, .wd-gruppen li + li { padding-left: 0; border-left: 0; }
  .wd-gruppen li + li { border-top: 1px solid var(--line); margin-top: 22px; }
  .wd-karte--app { display: flex; }
  .wd-karte--app a { align-self: flex-start; margin-top: 4px; }
  .wd-held { min-height: 0; }
  .wd-fuss { padding-bottom: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .wd-himmel i, .wd-himmel b { animation: none; }
}
