/* ── paper.css — the promos' page ground (hub + investor page) ─────────────
 *
 * "Planpapier & Beton": the same world as the films and
 * www.baulynq.com (assets/css/v3.css) — paper ground, dashed column guides,
 * Plus Jakarta Sans + Geist Mono, hairlines, soft warm-neutral shadows.
 *
 * Values are the brand tokens (brand/tokens/baulynq-tokens.json → semantic,
 * elevation, motion). Light is the default; [data-theme="dark"] flips it.
 *
 * Colour discipline (brand/README.md, LOGO-RULES.md v3.1):
 *   - red only where it means something and stays inside its frame: the live
 *     card's poster rail (paper.js marks ONE card .is-live — hovered, focused,
 *     or on touch the one mid-screen; the rail stays ink while the footer is on
 *     screen) and the flag rule's red band. At most one red element in view.
 *     There is no page-spanning line.
 *   - gold (#F6C500) ONLY in .flag-rule.
 *   - focus rings use the brand focus blue, not red.
 *
 * Fonts are the APP's root files (/fonts/*, frontend/public/fonts) — the same
 * single-file variable faces www.baulynq.com self-hosts. CSP font-src 'self'.
 * Served from app.baulynq.com/promos/ (this file sits next to the hub; the
 * investor page links ../paper.css).
 */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #F7F7F5;           /* beton.50 — the paper */
  --bg-2: #EFEFEC;
  --surface: #FFFFFF;
  --surface-2: #F4F4F1;
  --ink: #16181A;
  --ink-2: #53575B;
  --ink-3: #6B7075;        /* 4.66:1 on paper — the dim headline clause */
  --line: #E2E3E0;
  --line-2: #C5C9CD;
  --guide: rgba(90, 94, 98, 0.30);
  --grid: rgba(22, 24, 26, 0.035);
  --grid-major: rgba(22, 24, 26, 0.055);
  --red: #8E2222;       /* rot.700 — the red (live rail, flag band) */
  --gold-flag: #F6C500;    /* reserved: .flag-rule only */
  --focus: #286CBE;
  --tracing: rgba(255, 255, 255, 0.55);
  --light: rgba(255, 255, 255, 0.85);
  --e1: 0 1px 2px rgba(20, 22, 24, 0.06);
  --e2: 0 1px 2px rgba(20, 22, 24, 0.05), 0 6px 18px -8px rgba(20, 22, 24, 0.18);
  --e3: 0 1px 2px rgba(20, 22, 24, 0.05), 0 12px 28px -14px rgba(20, 22, 24, 0.22), 0 30px 70px -28px rgba(20, 22, 24, 0.35);
  --grain-op: 0.045;
  --grain-blend: multiply;

  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);      /* brand motion.ease  ≈ EASE.enter */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);   /* brand motion.ease-io = EASE.camera */
  --maxw: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 18px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080A;
  --bg-2: #0B0D10;
  --surface: #121418;
  --surface-2: #16191D;
  --ink: #F2F4F6;
  --ink-2: #9AA0A6;
  --ink-3: #7F8388;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --guide: rgba(148, 152, 157, 0.28);
  --grid: rgba(255, 255, 255, 0.025);
  --grid-major: rgba(255, 255, 255, 0.04);
  --red: #D8574D;       /* rot.500 on dark */
  --focus: #5FA4FC;
  --tracing: rgba(242, 244, 246, 0.05);
  --light: rgba(120, 140, 170, 0.10);
  --e1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --e2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -10px rgba(0, 0, 0, 0.7);
  --e3: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px -14px rgba(0, 0, 0, 0.6), 0 34px 80px -30px rgba(0, 0, 0, 0.85);
  --grain-op: 0.06;
  --grain-blend: overlay;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: rgba(142, 34, 34, 0.18); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* Language: both languages ship in the markup; <html lang> picks. */
html[lang="de"] [data-l="en"], html:not([lang="de"]) [data-l="de"] { display: none !important; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px;
  font: 600 14px/1 var(--sans); text-decoration: none;
}
.skip:focus { left: 12px; }

/* the page frame: 12px margins, widened by the notch / rounded corners in
   landscape (iOS reports equal left/right insets, so it stays centred) */
