/* =====================================================================
   AI Forum - Public Site  |  Design-System "Technik / ruhig / modern"
   Arbeitstitel-Marke: Companion Nexus (zentral austauschbar, siehe branding/BRANDING.md)
   Farbrichtung: Blau-Grau + rote Akzente. Hell + Dunkel.
   Motive: subtile Hexagons + dezente Leiterbahn-/Bus-Linien.
   100% self-hosted: System-Fonts, lokale SVGs, keine externen Requests.
   ===================================================================== */

/* ---------- Design Tokens: HELL (Default) ---------- */
/* V1.1 (2026-06-27): heller + freundlicher. Sehr helles Blau-Weiss,
   weicheres Blau-Grau, Rot nur sparsam, Deko dezenter. */
:root {
  /* Flaechen */
  --bg:         #f5f8fc;   /* Seite, sehr helles Blau-Weiss */
  --bg-top:     #ffffff;   /* luftiger heller Verlauf oben */
  --surface:    #ffffff;   /* Karten/Header */
  --surface-2:  #f6f9fd;   /* leicht abgesetzte Flaeche */
  /* Text */
  --text:       #212b3a;   /* etwas weicher als zuvor, weiter gut lesbar */
  --text-soft:  #5b6877;
  --muted:      #7e8a99;
  /* Linien */
  --border:     #e1e7ef;   /* weicher/heller */
  --border-2:   #d2dae4;
  /* Marke: Blau-Grau (etwas weicher) */
  --brand:      #38506a;   /* weicheres Schiefer-Blau */
  --brand-2:    #57708a;
  /* Akzent: Rot (sparsam) */
  --accent:       #d23a32;
  --accent-strong:#b62f28;
  --accent-soft:  rgba(210, 58, 50, .08);
  /* Links */
  --link:       #336392;
  --link-hover: #d23a32;
  /* Effekte */
  --ring:       rgba(47, 93, 134, .50);
  --shadow:     0 1px 2px rgba(26,35,48,.04), 0 8px 22px rgba(26,35,48,.05);
  --deco-opacity: .32;     /* Hex/Leiterbahn-Deko jetzt dezent */

  /* Typografie */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", "JetBrains Mono", Menlo, Consolas, monospace;

  --max:   72ch;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ---------- Design Tokens: DUNKEL (System) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #0f141a;
    --bg-top:     #141b24;
    --surface:    #161d26;
    --surface-2:  #1b2430;
    --text:       #e7ecf2;
    --text-soft:  #a0aebd;
    --muted:      #7e8b9b;
    --border:     #2a3543;
    --border-2:   #364456;
    --brand:      #9fb6cf;
    --brand-2:    #7d93ab;
    --accent:       #ef5a52;
    --accent-strong:#f26a62;
    --accent-soft:  rgba(239, 90, 82, .15);
    --link:       #82b4e0;
    --link-hover: #ef5a52;
    --ring:       rgba(130, 180, 224, .55);
    --shadow:     0 1px 2px rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.40);
    --deco-opacity: .85;
  }
}

/* ---------- Manuelle Umschaltung (ueberschreibt System) ---------- */
:root[data-theme="dark"] {
  --bg:#0f141a; --bg-top:#141b24; --surface:#161d26; --surface-2:#1b2430;
  --text:#e7ecf2; --text-soft:#a0aebd; --muted:#7e8b9b;
  --border:#2a3543; --border-2:#364456;
  --brand:#9fb6cf; --brand-2:#7d93ab;
  --accent:#ef5a52; --accent-strong:#f26a62; --accent-soft:rgba(239,90,82,.15);
  --link:#82b4e0; --link-hover:#ef5a52;
  --ring:rgba(130,180,224,.55);
  --shadow:0 1px 2px rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.40);
  --deco-opacity:.85;
}
:root[data-theme="light"] {
  --bg:#f5f8fc; --bg-top:#ffffff; --surface:#ffffff; --surface-2:#f6f9fd;
  --text:#212b3a; --text-soft:#5b6877; --muted:#7e8a99;
  --border:#e1e7ef; --border-2:#d2dae4;
  --brand:#38506a; --brand-2:#57708a;
  --accent:#d23a32; --accent-strong:#b62f28; --accent-soft:rgba(210,58,50,.08);
  --link:#336392; --link-hover:#d23a32;
  --ring:rgba(47,93,134,.50);
  --shadow:0 1px 2px rgba(26,35,48,.04),0 8px 22px rgba(26,35,48,.05);
  --deco-opacity:.32;
}

/* ---------- Reset / Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* luftiger heller Verlauf oben -> ruhige Flaeche unten */
  background-image:
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 360px);
  background-repeat: no-repeat;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 1.15rem; }
.prose { max-width: var(--max); }

/* Skip-Link (Barrierefreiheit) */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 100; font-weight: 600;
}
.skip:focus { left: 0; }

