/* Wachbuch Klar 2 – öffentliche Seiten
   Gemeinsame Bausteine für Startseite (/), Vorführung (/vorfuehrung/),
   Projektseite (site/) und Folien (docs/praesentation/). Setzt tokens.css und
   fonts.css voraus; keine eigenen Farben, keine Animationen außer auf Wunsch.

   Prinzipien: Die echte Oberfläche zeigen statt Stockfotos. Die Warnmarkierung
   steht für Grenzen (Abschnitt „Was nicht hineingehört“) und als schmale Kante
   oben. Text links, Zeilen unter 70 Zeichen, Zahlen tabellarisch. */

.pub {
  --pub-width: 72rem;
  --pub-gutter: clamp(1rem, 4vw, 2rem);
  color: var(--text);
  background: var(--bg);
}
.pub *, .pub *::before, .pub *::after { box-sizing: border-box; }
/* Das Logo in der Kopfleiste behält seine feste Höhe. */
.pub img:not(.brand-logo):not(.pub-brand-logo) { max-width: 100%; height: auto; display: block; }
.pub a { color: var(--accent-dark); text-underline-offset: .18em; }
.pub :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.pub-wrap {
  width: min(var(--pub-width), 100% - 2 * var(--pub-gutter));
  margin-inline: auto;
}

/* —— Kopf —— */
.pub-header {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.pub-header-inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
}
.pub-brand-logo { display: block; height: 2.4rem; width: auto; }
.pub-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.pub-nav a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  padding: 0 .75rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}
.pub-nav a:hover { color: var(--text); background: var(--surface-soft); }

/* —— Buttons —— */
.pub-button {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--brand);
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
.pub-button:hover { background: var(--accent-soft); border-color: var(--brand); }
.pub-button.primary { color: var(--on-primary); background: var(--brand); border-color: var(--brand); }
.pub-button.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.pub-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.pub-actions form { margin: 0; display: flex; }

/* —— Bühne —— */
.pub-hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); }
.pub-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.pub-hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 700;
  color: var(--text);
  max-width: 13ch;
}
.pub-lead {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
}
.pub-kicker { margin: 0 0 1rem; color: var(--muted); font-weight: 600; }

/* Geräte: Desktop hell, Handy im Nachtdienst davor – Tag und Nacht, groß und klein. */
.pub-devices { position: relative; padding-bottom: 3rem; }
.device {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 24px 48px -24px rgba(20, 33, 43, .28);
}
/* Das Handy liegt rechts unten über der Seitenspalte – die Aufmerksamkeitsliste
   links bleibt sichtbar. */
.pub-devices { padding: 0 6% 3rem 0; }
.device-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 30%;
  border-radius: 1.6rem;
  border: 6px solid #0d141a;
}
.device img { width: 100%; }

/* —— Abschnitte —— */
.pub-section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.pub-section-head { max-width: 44rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.pub-section h2 {
  margin: 0 0 .75rem;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--text);
}
.pub-section h3 { margin: 0 0 .4rem; font-size: 1.15rem; line-height: 1.3; color: var(--text); }
.pub-section p { line-height: 1.6; }
.pub-muted { color: var(--muted); }

/* Funktionen: drei Gruppen, ruhige Listen mit Haarlinien statt Kachelraster. */
.feature-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.feature-group h3 {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--text);
}
.feature-list { margin: 0; padding: 0; list-style: none; }
.feature-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.feature-list strong { display: block; margin-bottom: .2rem; }
.feature-list span { color: var(--muted); font-size: .97rem; line-height: 1.5; }

/* Einblicke: echte Aufnahmen, Bildunterschrift erklärt den Zweck. */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}
/* Gleiche Geräte stehen in einer Reihe: Desktops paarweise, Handys zu viert –
   so entstehen keine Löcher zwischen hohen und flachen Bildern. */
