/* Project Nika — die Vorderwand (Muster B „Inschrift", Joel 29.10.2026).
 *
 * Eine private Seite, kein Produkt: kein Menü, kein Knopf, kein Kontakt. Die
 * Seite geht beim Scrollen durch eine Nacht — jede Station eine Uhrzeit, ein
 * Satz, höchstens eine leise Zeile. Dazwischen vier Blicke in die App,
 * abgedunkelt, mit erfundenen Daten.
 *
 * Palette aus der App (app/artifacts/mobile/constants/colors.ts). Kein
 * Tailwind, keine Bibliothek, kein Bau-Schritt. Schriften liegen lokal in
 * fonts/ — die Seite lädt von keinem fremden Host.
 *
 * Ebenen:
 *   .bgfx      (fixed, z 0)  → Linienfeld + drei Verdunklungen (bg-flow.js)
 *   main       (z 1)         → alles Lesbare
 *   .gem-float (fixed, z 4)  → der Stein, der mitläuft (mark-gem.js)
 *   .corner    (fixed, z 5)  → „Sign in"
 */

/* ── Schriften ───────────────────────────────────────────────────────────── */
/* Variable Schnitte, auf Latin beschränkt (Inter 48 KB, JetBrains Mono 31 KB).
   Lizenz je Datei daneben: fonts/OFL-*.txt, beide SIL OFL 1.1. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrainsmono-latin-var.woff2") format("woff2");
}

:root {
  --bg: #0d0f11;
  --fg: #eaeae4;
  /* Großer Text darf gedämpft sein (3:1 reicht), kleiner nicht: `--fg-faint`
     trägt 11–13 px und misst 4,6:1 gegen den Grund (Runde 13). */
  --fg-dim: rgba(234, 234, 228, 0.5);
  --fg-muted: #9aa1a9;
  --fg-faint: rgba(234, 234, 228, 0.56);
  --accent: #7fcde6;
  --line-strong: rgba(255, 255, 255, 0.16);

  --t-h1: clamp(34px, 5vw, 64px);
  --t-h2: clamp(29px, 3.1vw, 44px);
  --t-later: clamp(20px, 2vw, 24px);
  --t-body: 15px;
  --t-small: 13px;
  --t-mark: 11px;
  --track-caps: 0.16em;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Ein dunkler Hof direkt an den Buchstaben. Das Linienfeld schiebt helle
     Bänder durch den Text; an diesen Stellen fiel der Kontrast unter 3:1
     (gemessen, Idee 7). Der Hof repariert genau die Fläche, auf die es
     ankommt, statt den ganzen Grund abzudunkeln. */
  --shade: 0 0 12px rgba(13, 15, 17, 0.95), 0 0 30px rgba(13, 15, 17, 0.85);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
p,
figure {
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  background: #1b1e22;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
}

/* ── Hintergrund: Linienfeld ─────────────────────────────────────────────── */
/* Textur statt Objekten. Oben und unten je 140 px Verlauf zur Grundfarbe,
   seitlich eine Abdunklung — wer den Effekt sofort bemerkt, sieht ihn zu
   stark. Fällt das Canvas aus, bleibt eine statische Textur derselben Machart. */

.bgfx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-image: repeating-linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.035) 0px,
      rgba(255, 255, 255, 0) 2px,
      rgba(255, 255, 255, 0) 26px
    ),
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(127, 205, 230, 0.05), transparent 70%);
}

/* Läuft das Canvas, hat der Rückfall nichts zu suchen (Joel 5.8.: „Querstreifen
   durch alle durch"). */
.bgfx:has(canvas) {
  background-image: none;
}

.bgfx canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.bgfx-top,
.bgfx-bottom,
.bgfx-vignette {
  position: absolute;
  pointer-events: none;
}

.bgfx-top {
  left: 0;
  right: 0;
  top: 0;
  height: 140px;
  background: linear-gradient(to bottom, var(--bg), rgba(13, 15, 17, 0));
}

.bgfx-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background: linear-gradient(to top, var(--bg), rgba(13, 15, 17, 0));
}

.bgfx-vignette {
  inset: 0;
  background: linear-gradient(
      to right,
      var(--bg) 0%,
      rgba(13, 15, 17, 0) 24%,
      rgba(13, 15, 17, 0) 88%,
      var(--bg) 100%
    ),
    radial-gradient(ellipse 120% 70% at 50% 50%, rgba(13, 15, 17, 0) 55%, var(--bg) 100%);
}

main {
  position: relative;
  z-index: 1;
}

/* ── Sign in ─────────────────────────────────────────────────────────────── */
/* Der einzige Weg in die App: klein, oben rechts, und noch einmal ganz unten.
   Die Trefferfläche ist 44 px hoch, auch wenn die Schrift 13 px ist. */

.corner,
.end a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  font-size: var(--t-small);
  color: var(--fg-faint);
  text-decoration: none;
  transition: color 200ms ease;
}

