/* Tiefbauatlas - Startseite
   Markenfarben: Indigo #4338CA (Hover #3730A3), Stone #1C1917 / #57534E / #78716C, Hintergrund #FAFAF9
   Schrift: Systemschrift, Labels in Monospace - keine externen Fonts (DSGVO-freundlich) */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #FAFAF9; color: #1C1917; }
img { max-width: 100%; }
a { color: #4338CA; text-decoration: none; transition: color .15s, background-color .15s, border-color .15s, opacity .15s; }
a:hover { color: #3730A3; }
input, select, textarea, button { font: inherit; }
:focus-visible { outline: 3px solid #A5B4FC; outline-offset: 2px; border-radius: 6px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4338CA !important; box-shadow: 0 0 0 3px rgba(67, 56, 202, .18); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: #FFFFFF; color: #1C1917; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 16px; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 18px; border-radius: 8px; font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; line-height: 1.2; }
.btn-primary { background: #4338CA; color: #FFFFFF !important; border: 0; }
.btn-primary:hover { background: #3730A3; }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: #FFFFFF !important; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-outline { background: transparent; border-color: #1C1917; color: #1C1917; }
.btn-outline:hover { background: #F5F5F4; }
.btn-lg { padding: 16px 22px; font-size: 17px; }
.btn[disabled] { opacity: .6; cursor: progress; }
a[style*="background: #4338CA"]:hover { background: #3730A3 !important; color: #FFFFFF !important; }
a[style*="background: #FFFFFF"]:hover { background: #EEF2FF !important; }

/* Navigation */
.tba-nav { position: relative; z-index: 20; max-width: 1240px; width: 100%; margin: 0 auto; padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tba-logo { display: flex; align-items: center; }
.tba-logo img { height: 44px; width: auto; display: block; }
.tba-menu { display: flex; align-items: center; gap: 32px; }
.tba-links { display: flex; gap: 28px; font-size: 15px; font-weight: 500; }
.tba-links a { color: #F5F5F4; }
.tba-links a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 6px; }
.tba-actions { display: flex; gap: 12px; align-items: center; }
.tba-burger { display: none; width: 48px; height: 48px; align-items: center; justify-content: center; background: rgba(255, 255, 255, .12); color: #FFFFFF; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; cursor: pointer; }

@media (max-width: 1020px) {
  .tba-nav { flex-wrap: wrap; padding: 18px 20px; }
  .tba-logo img { height: 36px; }
  .tba-burger { display: inline-flex; }
  .tba-menu { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; background: #1C1917; border: 1px solid #44403C; border-radius: 14px; }
  .tba-menu.open { display: flex; }
  .tba-links { flex-direction: column; gap: 0; font-size: 17px; }
  .tba-links a { padding: 12px 4px; border-bottom: 1px solid #292524; }
  .tba-actions { flex-direction: column; align-items: stretch; }
}

/* Abschnitte auf kleinen Bildschirmen */
@media (max-width: 640px) {
  main section > div, main footer > div, header > div, #nutzen, #zielgruppen, #testen, #presse { padding-left: 20px !important; padding-right: 20px !important; }
  #testen > div, #nutzen > div, #zielgruppen > div, #presse > div { padding-left: 0 !important; padding-right: 0 !important; }
  main section > div[style*="padding: 112px"], #nutzen, #zielgruppen, #testen, #presse { padding-top: 72px !important; padding-bottom: 72px !important; }
  header { min-height: 0 !important; }
  header > div { padding-top: 40px !important; padding-bottom: 56px !important; }
  section[aria-label="Gemeinsame Künette"] img { height: 440px !important; }
  #testen > div > div:last-child { padding: 24px !important; }
}

/* Formular */
.tba-toggle { margin: 0; padding: 4px; border: 1px solid #E7E5E4; border-radius: 12px; background: #FAFAF9; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tba-toggle label { position: relative; cursor: pointer; }
.tba-toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tba-toggle span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 10px; border-radius: 9px; font-size: 15px; font-weight: 600; color: #57534E; text-align: center; }
.tba-toggle input:checked + span { background: #1C1917; color: #FFFFFF; }
.tba-toggle input:focus-visible + span { outline: 3px solid #A5B4FC; outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[aria-invalid="true"] { border-color: #B91C1C !important; }

/* FAQ */
.tba-faq { border-top: 1px solid #E7E5E4; }
.tba-faq:last-child { border-bottom: 1px solid #E7E5E4; }
.tba-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font-size: 19px; font-weight: 600; cursor: pointer; }
.tba-faq summary::-webkit-details-marker { display: none; }
.tba-faq summary svg { flex-shrink: 0; transition: transform .2s; }
.tba-faq[open] summary svg { transform: rotate(45deg); }
.tba-faq summary:hover span { color: #4338CA; }
.tba-faq p { margin: 0 0 24px; max-width: 720px; font-size: 17px; color: #57534E; }

/* KI-Kennzeichnung der Symbolbilder (Transparenzpflicht Art. 50 KI-Verordnung) */
.ki-label { position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 4px 9px; border-radius: 6px; background: rgba(12, 10, 9, .72); color: #FFFFFF; font-size: 11px; font-weight: 500; line-height: 1.3; pointer-events: none; }
.ki-label-top { top: 12px; bottom: auto; }

/* Rechtsseiten */
.legal { max-width: 820px; margin: 0 auto; padding: 72px 32px 96px; font-size: 17px; line-height: 1.7; color: #292524; }
.legal h1 { margin: 0 0 8px; font-size: clamp(34px, 5vw, 48px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; color: #1C1917; }
.legal .stand { margin: 0 0 40px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #78716C; }
.legal h2 { margin: 48px 0 12px; font-size: 24px; font-weight: 600; color: #1C1917; scroll-margin-top: 24px; }
.legal h3 { margin: 28px 0 8px; font-size: 19px; font-weight: 600; color: #1C1917; }
.legal p, .legal ul { margin: 0 0 14px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal .box { padding: 20px 24px; border: 1px solid #E7E5E4; border-radius: 14px; background: #FFFFFF; }
.legal .box p { margin: 0; }
.legal dl { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 8px 24px; margin: 0; }
.legal dt { font-weight: 600; color: #1C1917; }
.legal dd { margin: 0; }
@media (max-width: 640px) { .legal { padding: 48px 20px 72px; } .legal dl { grid-template-columns: 1fr; gap: 2px; } .legal dd { margin-bottom: 10px; } }
.subhead { background: #1C1917; }
.subhead .tba-nav { padding-top: 18px; padding-bottom: 18px; }

/* Presse */
.tba-press { color: #1C1917; }
.tba-press:hover { color: #4338CA; text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ===================== Bewegung & Interaktion ===================== */
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes flow { to { stroke-dashoffset: -36; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(0); } }
@keyframes blink { 50% { opacity: .25; } }

/* Fortschrittsbalken */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: #4338CA; transform-origin: 0 50%; transform: scaleX(0); }

/* Hero */
.hero-img { animation: kenburns 16s cubic-bezier(.2,.6,.2,1) both; will-change: transform; }
.hero-title .hl { display: block; animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-title .hl:nth-child(2) { animation-delay: .12s; }
.hero-title .hl:nth-child(3) { animation-delay: .24s; position: relative; width: fit-content; }
.hero-title .hl-accent::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .08em; border-radius: 4px; background: #A5B4FC; transform-origin: 0 50%; animation: underline .8s .9s cubic-bezier(.2,.7,.2,1) both; opacity: .6; }
header > div > p:first-child, header > div > p + h1 + p, header > div > div { animation: rise .9s .35s cubic-bezier(.2,.7,.2,1) both; }
header > div > div:last-child { animation-delay: .5s; }

/* Fixierte Navigation beim Scrollen */
.tba-nav.is-fixed { position: fixed; top: 0; left: 0; right: 0; max-width: none; padding-top: 12px; padding-bottom: 12px; padding-inline: max(32px, calc((100% - 1240px) / 2 + 32px)); background: rgba(28, 25, 23, .86); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); box-shadow: 0 8px 30px rgba(0,0,0,.18); animation: navIn .35s ease both; }
.tba-nav.is-fixed .tba-logo img { height: 36px; }
@keyframes navIn { from { transform: translateY(-100%); } to { transform: none; } }
.nav-spacer { display: none; }
.nav-spacer.on { display: block; }
.tba-links a.active { color: #FFFFFF; text-decoration: underline; text-decoration-color: #A5B4FC; text-underline-offset: 6px; text-decoration-thickness: 2px; }
@media (max-width: 1020px) { .tba-nav.is-fixed { padding-inline: 20px; } }

/* Scroll-Reveal (nur aktiv, wenn JS läuft) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* Karten: Anheben beim Hover */
#nutzen > div > div, #zielgruppen article, #einstieg > div > div > div, #ueber-uns > div > div:last-child > div, #plattform ol li { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s; }
#nutzen > div:nth-of-type(2) > div:hover, #zielgruppen article:hover, #einstieg > div > div > div:hover { transform: translateY(-6px); box-shadow: 0 22px 44px -18px rgba(28, 25, 23, .28); }
#plattform ol li:hover, #ueber-uns > div > div:last-child > div:hover { transform: translateX(6px); border-color: #57534E !important; }
#zielgruppen article img { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
#zielgruppen article:hover img { transform: scale(1.06); }
#nutzen svg { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
#nutzen > div > div:hover svg { transform: rotate(-8deg) scale(1.08); }

/* Buttons: sanftes Anheben */
.btn, a[style*="border-radius: 8px"] { transition: transform .2s ease, background-color .2s, box-shadow .2s, color .2s; }
.btn:hover, a[style*="border-radius: 8px"]:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(67, 56, 202, .55); }
.btn:active, a[style*="border-radius: 8px"]:active { transform: translateY(0); }

/* Parallax im Bildband */
section[aria-label="Gemeinsame Künette"] { overflow: hidden; }
.parallax { will-change: transform; transform: scale(1.15); }

/* Interaktive Karte */
.demo-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #57534E; text-transform: uppercase; letter-spacing: .12em; }
.demo-live span { width: 7px; height: 7px; border-radius: 50%; background: #7BB98A; animation: blink 1.6s infinite; }
.demo-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 12px; border: 1px solid #E7E5E4; border-radius: 10px; background: #FFFFFF; text-align: left; cursor: pointer; color: #1C1917; transition: border-color .2s, background-color .2s, transform .2s; }
.demo-item:hover { border-color: #A5B4FC; transform: translateX(3px); }
.demo-item[aria-pressed="true"] { border: 2px solid #4338CA; background: #EEF2FF; padding: 11px; }
.demo-item strong { display: block; font-size: 14px; }
.demo-item small { display: block; font-size: 13px; color: #78716C; }
.demo-dot { flex-shrink: 0; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; }
.demo-badge { display: inline-block; margin-top: 8px; padding: 3px 8px; border-radius: 6px; background: #4338CA; color: #FFFFFF; font-size: 12px; font-weight: 600; font-style: normal; }
.route { transition: opacity .35s, stroke-width .35s; }
.js .demo .route { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .demo.drawn .route { transition: stroke-dashoffset 1.4s cubic-bezier(.4,.1,.2,1), opacity .35s, stroke-width .35s; stroke-dashoffset: 0; }
.js .demo.drawn .route[data-route="wasser"] { transition-delay: .25s, 0s, 0s; }
.js .demo.drawn .route[data-route="strom"] { transition-delay: .55s, 0s, 0s; }
.demo.focus .route { opacity: .22; }
.demo.focus .route.on { opacity: 1; stroke-width: 10; }
.route-flow { animation: flow 1.2s linear infinite; opacity: 0; transition: opacity .6s 1.6s; }
.demo.drawn .route-flow { opacity: .9; }
.synergy-pin { opacity: 0; transition: opacity .5s 1.8s; }
.demo.drawn .synergy-pin { opacity: 1; }
.synergy-pin .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
.js .demo .demo-toast { opacity: 0; transform: translateY(16px); transition: opacity .5s 2.1s, transform .5s 2.1s cubic-bezier(.2,.7,.2,1); }
.js .demo.drawn .demo-toast { opacity: 1; transform: none; }
.demo.drawn .bell { animation: ring 1s 2.5s ease-in-out; transform-origin: 50% 10%; }

/* Presse-Filter */
.press-filter { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 16px; border: 1px solid #D6D3D1; border-radius: 999px; background: #FFFFFF; color: #44403C; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .2s; }
.chip span { margin-left: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #78716C; }
.chip:hover { border-color: #4338CA; transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: #1C1917; border-color: #1C1917; color: #FFFFFF; }
.chip[aria-pressed="true"] span { color: #D6D3D1; }
.press-list { margin: 24px 0 0; padding: 0; list-style: none; border-bottom: 1px solid #D6D3D1; }
.press-item { display: grid; grid-template-columns: 110px 90px minmax(0, 1fr) auto; gap: 8px 24px; align-items: baseline; padding: 20px 8px; border-top: 1px solid #D6D3D1; transition: background-color .2s, opacity .3s, transform .3s; }
.press-item:hover { background: #FFFFFF; }
.press-item time { font-size: 15px; color: #78716C; font-variant-numeric: tabular-nums; }
.press-item .tba-press { font-size: 18px; font-weight: 500; }
.press-type { font-size: 14px; color: #78716C; }
.press-tag { justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-politik { background: #EEF2FF; color: #3730A3; }
.tag-medien { background: #F5F5F4; color: #44403C; }
.tag-branche { background: #FDF3E1; color: #7A4B0B; }
.press-item.hide { display: none; }
@media (max-width: 720px) { .press-item { grid-template-columns: auto 1fr; } .press-item .tba-press { grid-column: 1 / -1; } .press-type { display: none; } }

/* Nach oben */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: #4338CA; color: #FFFFFF; cursor: pointer; box-shadow: 0 12px 30px -10px rgba(67, 56, 202, .7); opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .3s, transform .3s, background-color .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #3730A3; }

/* FAQ sanft */
.tba-faq[open] p { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .demo .route { stroke-dashoffset: 0; }
  .js .demo .demo-toast, .synergy-pin { opacity: 1; transform: none; }
  .parallax { transform: none !important; }
}

/* Links im Fließtext klar erkennbar (WCAG 1.4.1) */
main p a, .legal a, .legal dd a, label a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal { overflow-wrap: anywhere; }
