/* ============================================================
   legal.css — shared styles for /impressum and /datenschutz
   Extends the "cream world" + transmission-terminal aesthetic
   from Seidenbyte Matrix.html (thank-you panel).
   ============================================================ */

:root {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cream: #f5f3ee;
  --ink: #111;
  --ink-soft: #4a4a4a;
  --ink-faint: #888;
  --rule: #e3dfd5;
  --red: #c8121f;

  --term-bg: #0b0b0b;
  --term-bar: #1f1f1f;
  --term-text: #c8ffd8;
  --term-dim: #6a8a78;
  --term-green: #00ff66;
  --term-glow: 0 0 6px rgba(0, 255, 102, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden; /* page itself does not scroll — scroll is inside the window */
}

/* ---------- White flash used by entry + exit transitions ---------- */
.white-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  z-index: 80;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.white-flash.active { opacity: 1; }
.white-flash.entry  { opacity: 1; } /* on first paint, then fades out */

/* ---------- Page chrome ---------- */
.legal-page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.legal-page.revealed { opacity: 1; }

/* zurück link — pinned top-right exactly like .contact-back */
.legal-back {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 70;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #555;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.legal-back:hover { color: var(--red); }

/* HUD-style locator in top-left, mirrors the matrix HUD vibe */
.legal-hud {
  position: fixed;
  top: 28px;
  left: 32px;
  z-index: 70;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.6;
}
.legal-hud .hud-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(200, 18, 31, 0.15);
}

/* Inner column: title block on top, terminal fills remaining height,
   footer pinned to the bottom. Whole column is flex-column so the
   terminal grows and its body scrolls internally. */
.legal-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  /* top padding must always clear the fixed HUD (28px top + ~40px tall)
     even on short viewports, so use a px floor in addition to vh */
  padding: max(96px, 9vh) 6vw 4vh;
  min-height: 0; /* critical: lets the terminal child shrink + scroll */
}

.legal-kicker {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.legal-kicker .k-dot {
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(200, 18, 31, 0.15);
}

.legal-title {
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.legal-title .accent { color: var(--red); }

.legal-lede {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 26px;
  max-width: 620px;
}

/* ---------- The transmission window (BIG) ---------- */
.tx-log {
  background: var(--term-bg);
  color: var(--term-text);
  border: 1px solid #1a1a1a;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22),
              0 2px 0 rgba(0, 0, 0, 0.05);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;

  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tx-log-bar {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--term-bar);
  padding: 12px 18px;
  font-size: 10px;
  color: var(--term-dim);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.tx-log-bar .dots { display: flex; gap: 6px; }
.tx-log-bar .dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid #2a3a30;
}
.tx-log-bar .dots span:first-child {
  background: var(--term-green);
  border-color: var(--term-green);
  box-shadow: 0 0 8px var(--term-green);
}
.tx-log-bar .bar-mid {
  flex: 1;
  text-align: center;
  color: #8aa897;
  letter-spacing: 0.18em;
}
.tx-log-bar .bar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tx-log-bar .bar-right .live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--term-green);
  box-shadow: 0 0 6px var(--term-green);
  animation: txPulse 1.4s ease-in-out infinite;
}
@keyframes txPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1;   }
}