.corner {
  position: fixed;
  z-index: 5;
  top: max(14px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
}

.corner:hover,
.end a:hover {
  color: var(--fg);
}

.corner:focus-visible,
.end a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  position: relative;
  text-shadow: var(--shade);
}

/* Der Platz des Steins. Der Stein selbst liegt in .gem-float und startet
   genau über diesem Platz; ohne Skript bleibt eine leere Fläche derselben
   Größe stehen statt eines Sprungs. */
.gem-slot {
  width: 132px;
  height: 132px;
  margin-bottom: 40px;
}

.name {
  font-family: var(--mono);
  font-size: var(--t-mark);
  letter-spacing: 0.42em;
  /* Die Laufweite hängt rechts Luft an — links dieselbe, sonst steht der
     Name sichtbar neben der Mitte. */
  padding-left: 0.42em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: var(--t-h1);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero h1 em {
  font-style: normal;
  color: var(--fg-dim);
}

.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  width: 1px;
  height: 48px;
  background: linear-gradient(var(--line-strong), transparent);
}

/* ── Stationen der Nacht ─────────────────────────────────────────────────── */

.st {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  text-shadow: var(--shade);
}

.st time {
  font-family: var(--mono);
  font-size: var(--t-mark);
  letter-spacing: var(--track-caps);
  font-variant-numeric: tabular-nums;
  color: var(--fg-faint);
  margin-bottom: 22px;
}

.st h2 {
  max-width: 22ch;
  font-size: var(--t-h2);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--fg-dim);
  text-wrap: balance;
}

.st h2 b {
  font-weight: 500;
  color: var(--fg);
}

.st p {
  max-width: 40ch;
  margin-top: 22px;
  color: var(--fg-muted);
  text-wrap: balance;
}

/* ── Blick in die App ────────────────────────────────────────────────────── */
/* Echte Aufnahmen der App mit erfundenen Daten (docs/landing/app_shots/), an
   den Rändern in die Nacht verlaufen. Am Telefon die Telefon-Aufnahme — der
   Laptop-Screen wäre auf 390 px Brei. */

.glimpse {
  padding: 6vh 24px 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.glimpse picture {
  display: block;
  width: min(860px, 100%);
}

.glimpse img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  opacity: 0.8;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, #000 30%, transparent 100%);
}

@media (max-width: 760px) {
  .glimpse picture {
    width: min(320px, 82vw);
  }
  .glimpse img {
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 35%, transparent 100%);
  }
}

.glimpse figcaption,
.end p {
  font-family: var(--mono);
  font-size: var(--t-mark);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg-faint);
}

.glimpse figcaption {
  margin-top: 6px;
}

/* ── Der ganze Weg: drei Punkte auf einer Linie ──────────────────────────── */

.route {
  display: flex;
  align-items: center;
  margin-top: 34px;
  font-family: var(--mono);
  font-size: var(--t-mark);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.route span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.route span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(127, 205, 230, 0.6);
}

.route i {
  width: clamp(40px, 9vw, 96px);
  height: 1px;
  margin: 0 12px;
  background: var(--line-strong);
  transform: translateY(-11px);
}

/* ── Morgen ──────────────────────────────────────────────────────────────── */
/* Am Ende hellt der Grund ganz leicht auf, und der Stein kehrt in die Mitte
   zurück — auf seinen zweiten Platz über „07:00". */

.dawn {
  padding-top: 18vh;
  justify-content: flex-start;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(127, 205, 230, 0.1), transparent 70%);
}

/* `margin: auto` ist Pflicht: der Platz steckt in einem Block, nicht direkt in
   der Flex-Spalte — ohne stand er links an der Satzkante, und der Stein
   landete bei 07:00 neben der Mitte statt darin (Joel, 30.10.). */
.dawn .gem-slot {
  width: 88px;
  height: 88px;
  margin: 0 auto 32px;
}

.dawn time {
  color: var(--accent);
}

.later {
  max-width: 26ch;
  margin: 16vh auto 0;
  font-size: var(--t-later);
  line-height: 1.4;
  color: var(--fg-muted);
  text-wrap: balance;
}

.later em {
  display: block;
  margin-top: 10px;
  font-style: normal;
  color: var(--fg-dim);
}

.end {
  padding: 14vh 0 max(40px, env(safe-area-inset-bottom));
}

.end p {
  margin-bottom: 14px;
}

/* ── Der Stein, der mitläuft ─────────────────────────────────────────────── */
/* mark-gem.js setzt Lage, Größe und Schein in jedem Bild. Ohne Skript gibt es
   kein .gem-float — dann stehen nur die leeren Plätze da. */

.gem-float {
  position: fixed;
  z-index: 4;
  left: 0;
  top: 0;
  width: 132px;
  height: 132px;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform, filter;
}

.gem-float svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ── Bewegung aus ────────────────────────────────────────────────────────── */
/* bg-flow.js baut dann gar kein Canvas, main.js blendet nichts ein, der Stein
   bleibt im Hero und dreht nicht. */

@media (prefers-reduced-motion: reduce) {
  .corner,
  .end a {
    transition: none;
  }
}
