/* ═══════════════════════════════════════════════════════════════════════
   SK PIXORA · CINEMATIC LAYER (Unterseiten)

   Dieselbe Bühne wie auf der Startseite, nur als eigene Datei: der Raum
   hinter der Seite, Filmkorn, Randabdunklung, der Pixelzeiger und der
   Vorhang beim Laden. Farbwelt und Schrift bleiben unverändert.

   Eingebunden von: impressum.html · datenschutz.html · brand-identity.html
   Gehört zusammen mit assets/cinematic.js
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --cin-black: #111111;
  --cin-white: #ffffff;
  --cin-ink: #0b0b0a;
  --cin-accent: #d4ed17;
  --cin-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --cin-ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --light: 1;     /* 0 = dunkler Abschnitt, 1 = heller (von JS gesetzt) */
  --vig: 0.2;
}

/* ─── 1 · DER RAUM HINTER DER SEITE ────────────────────────────────────
   Ein Bild in zwei Kopien mit derselben langsamen Kamerafahrt: einmal
   Nacht (Kopfbereich), einmal Tag (Inhalt). Zwischen beiden wird beim
   Scrollen übergeblendet. */
.bg-office {
  position: fixed;
  inset: -14vh -6vw;
  z-index: -2;
  will-change: transform;
}
/* Die Entsättigung steckt in den Bilddateien, nicht in einem CSS-Filter:
   ein Filter auf einer zoomenden, bildschirmfüllenden Ebene müsste bei jedem
   Bild neu gerechnet werden. So bleiben nur Transformation und Deckkraft. */
.bg-shot {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.bg-shot--night { background-image: url('hero-bg-night.jpg'); }
/* Deckkraft schreibt cinematic.js direkt auf dieses Element. Früher hing sie
   an der Variablen --light auf <html>: weil die in jedem Bild neu gesetzt
   wurde, musste der Browser die Stile der ganzen Seite neu bewerten. Der
   Übergang ist ebenfalls fort – er wurde in jedem Bild neu angestoßen. */
.bg-shot--day { opacity: 1; }
/* Nachgeladen – siehe assets/cinematic.js */
body.assets-ready .bg-shot--day { background-image: url('hero-bg-day.jpg'); }
html.js .bg-shot { animation: cinKenBurns 34s ease-in-out infinite alternate; }
@keyframes cinKenBurns {
  from { transform: scale(1.0)  translate3d(0, 0, 0); }
  to   { transform: scale(1.09) translate3d(-1.5%, 1.2%, 0); }
}

.bg-grade {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;   /* Laufender Wert kommt aus cinematic.js */
  background:
    radial-gradient(80% 55% at 12% 18%, rgba(212,237,23,0.10) 0%, rgba(212,237,23,0) 62%),
    radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,0) 38%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(8,8,7,0.72) 0%, rgba(8,8,7,0.12) 26%, rgba(8,8,7,0.05) 55%, rgba(8,8,7,0.62) 100%);
}

