/* =========================================================
   fabian-jobst.de – Startseite

   Fünf Bühnen, alles am Scrollen aufgehängt (Sprache und Werkzeug
   von /welten/): Jede Bühne klebt (position: sticky) in einem langen
   Abschnitt, der Fortschritt darin (0 … 1) steuert Titel, Kamera und
   Text. Die Namen sind Fenster: Schleier in Tinte, Schrift in Weiß,
   multipliziert – das Bild scheint nur durch die Buchstaben.

   Nur für index.html. /usa/ und /sim/ nutzen weiter site.css.
   Schriften: Big Shoulders Display, Literata, Schibsted Grotesk (SIL OFL,
   Lizenzen in assets/fonts/LICENSES-display.txt).
   ========================================================= */

@font-face {
  font-family: "Shoulders";
  src: url("/assets/fonts/big-shoulders.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata-opsz.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted";
  src: url("/assets/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #0a0b1c;            /* Nachtblau, auch Farbe des Schleiers */
  --ink-2: #12142c;
  --paper: #f6ece0;
  --paper-dim: rgb(246 236 224 / .7);
  --line: rgb(246 236 224 / .16);
  --rose: #ff6f9f;
  --orange: #ff9a4a;
  --amber: #ffc861;
  --heat: linear-gradient(96deg, #ffd9b0 0%, var(--amber) 22%, var(--orange) 55%, var(--rose) 100%);
  --display: "Shoulders", "Arial Narrow", sans-serif;
  --read: "Literata", Georgia, serif;
  --ui: "Schibsted", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --gut: clamp(16px, 6vw, 96px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgb(255 111 159 / .45); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 6px; }

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- Leiste */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) var(--gut) 16px;
  pointer-events: none;
}
.bar a { pointer-events: auto; text-decoration: none; }
.mark {
  font: 800 22px/1 var(--display);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.bar-now {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(10 11 28 / .45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--paper-dim);
  font: 600 13px/1 var(--ui);
  opacity: 0;
  transition: opacity .4s ease;
}
.bar-now.on { opacity: 1; }

/* ---------------------------------------------------------------- Bühnen */
section { position: relative; height: var(--len, 300vh); }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(var(--boost, 1));
}

/* Ausblende zur nächsten Bühne. */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: var(--ink);
  opacity: var(--out, 0);
  pointer-events: none;
}

/* Der Name als Fenster: der Schleier ist Tinte, die Schrift weiß –
   multipliziert bleibt nur dort Bild, wo Buchstaben sind. */
.veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--ink);
  mix-blend-mode: multiply;
  opacity: var(--veil, 1);
  pointer-events: none;
}
.knock {
  margin: 0;
  color: #fff;
  font: 900 20vw/.8 var(--display);
  text-transform: uppercase;
  letter-spacing: -.012em;
  white-space: nowrap;
  text-align: center;
  position: relative;
  transform: scale(var(--zoom, 1));
}
.knock .l { display: inline; }
.knock.two { line-height: .87; }
.knock.two .l { display: block; }
.knock .bl { display: inline-block; width: 0; height: 0; }

.shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(90deg, rgb(10 11 28 / .86) 0%, rgb(10 11 28 / .5) 40%, transparent 68%),
    linear-gradient(0deg, rgb(10 11 28 / .75) 0%, transparent 48%);
  opacity: var(--shade, 0);
  pointer-events: none;
}

