/* Ergänzungen zu den Claude-Design-Seiten: Barrierefreiheit (WCAG 2.2 AA),
   mobile Navigation, weiche Scroll-Einblendungen. Die Seiten setzen fast alles
   als Inline-Style, daher an einigen Stellen !important. */

/* ---------- Barrierefreiheit ---------- */

/* 2.4.1 Sprunglink */
.cb-skip { position: fixed; left: 16px; top: -80px; z-index: 2147483001; background: var(--c-yellow-500); color: #000 !important;
  padding: 12px 18px; font: 700 13px/1 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; text-decoration: none !important; }
.cb-skip:focus { top: 12px; }
main:focus { outline: none; }

/* 2.4.7 / 1.4.11 Fokus auf jedem Hintergrund sichtbar: schwarzer Innenring + gelber Außenring */
:focus-visible { outline: 3px solid var(--c-yellow-500) !important; outline-offset: 2px !important; box-shadow: 0 0 0 2px #000 !important; }

/* 1.4.3 Kontrast: Grau- und Akzenttöne auf weißen Flächen abdunkeln */
section[style^="background: var(--c-white)"], section[style^="background: rgb(255, 255, 255)"] {
  --c-ink-400: #6B6B6B; --text-muted: #6B6B6B;
  --c-yellow-700: #71510A; --text-accent: #71510A; --text-link-hover: #71510A;
}

/* 2.2.2 Keine endlos laufenden Deko-Animationen */
[data-drift] { animation-iteration-count: 1 !important; animation-fill-mode: forwards !important; }
[data-cue] { animation-iteration-count: 3 !important; }
span[style*="poPulse"] { animation-iteration-count: 2 !important; }

/* 2.5.8 Zielgröße für Header-Links */
header[data-header] nav a { display: inline-flex; align-items: center; min-height: 44px; padding-top: 0 !important; padding-bottom: 0 !important; }

/* ---------- Mobile Navigation ---------- */
.cb-burger { display: none; }
@media (max-width: 860px) {
  header[data-header] > div { flex-wrap: nowrap !important; min-height: 64px !important; }
  header[data-header] nav { display: none !important; }
  .cb-burger { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-left: auto; min-width: 48px; min-height: 48px;
    padding: 0 4px 0 12px; background: none; border: 0; color: inherit; cursor: pointer;
    font: 700 12px/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; }
  .cb-burger i { position: relative; width: 24px; height: 14px; display: block; }
  .cb-burger i::before, .cb-burger i::after, .cb-burger i b { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor;
    transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .2s; }
  .cb-burger i::before { top: 0; } .cb-burger i b { top: 6px; } .cb-burger i::after { top: 12px; }
  html.cb-nav-open .cb-burger i::before { transform: translateY(6px) rotate(45deg); }
  html.cb-nav-open .cb-burger i b { opacity: 0; }
  html.cb-nav-open .cb-burger i::after { transform: translateY(-6px) rotate(-45deg); }
}
.cb-menu { position: fixed; inset: 0; z-index: 29; background: #000; color: #fff; display: flex; flex-direction: column;
  padding: 148px 24px 32px; overflow-y: auto; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
html.cb-nav-open .cb-menu { opacity: 1; visibility: visible; transition: opacity .35s ease; }
html.cb-nav-open { overflow: hidden; }
.cb-menu nav { display: grid; gap: 4px; }
.cb-menu nav a { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid #262626;
  color: #fff !important; text-decoration: none !important; font: 800 clamp(28px, 8vw, 44px)/1 var(--font-display); text-transform: uppercase;
  opacity: 0; transform: translateY(16px); transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1); }
.cb-menu nav a::after { content: "→"; font-size: .6em; color: var(--c-yellow-500); }
.cb-menu nav a:hover { color: var(--c-yellow-500) !important; }
html.cb-nav-open .cb-menu nav a { opacity: 1; transform: none; }
.cb-menu .cb-menu-foot { margin-top: auto; padding-top: 32px; display: grid; gap: 16px; color: #b8b8b8; font: 15px/1.6 var(--font-sans); }
.cb-menu .cb-menu-foot a:not(.cb-cta) { color: var(--c-yellow-500) !important; }
.cb-menu .cb-cta { display: inline-flex; justify-content: center; align-items: center; min-height: 52px; background: var(--c-yellow-500); color: #000 !important;
  font: 700 13px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; text-decoration: none !important; }
html.cb-nav-open header[data-header] { background: #000 !important; color: #fff !important; border-color: #262626 !important; z-index: 31 !important; }
@media (min-width: 861px) { .cb-menu { display: none; } }

/* ---------- Infozeile als Laufband auf schmalen Bildschirmen ---------- */
.cb-ticker { display: none; }
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .cb-ticker { display: flex; position: relative; align-items: center; height: 36px; background: #000; color: #fff; overflow: hidden;
    font: 700 11px/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; }
  html.cb-has-ticker div:has(+ header[data-header]) { display: none !important; }
  .cb-ticker-track { display: flex; width: max-content; animation: cbTickerRun 26s linear infinite; }
  .cb-ticker:hover .cb-ticker-track, .cb-ticker:focus-within .cb-ticker-track, .cb-ticker.cb-paused .cb-ticker-track { animation-play-state: paused; }
  .cb-ticker-group { display: flex; flex: none; }
  .cb-ticker-item { display: inline-flex; align-items: center; gap: 10px; padding-right: 36px; white-space: nowrap; }
  .cb-ticker-item i { width: 6px; height: 6px; background: var(--c-yellow-500); display: block; }
  .cb-ticker-toggle { position: absolute; right: 0; top: 0; bottom: 0; width: 44px; border: 0; cursor: pointer; color: #fff;
    background: linear-gradient(90deg, rgba(0,0,0,0), #000 40%); display: flex; align-items: center; justify-content: flex-end; padding-right: 14px; }
  .cb-ticker-toggle span { width: 8px; height: 10px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
  .cb-ticker.cb-paused .cb-ticker-toggle span { width: 0; height: 0; border: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
}
@keyframes cbTickerRun { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* ---------- Cinematic-Hero am Handy: Fahrer oben sichtbar, Text darunter ---------- */
@media (max-width: 640px) and (orientation: portrait) {
  [data-hero-media] { bottom: auto !important; height: 64svh !important; }
  [data-hero-media] img { object-position: 36% 0% !important; }
  /* Verläufe: Kopf nicht abdunkeln, unten weich ins Schwarz übergehen */
  [data-hero-media] > div[style*="180deg"] {
    background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,.15) 55%, rgba(0,0,0,.85) 82%, #000 100%) !important; }
  [data-hero-media] > div[style*="90deg"] {
    background: linear-gradient(90deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.35) 100%) !important; }
  [data-hero-content] { padding-top: 44svh !important; }
}

/* ---------- Lichtkegel-Hero Handy/Tablet hochkant: Fahrer mittig, Text unten über Verlauf ---------- */
@media (max-width: 900px) and (orientation: portrait) {
  section[data-hero]:has([data-dark]) img { object-position: 34% 8% !important; }
  section[data-hero]:has([data-dark]) > div[style*="90deg"] {
    background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.7) 62%, rgba(0,0,0,.94) 80%, #000 100%) !important; }
  section[data-hero]:has([data-dark]) > div:last-child { align-items: flex-end !important; padding-bottom: 40px !important; }
  section[data-hero]:has([data-dark]) { min-height: max(calc(100svh - 108px), 640px) !important; }
}

/* ---------- Marken-Sektion: mittig, groß, Laufband (Markup aus build.js) ---------- */
.cb-brands { padding: clamp(64px, 9vw, 120px) 0 clamp(40px, 6vw, 72px); text-align: center; overflow: hidden; }
.cb-brands-title { margin: 0 0 clamp(28px, 4vw, 48px); padding: 0 24px; font: 400 12px/1.4 var(--font-mono, monospace); letter-spacing: .22em; text-transform: uppercase; color: #6B6B6B; }
.cb-brands-viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.cb-brands-track { display: flex; width: max-content; animation: cbBrandsRun 38s linear infinite; }
.cb-brands-group { display: flex; flex: none; align-items: center; margin: 0; padding: 0; list-style: none; }
.cb-brands-group li { display: flex; align-items: center; white-space: nowrap; font: 800 clamp(40px, 7vw, 96px)/1 var(--font-display); text-transform: uppercase; letter-spacing: -.02em; color: #000; }
.cb-brands-group li::after { content: ""; width: .16em; height: .16em; background: var(--c-yellow-500); margin: 0 .55em; flex: none; }
.cb-brands-group li.cb-brands-more { color: #6B6B6B; }
.cb-brands-viewport:hover .cb-brands-track, .cb-brands-pause:checked ~ .cb-brands-viewport .cb-brands-track { animation-play-state: paused; }
.cb-brands-pause { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cb-brands-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: clamp(20px, 3vw, 32px); padding: 0 14px; cursor: pointer; color: #6B6B6B; font: 700 11px/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; }
.cb-brands-btn:hover { color: #000; }
.cb-brands-pause:focus-visible ~ .cb-brands-btn { outline: 3px solid var(--c-yellow-500); outline-offset: 2px; box-shadow: 0 0 0 2px #000; }
.cb-brands-btn-icon { width: 8px; height: 10px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.cb-brands-pause:checked ~ .cb-brands-btn .cb-brands-btn-icon { width: 0; height: 0; border: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.cb-brands-pause:checked ~ .cb-brands-btn .cb-brands-btn-text { font-size: 0; }
.cb-brands-pause:checked ~ .cb-brands-btn .cb-brands-btn-text::after { content: "Laufband fortsetzen"; font-size: 11px; }
@keyframes cbBrandsRun { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) {
  .cb-brands-track { animation: none; width: auto; justify-content: center; }
  .cb-brands-group { flex-wrap: wrap; justify-content: center; row-gap: 12px; padding: 0 24px; }
  .cb-brands-group[aria-hidden] { display: none; }
  .cb-brands-viewport { -webkit-mask-image: none; mask-image: none; }
  .cb-brands-btn { display: none; }
}

/* ---------- Intro (Race-Team-Foto) einspaltig: erst Text, Foto dockt unten an die nächste Sektion ---------- */
@media (max-width: 743px) {
  section[data-screen-label="02 Intro"] > div > div:first-child { order: 2; }
  section[data-screen-label="02 Intro"] > div > div:last-child { padding-bottom: 8px !important; }
  section[data-screen-label="02 Intro"] > div { gap: 40px !important; }
}

/* ---------- Footer: Logo eigene Zeile, Kontakt / Rechtliches / Folge uns nebeneinander ---------- */
@media (max-width: 1100px) {
  footer div[style*="minmax(220px"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 36px 32px !important; }
  footer div[style*="minmax(220px"] > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  footer div[style*="minmax(220px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 36px 24px !important; }
  footer div[style*="minmax(220px"] > :nth-child(4) { grid-column: 1 / -1; }
}

/* ---------- Weiche Scroll-Einblendungen ---------- */
.cb-reveal { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(2px);
  transition: opacity 1.1s cubic-bezier(.16,1,.3,1), transform 1.1s cubic-bezier(.16,1,.3,1), filter 1.1s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--cb-delay, 0s); will-change: opacity, transform; }
.cb-reveal.cb-in { opacity: 1; transform: none; filter: none; }
.cb-reveal.cb-done { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  .cb-reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .cb-menu, .cb-menu nav a, .cb-burger i::before, .cb-burger i::after, .cb-burger i b { transition: none !important; }
}
