/* ----------------------------------------------------------------------------
   "Index" — Editorial-Design nach VTAI Corporate Identity v1.1
   ----------------------------------------------------------------------------
   Struktur entsteht aus Haarlinien und Nummern, nicht aus Schatten oder Icons.
   Flächen sind flach. Genau EIN grüner Moment pro Seite (der Status-Punkt).
   Farben kommen als CSS-Variablen aus dem Admin-Panel (siehe app.js) — die
   Signalfarbe bleibt bewusst fest, damit der Akzent nicht versehentlich
   verwässert wird.
---------------------------------------------------------------------------- */
:root {
  --bg: #f5f4f0;        /* Papier */
  --accent: #0a0a0a;    /* Tinte — Primär-Fläche */
  --text: #0a0a0a;      /* Tinte — Haupttext */
  --muted: #595959;     /* Stahl — Nebentext */
  --paper-pure: #ffffff;

  /* Linien: der Rahmen ist kräftiger als die Trennung im Inneren. */
  --line: rgba(10, 10, 10, 0.28);   /* Rahmen-Haarlinie */
  --rule: rgba(10, 10, 10, 0.13);   /* Trennlinie innerhalb einer Fläche */
  --rule-faint: rgba(10, 10, 10, 0.07); /* Satzspiegel-Achsen */

  /* Blattgrün — funktional für "Live/Verfügbar". Der einzige Akzent. */
  --leaf: #1f8a5b;

  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --radius: 0px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Satzspiegel ----------
   Zwei senkrechte Haarlinien laufen durch die ganze Seite und geben ihr eine
   Achse. Das ist der Grund, warum die Seite nicht mehr leer wirkt, obwohl
   inhaltlich nichts hinzugekommen ist. */
.cap-card {
  position: relative;
  min-height: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 44px 26px 36px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.cap-card::before,
.cap-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule-faint);
  pointer-events: none;
}
/* Bewusst außerhalb des Satzspiegels: liegen die Linien exakt auf der
   Textkante, läuft langer Text (z. B. der Status) optisch in sie hinein. */
.cap-card::before { left: 14px; }
.cap-card::after  { right: 14px; }

/* ---------- Kopfzeile: Marke links, Status rechts ---------- */
.cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.cap-brand {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Der eine grüne Moment der Seite. */
.cap-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--leaf);
  white-space: nowrap;
  flex: 0 0 auto;
}
.cap-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--leaf);
}

/* ---------- Portrait + Logo-Badge ---------- */
.cap-portrait {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 32px 0 24px;
  flex: 0 0 auto;
  align-self: flex-start;
}
.cap-portrait-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  background: #e9e7e1;
}
.cap-portrait-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 26px;
  color: var(--muted);
}
.vt-logo {
  position: absolute;
  right: -6px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper-pure);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Kein Schlagschatten — die Haarlinie trennt genug. */
}
.vt-logo img { width: 18px; height: 18px; object-fit: contain; }

/* ---------- Kopf-Texte ---------- */
.cap-name {
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
}
.cap-tagline {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.45;
  max-width: 30ch;
}
.cap-location {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.cap-location svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex: 0 0 auto;
}
a.cap-location {
  text-decoration: none;
  transition: color 0.16s ease;
}
a.cap-location:hover { color: var(--text); }

/* ---------- Kontakt (E-Mail/Telefon, optional) ---------- */
.cap-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.cap-contact .cap-location { margin-top: 0; }

/* ---------- Zahlen-Streifen (Belege statt Adjektive) ---------- */
.cap-facts {
  display: flex;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cap-fact {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 12px 13px 0;
}
.cap-fact + .cap-fact {
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}
.cap-fact-value {
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.cap-fact-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.35;
}

/* ---------- Abschnitts-Eyebrow mit §-Nummer ---------- */
.cap-section {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 34px;
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cap-section .num { color: var(--text); }
.cap-section .fill {
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule);
  transform: translateY(-3px);
}

/* ---------- Primär-Handlung (Tinte-Fläche) ---------- */
.cap-primary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 20px 20px 20px 18px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: background 0.16s ease;
}
.cap-primary:hover { background: #1a1a1a; }
.cap-primary .cap-idx { color: rgba(245, 244, 240, 0.5); }
.cap-primary .cap-btn-title { font-size: 17px; }
.cap-primary .cap-btn-meta { color: rgba(245, 244, 240, 0.62); }
.cap-primary .cap-btn-arrow { color: var(--bg); }

/* ---------- Index-Liste ----------
   Eine zusammenhängende Fläche mit Trennlinien statt fünf einzelner Karten:
   ruhiger, dichter, und die Nummern werden zur Leseachse. */
.cap-links {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cap-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 17px 4px 17px 2px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: padding-left 0.16s ease, background 0.16s ease;
}
.cap-btn + .cap-btn { border-top: 1px solid var(--rule); }
.cap-btn:hover { padding-left: 10px; }
.cap-btn:hover .cap-idx { color: var(--text); }
.cap-btn:hover .cap-btn-arrow { transform: translate(2px, -2px); }
.cap-btn:focus-visible,
.cap-primary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Laufende Nummer — trägt die Struktur, die sonst Icons tragen würden. */
.cap-idx {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  flex: 0 0 auto;
  width: 20px;
  transition: color 0.16s ease;
}

/* Link-Icon: ergänzt die Nummer, ersetzt sie nicht — ein zweiter, sehr
   ruhiger Anhaltspunkt, worum es beim jeweiligen Link geht. */
.cap-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.16s ease;
}
.cap-link-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cap-btn:hover .cap-link-icon { color: var(--text); }
.cap-primary .cap-link-icon { color: rgba(245, 244, 240, 0.62); }

