:root {
  color-scheme: dark;
  --background: #000000;
  --foreground: #f3fff8;
  --muted: #b6c8be;
  --subtle: #7f9188;
  --accent: #39f28f;
  --line: rgba(117, 255, 169, 0.22);
  --shadow: rgba(0, 0, 0, 0.72);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 4;
  transform: translateY(-160%);
  border: 1px solid var(--line);
  background: #050806;
  color: var(--foreground);
  padding: 0.65rem 0.8rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-main {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 4.5rem 1.5rem 5.5rem;
  background: #000000;
}

.world-frame {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.world-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
}

.background-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.72) 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.86));
}

.hero {
  width: min(100%, 52rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-mark {
  display: block;
  width: min(52vw, 20rem);
  filter: drop-shadow(0 1.5rem 2.5rem var(--shadow));
}

.brand-logo {
  width: 100%;
  height: auto;
}

/* The name is live text rather than part of the logo image, so it stays crisp,
   selectable and reflows on narrow screens. .brand-suffix echoes the green dot
   that closes the claim in the original lockup. */
.brand-wordmark {
  margin: 0.9rem 0 0;
  font-size: clamp(2.2rem, 10vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-suffix {
  color: var(--accent);
}

.status {
  margin: 1.25rem 0 0;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.claim {
  max-width: 38rem;
  margin: 1rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.18;
}

.summary {
  max-width: 42rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.imprint-link {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.imprint-link:hover {
  color: var(--foreground);
}

.imprint {
  border-top: 1px solid var(--line);
  background: #020403;
  color: var(--muted);
  padding: 3.5rem 1.5rem;
}

.imprint-inner {
  width: min(100%, 58rem);
  margin: 0 auto;
  /* German legal prose is full of long compounds ("Datenschutz-Aufsichtsbehörde",
     "Angemessenheitsbeschlüsse"). Below ~340px one of them overran its line box and
     pushed the page into horizontal scroll, so let long words break rather than
     widen the document. */
  overflow-wrap: break-word;
  hyphens: auto;
}

.imprint h1 {
  margin: 0 0 1.5rem;
  color: var(--foreground);
  font-size: 1.5rem;
  line-height: 1.25;
}

.imprint address {
  display: grid;
  gap: 1rem;
  margin: 0;
  font-style: normal;
  line-height: 1.65;
}

.imprint strong {
  color: var(--foreground);
}

.imprint a {
  color: var(--accent);
}

.label {
  display: block;
  color: var(--subtle);
  font-size: 0.875rem;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .site-main {
    padding: 3rem 1rem 5rem;
  }

  .brand-mark {
    width: min(72vw, 15rem);
  }

  .claim {
    font-size: 1.35rem;
  }

  .summary {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ── M11: live demo section ─────────────────────────────────────────────────
   Layered WITH the hero visual (FR-003a): a translucent panel floating over the
   world map (which sits at z-index -3/-2), never replacing or obscuring it. */
.demo {
  position: relative;
  margin: 2.75rem auto 3.5rem;
  max-width: 34rem;
  padding: 1.5rem 1.75rem 1.65rem;
  background: rgba(2, 8, 5, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.demo h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.demo-intro {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.demo-step label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--foreground);
}

.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* 024 — recording opt-out (default: record; ticking the box declines) */
.demo-optout {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.4rem 0 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.demo-optout input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.12rem;
  accent-color: var(--accent);
}

.demo-optout input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.demo-row input {
  flex: 1 1 12rem;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.demo-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.demo-row button,
.demo-link {
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #02140a;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.demo-link {
  margin-top: 0.7rem;
  padding: 0;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.demo-privacy {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--subtle);
}

.demo-codeword-label {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.demo-codeword {
  margin: 0 0 0.75rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.demo-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.demo-status {
  margin: 1rem 0 0;
  min-height: 1.3em;
  font-size: 0.92rem;
  color: var(--foreground);
}

.demo-status.demo-error {
  color: #ff9d8a;
}

@media (max-width: 700px) {
  .demo {
    margin: 2rem 1rem 2.75rem;
    padding: 1.25rem 1.1rem 1.35rem;
  }
}

/* ── Legal: footer link row + legal-page shell (reuses .imprint typography) ──
   The links are laid out by this flex row; they are NOT individually positioned.
   Absolutely positioning each <a> (as an earlier revision did) stacked them on
   the same coordinates, so "Impressum" and "Datenschutz" sat on top of each
   other — most visibly on mobile, where both were pinned to left: 50%. */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  justify-content: center;
  align-items: baseline;
}

/* Homepage only: pin the row into the hero's bottom corner.
   width: max-content is load-bearing on the mobile branch below. An absolutely
   positioned box with `left: 50%` and no `right` is shrink-to-fit against the space
   left of the container edge — i.e. half the viewport — so at 320px the row was sized
   to 160px and wrapped the two links onto separate lines. max-content sizes it to the
   links instead; translateX(-50%) then centres that true width. */
.legal-links--pinned {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  width: max-content;
  max-width: calc(100% - 3rem);
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .legal-links--pinned {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
    justify-content: center;
  }
}

/* Standalone /impressum/ and /datenschutz/ pages. */
.legal-body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.legal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.legal-home {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.legal-home img {
  width: 2.5rem;
  height: auto;
}

.legal-home-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.legal-main {
  flex: 1 1 auto;
  border-top: none;
}

.legal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  background: #020403;
}

.imprint h2 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1rem;
  color: var(--foreground);
}

.imprint p,
.imprint ul {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.imprint ul {
  padding-left: 1.2rem;
}

/* ── M11: outcome lighting — the page reacts to the demo verdict ─────────────
   REAL_ALARM: police-style red/blue wash. FALSE_ALARM: calm green breathing.
   UNCLEAR: amber pulse. Overlay only (pointer-events none), content stays
   readable; flash rate < 2 Hz (WCAG 2.3.1); reduced-motion gets a static tint. */
.outcome-lights {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}

.outcome-lights::before,
.outcome-lights::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
}

body.outcome-alarm .outcome-lights {
  opacity: 1;
}
body.outcome-alarm .outcome-lights::before {
  background: radial-gradient(ellipse 70% 55% at 12% 18%, rgba(255, 40, 40, 0.5), transparent 65%);
  animation: police-red 1.1s steps(1) infinite;
}
body.outcome-alarm .outcome-lights::after {
  background: radial-gradient(ellipse 70% 55% at 88% 18%, rgba(60, 110, 255, 0.55), transparent 65%);
  animation: police-blue 1.1s steps(1) infinite;
}
@keyframes police-red {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0.12; }
}
@keyframes police-blue {
  0%, 45% { opacity: 0.12; }
  50%, 100% { opacity: 1; }
}

body.outcome-clear .outcome-lights {
  opacity: 1;
}
body.outcome-clear .outcome-lights::before {
  background: radial-gradient(ellipse 90% 70% at 50% 85%, rgba(57, 242, 143, 0.4), transparent 70%);
  animation: breathe 3s ease-in-out infinite;
  opacity: 1;
}
@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

body.outcome-unclear .outcome-lights {
  opacity: 1;
}
body.outcome-unclear .outcome-lights::before {
  background: radial-gradient(ellipse 90% 70% at 50% 15%, rgba(255, 190, 60, 0.38), transparent 70%);
  animation: breathe 2s ease-in-out infinite;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  body.outcome-alarm .outcome-lights::before,
  body.outcome-alarm .outcome-lights::after,
  body.outcome-clear .outcome-lights::before,
  body.outcome-unclear .outcome-lights::before {
    animation: none;
    opacity: 0.45;
  }
}

.demo-caller-note {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--foreground);
  background: rgba(57, 242, 143, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.demo-caller-note strong {
  color: var(--accent);
  letter-spacing: 0.04em;
}

.demo-duress {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
}

.demo-codeword-duress {
  color: #ff9d5c;
}