/* ─── 2 · FILMKORN UND VIGNETTE ───────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 299;
  pointer-events: none;
  opacity: 0.18;   /* Laufender Wert kommt aus cinematic.js */
  background: radial-gradient(115% 88% at 50% 50%, rgba(0,0,0,0) 42%, rgba(0,0,0,0.55) 100%);
}
.grain {
  position: fixed;
  inset: -160px;
  z-index: 300;
  pointer-events: none;
  /* Ohne Mischebene: die zwingt beim Scrollen alles darunter zur
     Neuberechnung. */
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  animation: cinGrain 0.9s steps(4) infinite;
}
html.calm .grain { animation: none; opacity: 0.09; }
@keyframes cinGrain {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-42px, 26px, 0); }
  50%  { transform: translate3d(28px, -34px, 0); }
  75%  { transform: translate3d(-18px, -20px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ─── 3 · PIXELZEIGER ──────────────────────────────────────────────────
   Ein Quadrat, das weich nachzieht, und ein Pixel, der exakt auf der
   Maus sitzt. Schwarzweiß, ohne Schweif. */
html.fine:not(.calm) body,
html.fine:not(.calm) a,
html.fine:not(.calm) button,
html.fine:not(.calm) label,
html.fine:not(.calm) .opt-card,
html.fine:not(.calm) .chip,
html.fine:not(.calm) .palette-card { cursor: none; }
/* Eingabefelder behalten ihren Textcursor – dort ist er echte Information */
html.fine:not(.calm) input,
html.fine:not(.calm) textarea,
html.fine:not(.calm) select { cursor: auto; }

.cursor, .cursor-dot { display: none; }
html.fine:not(.calm) .cursor,
html.fine:not(.calm) .cursor-dot {
  display: block;
  position: fixed;
  top: 0; left: 0;
  z-index: 950;
  pointer-events: none;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s ease;
}
/* Muss dieselbe Kette wie die Regel darüber tragen, sonst gewinnt dort das
   opacity: 0 und der Zeiger bleibt für immer unsichtbar. */
html.fine:not(.calm) body.pointer-seen .cursor,
html.fine:not(.calm) body.pointer-seen .cursor-dot { opacity: 1; }
/* Ein kleines Quadrat mit dem Pixel darin. Beide tragen eine gegenläufige
   Konturlinie – dadurch bleibt der Zeiger auf hellem wie auf dunklem Grund
   sichtbar. */
.cursor {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 1.5px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.38);
  transition: width 0.28s var(--cin-ease-out), height 0.28s var(--cin-ease-out),
              margin 0.28s var(--cin-ease-out),
              border-color 0.28s ease, box-shadow 0.28s ease, opacity 0.3s ease;
}
.cursor-dot {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.45);
  transition: background 0.28s ease, box-shadow 0.28s ease, opacity 0.3s ease;
}
body.on-light .cursor {
  border-color: rgba(17,17,17,0.9);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65);
}
body.on-light .cursor-dot {
  background: #111111;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7);
}
body.cursor-hot .cursor { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
body.cursor-press .cursor { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }

/* ─── 4 · PIXELVORHANG BEIM LADEN ─────────────────────────────────────── */
.curtain { display: none; }
html.js:not(.calm) .curtain {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--cin-ink);
}
html.js:not(.calm) body:not(.curtain-up) { overflow: hidden; }
.curtain.gone { pointer-events: none; background: transparent; }

.curtain-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 14), 1fr);
  grid-template-rows: repeat(var(--rows, 8), 1fr);
}
.curtain-grid i {
  display: block;
  background: var(--cin-ink);
  transition: transform 0.5s var(--cin-ease-io), opacity 0.5s linear;
}
.curtain.gone .curtain-grid i { transform: scale(0.001); opacity: 0; }

.curtain-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(380px, 66vw);
  transform: translate(-50%, -50%);
  transition: transform 0.7s var(--cin-ease-out), opacity 0.5s ease;
}
.curtain.gone .curtain-stack { transform: translate(-50%, -50%) scale(1.28); opacity: 0; }

.curtain-mark {
  position: relative;
  width: 84%;
  margin: 0 auto;
  aspect-ratio: 1984 / 1701;
}
.curtain-mark b {
  position: absolute;
  display: block;
  background: var(--cin-white);
  opacity: 0;
  transform: translate3d(var(--dx), var(--dy), 0) scale(0.2);
  transition: transform 0.72s var(--cin-ease-out), opacity 0.5s ease;
  transition-delay: var(--d);
}
.curtain.build .curtain-mark b { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }

.curtain-script {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 1.4rem;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
}
.curtain-script path {
  fill: var(--cin-white);
  opacity: 0;
  transform: translateY(0.1em);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: opacity 0.55s ease, transform 0.8s var(--cin-ease-out);
  transition-delay: calc(var(--i) * 90ms + 980ms);
}
.curtain.build .curtain-script path { opacity: 1; transform: none; }

/* ─── 5 · AUFTRITTE BEIM SCROLLEN ─────────────────────────────────────── */
/* Nur Verschiebung und Deckkraft – beides erledigt der Compositor. */
html.js:not(.calm) .reveal {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition: opacity 0.9s var(--cin-ease-out), transform 1.1s var(--cin-ease-out);
}
html.js:not(.calm) .reveal.visible { opacity: 1; transform: none; }

.tw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.twi { display: inline-block; }
html.js:not(.calm) .twi {
  transform: translateY(108%);
  opacity: 0;
  transition: transform 1s var(--cin-ease-out), opacity 0.7s ease;
  transition-delay: calc(var(--wi) * 65ms);
}
html.js:not(.calm) .visible .twi,
html.js:not(.calm) .tw-run .twi { transform: none; opacity: 1; }

/* ─── 6 · RÜCKSICHT AUF EINSTELLUNGEN ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .curtain { display: none !important; }
  .cursor, .cursor-dot { display: none !important; }
  .grain { animation: none !important; }
  .bg-shot { animation: none !important; }
  body { overflow: visible !important; }
}
@media (max-width: 600px) {
  .grain { opacity: 0.18; }
  .curtain-stack { width: 62vw; }
}