.shot { margin: 0; }
.shot.half { grid-column: span 6; }
.shot.phone { grid-column: span 3; }
.shot .device { margin-bottom: .75rem; }
.shot .device-phone-flat { border-radius: 1.4rem; border: 5px solid #0d141a; }
.shot figcaption strong { display: block; color: var(--text); }
.shot figcaption { color: var(--muted); font-size: .95rem; line-height: 1.5; }

/* Grenze: hier – und nur hier – rahmt die Warnmarkierung den Inhalt. */
.boundary {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  padding-left: calc(clamp(1.5rem, 4vw, 2.5rem) + .5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.boundary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: .375rem;
  background: var(--brand);
}
.boundary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.boundary-list strong { display: block; }
.boundary-list span { color: var(--muted); }

/* Installation: echte Reihenfolge, deshalb nummeriert. */
.code-block {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  color: #e7ecef;
  background: #0d141a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: .95rem;
  line-height: 1.6;
}
.code-block code { font-family: inherit; white-space: pre; }
.steps { margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 1.25rem; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.steps li::before {
  content: counter(step);
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps p { margin: .2rem 0 0; color: var(--muted); }

/* Fakten- und Statustabellen */
.facts { width: 100%; border-collapse: collapse; font-size: .98rem; }
.facts th, .facts td { padding: .85rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.facts th { width: 32%; padding-right: 1.5rem; font-weight: 700; }
.facts td { color: var(--muted); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.check-list, .open-list { margin: 0; padding: 0; list-style: none; }
.check-list li, .open-list li { position: relative; padding: .55rem 0 .55rem 1.75rem; border-bottom: 1px solid var(--line); }
.check-list li::before, .open-list li::before {
  content: "";
  position: absolute;
  left: .2rem;
  top: 1.05rem;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
}
.check-list li::before { background: var(--success); }
.open-list li::before { background: var(--warning-accent); }

.note {
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--warning-soft);
  border-left: 4px solid var(--warning-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  padding: .9rem 0;
  font-weight: 700;
  cursor: pointer;
}
.faq details p { margin: 0 0 1.1rem; color: var(--muted); max-width: 60ch; }

/* Fuß */
.pub-footer { padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.pub-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.pub-footer a { color: inherit; }

@media (max-width: 60rem) {
  .pub-hero-grid { grid-template-columns: 1fr; }
  .pub-devices { margin-inline: 4% 0; }
  .feature-groups, .split, .boundary-list { grid-template-columns: 1fr; }
  .shot.half { grid-column: span 12; }
  .shot.phone { grid-column: span 6; }
}
@media (max-width: 46rem) {
  .pub-nav { display: none; }
  .facts th { width: 40%; }
}
@media (max-width: 46rem) {
  .pub-actions .pub-button, .pub-actions form { flex: 1 1 100%; }
}
/* Terminalblock im Nachtdienst eine Stufe heller als die Seite, sonst verschwindet er. */
:root[data-theme="dark"] .code-block { background: var(--surface-raised); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .code-block { background: var(--surface-raised); }
  :root:not([data-theme="light"]) .device { box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgba(0, 0, 0, .7); }
}
@media (prefers-contrast: more) {
  .device { box-shadow: none; border: 2px solid var(--text); }
}
@media print {
  .pub-header::before, .boundary::before { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Anleitung „Selbst betreiben“ */
.install-hero h1 { margin: .25rem 0 .75rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.install-hero .pub-lead { max-width: 46rem; }
.steps .code-block { margin-top: .75rem; }
.faq-list { display: grid; gap: .5rem; margin-bottom: 1.5rem; }
.faq-list details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.faq-list summary { padding: .9rem 1.1rem; font-weight: 600; cursor: pointer; min-height: var(--touch); }
.faq-list details p { margin: 0; padding: 0 1.1rem 1rem; color: var(--muted); }
.facts code { font-family: var(--mono); font-size: .92rem; }
.demo-notice { padding-top: 1.25rem; }
.demo-notice .pub-actions { margin: .75rem 0 0; }
@media (max-width: 40rem) {
  /* Lange Befehle umbrechen statt seitlich scrollen; kopiert wird trotzdem eine Zeile. */
  .install-hero ~ .pub-section .code-block code { white-space: pre-wrap; overflow-wrap: anywhere; }
}

/* Feedback-Seite */
.feedback-wrap { max-width: 46rem; }
.feedback-form { margin: 1.5rem 0; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.consent label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.consent input { margin-top: .25rem; min-width: 1.25rem; min-height: 1.25rem; }

/* Anleitung: Hardware-Tabellen */
.pub-section .install-subhead { margin: 2.5rem 0 1rem; font-size: 1.2rem; }
.table-scroll { overflow-x: auto; }
.hardware-table { min-width: 36rem; }
.hardware-table th, .hardware-table td { padding-right: 1rem; }
.hardware-table thead th { color: var(--muted); font-size: .9rem; font-weight: 600; }

/* Startseite: Live-Zahl der Demo, Vertrauenszeichen, Stärken mit Sperrbildschirm */
.pub-hero-note { margin: 1rem 0 0; max-width: 34rem; color: var(--muted); font-size: .97rem; line-height: 1.5; }
.pub-live { display: inline-block; color: var(--text); white-space: nowrap; }
.pub-live::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .4rem;
  border-radius: 50%;
  background: var(--success);
  vertical-align: .05em;
}
.trust-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.trust-badges li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .9rem;
  font-weight: 600;
}
.trust-badges .icon { width: 1rem; height: 1rem; color: var(--success); }
.pub-hero-link { margin: 1rem 0 0; font-weight: 600; }
.highlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.highlight-shot figcaption { padding: .75rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; line-height: 1.5; }
.highlight-list li:first-child { padding-top: 0; }
.highlight-list strong { display: flex; align-items: center; gap: .5rem; }
.highlight-list .icon { color: var(--brand); }
@media (max-width: 60rem) {
  .highlight-grid { grid-template-columns: 1fr; }
}

/* Seite „Für IT und Datenschutz“ */
.it-split { align-items: start; }
.it-diagram { width: 100%; max-width: 26rem; justify-self: center; margin: 0; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.it-diagram svg { display: block; width: 100%; height: auto; }
.it-diagram figcaption { margin-top: .75rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.it-diagram .box { fill: var(--surface-soft); stroke: var(--line-strong, var(--line)); stroke-width: 1.5; }
.it-diagram .box-server { fill: var(--accent-soft); stroke: var(--brand); }
.it-diagram .zone { fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 6 5; }
.it-diagram .wire { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.it-diagram .wire-optional { stroke-dasharray: 4 4; }
.it-diagram text { fill: var(--text); font-family: inherit; font-size: 15px; }
.it-diagram .label-dim { fill: var(--muted); font-size: 13px; }
.it-diagram .label-zone { fill: var(--brand); font-size: 13px; font-weight: 700; }
.it-section + .it-section { margin-top: clamp(2rem, 5vw, 3rem); }
.it-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.it-docs a { display: block; height: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 600; text-decoration: none; }
.it-docs a:hover { border-color: var(--brand); }
.it-docs span { display: block; margin-top: .2rem; color: var(--muted); font-size: .9rem; font-weight: 400; }
