/*
 * GLASS HUMAN – Stil.
 *
 * ⚠ KANTIG: kein border-radius, nirgends. Ansage des Inhabers.
 * ⚠ Dunkel ist die Vorgabe, hell über prefers-color-scheme und über den
 *   Schalter. Die Wahl wird NICHT gespeichert (kein Cookie, kein Speicher).
 * ⚠ Schriften liegen auf dem eigenen Server. Keine Fremdquelle, nirgends.
 * ⚠ Mobil zuerst; die meisten Besucher kommen am Handy.
 */

/* ── Schriften ──────────────────────────────────────────────────────
 * ⚠ KEINE geladene Schrift, nirgends. Zwei Gründe, beide tragen:
 *   1. Jede nachgeladene Schrift wäre eine Fremdquelle oder ein weiterer
 *      Messpunkt. Auf einer Seite über Fingerprinting wäre das absurd.
 *   2. Die zwölf Sprachen brauchen chinesische, arabische, indische und
 *      bengalische Zeichen. Als Datei wären das mehrere Megabyte; das
 *      System hat sie ohnehin.
 * Der Stapel nennt zuerst die Systemschrift jeder Plattform und fällt am
 * Ende auf die allgemeinen Familien zurück.
 */
:root {
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
    'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Devanagari', 'Noto Sans Bengali',
    'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans',
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    'Liberation Mono', 'Noto Sans Mono', monospace;
}

/* ── Farben ─────────────────────────────────────────────────────── */
:root {
  --bg: #0b0d11;
  --surface: #11151c;
  --surface-2: #161b24;
  --line: #242c39;
  --line-strong: #3a4556;
  --text: #e9eef5;
  --muted: #8f9db1;
  --cold: #5b9bd5;      /* das Blau des Logos */
  --cold-dim: #2f5f8f;
  --warm: #f0a93c;      /* das Gold des Logos */
  --warm-dim: #8a5f1d;
  --danger: #e4572e;
  --danger-bg: #2a1310;
  --safe: #3fb68b;
  --safe-bg: #0e221b;
  --shadow: 0 0 0 1px var(--line);
  color-scheme: dark;
}

/* Hell: einmal über die Systemwahl (sofern der Schalter nicht auf dunkel
   steht) und einmal über den Schalter selbst. Gespeichert wird nichts. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f1f4f8;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --line: #d2d9e3;
    --line-strong: #a9b4c3;
    --text: #0e141c;
    --muted: #55616f;
    --cold: #1f5c96;
    --cold-dim: #7fa8cd;
    --warm: #9a6410;
    --warm-dim: #d8b47a;
    --danger: #b3301a;
    --danger-bg: #fbeae7;
    --safe: #1d7a56;
    --safe-bg: #e7f5ef;
    color-scheme: light;
  }
}

:root[data-theme='light'] {
  --bg: #f1f4f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #d2d9e3;
  --line-strong: #a9b4c3;
  --text: #0e141c;
  --muted: #55616f;
  --cold: #1f5c96;
  --cold-dim: #7fa8cd;
  --warm: #9a6410;
  --warm-dim: #d8b47a;
  --danger: #b3301a;
  --danger-bg: #fbeae7;
  --safe: #1d7a56;
  --safe-bg: #e7f5ef;
  color-scheme: light;
}

/* ── Grundlagen ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 4.6vw, 2.3rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; }
p { margin: 0 0 1em; }
a { color: var(--cold); text-underline-offset: 3px; }
a:hover { color: var(--warm); }

:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 62ch; }
.eyebrow { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--warm); font-weight: 600; margin-bottom: 0.9rem; }

/* ── Kopf ───────────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: auto; display: block; }
.brand span { font-size: 0.95rem; }
.head-spacer { flex: 1; }

.btn {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 7px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--warm); color: var(--warm); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--warm); color: #14100a; border-color: var(--warm); font-size: 1rem; padding: 13px 22px; }
.btn-primary:hover { background: var(--cold); border-color: var(--cold); color: #05101a; }
.btn-ghost { border-color: var(--line); color: var(--muted); }

.lang { position: relative; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line-strong);
  display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr));
  min-width: 280px; z-index: 60;
}
.lang-menu a {
  display: block; padding: 9px 12px; text-decoration: none; color: var(--text);
  font-size: 0.86rem; border-bottom: 1px solid var(--line);
}
.lang-menu a:hover { background: var(--surface-2); color: var(--warm); }
.lang-menu a[aria-current='true'] { color: var(--warm); font-weight: 600; }
.lang-menu a .native { color: var(--muted); font-size: 0.78rem; display: block; }

/* ── Startseite ─────────────────────────────────────────────────── */
.hero { padding: clamp(40px, 9vw, 96px) 0 clamp(32px, 6vw, 64px); position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: clamp(24px, 5vw, 48px); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr 0.85fr; } }
.hero-art img { width: 100%; height: auto; display: block; filter: drop-shadow(0 0 60px color-mix(in srgb, var(--cold) 35%, transparent)); }
.hero h1 strong { color: var(--warm); font-weight: 600; }

