/* EDN Website – Grundgerüst (Prototyp)
   Farben aus dem Markenkern v4, Schrift Inter als Platzhalter (selbst gehostet). */

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

:root {
  --paper: #f1e9d8;      /* warmes Papier */
  --paper-2: #e9dfca;    /* Papier, eine Stufe dunkler (Flächen) */
  --ink: #2b2116;        /* Tusche */
  --ink-soft: #4f3f2e;   /* Fließtext zweiter Ordnung */
  --line: #d9ccb4;       /* feine Trennlinien */
  --gold: #d6a63a;       /* SAJA, Licht – nur als Akzent, nie für Text */
  --sage: #7a9b6e;       /* Wachstum – sparsam */
  --petrol: #0f2b2e;     /* Nacht, Video */
  --petrol-ink: #e8e0cf; /* Text auf Petrol */
  --panel: #fbf7ef;
  --paper-dark: #e5d8bd; /* dunklere Pergamentbahn */
  --paper-night: #13302f;/* Nacht-Papier für SAJA.JU */
  /* Papierkorn: Vorlage ist dieses SVG-Rauschen (--korn-svg). Benutzt wird es als fertige Kachel in der passenden Dichte
     (werkzeug/papierkanten.py --korn), weil das Rauschen im Browser beim ersten Erscheinen bis 90 ms kostete. Rückfall: --korn: var(--korn-svg) */
  --korn-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .16  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --korn: image-set(url(korn-1x.webp) 1x, url(korn-15x.webp) 1.5x, url(korn-2x.webp) 2x);
  --korn-ruhig: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .16  0 0 0 .063 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --wrap: 1200px;
  --gutter: max(20px, 6vw);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 18px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---------- Schrift ---------- */
h1, h2, h3 { font-weight: 680; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(36px, 4.6vw, 68px); }
h2 { font-size: clamp(30px, 3.4vw, 50px); }
h3 { font-size: clamp(20px, 1.6vw, 24px); letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
.lead { font-size: clamp(19px, 1.45vw, 22px); line-height: 1.55; color: var(--ink-soft); max-width: 34em; }
.kicker { font-size: 15px; font-weight: 600; color: var(--ink-soft); margin-bottom: 14px; display: block; }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 620 17px/1 "Inter", system-ui, sans-serif; text-decoration: none;
       padding: 17px 26px; border-radius: 999px; border: 1.5px solid var(--ink); transition: background .2s ease, color .2s ease; cursor: pointer; }
.btn-primary { background: var(--ink); color: #fbf7ef; }
.btn-primary:hover { background: #45351f; border-color: #45351f; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(43,33,22,.06); }
.btn-light { background: var(--petrol-ink); color: var(--petrol); border-color: var(--petrol-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Kopfleiste ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 20; transition: background .25s ease, box-shadow .25s ease, opacity .4s ease; }
.nav { transition: padding .25s ease; }
.site-header.is-solid .nav { padding-top: 14px; }
.site-header.is-solid { background: rgba(241,233,216,.92); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(6px); }
.nav { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 30px var(--gutter) 16px; display: flex; align-items: center; gap: 28px; }
.brand { font-weight: 760; font-size: 22px; letter-spacing: -.02em; text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.brand img { width: 46px; height: 46px; display: block; }
.brand small { font-weight: 500; font-size: 14px; color: var(--ink-soft); letter-spacing: 0; }
.nav ul { list-style: none; display: flex; gap: 26px; margin: 0 0 0 auto; padding: 0; }
.nav ul a { text-decoration: none; font-size: 16px; font-weight: 520; color: var(--ink-soft); }
.nav ul a:hover { color: var(--ink); }
.nav .btn { padding: 12px 18px; font-size: 15px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 9px 14px; font: 600 15px/1 "Inter", sans-serif; color: var(--ink); }
@media (max-width: 920px) {
  .menu-btn { display: inline-block; }
  .nav ul, .nav > .btn { display: none; }
  .nav.is-open ul { display: flex; position: absolute; top: 84px; left: 12px; right: 12px; flex-direction: column; gap: 4px;
                    background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 12px 30px rgba(58,45,31,.12); }
  .nav.is-open ul a { display: block; padding: 12px 10px; font-size: 18px; color: var(--ink); }
}

/* ---------- Abschnitte ---------- */
.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(80px, 12vh, 150px) 0; position: relative; }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }
.stack > * + * { margin-top: 22px; }

/* Linienzeichnungen in Tusche (aus den eigenen SVGs, über eine Maske gefärbt) */
.drawing { width: 100%; aspect-ratio: var(--ar, 1); background: var(--ink-soft); opacity: .78;
           -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
           -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }   /* Bild selbst steht als mask-image am Element */

/* ---------- Der Nerv ---------- */
.nerv { text-align: left; }
.nerv h2 { font-size: clamp(34px, 5vw, 76px); max-width: 15ch; }
.nerv .lines { margin-top: 40px; display: grid; gap: 18px; max-width: 40em; }
.nerv .lines p { font-size: clamp(20px, 1.7vw, 26px); line-height: 1.5; color: var(--ink-soft); }

/* ---------- Maria ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip { font: 500 15px/1 ui-monospace, "IBM Plex Mono", Consolas, monospace; padding: 9px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.chip s { color: #9c3b2e; text-decoration-thickness: 2px; }
.honest { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.honest .zettel { padding: 20px 22px 22px; }
.honest b { display: block; font-size: 15px; margin-bottom: 6px; }
.honest p { font-size: 16.5px; color: var(--ink-soft); line-height: 1.5; }
@media (max-width: 560px) { .honest { grid-template-columns: 1fr; } }

/* ---------- SAJA im Alltag ---------- */
.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
@media (max-width: 760px) { .quotes { grid-template-columns: 1fr; } }
.quote { padding: 26px 26px 28px 56px; font-size: 19px; line-height: 1.45; margin: 0; }
.quotes .zettel-wrap:nth-child(2n) { transform: rotate(.5deg); } .quotes .zettel-wrap:nth-child(2n+1) { transform: rotate(-.4deg); }
.quote::before { content: ""; position: absolute; left: 22px; top: 28px; width: 12px; height: 12px; border-radius: 50%;
                 background: var(--ink-soft); opacity: .5; }   /* kleiner Tuschepunkt statt Goldpunkt */
.quote small { display: block; margin-top: 8px; font-size: 14.5px; color: var(--ink-soft); }
.note { margin-top: 26px; font-size: 16.5px; color: var(--ink-soft); }

/* ---------- SAJA.JU (Nacht, Sterne) ---------- */
.night { color: var(--petrol-ink); }
.night .lead, .night .kicker { color: #c9c1b0; }
.night h2 { color: #f4ecdb; max-width: 18ch; }
.constellation { width: 100%; height: auto; display: block; }
.constellation .st { fill: #f4ecdb; }
.constellation .st.gold { fill: var(--gold); }
.constellation .ln { stroke: rgba(244,236,219,.28); stroke-width: 1; fill: none; stroke-dasharray: 4 6; }
@media (prefers-reduced-motion: no-preference) {
  .constellation .st { animation: funkeln 5s ease-in-out infinite; }
  .constellation .st:nth-child(3n) { animation-delay: -1.7s; } .constellation .st:nth-child(3n+1) { animation-delay: -3.1s; }
}
@keyframes funkeln { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.status { display: inline-block; margin-top: 6px; font-size: 15px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(244,236,219,.35); color: #e8e0cf; }

/* ---------- Hendrik ---------- */
.portrait { aspect-ratio: 4 / 5; border-radius: 14px; background: repeating-linear-gradient(135deg, var(--paper-2) 0 12px, #e3d8c1 12px 24px);
            display: grid; place-items: center; color: var(--ink-soft); font-size: 15px; border: 1px solid var(--line); }
.signature { font-size: clamp(22px, 2vw, 30px); font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }

/* ---------- Early Access ---------- */
.early { text-align: center; }
.early h2 { font-size: clamp(40px, 6vw, 88px); }
.early .lead { margin: 22px auto 34px; }
.early .actions { justify-content: center; }
.early .fine { margin-top: 18px; font-size: 15px; color: var(--ink-soft); }

/* ---------- Fußzeile ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 60px; font-size: 15.5px; color: var(--ink-soft); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 28px 60px; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* =================== Prägewand (Kopf) =================== */
.hero { position: relative; min-height: 100vh; padding-bottom: 10vh; }
.slot { position: absolute; visibility: hidden; pointer-events: none; z-index: -1; }
.m-s3 { height: 80vh; aspect-ratio: 1400 / 1198; right: -7vw; top: 4vh; }
.m-m3 { height: 72vh; aspect-ratio: 1400 / 1776; right: -15vw; top: 82vh; }
.m-s5 { height: 74vh; aspect-ratio: 1100 / 1680; left: -8vw; top: 70vh; }
.m-e2 { width: 40vw;  aspect-ratio: 1100 / 768;  left: 30vw; top: 142vh; }
.wall-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }   /* bildschirmgroß, zeigt den jeweiligen Ausschnitt */
.wall-layer #wall { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
main, .site-footer { position: relative; z-index: 1; background-image: url(papier.jpg); background-size: 512px 512px; }   /* Korn liegt über der Wand und scrollt mit: keine Naht am Lichtfenster */
.grain { position: absolute; inset: 0; pointer-events: none; opacity: var(--grain-static, .7);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .16  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.saja { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; pointer-events: none; z-index: 2; opacity: var(--saja, .6); will-change: opacity, transform;
        background: radial-gradient(circle, rgba(255,236,180,.95) 0, rgba(240,196,96,.55) 9%, rgba(214,166,58,.20) 30%, rgba(214,166,58,0) 62%); animation: atmen 7s ease-in-out infinite; }
@keyframes atmen { 0%, 100% { transform: scale(.9); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .saja { animation: none; } }
.hero-inner { position: relative; z-index: 3; padding-top: max(19vh, 120px); }
.hero .content { width: min(640px, 48vw); }
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 32px; }

/* Video: dunkles Fenster in der Wand */
.video { position: relative; z-index: 3; margin: 10vh auto 0; width: min(1100px, 100%); }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--petrol);
               box-shadow: inset 0 2px 14px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.55), 0 -1px 0 rgba(58,45,31,.18); }
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster { position: absolute; inset: 0; border: 0; padding: 0; width: 100%; cursor: pointer; color: var(--petrol-ink); font: inherit;
          background: radial-gradient(120% 90% at 50% 35%, #17393d 0%, var(--petrol) 58%, #0a1f21 100%); }
.poster svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 88px; height: 88px; border-radius: 50%;
                border: 1.5px solid rgba(241,233,216,.8); display: grid; place-items: center; transition: transform .25s ease, background .25s ease; }
.poster .play::after { content: ""; border-left: 22px solid rgba(241,233,216,.95); border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px; }
.poster:hover .play { background: rgba(241,233,216,.08); transform: translate(-50%, -50%) scale(1.05); }
.poster .vmeta { position: absolute; left: 24px; bottom: 20px; max-width: calc(100% - 150px); text-align: left; font-size: 16px; line-height: 1.4; }   /* rechts unten steht das Haus */
.poster .vmeta b { display: block; font-size: 20px; color: #f4ecdb; }
.video-caption { margin-top: 14px; font-size: 15.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.video-msg { position: absolute; inset: auto 0 0 0; padding: 14px 20px; background: rgba(10,31,33,.88); color: var(--petrol-ink); font-size: 15.5px; }

@media (max-aspect-ratio: 1/1) {
  .hero { min-height: 0; }
  .hero-inner { padding-top: max(14vh, 100px); }
  .hero .content { width: auto; }
  .video { margin-top: 6vh; }
  .m-s3 { height: auto; width: 120vw; left: -14vw; right: auto; top: auto; bottom: -30vh; }
  .m-m3, .m-s5, .p-m4, .p-s6 { display: none; }
}

/* Reglerfeld (nur mit ?regler sichtbar) */
.toggle { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 31; font: 600 14px/1 system-ui, sans-serif; color: var(--ink);
          background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; cursor: pointer; }
.panel { position: fixed; right: 16px; bottom: 64px; top: 80px; z-index: 30; width: min(340px, calc(100vw - 32px)); overflow: auto;
         background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; box-shadow: 0 10px 30px rgba(58,45,31,.12); font-size: 15px; }
.panel[hidden] { display: none; }
.panel h2 { font-size: 15px; margin: 0 0 4px; letter-spacing: 0; }
.panel p.hint { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); }
.row { margin: 0 0 12px; }
.row label { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.row output { font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.row small { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.row input[type=range] { width: 100%; margin: 6px 0 0; accent-color: #9a6f1e; height: 22px; }
.group { font-size: 12px; color: var(--ink-soft); margin: 16px 0 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; position: sticky; bottom: -16px; background: var(--panel); padding: 10px 0 2px; }
.btns button { font: 600 14px/1 system-ui, sans-serif; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.btns button.primary { background: var(--ink); color: #fbf7ef; border-color: var(--ink); }
.msg { font-size: 13px; color: var(--ink-soft); min-height: 1.2em; margin-top: 6px; }
.hud { position: fixed; left: 10px; bottom: 10px; z-index: 32; background: #2a2118; color: #f6efe0; font: 12px/1.4 ui-monospace, Consolas, monospace; padding: 6px 8px; border-radius: 4px; display: none; white-space: pre; }
.hud.on { display: block; }

/* =================== Papierbahnen: dunkleres Pergament, oben und unten abgerissen =================== */
/* Schatten der Bahn: fertig gerechnet in bahn-kante-oben/-unten.png (unten bei "Papier v2", .bahn-wrap::before).
   Vorher filter: drop-shadow(0 8px 14px rgba(58,45,31,.13)) drop-shadow(0 1px 1px rgba(58,45,31,.10)) – ließ beim Scrollen ruckeln. */
.bahn-wrap { position: relative; z-index: 1; }
/* Rissmaske als Bild (edge-top/-bottom.png = edge-top/-bottom.svg in doppelter Auflösung, werkzeug/papierkanten.py):
   ein Bild zeichnet der Browser viel schneller als den Vektorpfad mit 1200 Punkten */
.bahn { background: var(--paper-dark) var(--korn); padding: clamp(70px, 10vh, 120px) 0;
        -webkit-mask: url(edge-top.png) top / 1200px 30px repeat-x, url(edge-bottom.png) bottom / 1200px 30px repeat-x, linear-gradient(#000 0 0) center / 100% calc(100% - 58px) no-repeat;
                mask: url(edge-top.png) top / 1200px 30px repeat-x, url(edge-bottom.png) bottom / 1200px 30px repeat-x, linear-gradient(#000 0 0) center / 100% calc(100% - 58px) no-repeat; }
.bahn--schief { transform: rotate(-.6deg); margin: 0 -2vw; }
.bahn--schief > * { transform: rotate(.6deg); }   /* Bahn liegt schief, Text bleibt gerade */
.bahn--nacht { background-color: var(--paper-night); }
.bahn--nacht + .ink-note, .bahn--nacht .lead { color: #cfc6b4; }
.section.has-bahn { padding: 40px 0; }

/* Zettel: kleine abgerissene Papierstücke statt Kacheln */
.zettel-wrap { filter: drop-shadow(0 4px 7px rgba(58,45,31,.12)); }
.zettel { position: relative; background: #f7f1e3 var(--korn); padding: 22px 24px;
          -webkit-mask: url(edge-top.svg) top / 700px 16px repeat-x, url(edge-bottom.svg) bottom / 700px 16px repeat-x, linear-gradient(#000 0 0) center / 100% calc(100% - 30px) no-repeat;
                  mask: url(edge-top.svg) top / 700px 16px repeat-x, url(edge-bottom.svg) bottom / 700px 16px repeat-x, linear-gradient(#000 0 0) center / 100% calc(100% - 30px) no-repeat; }

/* =================== Kino: das Fenster in der Wand öffnet sich =================== */
.video-frame { transition: border-radius .6s ease; }
.video-frame.is-cinema { position: fixed; z-index: 60; margin: 0; border-radius: 0; box-shadow: none;
                         transition: left .65s cubic-bezier(.2,.7,.1,1), top .65s cubic-bezier(.2,.7,.1,1), width .65s cubic-bezier(.2,.7,.1,1), height .65s cubic-bezier(.2,.7,.1,1), border-radius .65s ease; }
body.cinema-on { overflow: hidden; }
body.cinema-on .site-header, body.cinema-on .hero-inner .content, body.cinema-on .video-caption { opacity: 0; pointer-events: none; }
.hero-inner .content, .video-caption { transition: opacity .4s ease; }
.cine-close { position: absolute; right: 18px; top: 18px; z-index: 3; display: none; font: 600 15px/1 "Inter", sans-serif; color: var(--petrol-ink);
              background: rgba(10,31,33,.6); border: 1px solid rgba(232,224,207,.45); border-radius: 999px; padding: 11px 16px; cursor: pointer; }
.video-frame.is-cinema .cine-close { display: block; }
.video-frame.is-cinema .poster .play { width: 104px; height: 104px; }
.poster .st { animation: funkeln 6s ease-in-out infinite; }
.poster .st:nth-child(3n) { animation-delay: -2s; } .poster .st:nth-child(3n+1) { animation-delay: -4s; }
@media (prefers-reduced-motion: reduce) { .video-frame.is-cinema, .video-frame { transition: none; } .poster .st { animation: none; } }
.video-frame.is-cinema video { object-fit: contain; background: #050f10; }

/* Korrekturen */
.site-header .nav { padding: 34px var(--gutter) 16px; }              /* Kopfleiste tiefer (die .wrap-Regel hatte den Abstand überschrieben) */
.site-header.is-solid .nav { padding-top: 14px; padding-bottom: 14px; }
.quote.zettel { padding: 26px 26px 28px 58px; }                       /* Platz für den Tuschepunkt */
.video-frame.is-cinema .vmeta { display: none; }                      /* im Kino nur der Hinweis bzw. der Player */

/* =================== Schrift-Varianten (Probe): html.f0 … f4, umschaltbar mit ?schrift=0…4 =================== */
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
html:not(.f0) :is(h1, h2, h3, .signature, .brand) { font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto; }
/* f1 · weich: warm und rund, kräftig, ohne Eigenheiten */
html.f1 :is(h1, h2, h3, .signature) { font-weight: 640; font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -.012em; }
/* f2 · eigen: schwer, mit den eigenwilligen Fraunces-Formen */
html.f2 :is(h1, h2, h3, .signature) { font-weight: 820; font-variation-settings: "SOFT" 40, "WONK" 1; letter-spacing: -.02em; }
/* f3 · Buch: Fraunces auch im Fließtext, wie in einem guten Buch */
html.f3 :is(h1, h2, h3, .signature) { font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -.01em; }
html.f3 body { font-family: "Fraunces", Georgia, serif; font-variation-settings: "SOFT" 60; font-size: 19px; }
html.f3 :is(.btn, .nav ul a, .kicker, .video-caption, .site-footer, .chip, .panel, .toggle, .poster) { font-family: "Inter", system-ui, sans-serif; }
/* f4 · leicht: fein und groß, edel (Vorsicht: nah am typischen KI-Look) */
html.f4 :is(h1, h2, h3, .signature) { font-weight: 360; font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -.015em; }
html.f4 h1 { font-size: clamp(40px, 5.2vw, 78px); }
html :is(.brand) { font-weight: 700; }
html.f0 .brand { font-family: "Inter", sans-serif; }

/* Umschalter für die Schrift (nur mit ?schrift sichtbar) */
.fontbar { position: fixed; left: 16px; bottom: 16px; z-index: 31; display: flex; gap: 6px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line);
           border-radius: 999px; padding: 6px; box-shadow: 0 6px 18px rgba(58,45,31,.12); font: 600 14px/1 "Inter", sans-serif; }
.fontbar button { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 9px 12px; border-radius: 999px; cursor: pointer; }
.fontbar button[aria-pressed="true"] { background: var(--ink); color: #fbf7ef; }

/* Figuren in den Abschnitten (Lage relativ zum Abschnitt; Papierbahnen und Zettel liegen darüber) */
.p-ma1 { width: 70vw; aspect-ratio: 1000 / 401; left: -6vw; bottom: -14vh; }
.p-m4  { width: 46vw; aspect-ratio: 1000 / 652; left: -14vw; bottom: -26vh; }
.p-e3  { height: 92vh; aspect-ratio: 1100 / 2154; right: -6vw; top: -12vh; }
.p-s4  { height: 84vh; aspect-ratio: 1000 / 1669; left: -3vw; top: -10vh; }
.p-s6  { width: 44vw; aspect-ratio: 1000 / 678; right: -12vw; bottom: -6vh; }
@media (max-aspect-ratio: 1/1) {
  .p-ma1 { width: 140vw; left: -20vw; }
  .p-e3 { height: auto; width: 60vw; right: -24vw; }
  .p-s4 { height: auto; width: 55vw; left: -20vw; }
}

/* =================== Kopf-Varianten =================== */
html.hero-b .hero-wand { display: none; }
html.hero-a .hero-night { display: none; }

/* Kopf B: Nacht */
.hero-night { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; color: #f4ecdb;
              /* Nachtblau aus dem Video gemessen (Szene 1), damit Schleife und Kopf verschmelzen */
              background: radial-gradient(110% 85% at 70% 32%, #131445 0%, #0b0d33 48%, #04061d 100%); }
.hero-night .loop { position: absolute; right: 0; top: 0; height: 100%; width: min(1400px, 66vw); object-fit: cover; object-position: 50% 45%;
                    -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.6) 30%, #000 62%), linear-gradient(to bottom, transparent 0, #000 22%);
                    mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.6) 30%, #000 62%), linear-gradient(to bottom, transparent 0, #000 22%);
                    -webkit-mask-composite: source-in; mask-composite: intersect;
                    opacity: 0; transition: opacity 1.2s ease; }
.hero-night .loop.is-on { opacity: .85; }
/* Menü und Text bleiben auf ruhiger Nacht: sanfte Abdunklung oben und links */
.hero-night::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
                      background: linear-gradient(to bottom, rgba(4,6,29,.75) 0, rgba(4,6,29,0) 160px), linear-gradient(to right, rgba(4,6,29,.55) 0, rgba(4,6,29,0) 55%); }
.hero-night .sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-night .sky circle { fill: #f4ecdb; }
.hero-night .sky .tw { animation: funkeln 6s ease-in-out infinite; }
.hero-night .lamp { position: absolute; left: 0; top: 0; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none; will-change: transform;
                    background: radial-gradient(closest-side, rgba(244,236,219,.10), rgba(244,236,219,.04) 45%, rgba(244,236,219,0) 100%); }
.hero-night .house { position: absolute; right: 9vw; bottom: 26px; width: clamp(110px, 12vw, 190px); height: auto; }
.hero-night .window { filter: drop-shadow(0 0 10px rgba(214,166,58,.7)); }
@media (prefers-reduced-motion: no-preference) { .hero-night .window { animation: fenster 9s ease-in-out infinite; } }
@keyframes fenster { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }
.night-inner { position: relative; z-index: 2; padding-top: 16vh; padding-bottom: 24vh; width: 100%; }
.hero-night h1 { color: #f4ecdb; max-width: 13ch; margin-bottom: 26px; }
html.f4 .hero-night h1 { font-size: clamp(44px, 6vw, 92px); }
.hero-night .lead { color: #cfc6b4; margin-bottom: 36px; }
.btn-light:hover { background: #fffaf0; }
.btn-ghost-light { background: transparent; color: #f4ecdb; border-color: rgba(244,236,219,.6); }
.btn-ghost-light:hover { background: rgba(244,236,219,.08); }
.mini-play { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
/* unten reißt das Papier auf: die Seite liegt wie ein Blatt über der Nacht */
.tear { position: absolute; left: 0; right: 0; bottom: -2px; height: 60px; z-index: 3; filter: drop-shadow(0 -4px 7px rgba(0,0,0,.32)); }
.tear::before, .tear-paper { position: absolute; inset: 0; content: ""; }
/* heller, faseriger Rissrand (das Innere des Papiers), darüber die glatte Papierfläche */
.tear::before { background: #faf5ea; -webkit-mask: url(edge-tear-rim.svg) bottom / 1600px 60px repeat-x; mask: url(edge-tear-rim.svg) bottom / 1600px 60px repeat-x; }
.tear-paper { background: var(--paper) url(papier.jpg) 0 0 / 512px 512px; -webkit-mask: url(edge-tear.svg) bottom / 1600px 60px repeat-x; mask: url(edge-tear.svg) bottom / 1600px 60px repeat-x; }

/* Kopfleiste über der Nacht: helle Schrift, solange sie über dem dunklen Kopf liegt */
.site-header.over-night .brand, .site-header.over-night .brand small, .site-header.over-night .nav ul a { color: #e8e0cf; }
.site-header.over-night .nav > .btn { background: #f4ecdb; color: var(--petrol); border-color: #f4ecdb; }
.site-header.over-night .menu-btn { color: #f4ecdb; border-color: rgba(244,236,219,.7); }

/* Kino für Kopf B */
.cinema { position: fixed; inset: 0; z-index: 60; background: #04061d; display: grid; place-items: center; opacity: 0; transition: opacity .45s ease; }
.cinema.is-open { opacity: 1; }
.cinema[hidden] { display: none; }
.cinema .cine-close { display: block; }
.cinema-stage { width: min(1400px, 100vw); aspect-ratio: 16 / 9; max-height: 100vh; display: grid; place-items: center; position: relative; }
.cinema-stage video { width: 100%; height: 100%; object-fit: contain; }
.cinema-msg { color: #e8e0cf; font-size: 19px; max-width: 30em; text-align: center; padding: 0 24px; }
@media (prefers-reduced-motion: reduce) { .cinema { transition: none; } }
/* Untertitel (media/die-sterne.vtt): Der Browser setzt sie auf 5 % der kleineren Bildseite. Am Handy hochkant ist der Film
   nur gut 200 px hoch, die Schrift dann um 10 px und kaum lesbar. Darum auf schmalen oder niedrigen Bildschirmen mindestens 15 px. */
@media (max-width: 540px), (max-height: 300px) { video::cue { font-size: 15px; } }

/* Figur beim Nerv: Übergabe-Hände links, weit weg von der Zeichnung */
.p-e2 { width: 38vw; aspect-ratio: 1100 / 768; left: -14vw; top: 6vh; }
@media (max-aspect-ratio: 1/1) {
  .p-e2 { display: none; }
  .hero-night { min-height: 92vh; }
  .night-inner { padding-top: 18vh; padding-bottom: 20vh; }
  .hero-night .house { right: 6vw; width: 96px; }
}

@media (max-aspect-ratio: 1/1) {
  .hero-night .loop { width: 100%; height: 58%; top: auto; bottom: 0; object-position: 55% 50%;
                      -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40%); mask-image: linear-gradient(to bottom, transparent 0, #000 40%); }
  .hero-night .night-inner { align-self: flex-start; }
}

/* =================== Unterseiten =================== */
.page-head { position: relative; padding: max(22vh, 150px) 0 clamp(60px, 10vh, 120px); }
.page-head h1 { max-width: 15ch; margin-bottom: 24px; }
html.f4 .page-head h1 { font-size: clamp(44px, 6vw, 90px); }
.page-head .lead { font-size: clamp(20px, 1.6vw, 25px); max-width: 36em; }
.voice-note { margin-top: 26px; font-size: 15px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 10px; }
.voice-note::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); opacity: .55; }
.section-head { max-width: 46em; margin-bottom: clamp(30px, 5vh, 56px); }
.section-head h2 { margin-bottom: 18px; }
.prose { max-width: 40em; }
.prose p + p { margin-top: 1em; }
.prose p { font-size: 19px; line-height: 1.65; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }

/* eingeklebtes Bildschirmfoto */
.pinned { position: relative; margin: 0; background: #fbf8f1; padding: 12px 12px 14px; transform: rotate(var(--rot, -.6deg));
          box-shadow: 0 1px 1px rgba(58,45,31,.08), 0 12px 26px rgba(58,45,31,.14); }
.pinned img { display: block; width: 100%; height: auto; background: #fff; }
.pinned figcaption { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.4; }
.pinned::before { content: ""; position: absolute; left: 50%; top: -12px; width: 110px; height: 26px; transform: translateX(-50%) rotate(-2deg);
                  background: rgba(233,223,202,.78); box-shadow: 0 1px 2px rgba(58,45,31,.12); }   /* Klebestreifen */
.pinned.tilt-r { --rot: .7deg; }
.pinned.small { max-width: 520px; }

/* Funktions-Raster: Text neben eingeklebtem Bild */
.feature { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 6vw, 90px); align-items: center; padding: clamp(40px, 7vh, 80px) 0; }
.feature.flip > :first-child { order: 2; }
.feature h3 { font-size: clamp(26px, 2.4vw, 36px); margin-bottom: 14px; }
.feature .tag { display: inline-block; margin-top: 16px; font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature.flip > :first-child { order: 0; } }

/* Gespräch: was du sagst, was SAJA antwortet */
.talks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 26px; margin-top: 40px; }
@media (max-width: 760px) { .talks { grid-template-columns: 1fr; } }
.talk { display: grid; gap: 8px; }
.talk .zettel { padding: 18px 22px 20px; font-size: 18px; line-height: 1.45; }
.talk .who { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; letter-spacing: .01em; }
.talk .du { margin-right: 12%; }
.talk .du .zettel { background-color: #ece2cd; }
.talk .sie { margin-left: 12%; transform: rotate(.4deg); }
.talk .sie .who::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); opacity: .55; margin-right: 8px; vertical-align: 1px; }

/* Vergleich: was eingegeben wird, was beim Modell ankommt */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; margin-top: 30px; }
.compare .arrow { align-self: center; font-size: 28px; color: var(--ink-soft); }
.compare .zettel { padding: 22px 24px 26px; font-size: 18px; line-height: 1.6; }
.compare .who { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.compare mark { background: none; color: inherit; padding: 0 2px; border-radius: 3px; }
.compare mark.klar { box-shadow: inset 0 -.55em 0 rgba(156,59,46,.16); }
.compare mark.ref { font: 500 .86em/1 ui-monospace, "IBM Plex Mono", Consolas, monospace; background: rgba(43,33,22,.07); padding: 3px 6px; white-space: nowrap; }   /* Platzhalter wie „[Vorname 2]“ nie mitten im Wort umbrechen (Handy, 22.10.) */
.compare .fine { display: block; margin-top: 12px; font-size: 14px; color: var(--ink-soft); }
@media (max-width: 860px) { .compare { grid-template-columns: 1fr; } .compare .arrow { transform: rotate(90deg); justify-self: center; } }

/* nummerierte Schritte als Zettel */
.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; counter-reset: s; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: s; }
.steps .zettel { padding: 22px 24px 24px; height: 100%; }
.steps .zettel::before { content: counter(s, decimal-leading-zero); display: block; font-family: "Fraunces", Georgia, serif; font-size: 34px; font-weight: 360; color: var(--ink-soft); margin-bottom: 6px; }
.steps b { display: block; font-size: 18px; margin-bottom: 6px; }
.steps p { font-size: 16.5px; line-height: 1.5; color: var(--ink-soft); }
.steps .state { display: inline-block; margin-top: 10px; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.steps .state.laeuft { border-color: rgba(122,155,110,.7); }
.steps .state.offen { border-style: dashed; }

/* was nicht: ruhige Liste */
.nicht { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
@media (max-width: 760px) { .nicht { grid-template-columns: 1fr; } }
.nicht li { padding: 18px 0; border-top: 1px solid var(--line); }
.nicht b { display: block; font-size: 19px; margin-bottom: 4px; }
.nicht p { font-size: 16.5px; color: var(--ink-soft); line-height: 1.5; }
.bahn--nacht .nicht li { border-color: rgba(244,236,219,.18); }
.bahn--nacht .nicht p { color: #cfc6b4; }
.bahn--nacht h2, .bahn--nacht h3, .bahn--nacht b { color: #f4ecdb; }
.bahn--nacht .prose p { color: #cfc6b4; }

/* Sicht des Jugendamts: Platz-Eigenschaften */
.platz { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
@media (max-width: 760px) { .platz { grid-template-columns: 1fr; } }
.platz dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 16.5px; }
.platz dt { color: var(--ink-soft); }
.platz dd { margin: 0; }
.platz .nein li { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(156,59,46,.55); text-decoration-thickness: 1.5px; }
.platz ul { margin: 0; padding-left: 18px; line-height: 1.9; font-size: 16.5px; }
.closing { text-align: center; }
.closing h2 { max-width: 20ch; margin: 0 auto 20px; }
.closing .lead { margin: 0 auto 32px; }
.closing .actions { justify-content: center; }
.compare--kurz { grid-template-columns: 1fr; gap: 10px; margin-top: 6px; }
.compare--kurz .arrow { transform: rotate(90deg); justify-self: start; margin-left: 30px; font-size: 22px; }
@media (max-aspect-ratio: 1/1) { .slot.nur-gross { display: none; } }

/* =================== Papier v2: Pergament-Struktur, matt, weißer Rissrand =================== */
/* Bahnen: oben und unten gerissen; darunter liegt ein weißer Rand (das Innere des Papiers), etwas größer */
.bahn-wrap > .bahn { position: relative; z-index: 1;
  background-color: var(--paper-dark); background-image: url(pergament.jpg), var(--korn); background-size: 512px 512px, auto; background-blend-mode: multiply, normal; }
/* Weißer Rand und Schatten als fertige Bilder (werkzeug/papierkanten.py): oben von 48 px über der Bahn bis 40 px hinein,
   unten gespiegelt, dazwischen weiß. Sieht aus wie vorher (Rand #fbf8f0 mit Maske edge-top/-bottom.svg, oben und unten 4 px
   größer als die Bahn, dazu der drop-shadow der ganzen Bahn), kostet beim Scrollen aber nichts mehr. */
.bahn-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: -48px; bottom: -48px;
  background: url(bahn-kante-oben.png) center top / 1200px 88px repeat-x, url(bahn-kante-unten.png) center bottom / 1200px 88px repeat-x,
              linear-gradient(#fbf8f0 0 0) center / 100% calc(100% - 172px) no-repeat; }
.bahn--nacht { background-color: var(--paper-night) !important; background-blend-mode: soft-light, normal !important; }
/* schief liegende Bahn: das ganze Blatt samt Rand drehen, Text bleibt gerade */
.bahn--schief { transform: none; margin: 0; }
.bahn-wrap:has(> .bahn--schief) { transform: rotate(-.6deg); margin: 0 -2vw; }
/* Die schiefe Bahn ragt links und rechts über den Bildschirm. Auf dem Handy machte das die ganze Seite breiter (390 px Gerät,
   407 px Seite: alles leicht verkleinert). Nur waagerecht abschneiden, Schatten und Figuren nach oben und unten bleiben. */
:where(section, div):has(> .bahn-wrap > .bahn--schief) { overflow-x: clip; }

/* Zettel: auf allen vier Seiten gerissen (Rissform als 9-Teil-Maske) */
.zettel-wrap { position: relative; }
/* Rissformen: riss-zettel-bild.svg / riss-zettel-rand-bild.svg (werkzeug/papierkanten.py) sind dieselben Formen wie
   riss-zettel.svg / riss-zettel-rand.svg, aber als Bild in einer SVG-Hülle ohne eigene Größe. So zieht der Browser die Form
   genau wie vorher auf die Größe des Zettels, muss aber keinen Vektorpfad mit über 1000 Punkten zeichnen (das ließ beim
   ersten Erscheinen der Zettel bis 230 ms ruckeln). */
.zettel-wrap::before { content: ""; position: absolute; inset: -4px; background: #fbf8f0;
  -webkit-mask-box-image: url(riss-zettel-rand-bild.svg) 30 fill / 30px round; mask-border: url(riss-zettel-rand-bild.svg) 30 fill / 30px round; }
.zettel { position: relative; -webkit-mask: none; mask: none;
  background-color: #f4ecda; background-image: url(pergament.jpg), var(--korn); background-size: 512px 512px, auto; background-blend-mode: multiply, normal;
  -webkit-mask-box-image: url(riss-zettel-bild.svg) 30 fill / 30px round; mask-border: url(riss-zettel-bild.svg) 30 fill / 30px round; }
.talk .du .zettel { background-color: #e9dcc0; }
/* Zettel füllt den Platz ganz aus (sonst bleibt unter kurzen Zetteln ein weißer Rest) */
.zettel-wrap { display: flex; flex-direction: column; }
.zettel-wrap > .zettel { flex: 1 1 auto; }
.zettel-wrap::before { inset: 0; }   /* Rand steckt jetzt in der Rissform selbst */

/* =================== Bildschirmfotos: größer, klickbar =================== */
.feature { grid-template-columns: .82fr 1.3fr; }
.feature.flip { grid-template-columns: 1.3fr .82fr; }
.pinned.small { max-width: 640px; }
.pinned .zoom { display: block; padding: 0; border: 0; background: none; width: 100%; cursor: zoom-in; position: relative; }
.pinned .zoom img { transition: transform .35s ease; }
.pinned .zoom:hover img { transform: scale(1.012); }
.pinned figcaption { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pinned .hint-zoom { flex: none; font-size: 13px; color: var(--ink-soft); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pinned .hint-zoom::before { content: ""; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; box-shadow: 4px 4px 0 -2.5px currentColor; }
@media (max-width: 860px) { .feature, .feature.flip { grid-template-columns: 1fr; } }

/* Lupe: Bild groß, auf Papier */
.lupe { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 4vh 3vw; background: rgba(43,33,22,.62); backdrop-filter: blur(3px);
        opacity: 0; transition: opacity .3s ease; cursor: zoom-out; }
.lupe.is-open { opacity: 1; }
.lupe[hidden] { display: none; }
.lupe figure { margin: 0; max-width: min(1500px, 94vw); max-height: 92vh; background: #fbf8f1; padding: 14px 14px 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; cursor: default; }
.lupe img { display: block; max-width: 100%; max-height: calc(92vh - 70px); object-fit: contain; margin: 0 auto; }
.lupe figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.lupe .cine-close { display: block; position: fixed; color: #fbf7ef; background: rgba(43,33,22,.7); border-color: rgba(251,247,239,.5); }
@media (prefers-reduced-motion: reduce) { .lupe { transition: none; } }
.portrait-pin { max-width: 380px; justify-self: end; }
.page-head .split { align-items: center; }
@media (max-width: 860px) { .portrait-pin { max-width: 300px; justify-self: start; } }
.steps--plain .zettel::before { display: none; }

/* =================== Kopf: Nacht aus dem fertigen Video (20.10.) =================== */
.hero-night { background: radial-gradient(110% 85% at 68% 38%, #272a79 0%, #191c5b 46%, #0b0c2b 100%); }
.cinema { background: #0b0c2b; }
.hero-night .loop { width: min(1500px, 72vw); object-position: 50% 60%; }
.hero-night .loop.is-on { opacity: .92; }
.hero-night::before { background: linear-gradient(to bottom, rgba(11,12,43,.72) 0, rgba(11,12,43,0) 170px), linear-gradient(to right, rgba(11,12,43,.62) 0, rgba(11,12,43,0) 58%); }
.hero-night .house { display: none; }   /* die Häuser mit den erleuchteten Fenstern bringt jetzt das Video mit */

/* Nacht-Bahnen im Indigo des Videos, helle Schrift überall darauf */
:root { --paper-night: #1b1e5e; }
.bahn--nacht .kicker, .bahn--nacht .prose p, .bahn--nacht .lead { color: #cfcbe0; }
.bahn--nacht strong, .bahn--nacht h2, .bahn--nacht h3, .bahn--nacht b { color: #f4ecdb; }
.bahn--nacht a { color: #f4ecdb; }
.bahn--nacht .nicht li { border-color: rgba(244,236,219,.2); }
.bahn--nacht .nicht p { color: #cfcbe0; }
.bahn-wrap > .bahn.bahn--nacht { background-color: #1b1e5e !important; background-blend-mode: multiply, normal !important; }

/* Große Zeichnungen als feste Prägung (statt Tuschelinie) */
.praegung { margin: 0; width: 100%; aspect-ratio: var(--ar, 1); position: relative; z-index: 1; will-change: transform; }
.praegung svg { display: block; width: 100%; height: 100%; overflow: visible; }


/* =================== Prägewand 2.0: vorab gerechnete Ebenen, scrollen normal mit =================== */
html.praeg2 .slot { visibility: visible; }
.p2 img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; user-select: none; }
.p2.p2-an img { will-change: opacity; }
.praegung.p2 { position: relative; }
@media (max-aspect-ratio: 1/1) { html.praeg2 .slot.nur-gross { display: none; } }
/* Figuren liegen über dem Papier, aber unter dem Inhalt des Abschnitts */
html.praeg2 .slot { z-index: 0; }
html.praeg2 .section > .wrap, html.praeg2 .page-head > .wrap, html.praeg2 .bahn-wrap, html.praeg2 .hero-inner { position: relative; z-index: 1; }
/* Video-Schleife: einmaliges Einblenden statt Opacity-Übergang (der ließ beim Scrollen die Seite stolpern) */
.hero-night .loop { transition: none; }
.hero-night .loop.is-on { animation: loopEin 1.2s ease both; }
@keyframes loopEin { from { opacity: 0; } to { opacity: .92; } }
@media (prefers-reduced-motion: reduce) { .hero-night .loop.is-on { animation: none; opacity: .92; } }


/* =================== Prägewand 3 (WebGL): eine Zeichenfläche je Abschnitt, scrollt mit =================== */
canvas.p3 { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; display: block; }
html.gl .praegung svg { visibility: hidden; }
html.gl .section > .wrap, html.gl .page-head > .wrap, html.gl .bahn-wrap, html.gl .site-footer > .wrap { position: relative; z-index: 1; }


/* Wand-Figuren neben Text nur auf breiten Bildschirmen (Motivplan, Regel 10): unter 1180 px Breite aus */
@media (max-width: 1179px) { .slot.nur-breit { display: none; } }

/* =================== Briefing 21.10.: Akzentwort, sichtbare Platzhalter, Schrift-Probe f5 =================== */
/* Ein kursives, goldenes Wort je Überschrift: <h2>Der Moment, <em>den</em> du kennst</h2>.
   Gold als Schrift braucht Kontrast: auf Papier ein dunkles Gold (#8c6418, gut 4:1 auf #f1e9d8), auf Nacht das helle Gold. */
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-Variable.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-Variable-Italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
:root { --gold-text: #8c6418; }
:is(h1, h2, h3) em { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 420; color: var(--gold-text); letter-spacing: -.01em; }
:is(.night, .bahn--nacht, .hero-night) :is(h1, h2, h3) em { color: var(--gold); }
/* f5 · Source Serif (laut Briefing) zum Vergleich mit Fraunces: ?schrift=5 */
html.f5 :is(h1, h2, h3, .signature) { font-family: "Source Serif 4", Georgia, serif; font-weight: 480; letter-spacing: -.015em; }
html.f5 h1 { font-size: clamp(40px, 5.2vw, 78px); }
/* Offene Stellen für Hendrik bleiben sichtbar: <span class="offen">[Hendrik: …]</span> */
.offen { display: inline; background: #fff2c2; color: #3b2a10; border: 1px dashed #b4862a; border-radius: 5px; padding: .05em .35em; font: 500 .9em/1.5 "Inter", system-ui, sans-serif; letter-spacing: 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.bahn--nacht .offen, .night .offen { background: #3a3a7a; color: #fff2c2; border-color: #d6a63a; }

/* =================== Prägewand 4: ein Licht, jede Figur mit eigener Zeichenfläche =================== */
/* Pergament liegt fest im Papier (papier.jpg, oben bei main); das Licht trifft nur die Figuren */
canvas.p4 { position: absolute; pointer-events: none; display: block; }
html.gl4 .slot { visibility: visible; z-index: 0; }
html.gl4 .praegung.p4-ok svg { visibility: hidden; }
html.gl4 .section > .wrap, html.gl4 .page-head > .wrap, html.gl4 .bahn-wrap, html.gl4 .site-footer > .wrap, html.gl4 .bahn > .wrap { position: relative; z-index: 1; }
/* Riss am Nacht-Kopf: das Korn von .tear-paper legt praegewand4.js (unten, "Papier-Naht") genau auf das Korn von main,
   sonst entsteht an der Unterkante des Risses eine gerade Naht im Muster. */

/* =================== Handy-Korrekturen 21.10. abends (Hendriks Handy-Fotos) =================== */
/* Kopf-Video am Handy hochkant: über die ganze Breite. Die Breitenregel des Indigo-Kopfs (min(1500px, 72vw)) galt sonst
   auch hier, das Video endete links mit harter Kante und verdeckte den Riss unten rechts. */
@media (max-aspect-ratio: 1/1) {
  .hero-night .loop { width: 100%; left: 0; right: 0; }
}
/* Aufgeklapptes Menü über der Nacht: dunkle Schrift auf dem hellen Feld (vorher hell auf hell, kaum lesbar) */
.site-header.over-night .nav.is-open ul a { color: var(--ink); }
.site-header.over-night .nav.is-open ul a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.site-header.over-night .nav.is-open .nur-mobil a { color: #fbf7ef; }

/* =================== Kopf-Sequenz 21.10. spät: Fäden → Netz → Logo (media/sterne-netz.mp4, läuft einmal) =================== */
/* Ersetzt die Lage der alten Schleife. Im Endbild steht der goldene Ring genau in der Bildmitte, sein Lichtkreis ist 65,8 % der
   Bildhöhe groß (oben reicht er bis an den Bildrand). Darum wird das Bild nicht mehr beschnitten, sondern ganz gezeigt (16:9):
   – waagrecht: Bildmitte (also der Ring) genau in der Mitte zwischen Textende und rechtem Rand. Textende = linker Rand von .wrap
     plus die längste Zeile, und das ist immer die erste Zeile der Einleitung ("… Gebaut für die Kinder- und"): gemessen 29,1 em
     ihrer Schriftgröße (19 bis 22 px) von 844 bis 3440 px Breite; die Überschrift ist überall kürzer. Gerechnet wird mit 29,4 em.
     (Vorher stand hier pauschal min(640px, 42vw). Das war unter etwa 1280 px Breite zu knapp, z. B. iPad quer 1024x768 oder
     Handy quer: Dort lag "Kinder- und" mitten im hellen Lichtkreis und war nicht lesbar. Wer die Einleitung ändert, prüft diese Zahl.)
     Rechts darf das Bild über den Rand laufen (der Kopf schneidet es ab).
   – Höhe: 92 % des Kopfs (oben bleibt die Kopfleiste frei), höchstens 1000 px (sonst wird das Logo auf großen Bildschirmen
     riesig neben der Schrift), und so klein, dass der Lichtkreis mit je 40 px Luft zwischen Text und rechten Rand passt.
   – senkrecht: mittig im Kopf, aber nie höher als 8 % (Kopfleiste). Unten läuft das Bild hinter dem Riss aus.
   – Maske: links von kurz vor dem Textende bis zum linken Rand des Lichtkreises (31,5 % der Bildbreite) weich einblenden,
     oben und unten weich (oben nur 9 %, damit der Ring oben nicht verblasst). Hinter dem Text bleibt das Netz unsichtbar. */
.hero-night { --text-r: calc(max(6vw, 50vw - 600px) + 29.4 * clamp(19px, 1.45vw, 22px));
              --halb: calc((100vw - var(--text-r)) / 2);
              --kv-h: min(92%, 1000px, calc((100vw - var(--text-r) - 80px) * 1.52)); }
.hero-night .loop { top: max(8%, calc((100% - var(--kv-h)) / 2)); bottom: auto; right: auto; left: calc(100vw - var(--halb));
                    width: auto; height: var(--kv-h); aspect-ratio: 16 / 9; transform: translateX(-50%);
                    object-fit: cover; object-position: 50% 50%;
                    -webkit-mask-image: linear-gradient(to right, transparent calc(50% - var(--halb) - 40px), #000 31.5%),
                                        linear-gradient(to bottom, transparent 0, #000 9%, #000 93%, transparent 100%);
                    mask-image: linear-gradient(to right, transparent calc(50% - var(--halb) - 40px), #000 31.5%),
                                linear-gradient(to bottom, transparent 0, #000 9%, #000 93%, transparent 100%);
                    -webkit-mask-composite: source-in; mask-composite: intersect; }
/* Hochkant (Handy, Tablet): dieselbe Sequenz unter dem Text, volle Breite, Ring in der Mitte. Höhe = Breite (quadratischer
   Ausschnitt aus der Bildmitte), höchstens 55 % der Fensterhöhe. Der Kopf wächst um diese Höhe, damit nichts hinter dem Text liegt;
   oben weich aus der Nacht (12 %), unten verschwindet der Boden hinter dem Riss. */
@media (max-aspect-ratio: 1/1) {
  .hero-night { --kv-h: min(100vw, 55vh); }
  .hero-night .loop { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: var(--kv-h); aspect-ratio: auto; transform: none;
                      -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%); mask-image: linear-gradient(to bottom, transparent 0, #000 12%); }
  .hero-night .night-inner { padding-bottom: calc(var(--kv-h) + 10px); }
}
/* Quer und niedrig (Handy quer, kleine Fenster): 16vh Abstand oben sind dort weniger als die Kopfleiste (96 px),
   die Überschrift rutschte unter das Logo der Kopfleiste. Mindestens 112 px; ab 700 px Fensterhöhe ändert sich nichts. */
@media (min-aspect-ratio: 1001/1000) { .night-inner { padding-top: max(16vh, 112px); } }
/* iPhone im Stromsparmodus legt sonst einen Wiedergabeknopf über das stumme Video (site.js zeigt dann ohnehin das Endbild) */
.hero-night .loop::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }

/* =================== Kopf-Clips von Hendrik (22.10.2026): media/hero-16x9.mp4 (quer) und media/hero-4x5.mp4 (hochkant) =================== */
/* Hendrik hat die Clips eigens für den Kopf gerendert: durchgehend Nacht, an allen Rändern genau #181c5b (gemessen), zur Mitte heller,
   keine eigene Randabdunklung, Netz und Logo im rechten Teil (16:9) bzw. mittig (4:5), am Ende 2 s Standbild auf dem Logo.
   Damit nichts "eingesetzt" wirkt (Hendrik am 21.10. zum Papier-Ende), bekommt der Kopf genau die Randfarbe der Clips;
   die weichen Masken an den Kanten fallen dann nicht auf. Die Abdunklung oben und links (::before) bleibt für Menü und Text. */
.hero-night { background: #181c5b; }
.hero-night .sky { display: none; }   /* die Clips bringen ihre eigenen Lichter; die Sterne der Seite lägen sonst über Netz und Logo */
/* Quer. Gemessen im 16:9-Bild: Netz (größte Ausdehnung, bei 8 s) x 44,7 bis 95,3 % der Breite, Mitte 70 %; Logo am Ende x 50,5 bis 80,6 %,
   y 28,5 bis 78,4 %. Die Netz-Mitte steht genau in der Mitte zwischen Textende (--text-r, siehe Block davor) und rechtem Rand
   (left = Mitte, translateX(-70 %)). Höhe: Das Netz ist 50,6 % der Bildbreite = 0,9 x Bildhöhe breit und soll mit je 30 px Luft
   in diesen Raum passen; höchstens 92 % des Kopfs und 1000 px. Masken: links bis 40 % (dort ist der Clip leer), rechts nur die letzten 3 %. */
.hero-night { --kv-h: min(92%, 1000px, calc((100vw - var(--text-r) - 120px) / .9)); }   /* 120 px: links etwa 70 px Luft zur Einleitung, rechts 50 px (erste Fassung mit 60 px reichte bei 1366 bis an „Kinder- und“) */
.hero-night .loop { top: max(8%, calc((100% - var(--kv-h)) / 2)); left: calc(100vw - var(--halb) + 10px); right: auto; bottom: auto;
                    width: auto; height: var(--kv-h); aspect-ratio: 16 / 9; transform: translateX(-70%); object-fit: cover; object-position: 50% 50%;
                    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40%, #000 97%, transparent 100%),
                                        linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
                    mask-image: linear-gradient(to right, transparent 0, #000 40%, #000 97%, transparent 100%),
                                linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
                    -webkit-mask-composite: source-in; mask-composite: intersect; }
/* Volle Deckkraft: Mit .92 würde das Logo matter als in Hendriks Clip (der Grund ist ohnehin dieselbe Farbe) */
@keyframes loopEinVoll { from { opacity: 0; } to { opacity: 1; } }
.hero-night .loop.is-on { opacity: 1; animation-name: loopEinVoll; }
@media (prefers-reduced-motion: reduce) { .hero-night .loop.is-on { animation: none; opacity: 1; } }
/* Hochkant (Handy, Tablet): der 4:5-Clip (site.js tauscht die Quelle) unter dem Text, mittig. Volle Breite, aber höchstens so hoch,
   dass der Clip 62 % der Fensterhöhe nicht übersteigt (Tablet hoch: dann schmaler und mittig). Oben weich aus der Nacht, seitlich die
   letzten 6 % weich (fällt bei voller Breite mit dem Bildschirmrand zusammen), unten liegt der Riss darüber. */
@media (max-aspect-ratio: 1/1) {
  .hero-night { --kv-h: min(125vw, 62vh); }
  .hero-night .loop { top: auto; bottom: 0; left: 50%; right: auto; width: auto; height: var(--kv-h); aspect-ratio: 4 / 5; transform: translateX(-50%);
                      -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10%), linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
                      mask-image: linear-gradient(to bottom, transparent 0, #000 10%), linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
                      -webkit-mask-composite: source-in; mask-composite: intersect; }
  .hero-night .night-inner { padding-bottom: calc(var(--kv-h) + 10px); }
}
/* Hochkant (Hendrik 22.10.: "bei mobil könnte das Video etwas höher sein"): der Text beginnt näher an der Kopfleiste (vorher 18vh,
   auf dem Handy 152 px), so rückt der Clip rund 50 px nach oben und das Logo steht am Ende weiter im ersten Bildschirm. */
@media (max-aspect-ratio: 1/1) { .hero-night .night-inner { padding-top: max(11vh, 100px); } }
/* Startseite, Goldener Ring auf der Nachtbahn (22.10.): Signatur und Fließtext hell wie die übrigen Nacht-Texte */
.bahn--nacht .signature { color: #f4ecdb; margin: 6px 0 14px; }
.bahn--nacht .ix-ring-text { color: #cfcbe0; }
/* Hochkant, noch höher (Hendrik 22.10.: "Die Sterne können hinter den Buttons liegen. Nur das Logo nicht."): Der Clip schiebt sich mit
   seinem oberen Viertel unter die Knöpfe. Im 4:5-Endbild beginnt der Schein des Rings bei 24 % der Clip-Höhe (gemessen), darum liegt
   unter dem Text nur 76 % der Clip-Höhe plus 16 px Luft. Netz und Sterne laufen während des Clips hinter den Knöpfen durch, das Logo am Ende nie. */
@media (max-aspect-ratio: 1/1) { .hero-night .night-inner { padding-bottom: calc(var(--kv-h) * .76 + 16px); } }
/* Startseite, Der Nerv (22.10.): "Ich auch." antwortet auf die Überschrift "Du bist angetreten, um etwas zu verändern.", darum groß wie eine Zwischenüberschrift */
.nerv .lines .ix-ichauch { font-size: clamp(30px, 3.2vw, 48px); line-height: 1.1; color: var(--ink); margin-top: clamp(22px, 3vh, 34px); }
/* =================== Nacht mit Detail (Hendrik 22.10.2026: "dieses Blau braucht wieder diese kleinen Sterne … ein bisschen Detailfreude ins Blau") ===================
   nacht-kachel.webp (werkzeug: scratchpad/nacht_detail.py, 600 px, nahtlos): schräge Bleistiftschraffur wie im Himmel der Kopf-Clips und ein paar ruhige
   kleine Sterne, durchsichtig, liegt über dem Nachtblau. Im Kopf funkeln dazu wieder die Sterne der Seite (.sky); sie liegen jetzt HINTER dem Clip,
   so stehen sie links über dem Text und im Rand, aber nie im Netz oder im Logo. */
.hero-night { background: #181c5b image-set(url(nacht-kachel.webp) type("image/webp"), url(nacht-kachel.png) type("image/png")) 0 0 / 600px 600px; }
.hero-night .sky { display: block; z-index: 0; }
.hero-night .loop { z-index: 1; }
.bahn-wrap > .bahn.bahn--nacht { background-image: image-set(url(nacht-kachel.webp) type("image/webp"), url(nacht-kachel.png) type("image/png")), url(pergament.jpg), var(--korn) !important;
  background-size: 600px 600px, 512px 512px, auto !important; background-blend-mode: normal, multiply, normal !important; }
/* =================== Scharfe Schrift auf Zetteln (22.10.2026) ===================
   Ein gedrehter Zettel (transform: rotate auf .zettel-wrap) wird mit Rissmaske und Schatten erst gerade gezeichnet und dann als Bild gedreht:
   Die Schrift wird weich (gemessen rund 30 % weniger Schärfe; Hendrik: "leicht verschwommen"). Darum stehen Zettel mit Text gerade.
   Den handgemachten Knick trägt nur der weiße Papierrand dahinter (.zettel-wrap::before), gedreht um --rim. */
.zettel-wrap::before { transform: rotate(var(--rim, 0deg)); }
.talk .sie { transform: none; --rim: .7deg; }
.quotes .zettel-wrap:nth-child(2n) { transform: none; --rim: .8deg; }
.quotes .zettel-wrap:nth-child(2n+1) { transform: none; --rim: -.7deg; }