/* ---------- Beta-Banner (zentral, hell/freundlich, theme-bewusst) ---------- */
.beta-banner {
  background: var(--surface-2);
  color: var(--text-soft);
  text-align: center;
  padding: .55rem 1rem;
  font: 600 .8rem/1.46 var(--font-mono);
  letter-spacing: .02em;
  border-bottom: 1px solid var(--border);
}
.beta-banner strong {
  color: var(--accent);
  letter-spacing: .08em;
  margin-right: .15rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
/* dezente Bus-Linie unter dem Header */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0, transparent 26px,
      var(--accent) 26px, var(--accent) 30px);
  opacity: .14; pointer-events: none;
}
.nav {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 0; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 1.12rem; letter-spacing: .3px;
  color: var(--brand); text-decoration: none;
}
:root[data-theme="dark"] .brand,
.brand { color: var(--text); }
.brand:hover { color: var(--brand); }
/* Hexagon-Logo-Knoten (aus dem bestehenden .dot, kein HTML noetig) */
.brand .dot {
  width: 20px; height: 22px; display: inline-block; position: relative;
  background: var(--brand);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  flex: 0 0 auto;
}
.brand .dot::after {           /* roter Signal-Knoten in der Mitte */
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.brand .tld { color: var(--accent); }   /* optionaler roter Akzent im Wortzeichen */

.nav-links { display: flex; gap: .15rem 1.1rem; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav-links a {
  position: relative; color: var(--text-soft); text-decoration: none;
  padding: .4rem .15rem; font-size: .97rem;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"], .nav-links a[aria-current="true"] { color: var(--text); }
.nav-links a[aria-current="page"]::after, .nav-links a[aria-current="true"]::after {  /* roter Aktiv-Indikator */
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: #fff;
  padding: .58rem 1.05rem; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600; border: 1px solid transparent;
  transition: filter .15s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.05); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border-color: var(--border-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); filter: none; }

.theme-toggle {
  font-family: var(--font-mono); font-size: .82rem;
  background: transparent; border: 1px solid var(--border-2); color: var(--text-soft);
  border-radius: var(--radius-sm); padding: .42rem .6rem; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--brand-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 4rem 0 3rem; isolation: isolate;
}
/* Hexagon-/Leiterbahn-Deko oben rechts, sehr subtil */
.hero::before {
  content: ""; position: absolute; z-index: -1;
  top: -40px; right: -40px; width: 560px; height: 360px;
  background: url("/assets/hex-bg.svg") top right / contain no-repeat;
  opacity: var(--deco-opacity); pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent 95%);
          mask-image: linear-gradient(to left, #000 30%, transparent 95%);
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.12; margin: 0 0 .8rem;
  letter-spacing: -.5px;
}
.hero p.lead { font-size: 1.16rem; color: var(--text-soft); max-width: 62ch; }
.hero .cta { margin-top: 1.5rem; display: flex; gap: .7rem; flex-wrap: wrap; }

/* ---------- Sektionen / Headings ---------- */
section { padding: 1.7rem 0; }
h2 {
  font-size: 1.5rem; margin: 1.2rem 0 .8rem; line-height: 1.2;
  display: flex; align-items: center; gap: .6rem; color: var(--text);
}
/* kleines Hexagon-Bullet vor h2 (jetzt ruhiges Blau-Grau statt Rot) */
h2::before {
  content: ""; width: 12px; height: 14px; flex: 0 0 auto;
  background: var(--brand-2);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.hero h1::before { content: none; }
h3 { font-size: 1.12rem; margin: 1.1rem 0 .4rem; color: var(--text); }

/* ---------- Karten ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem 1.45rem; box-shadow: var(--shadow);
}
/* technischer Akzent: nur noch ein kurzer roter Tick oben links, sonst dezent */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent) 0 14%, var(--border-2) 14% 100%);
  opacity: .5;
}
.card h3 { margin-top: .2rem; }
.card p { margin-bottom: .2rem; color: var(--text-soft); }
a.card-link { text-decoration: none; color: var(--text); display: block; }
a.card-link:hover { border-color: var(--brand-2); }
a.card-link:hover h3 { color: var(--accent); }
a.card-link:hover { box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 10px 26px rgba(26,35,48,.10); }

/* ---------- Hinweis-Box ---------- */
.note {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: .95rem 1.1rem; margin: 1.3rem 0; color: var(--text-soft);
}
.note strong { color: var(--text); }

/* ---------- Badge / Tag (technisch, mono) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .76rem; font-weight: 600; letter-spacing: .3px;
  color: var(--brand); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: 999px; padding: .2rem .7rem;
}
.badge::before {                 /* roter Signal-Punkt */
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.badge.badge-plain::before { content: none; }

/* ---------- Listen / Tabelle / Footer ---------- */
ul.clean { list-style: none; padding: 0; }
ul.clean li { padding: .45rem 0 .45rem 1.4rem; border-bottom: 1px solid var(--border); position: relative; }
ul.clean li::before {            /* kleines Hex-Aufzaehlungszeichen */
  content: ""; position: absolute; left: 0; top: .85rem; width: 9px; height: 10px;
  background: var(--brand-2);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
ul.clean li:last-child { border-bottom: 0; }

table.legal { width: 100%; border-collapse: collapse; }
table.legal td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.site-footer {
  position: relative; border-top: 1px solid var(--border);
  margin-top: 3rem; padding: 2rem 0; color: var(--text-soft); font-size: .95rem;
}
.site-footer::before {           /* Bus-Linie ueber dem Footer */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: repeating-linear-gradient(90deg, transparent 0 26px, var(--accent) 26px 30px);
  opacity: .12;
}
.site-footer .foot-grid { display: flex; gap: 1.5rem 2rem; flex-wrap: wrap; justify-content: space-between; }
.site-footer strong { color: var(--text); font-family: var(--font-mono); letter-spacing: .3px; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Fokus / A11y ---------- */
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