.consent {
  margin-top: 28px; border: 1px solid var(--line-strong);
  background: var(--surface); padding: clamp(18px, 3.5vw, 26px);
}
.consent h2 { font-size: 1.1rem; margin-bottom: 0.6em; }
.consent ul { margin: 0 0 1.1em; padding-inline-start: 1.1em; color: var(--muted); font-size: 0.95rem; }
.consent li { margin-bottom: 0.35em; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.consent-note { font-size: 0.82rem; color: var(--muted); margin-top: 12px; }
#consent-detail { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 0.9rem; color: var(--muted); }
#consent-detail h3 { font-size: 0.95rem; color: var(--text); }

/* ── Messlauf ───────────────────────────────────────────────────── */
.scan { padding: clamp(50px, 10vw, 110px) 0; text-align: center; }
.scan-count {
  font-family: var(--font-mono);
  font-size: clamp(3.4rem, 17vw, 9rem); line-height: 1; font-weight: 400;
  color: var(--warm); font-variant-numeric: tabular-nums;
}
.scan-track { height: 3px; background: var(--line); margin: 26px auto 14px; max-width: 540px; }
.scan-bar { height: 100%; width: 0; background: var(--cold); transition: width 0.25s linear; }
.scan-stage { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }

/* ── Bericht ────────────────────────────────────────────────────── */
.section { padding: clamp(40px, 7vw, 80px) 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(20px, 3.5vw, 36px); }

.shock { display: grid; gap: 22px; }
@media (min-width: 820px) { .shock { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }
.shock-num {
  font-family: var(--font-mono); font-size: clamp(3rem, 12vw, 6.4rem);
  line-height: 0.95; color: var(--warm); font-variant-numeric: tabular-nums;
}
.shock-examples { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.shock-examples li { display: grid; grid-template-columns: minmax(110px, 0.6fr) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.shock-examples .k { color: var(--muted); }
.shock-examples .v { font-family: var(--font-mono); word-break: break-word; }

.finger { border: 1px solid var(--warm-dim); background: var(--surface); padding: clamp(18px, 3.5vw, 28px); margin-top: 26px; }
.finger-code {
  font-family: var(--font-mono); font-size: clamp(1.3rem, 5vw, 2.1rem);
  letter-spacing: 0.1em; color: var(--warm); word-break: break-all;
}

/* ── Karten ─────────────────────────────────────────────────────── */
.card { border: 1px solid var(--line); background: var(--surface); margin-bottom: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.card-head h3 { margin: 0; }
.card-head .count { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.card-intro { padding: 14px 16px 0; color: var(--muted); font-size: 0.92rem; margin: 0; }

table.values { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.values th {
  text-align: start; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); font-weight: 600; padding: 12px 16px 8px; border-bottom: 1px solid var(--line);
}
table.values td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.values tr:last-child td { border-bottom: 0; }
td.feature { width: 26%; color: var(--text); }
td.value { width: 38%; }
td.value .v { font-family: var(--font-mono); color: var(--cold); word-break: break-word; }
td.meaning { width: 36%; color: var(--muted); }
.unreadable { color: var(--muted); font-style: italic; }

@media (max-width: 700px) {
  table.values thead { display: none; }
  table.values tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.values td { display: block; border: 0; padding: 2px 16px; width: auto; }
  td.feature { font-weight: 600; }
  td.meaning { font-size: 0.84rem; padding-top: 5px; }
}

.raw-toggle {
  display: block; margin-top: 6px; font: inherit; font-size: 0.72rem;
  background: none; border: 0; border-bottom: 1px dotted var(--line-strong);
  color: var(--muted); cursor: pointer; padding: 0 0 1px;
}
.raw-toggle:hover { color: var(--warm); border-color: var(--warm); }
pre.raw {
  margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted);
  max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}

.box { margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.box h4 { margin-bottom: 0.5em; }
.box p { margin-bottom: 0.5em; }
.box p:last-child { margin-bottom: 0; }
.box.attack { background: var(--danger-bg); border-top-color: var(--danger); }
.box.attack h4 { color: var(--danger); }
.box.protect { background: var(--safe-bg); border-top-color: var(--safe); }
.box.protect h4 { color: var(--safe); }

/* ── Stufe 2 ────────────────────────────────────────────────────── */
.stage2-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .stage2-grid { grid-template-columns: repeat(2, 1fr); } }
.stage2-item { border: 1px solid var(--line); background: var(--surface); padding: 14px 16px; }
.stage2-item h4 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1rem; }
.stage2-item p { font-size: 0.88rem; color: var(--muted); }
.stage2-state { display: block; font-size: 0.78rem; color: var(--warm); margin-top: 8px; min-height: 1.2em; }

/* ── Live-Leiste ────────────────────────────────────────────────── */
.live-rail {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--warm-dim); backdrop-filter: blur(8px);
  padding: 8px 0;
}
.live-rail .wrap { display: flex; align-items: center; gap: 14px; overflow-x: auto; }
.live-rail-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--warm); white-space: nowrap; }
.rail-row { display: flex; gap: 7px; align-items: baseline; white-space: nowrap; font-size: 0.78rem; }
.rail-k { color: var(--muted); }
.rail-v { font-family: var(--font-mono); color: var(--text); }
/* ⚠ Die Leiste bleibt auf JEDER Breite unten. Rechts oben verdeckte sie am
   grossen Bildschirm die Tabellen und den Sprachwähler (gemessen 19.10.). */
@media (min-width: 1100px) {
  .live-rail .wrap { justify-content: center; }
  .rail-row { font-size: 0.82rem; }
}

/* ── Checklisten ────────────────────────────────────────────────── */
.checks { display: grid; gap: 18px; }
@media (min-width: 760px) { .checks { grid-template-columns: repeat(2, 1fr); } }
.check-group { border: 1px solid var(--line); background: var(--surface); padding: 16px; }
.check-group h3 { color: var(--warm); }
.check-group ul { list-style: none; margin: 0; padding: 0; }
.check-group li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.check-group li:last-child { border-bottom: 0; }
.check-group li::before { content: ''; flex: 0 0 14px; height: 14px; margin-top: 4px; border: 1px solid var(--line-strong); }

/* ── Tabellen im Fliesstext (Fälle, App-Vergleich) ──────────────── */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table.plain { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 560px; }
table.plain th { text-align: start; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line-strong); background: var(--surface-2); }
table.plain td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain tr:last-child td { border-bottom: 0; }
table.plain td:first-child { white-space: nowrap; color: var(--warm); font-family: var(--font-mono); font-size: 0.8rem; }

