:root {
  --bg: #080b11;
  --bg-soft: #0f141d;
  --card: #141b26;
  --line: rgba(255,255,255,.11);
  --text: #f4f7fb;
  --muted: #9aa6b7;
  --ice: #78d7ff;
  --ice-strong: #21aee8;
  --accent: #d8f4ff;
  --max: 1180px;
  --radius: 22px;
  --shadow: 0 22px 60px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(33,174,232,.12), transparent 32rem),
    linear-gradient(180deg, #090c12 0%, #080b11 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

.container { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,11,17,.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.nav-wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .85rem; font-weight: 900; letter-spacing: -.03em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(120,215,255,.45);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(120,215,255,.22), rgba(255,255,255,.04));
  color: var(--ice);
  font-size: .78rem;
  box-shadow: inset 0 0 24px rgba(120,215,255,.08);
}
.brand span:last-child { font-size: 1.02rem; }
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a { padding: .65rem .9rem; color: var(--muted); border-radius: 999px; font-weight: 700; font-size: .94rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.07); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--bg-soft); cursor: pointer; }

.hero { position: relative; overflow: hidden; min-height: 78vh; display: grid; align-items: center; background-color: #050910; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4,7,12,.98) 0%, rgba(5,9,15,.90) 38%, rgba(6,10,17,.45) 70%, rgba(7,10,16,.18) 100%),
    url('../img/hero-background-krb.png') center/cover no-repeat;
  opacity: .95;
}
.hero-content { position: relative; z-index: 1; padding: 7rem 0; max-width: 760px; }
.hero h1, .hero .lead, .hero .eyebrow { text-shadow: 0 6px 28px rgba(0,0,0,.55); }
.eyebrow { color: var(--ice); text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 900; }
h1, h2, h3 { line-height: 1.08; margin-top: 0; }
h1 { margin-bottom: 1.4rem; font-size: clamp(3rem, 7.2vw, 6.8rem); letter-spacing: -.06em; }
h2 { margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 3.6rem); letter-spacing: -.045em; }
h3 { font-size: 1.3rem; letter-spacing: -.025em; }
.lead { max-width: 680px; color: #c7d0dc; font-size: clamp(1.06rem, 2vw, 1.3rem); }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .8rem 1.15rem; border-radius: 14px; font-weight: 850; border: 1px solid transparent; transition: .2s ease; }
.btn-primary { background: var(--ice); color: #061017; }
.btn-primary:hover { background: #a5e8ff; transform: translateY(-2px); }
.btn-secondary { border-color: var(--line); background: rgba(255,255,255,.045); }
.btn-secondary:hover { border-color: rgba(120,215,255,.45); background: rgba(120,215,255,.08); }

.stats { margin-top: -44px; position: relative; z-index: 4; }
.stats-grid, .grid-3, .grid-2, .footer-grid { display: grid; gap: 1rem; }
.stats-grid { grid-template-columns: repeat(5, 1fr); }
.stat, .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20,27,38,.96), rgba(13,18,27,.96));
  box-shadow: var(--shadow);
}
.stat { padding: 1.35rem; }
.stat strong { display: block; font-size: 1.8rem; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: .88rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { overflow: hidden; }
.card-body { padding: 1.5rem; }
.card-media { min-height: 230px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(120,215,255,.18), rgba(255,255,255,.02)); border-bottom: 1px solid var(--line); color: rgba(255,255,255,.58); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.card p, .muted { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: .9rem; color: var(--muted); font-size: .82rem; }
.tag { display: inline-flex; padding: .3rem .58rem; border: 1px solid rgba(120,215,255,.25); border-radius: 999px; color: var(--ice); background: rgba(120,215,255,.06); font-size: .75rem; font-weight: 800; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-heading p { max-width: 610px; color: var(--muted); margin: 0; }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.placeholder-panel { min-height: 430px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(135deg, rgba(120,215,255,.13), rgba(255,255,255,.025)); box-shadow: var(--shadow); color: rgba(255,255,255,.52); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }

.page-hero { padding: 7rem 0 4rem; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 80% 20%, rgba(33,174,232,.15), transparent 26rem); }
.page-hero h1 { font-size: clamp(3rem, 6vw, 5.4rem); max-width: 920px; }

.driver-card .avatar { aspect-ratio: 4/3; display: grid; place-items: center; background: linear-gradient(145deg, rgba(120,215,255,.16), rgba(255,255,255,.03)); border-bottom: 1px solid var(--line); color: rgba(255,255,255,.48); }
.driver-links { display: flex; gap: .8rem; margin-top: 1rem; color: var(--ice); font-weight: 800; font-size: .9rem; }

.report-list { display: grid; gap: 1rem; }
.report-item { display: grid; grid-template-columns: 220px 1fr; min-height: 210px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.report-thumb { display: grid; place-items: center; background: linear-gradient(145deg, rgba(120,215,255,.16), rgba(255,255,255,.02)); color: rgba(255,255,255,.48); font-weight: 850; }
.report-content { padding: 1.5rem; }
.report-content p { color: var(--muted); }

.calendar { display: grid; gap: .8rem; }
.event { display: grid; grid-template-columns: 120px 1fr auto; gap: 1.3rem; align-items: center; padding: 1.25rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); }
.event-date { color: var(--ice); font-weight: 900; }
.event h3 { margin-bottom: .25rem; }
.event p { margin: 0; color: var(--muted); }
.status { padding: .35rem .7rem; border-radius: 999px; background: rgba(120,215,255,.1); color: var(--ice); border: 1px solid rgba(120,215,255,.2); font-size: .78rem; font-weight: 850; white-space: nowrap; }

.upcoming-event { grid-template-columns: 120px 1fr; }
.upcoming-event strong { color: var(--text); }

.archive-disclosure {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.archive-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.45rem 1.6rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.archive-disclosure summary::-webkit-details-marker { display: none; }
.archive-disclosure summary::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(120,215,255,.25);
  border-radius: 50%;
  color: var(--ice);
  font-size: 1.5rem;
  line-height: 1;
}
.archive-disclosure[open] summary::after { content: "−"; }
.archive-disclosure summary:hover { background: rgba(120,215,255,.045); }
.archive-title { display: block; margin-top: .35rem; font-size: clamp(1.55rem, 3vw, 2.4rem); font-weight: 850; letter-spacing: -.04em; }
.archive-hint { margin-left: auto; color: var(--muted); font-size: .9rem; }
.archive-disclosure[open] .archive-hint { font-size: 0; }
.archive-disclosure[open] .archive-hint::after { content: "Tabelle schließen"; font-size: .9rem; }
.archive-content { padding: 0 1.6rem 1.6rem; border-top: 1px solid var(--line); }
.archive-content > p { margin: 1.25rem 0; }

.results-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  box-shadow: var(--shadow);
}
.results-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  text-align: left;
}
.results-table th, .results-table td {
  padding: 1rem 1.05rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.results-table th {
  color: var(--ice);
  background: rgba(120,215,255,.055);
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.results-table td { color: #c9d2df; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr:hover { background: rgba(255,255,255,.035); }
.results-table td:nth-last-child(-n+2) { white-space: nowrap; }

.social-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.social-card { min-height: 180px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.035); }
.social-card strong { display: block; margin-bottom: .45rem; font-size: 1.2rem; }
.social-card p { color: var(--muted); }

.contact-box { padding: 2rem; border: 1px solid rgba(120,215,255,.22); border-radius: 28px; background: linear-gradient(145deg, rgba(120,215,255,.11), rgba(255,255,255,.025)); }

.site-footer { padding: 3rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer-grid { grid-template-columns: 1fr auto; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .stats-grid, .grid-3, .social-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav-links { display: none; position: absolute; top: 68px; left: 1rem; right: 1rem; padding: .65rem; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 18px; background: #0d121a; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: 12px; }
}

@media (max-width: 640px) {
  .section { padding: 4rem 0; }
  .stats { margin-top: -24px; }
  .stats-grid, .grid-3, .grid-2, .social-grid { grid-template-columns: 1fr; }
  .hero { min-height: 720px; }
  .hero::before { background: linear-gradient(180deg, rgba(8,11,17,.65), rgba(8,11,17,.98)), url('../img/hero-background-krb.png') center/cover no-repeat; }
  .hero-content { padding: 5rem 0 7rem; }
  .report-item { grid-template-columns: 1fr; }
  .report-thumb { min-height: 180px; }
  .event { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Version 1.6 – Branding assets */
.nav-wrap { position: relative; }
.brand-logo {
  flex: 0 0 auto;
  width: 118px;
  height: 76px;
  overflow: visible;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.4));
}

.team-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8,11,17,.97) 0%, rgba(8,11,17,.84) 48%, rgba(8,11,17,.68) 100%),
    url('../img/team-stickerbomb.jpg') center/cover no-repeat;
}
.team-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,11,17,.1), rgba(8,11,17,.72));
  pointer-events: none;
}
.team-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(260px,380px);
  gap: 3rem;
  align-items: center;
}
.team-hero-copy { max-width: 820px; }
.team-hero-copy h1 { text-shadow: 0 5px 24px rgba(0,0,0,.72); }
.team-hero-logo {
  justify-self: end;
  width: min(100%, 360px);
  padding: .75rem;
  border-radius: 50%;
  background: rgba(8,11,17,.2);
  filter: drop-shadow(0 22px 44px rgba(0,0,0,.5));
}
.team-hero-logo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