:root { --frame: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
.wrap {
  width: min(var(--maxw), var(--frame));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ── The ground: paper, plan grid (parallax), key light, fibre ──────────── */
.ground { /* spans the whole document; the grid inside scrolls a little slower (depth) */
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.ground .grid {
  position: absolute; left: 0; right: 0; top: -96px; bottom: -96px;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: center top;
  /* the page camera: paper.js moves it at a fraction of the scroll */
  transform: translate3d(0, var(--grid-y, 0px), 0);
  -webkit-mask-image: linear-gradient(#000, rgba(0, 0, 0, 0.55) 1400px, rgba(0, 0, 0, 0.35));
  mask-image: linear-gradient(#000, rgba(0, 0, 0, 0.55) 1400px, rgba(0, 0, 0, 0.35));
}
.ground .key {
  /* cool daylight key from the top-left */
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 900px at 12% -8%, var(--light), transparent 70%),
    radial-gradient(90% 70% at 100% 110%, rgba(22, 24, 26, 0.035), transparent 70%);
}
.ground .fibre {
  position: absolute; inset: 0; opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 1.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* dashed column guides — the site's signature (the page's frame) */
.guides {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  width: min(var(--maxw), var(--frame)); margin-inline: auto;
  border-inline: 1px dashed var(--guide);
}
.page { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; }

/* ── Header: mark far left, controls far right (LOGO-RULES: no lockup) ──── */
.top {
  display: flex; align-items: center; gap: 12px;
  padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: 18px;
}
.mark-link { display: inline-flex; justify-content: center; min-width: 44px; color: var(--ink); text-decoration: none; padding: 9px; margin: -9px; border-radius: 10px; } /* 44px tap target */
.mark { height: 26px; width: calc(26px * 0.8665); display: block; }
.controls { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.seg button {
  font: 500 11.5px/1 var(--mono); letter-spacing: 0.08em; color: var(--ink-3);
  height: 28px; min-width: 38px; padding: 0 10px; border-radius: 999px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
@media (hover: hover) { .seg button:hover { color: var(--ink); } }
.seg button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--e2); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  border: 1px solid var(--line-2); color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: color 0.2s var(--ease), transform 0.3s var(--ease);
}
@media (hover: hover) { .icon-btn:hover { color: var(--ink); transform: rotate(-12deg); } }
.icon-btn svg { width: 16px; height: 16px; }
.back {
  font: 500 12.5px/1 var(--mono); letter-spacing: 0.02em; color: var(--ink-2); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 2px;
}
@media (hover: hover) { .back:hover { color: var(--ink); } }

/* touch: every control is at least 44 × 44 */
@media (pointer: coarse), (max-width: 560px) {
  .controls { gap: 8px; }
  .seg { padding: 2px; }
  .seg button { height: 44px; min-width: 46px; font-size: 12.5px; }
  .icon-btn { width: 50px; height: 50px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .back { min-height: 44px; padding: 0 2px; }
}

/* ── Type ───────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font: 500 12px/1.2 var(--mono); letter-spacing: 0.04em; color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); display: block; }

/* The site's headline: words start at ink-3 and light up in turn; the final
   clause (.dim) keeps the grey — "Ein Bauprojekt. Ein Datensatz." */
.display {
  font: 800 clamp(40px, 6.6vw, 88px)/0.98 var(--sans);
  letter-spacing: -0.045em; margin: 0; text-wrap: balance;
}
.display .ln { display: block; }
.display .w { color: var(--ink-3); transition: color 0.7s var(--ease) calc(var(--i, 0) * 0.14s + 0.15s); }
.display.is-in .w { color: var(--ink); }
.display.is-in .w.dim { color: var(--ink-3); }
.display.is-done .w { transition: none; }
.lede { margin: 0; color: var(--ink-2); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; max-width: 58ch; }

/* ── Rise-in (pages) ────────────────────────────────────────────────────── */
.rise { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.08s + 0.1s); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }

/* ── Paper sheet (poster props, documents) ──────────────────────────────── */
.sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--e2);
}
.bars { display: grid; gap: 5px; }
.bars span { display: block; height: 4px; border-radius: 2px; background: var(--line-2); }
.bars span:nth-child(2) { width: 82%; }
.bars span:nth-child(3) { width: 64%; }

/* ── Document stack (investor poster + investor hero) ───────────────────── */
.stack { position: absolute; inset: 0; }
.stack .doc {
  position: absolute; width: 30%; aspect-ratio: 0.72; padding: 9% 3% 3%;
  display: flex; flex-direction: column; gap: 7%;
}
.stack .doc b { font: 600 clamp(8px, 0.75vw, 10px)/1 var(--mono); letter-spacing: 0.1em; color: var(--ink-2); }
.stack .doc .fig { flex: 1; border-top: 1px solid var(--line); display: flex; align-items: flex-end; gap: 8%; padding-top: 8%; }
.stack .doc .fig span { flex: 1; background: var(--line-2); border-radius: 1px; }
.stack .d1 { left: 16%; top: 16%; transform: rotate(-6deg); }
.stack .d2 { left: 35%; top: 11%; transform: rotate(1.5deg); z-index: 1; }
.stack .d3 { left: 54%; top: 15%; transform: rotate(7deg); }
.stack .slide { flex: 1; border: 1px solid var(--line-2); border-radius: 3px; position: relative; }
.stack .slide::after { content: ""; position: absolute; left: 12%; right: 30%; top: 22%; height: 3px; border-radius: 2px; background: var(--ink-3); opacity: .6; }

/* ── Footer: flag rule (ink · red · gold) + the name ─────────────────────── */
.foot { border-top: 1px dashed var(--guide); margin-top: auto; }
.foot .wrap {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-top: 28px; padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}
.flag-rule { display: flex; width: 72px; height: 3px; flex: none; }
.flag-rule span { flex: 1; }
.flag-rule span:nth-child(1) { background: var(--ink); }
.flag-rule span:nth-child(2) { background: var(--red); }
.flag-rule span:nth-child(3) { background: var(--gold-flag); }
.foot small { font: 500 12px/1.4 var(--mono); letter-spacing: 0.04em; color: var(--ink-3); }
.foot .name { margin-left: auto; font: 700 15px/1 var(--sans); letter-spacing: -0.012em; color: var(--ink); }

@media (max-width: 560px) {
  .foot .wrap { gap: 12px 18px; }
  .foot .name { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .ground .grid { transform: none; }
}