/* ── Fuss ───────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--muted); font-size: 0.85rem; }
.site-foot .wrap { display: grid; gap: 14px; }
@media (min-width: 760px) { .site-foot .wrap { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.foot-from { color: var(--text); }
.foot-from a { font-weight: 600; }

/* ── Rechts nach links ──────────────────────────────────────────── */
[dir='rtl'] .shock-examples li { grid-template-columns: minmax(110px, 0.6fr) 1fr; }
[dir='rtl'] .scan-bar { margin-inline-start: auto; }

/* ── Druck: der Bericht zum Mitnehmen ───────────────────────────── */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --line: #bbb; --line-strong: #666;
    --text: #000; --muted: #333; --cold: #14406b; --warm: #7a4f08;
    --danger: #8d2112; --danger-bg: #fff; --safe: #11543c; --safe-bg: #fff;
  }
  @page { margin: 14mm 12mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .site-head, .live-rail, .lang, #theme-toggle, .btn, .consent, #intro, .scan, .raw-toggle, .stage2-grid { display: none !important; }
  .wrap { width: 100%; }
  .section { padding: 10pt 0; border-top: 1px solid #999; break-inside: auto; }
  .card { border: 1px solid #999; break-inside: avoid; margin-bottom: 10pt; }
  .card-head { background: #f2f2f2; }
  table.values { font-size: 9pt; }
  table.values thead { display: table-header-group; }
  table.values tr { break-inside: avoid; }
  pre.raw { display: block !important; max-height: none; border: 1px solid #ccc; font-size: 7.5pt; }
  pre.raw[hidden] { display: none !important; }
  .print-only { display: block !important; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 8pt; color: #555; word-break: break-all; }
  .box.attack, .box.protect { border: 1px solid #999; }
}
.print-only { display: none; }

/* ── Hilfen ─────────────────────────────────────────────────────── */
[hidden] { display: none !important; }
.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; background: var(--warm); color: #14100a;
  padding: 10px 16px; z-index: 100; font-weight: 600;
}
.skip:focus { inset-inline-start: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Hilfsklassen statt Inline-Styles (strenge Sicherheitsrichtlinie) ── */
.center { margin-inline: auto; }
.spaced { margin-top: 28px; }
.quote { font-size: 1.1rem; }
.box.standalone { border: 1px solid var(--danger); margin-top: 22px; }
.plainlist { list-style: none; margin: 0; padding: 0; }
.plainlist li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.plainlist li:last-child { border-bottom: 0; }
.lead.answer { font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--warm); font-weight: 600; }

/* Der Kopf steht fest; ohne diesen Abstand verschwindet die erste Zeile
   eines Sprungziels darunter. */
:target, .section, .card { scroll-margin-top: 72px; }
body { padding-bottom: 64px; }

/* ── Graphen ────────────────────────────────────────────────────────
 * Selbst gezeichnetes SVG, kantig wie alles andere. Die Farben kommen
 * aus denselben Variablen, damit sie im Hell- und Dunkelmodus stimmen.
 */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-label { fill: var(--muted); font-size: 13px; font-family: var(--font-sans); }
.chart-value { fill: var(--text); font-size: 12px; font-family: var(--font-mono); }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.chart-track { fill: var(--line); }
.chart-bar { fill: var(--cold); }
.chart-bar.warm { fill: var(--warm); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-grid.strong { stroke: var(--line-strong); }
.chart-line { stroke: var(--cold); stroke-width: 2; fill: none; }
.chart-line.warm { stroke: var(--warm); }

.chart-box { border: 1px solid var(--line); background: var(--surface); padding: 16px; margin: 18px 0; }
.chart-box h3 { font-size: 0.95rem; margin-bottom: 4px; }
.chart-box p { font-size: 0.86rem; color: var(--muted); margin: 0 0 12px; }

/* ── Das Touch-Bild ─────────────────────────────────────────────── */
.touchmap { display: grid; gap: 14px; }
@media (min-width: 760px) { .touchmap { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.touchmap canvas {
  width: 100%; aspect-ratio: 3 / 4; display: block;
  border: 1px solid var(--line-strong); background: var(--bg);
  touch-action: none; cursor: crosshair;
}
@media (min-width: 760px) { .touchmap canvas { aspect-ratio: 16 / 10; } }
.tm-info { font-size: 0.84rem; }
.tm-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tm-row:last-child { border-bottom: 0; }
.tm-row span { color: var(--muted); }
.tm-row b { font-family: var(--font-mono); font-weight: 400; color: var(--cold); }
.tm-hint { font-size: 0.84rem; color: var(--muted); margin-top: 10px; }

@media print {
  .chart { break-inside: avoid; }
  .chart-label, .chart-value, .chart-axis { fill: #000; }
  .chart-bar { fill: #444; } .chart-bar.warm { fill: #000; }
  .chart-track { fill: #ddd; } .chart-line { stroke: #000; }
  .touchmap canvas { display: none; }
}

/* ── Was erst nach der Zustimmung erscheint ──────────────────────────
 * Die Abschnitte über Apps, Fälle, Werbeblocker und Schutz stehen fest im
 * HTML, damit Suchmaschinen und KI-Dienste sie lesen. Sichtbar werden sie
 * erst nach dem Klick, damit der Start ruhig bleibt.
 * ⚠ Ohne JavaScript bleiben sie sichtbar: die Regel greift nur, wenn das
 *   Vorab-Skript `data-js` gesetzt hat.
 */
html[data-js] .after-consent { display: none; }
html[data-js][data-consent] .after-consent { display: block; }