@media (max-width: 1000px) {
  .brand-logo { width: 100px; }
}
@media (max-width: 900px) {
  .brand-logo { width: 92px; height: 68px; }
  .team-hero-grid { grid-template-columns: 1fr minmax(190px,260px); gap: 1.5rem; }
}
@media (max-width: 640px) {
  .nav-wrap { min-height: 70px; }
  .brand-logo { width: 82px; height: 62px; }
  .team-hero-grid { grid-template-columns: 1fr; }
  .team-hero-logo { justify-self: center; width: min(72vw, 280px); }
  .team-hero { background-position: center; }
}


/* Version 1.9 – left-aligned header graphic */
.header-graphic { display: inline-flex; align-items: center; flex: 0 1 auto; width: min(52vw, 680px); min-width: 260px; }
.header-graphic img { width: 100%; height: 56px; object-fit: contain; object-position: left center; display: block; filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(120,215,255,.18)); opacity: .92; }
.nav-wrap { justify-content: space-between; }
@media (max-width: 1000px) { .header-graphic { width: min(50vw, 520px); min-width: 220px; } .header-graphic img { height: 46px; } }
@media (max-width: 640px) { .header-graphic { width: min(58vw, 360px); min-width: 170px; } .header-graphic img { height: 34px; } }


/* Version 1.10 – final start page content */
.hero-content { text-align: left; max-width: var(--max); margin-inline: auto; }
.hero-content > * { max-width: 760px; }
.hero-intro p { margin: 0 0 1rem; }
.hero-intro p:last-child { margin-bottom: 0; }
.social-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .social-grid-2 { grid-template-columns: 1fr; } }