/* The scrolling region */
.tx-log-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 36px 36px;
  scrollbar-width: thin;
  scrollbar-color: #2a4a36 transparent;
  position: relative;

  /* faint scanline overlay so the terminal feels CRT-ish, like the
     scanlines layer on the matrix page */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(0, 255, 102, 0.025) 3px
    );
}
.tx-log-body::-webkit-scrollbar { width: 10px; }
.tx-log-body::-webkit-scrollbar-track { background: #0b0b0b; }
.tx-log-body::-webkit-scrollbar-thumb {
  background: #1f3a2a;
  border: 2px solid #0b0b0b;
  border-radius: 5px;
}
.tx-log-body::-webkit-scrollbar-thumb:hover { background: #2a5a3e; }

/* faint fade at top + bottom of scroll area to suggest more content */
.tx-log-body::before,
.tx-log-body::after {
  content: "";
  position: sticky;
  left: 0; right: 0;
  height: 26px;
  display: block;
  pointer-events: none;
  z-index: 2;
}
.tx-log-body::before {
  top: 0;
  margin-bottom: -26px;
  background: linear-gradient(to bottom, #0b0b0b, rgba(11,11,11,0));
}
.tx-log-body::after {
  bottom: 0;
  margin-top: -26px;
  background: linear-gradient(to top, #0b0b0b, rgba(11,11,11,0));
}

/* ---------- Typography inside the terminal ---------- */
.tx-prompt  { color: var(--term-green); }
.tx-label   { color: var(--term-dim); }
.tx-val     { color: #e6ffe6; text-shadow: var(--term-glow); }
.tx-ok      { color: var(--term-green); }
.tx-mute    { color: #5a7a68; }
.tx-red     { color: #ff6470; }

.tx-section {
  margin: 0 0 38px;
  scroll-margin-top: 8px;
}
.tx-section:last-child { margin-bottom: 0; }

.tx-section h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--term-green);
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.tx-section h2 .num {
  color: var(--term-dim);
  font-weight: 500;
}
.tx-section h2 .glyph { color: var(--term-dim); }

.tx-rule {
  border: none;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    #1f3a2a 0,
    #1f3a2a 6px,
    transparent 6px,
    transparent 12px
  );
  margin: 0 0 18px;
}

.tx-section p,
.tx-section li {
  color: #c8ffd8;
  margin: 0 0 10px;
}
.tx-section p:last-child,
.tx-section li:last-child { margin-bottom: 0; }

.tx-section strong { color: #e6ffe6; font-weight: 500; }
.tx-section a {
  color: var(--term-green);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 255, 102, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tx-section a:hover {
  color: #aaffc0;
  border-bottom-color: rgba(0, 255, 102, 0.8);
}

.tx-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.tx-section ul li {
  padding-left: 22px;
  position: relative;
}
.tx-section ul li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--term-green);
  opacity: 0.7;
}

.tx-kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4px 18px;
  margin: 0 0 12px;
}
.tx-kv dt {
  color: var(--term-dim);
  font-size: 12px;
}
.tx-kv dd {
  margin: 0;
  color: #e6ffe6;
  text-shadow: var(--term-glow);
}

.tx-callout {
  border-left: 2px solid var(--term-green);
  padding: 10px 0 10px 14px;
  margin: 0 0 14px;
  color: #c8ffd8;
  background: linear-gradient(to right, rgba(0, 255, 102, 0.04), transparent 70%);
}

/* End-of-file marker at the bottom of the scroll */
.tx-eof {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed #1f3a2a;
  color: var(--term-dim);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

/* ---------- Footer row (under the window) ---------- */
.legal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 22px;
  margin-top: 0;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.legal-footer .meta-left  { display: flex; gap: 22px; }
.legal-footer .meta-left span { color: var(--ink-faint); }

.pill-back {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.pill-back .mini-pill {
  width: 56px; height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9ebcff 0%, #4a73ff 32%, #1a3bc0 68%, #060e54 100%);
  box-shadow: 0 6px 18px rgba(40, 80, 255, 0.45), 0 0 0 1px rgba(130, 165, 255, 0.55);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pill-back .mini-pill::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%; top: 3px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 100%);
}
.pill-back:hover .mini-pill {
  transform: translateY(-2px);
  box-shadow: 0 9px 24px rgba(40, 80, 255, 0.65);
}
.pill-back:hover { color: #1a3bc0; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .legal-inner { padding: 11vh 5vw 3vh; }
  .tx-log-body { padding: 22px 20px 28px; }
  .tx-kv { grid-template-columns: 1fr; gap: 0; }
  .tx-kv dt { margin-top: 6px; }
  .legal-hud { display: none; }
  .legal-footer { flex-direction: column; align-items: flex-start; }
  .tx-log-bar .bar-mid { display: none; }
}