.cap-btn-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.cap-btn-title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.cap-btn-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.cap-btn-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}
.cap-btn-clicks {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  opacity: 0.65;
  flex: 0 0 auto;
}

/* ---------- Social-Icons ---------- */
.cap-socials {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}
.cap-social {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}
.cap-social:hover { background: var(--accent); color: var(--bg); }
.cap-social:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.cap-social svg { width: 17px; height: 17px; }

/* ---------- Footer / Rechtslinks ---------- */
.cap-footer {
  margin-top: auto;
  padding-top: 30px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.cap-footer-rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 14px;
}
.cap-footer .footer-text {
  margin-bottom: 10px;
  text-transform: none;
  letter-spacing: 0.04em;
}
.cap-legal { display: flex; gap: 12px; align-items: center; }
.cap-legal a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.cap-legal a:hover { color: var(--text); border-bottom-color: var(--text); }
.cap-legal .sep { opacity: 0.45; }

.loading {
  color: var(--muted);
  padding: 60px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Rechtstexte-Seite (Impressum / Datenschutz) ---------- */
.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 26px;
}
.legal-page .back {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.legal-page .back:hover { color: var(--text); }
.legal-page h1 {
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.legal-page pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: #2a2a2a;
}

/* ---------- Körper-Raster ----------
   Am Handy eine Spalte in DOM-Reihenfolge (Identität, Index, Socials).
   Am Rechner zwei Spalten — siehe Desktop-Block weiter unten. */
.cap-body {
  display: grid;
  grid-template-columns: 1fr;
}

/* ---------- Rechner ab 880px ----------
   Ein Handy-Layout auf 1440px stehen zu lassen heißt: zwei Drittel der Seite
   sind leer. Deshalb hier ein eigenes Layout — die Fläche wird zur Karte,
   der Inhalt teilt sich in "wer" (links) und "was" (rechts). */
@media (min-width: 880px) {
  body {
    min-height: 100vh;
    display: flex;
    padding: 48px 32px;
  }
  .cap-card {
    /* margin:auto statt align-items:center — zentriert, schneidet aber bei
       zu hohem Inhalt nicht oben ab, sondern scrollt normal. */
    margin: auto;
    min-height: 0;
    max-width: 900px;
    width: 100%;
    padding: 38px 44px 32px;
    background: var(--paper-pure);
    border: 1px solid var(--line);
  }
  /* Die Achsenlinien waren der Ersatz für einen Rahmen — jetzt gibt es einen. */
  .cap-card::before,
  .cap-card::after { display: none; }

  .cap-body {
    grid-template-columns: 300px 1fr;
    /* auto/1fr ist entscheidend: sonst zieht die hohe Index-Spalte die erste
       Zeile mit auf und die Social-Icons treiben nach unten weg. */
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "me      index"
      "socials index";
    column-gap: 44px;
    align-items: start;
  }
  .cap-me      { grid-area: me; }
  .cap-index   { grid-area: index; padding-left: 44px; border-left: 1px solid var(--rule); }
  .cap-socials { grid-area: socials; align-self: start; margin-top: 24px; }

  .cap-portrait { margin: 30px 0 22px; }
  .cap-name { font-size: 36px; }
  .cap-tagline { font-size: 15px; max-width: none; }

  /* Der Index beginnt oben bündig mit dem Portrait, nicht mit Abstand. */
  .cap-index .cap-section:first-child { margin-top: 30px; }

  /* In der schmalen Identitätsspalte stehen Belege untereinander. */
  .cap-facts { flex-direction: column; }
  .cap-fact { padding: 12px 0; }
  .cap-fact + .cap-fact {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
  }

  .cap-footer { margin-top: 34px; padding-top: 22px; }
}

/* ---------- Mobil ----------
   Die Seite wird fast nur am Handy geöffnet: Achsenlinien rücken mit dem
   Padding nach innen, damit der Satzspiegel erhalten bleibt. */
@media (max-width: 480px) {
  .cap-card { padding: 34px 20px 28px; }
  .cap-card::before { left: 9px; }
  .cap-card::after  { right: 9px; }
  .cap-brand, .cap-status { font-size: 9.5px; letter-spacing: 0.13em; }
  .cap-name { font-size: 32px; }
  .cap-tagline { font-size: 15px; }
  .cap-fact-value { font-size: 18px; }
  .cap-fact-label { font-size: 9px; }
  .cap-primary { padding: 18px 16px; gap: 13px; }
  .cap-btn { gap: 13px; }
  .cap-idx { width: 18px; }
}

/* Sehr schmale Geräte: der Fakten-Streifen bricht sonst um. */
@media (max-width: 360px) {
  .cap-facts { flex-wrap: wrap; }
  .cap-fact { flex: 1 1 50%; }
  .cap-fact:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
}

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