/* ---------------------------------------------------------------- Erzählblock */
.story {
  position: absolute;
  z-index: 4;
  left: var(--gut);
  bottom: clamp(40px, 10vh, 112px);
  width: min(38rem, calc(100% - 2 * var(--gut)));
}
.js .story {
  opacity: var(--story, 0);
  transform: translateY(calc((1 - var(--story, 0)) * 28px));
  pointer-events: none;
}
.js .story.shown { pointer-events: auto; }
.kicker {
  margin: 0 0 6px;
  color: var(--paper-dim);
  font: 600 clamp(14px, 1.15vw, 16px)/1.3 var(--ui);
}
.title {
  margin: 0 0 18px;
  padding-bottom: .04em;
  font: 900 clamp(68px, 9.6vw, 168px)/.84 var(--display);
  text-transform: uppercase;
  letter-spacing: -.005em;
  background: linear-gradient(96deg, #ffe2c2 0%, var(--a, var(--amber)) 35%, var(--b, var(--rose)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.excerpt {
  max-width: 32rem;
  margin: 0;
  font: 400 clamp(19px, 1.75vw, 24px)/1.5 var(--read);
  text-wrap: pretty;
}
.js [data-words] .w { opacity: .16; transition: opacity .25s linear; }
.js [data-words] .w.on { opacity: 1; }

.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}
.js .acts { opacity: var(--acts, 0); }
.go, .film-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: 800 20px/1 var(--display);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), background-color .2s ease, border-color .2s ease;
}
.go {
  background: var(--heat);
  color: #1a0d14;
}
.film-btn {
  border: 1px solid rgb(246 236 224 / .38);
  background: rgb(10 11 28 / .35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.film-btn svg { width: 16px; height: 16px; fill: currentColor; }
.go:hover, .film-btn:hover { transform: scale(1.04); }
.film-btn:hover { border-color: var(--paper); }
.tag {
  padding: 4px 0 4px 4px;
  color: var(--paper-dim);
  font: 600 14px/1 var(--ui);
}
.tag::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: 1px;
}

/* ---------------------------------------------------------------- Auftakt */
.hero .veil { z-index: 2; }
.hero-where {
  position: absolute;
  z-index: 3;
  inset: auto var(--gut) clamp(24px, 5vh, 44px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: var(--paper-dim);
  font: 600 13px/1.3 var(--ui);
  opacity: var(--where, 1);
}
.hero-line {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: center;
  padding: 0 var(--gut);
  pointer-events: none;
}
.js .hero-line { opacity: var(--lede, 0); }
.lede {
  max-width: 11ch;
  margin: 0;
  font: 900 clamp(64px, 10.5vw, 190px)/.84 var(--display);
  text-transform: uppercase;
  letter-spacing: -.005em;
  text-shadow: 0 6px 60px rgb(10 11 28 / .35);
}
/* Ein Verlauf über den ganzen Schirm: jedes Wort nimmt die Farbe seiner Stelle. */
.lede .w {
  background: linear-gradient(100deg, #ffe0bd 8%, var(--amber) 30%, var(--orange) 52%, var(--rose) 78%) fixed;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 26px;
  width: 1px;
  height: 56px;
  overflow: hidden;
  background: var(--line);
  opacity: var(--cue, 1);
}
.cue i {
  position: absolute;
  inset: 0;
  background: var(--paper);
  animation: cue 2.4s cubic-bezier(.6, 0, .2, 1) infinite;
}
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* Ohne WebGL bleibt ein Abendhimmel aus CSS. */
.hero .stage {
  background:
    radial-gradient(40% 30% at 62% 56%, rgb(255 190 110 / .9), transparent 70%),
    linear-gradient(180deg, #14163a 0%, #5a2350 38%, #ff7a5a 58%, #2a1d3e 60%, #0c0f26 100%);
}
.world .stage { background: var(--ink); }
/* Ohne WebGL: das Foto flach statt räumlich. */
.no-gl .scene { display: none; }
.world.no-gl .stage { background: var(--ink) url("/welten/assets/port-royal/szene.jpg") 74% 50% / cover no-repeat; }

/* ---------------------------------------------------------------- Fenster */
.window .stage { background: var(--ink); }
.pane {
  position: absolute;
  z-index: 1;
  left: var(--pl, 0px);
  top: var(--pt, 0px);
  width: var(--pw, 100%);
  height: var(--ph, 100%);
  overflow: hidden;
  border-radius: var(--pr, 0px);
  background: #0d1430 url("/assets/brag/fenster-szene.jpg") 18% 50% / cover;
  box-shadow: 0 50px 120px rgb(0 0 0 / calc(var(--win, 0) * .55));
}
.pane-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Die Kreideküste steht links im Bild: dort festhalten, auch hochkant. */
  object-position: 18% 50%;
  filter: brightness(var(--boost, 1));
}
/* Die beschlagene Scheibe, die beim Scrollen freigewischt wird. */
.fog {
  position: absolute;
  inset: -2px;
  background: rgb(200 214 235 / .12);
  -webkit-backdrop-filter: blur(16px) saturate(.8) brightness(1.15);
  backdrop-filter: blur(16px) saturate(.8) brightness(1.15);
  opacity: var(--fog, 0);
  -webkit-mask-image: linear-gradient(105deg, transparent calc(var(--wipe, 0) * 130% - 30%), #000 calc(var(--wipe, 0) * 130%));
  mask-image: linear-gradient(105deg, transparent calc(var(--wipe, 0) * 130% - 30%), #000 calc(var(--wipe, 0) * 130%));
}
/* Ein Hauch Rahmen und Spiegelung auf dem Glas. */
.pane::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(246 236 224 / .16);
  background: linear-gradient(125deg, rgb(255 255 255 / .07) 0%, transparent 32%);
  opacity: var(--win, 0);
  pointer-events: none;
}
.window .story {
  top: 50%;
  bottom: auto;
  width: min(32rem, 40vw);
  transform: translateY(calc(-50% + (1 - var(--story, 0)) * 28px));
}

/* ---------------------------------------------------------------- Radar */
.radar .stage {
  background:
    radial-gradient(60% 70% at 75% 50%, rgb(40 90 90 / .22), transparent 70%),
    var(--ink);
}
.radar-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(45% 55% at 74% 50%, rgb(125 255 196 / .07), transparent 70%);
}
.scope-wrap {
  position: absolute;
  z-index: 1;
  right: 5vw;
  top: 50%;
  width: min(80vh, 50vw);
  aspect-ratio: 1;
  transform: translateY(-50%) scale(var(--sc, 1)) rotate(var(--rot, 0deg));
  opacity: var(--scope, 1);
}
.scope { display: block; width: 100%; height: 100%; }
.radar .story {
  top: 50%;
  bottom: auto;
  width: min(32rem, 42vw);
  transform: translateY(calc(-50% + (1 - var(--story, 0)) * 28px));
}
.live {
  margin: 18px 0 0;
  color: #9fffd2;
  font: 600 15px/1.3 var(--ui);
  font-variant-numeric: tabular-nums;
}
.live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #7dffc4;
  box-shadow: 0 0 12px #7dffc4;
  vertical-align: 1px;
}

/* ---------------------------------------------------------------- Schluss */
.outro-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0 var(--gut);
}
.outro-title {
  margin: 0;
  font: 900 clamp(84px, 17vw, 300px)/.82 var(--display);
  text-transform: uppercase;
  text-align: center;
  letter-spacing: var(--track, -.01em);
  background: var(--heat);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Fest zwei Zeilen: sonst bricht die weit gesperrte Zeile beim Zusammenziehen
   erst um und springt dann zurück in eine. */
.outro-title span { display: block; white-space: nowrap; }
.foot {
  position: absolute;
  z-index: 3;
  inset: auto var(--gut) max(24px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--paper-dim);
  font: 500 14px/1.3 var(--ui);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--paper); }

/* ---------------------------------------------------------------- Film */
.film {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: max(56px, env(safe-area-inset-top)) 16px 16px;
  border: 0;
  background: transparent;
  color: var(--paper);
}
.film[open] { display: grid; place-items: center; }
.film::backdrop { background: rgb(5 6 16 / .9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.film-inner { position: relative; width: min(1280px, 100%, (100dvh - 90px) * 16 / 9); }
.film video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 40px 120px rgb(0 0 0 / .6);
}
.film-x {
  position: absolute;
  top: -50px;
  right: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(246 236 224 / .08);
  font-size: 18px;
  cursor: pointer;
}
.film-x:hover { background: rgb(246 236 224 / .18); }

/* ---------------------------------------------------------------- Schmal */
@media (max-width: 760px) {
  .mark { font-size: 20px; }
  .shade {
    background: linear-gradient(0deg, rgb(10 11 28 / .94) 0%, rgb(10 11 28 / .7) 45%, transparent 80%);
  }
  .story { bottom: max(28px, env(safe-area-inset-bottom)); }
  .title { margin-bottom: 14px; font-size: clamp(60px, 19vw, 96px); }
  .excerpt { font-size: 18px; }
  .acts { gap: 10px; margin-top: 22px; }
  .go, .film-btn { min-height: 46px; padding: 0 18px; font-size: 18px; }
  .hero-where { flex-direction: column; gap: 2px; bottom: 96px; }
  .hero-line { align-content: start; padding-top: max(96px, 17svh); }
  .lede { max-width: 9ch; font-size: clamp(60px, 18.5vw, 110px); }

  .window .story, .radar .story {
    top: auto;
    bottom: max(28px, env(safe-area-inset-bottom));
    width: calc(100% - 2 * var(--gut));
    transform: translateY(calc((1 - var(--story, 0)) * 28px));
  }
  .scope-wrap {
    right: 50%;
    top: 84px;
    width: min(88vw, 44svh);
    transform: translateX(50%) scale(var(--sc, 1)) rotate(var(--rot, 0deg));
    transform-origin: 50% 50%;
  }
  .radar-glow { background: radial-gradient(70% 40% at 50% 28%, rgb(125 255 196 / .08), transparent 70%); }
}
@media (max-width: 380px) {
  .go, .film-btn { padding: 0 15px; font-size: 17px; }
  .excerpt { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .cue i { animation: none; transform: none; }
  [data-words] .w { transition: none; }
  .go, .film-btn { transition: none; }
}