/* Version 1.11 – Kader und Rig-Overlay */
.avatar-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid var(--line); }
.driver-name { display: flex; align-items: center; gap: .55rem; }
.flag { width: 25px; height: 17px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.rig-button { margin-top: .7rem; cursor: pointer; }
.placeholder-driver { opacity: .55; }
.rig-modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 2rem; background: rgba(2,5,9,.92); backdrop-filter: blur(12px); }
.rig-modal.open { display: grid; }
.rig-modal-content { margin: 0; width: min(1200px, 94vw); max-height: 90vh; }
.rig-modal-content img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.65); }
.rig-modal-content figcaption { margin-top: .7rem; text-align: center; color: var(--muted); }
.rig-modal-close { position: fixed; top: 1rem; right: 1rem; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #111824; color: white; font-size: 2rem; line-height: 1; cursor: pointer; }
body.modal-open { overflow: hidden; }


/* Version 1.12 – Google-Sheets data */
.data-loading, .data-empty, .data-error {
  padding: 1.3rem 1.4rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
}
.data-error { color: #ffb5b5; border-color: rgba(255,120,120,.28); }
.results-table td.data-loading, .results-table td.data-empty, .results-table td.data-error { text-align: center; }
.stat strong[data-counter] { min-height: 2.7rem; }
.data-error small { display: block; margin-top: .45rem; color: var(--muted); font-weight: 500; }


/* Version 1.13 – Google-Sheets-/Google-Docs-Berichte */
.data-loading { padding: 1.5rem; color: var(--muted); border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); }
.report-thumb-image, .report-card-media { overflow: hidden; }
.report-thumb-image img, .report-card-media img { width: 100%; height: 100%; object-fit: cover; }
.report-card-media { min-height: 230px; padding: 0; }
.report-detail-hero { padding-bottom: 3.25rem; }
.report-detail-hero h1 { max-width: 980px; font-size: clamp(2.7rem, 5.6vw, 5rem); }
.report-detail-layout { width: min(calc(100% - 2rem), 920px); }
.report-detail-image { width: 100%; max-height: 540px; object-fit: cover; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 2rem; }
.report-article { color: #d5dce6; font-size: 1.08rem; line-height: 1.78; }
.report-article h1, .report-article h2, .report-article h3 { margin-top: 2.2rem; margin-bottom: .8rem; color: var(--text); letter-spacing: -.035em; }
.report-article h1 { font-size: 2.2rem; }
.report-article h2 { font-size: 1.75rem; }
.report-article h3 { font-size: 1.35rem; }
.report-article p { margin: 0 0 1.25rem; }
.report-article img { max-width: 100%; height: auto; border-radius: 16px; margin: 1.25rem auto; }
.report-article a { color: var(--ice); text-decoration: underline; text-underline-offset: .18em; }
.report-article ul, .report-article ol { padding-left: 1.4rem; }
.report-article blockquote { margin: 1.5rem 0; padding: .4rem 0 .4rem 1.25rem; border-left: 3px solid var(--ice); color: #b9c8d8; }
@media (max-width: 640px) { .report-detail-layout { width: min(calc(100% - 2rem), 920px); } .report-article { font-size: 1rem; } }


/* Version 1.14 – dynamischer Kader */
#drivers-grid > .data-loading,
#drivers-grid > .data-empty,
#drivers-grid > .data-error { grid-column: 1 / -1; }
.driver-card .card-body { display: flex; flex-direction: column; }
.driver-card .card-body p { flex: 1; }
.nation-text { margin-left: .35rem; color: var(--muted); font-size: .78rem; font-weight: 700; }


/* Version 1.15 – Berichte-Archiv und Rechtstexte */
.reports-archive { margin-top: 1rem; }
.report-archive-list { display: grid; }
.report-archive-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem .25rem;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease, padding .2s ease;
}
.report-archive-row:last-child { border-bottom: 0; }
.report-archive-row:hover { padding-inline: .75rem; background: rgba(120,215,255,.045); }
.report-archive-row time { color: var(--ice); font-weight: 800; white-space: nowrap; }
.report-archive-row span { min-width: 0; font-weight: 750; }
.report-archive-row b { color: var(--ice); font-size: 1.15rem; }
.legal-layout { width: min(calc(100% - 2rem), 920px); }
.legal-hero { padding-bottom: 3.25rem; }
.legal-article { padding: 2rem; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.025); box-shadow: var(--shadow); }
.legal-article > :first-child { margin-top: 0; }
@media (max-width: 640px) {
  .report-archive-row { grid-template-columns: 1fr auto; gap: .35rem .8rem; }
  .report-archive-row time { grid-column: 1; font-size: .82rem; }
  .report-archive-row span { grid-column: 1; }
  .report-archive-row b { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .legal-article { padding: 1.25rem; }
}
