/* ============================================================
   Scroll-Film „Rabbit Hole“ — Intro vor dem Hero
   Film und Typografie sind getrennt: Canvas zeigt Einzelbilder,
   HTML-Text liegt darüber.
   ============================================================ */

.sf { display: none; }                 /* ohne JS / reduced motion: kein Intro */
.js-sf .sf { display: block; }

.sf {
    position: relative;
    height: 800vh;                     /* Scrollweg Desktop */
    background: var(--bg);
}
@media (max-width: 760px), (orientation: portrait) {
    .sf { height: 650vh; }
}

.sf-stage {
    position: sticky; top: 0;
    height: 100vh; height: 100lvh;   /* immer Vollbild, auch wenn die Browserleiste verschwindet */
    overflow: hidden;
    background: var(--bg) center / cover no-repeat;
}

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

/* Abblende am Filmende in die Seitenfarbe */
.sf-white {
    position: absolute; inset: 0;
    background: var(--bg);
    opacity: var(--sf-white, 0);
    pointer-events: none;
}

/* Textebene */
.sf-copy {
    position: absolute; inset: 0;
    display: flex; align-items: center;
    padding: calc(var(--nav-h) + 24px) clamp(20px, 6vw, 96px) 48px;
    pointer-events: none;
}
.sf-line {
    position: absolute;
    left: clamp(20px, 6vw, 96px);
    max-width: min(42vw, 640px);
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5.2vw, 5rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: var(--text-light);
    text-shadow: 0 2px 30px rgba(0,0,0,0.55);
    opacity: 0;
    transform: translateY(32px);
    will-change: opacity, transform;
}
.sf-line em { font-style: italic; color: var(--accent); }
.sf-line small {
    display: block;
    margin-top: 0.9em;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: none;
}
.sf-line--claim {
    font-weight: 400;
    font-size: clamp(1.9rem, 3.6vw, 3.4rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
}
.sf-line--claim span { display: block; }

@media (max-width: 760px), (orientation: portrait) {
    .sf-copy { align-items: flex-start; }
    .sf-line {
        top: calc(var(--nav-h) + 6vh);
        left: 20px; right: 20px;
        max-width: none;
        font-size: clamp(2rem, 9vw, 3rem);
    }
}

/* Scroll-Hinweis + Überspringen */
.sf-hint {
    position: absolute; left: 50%; bottom: 28px; bottom: calc(28px + 100lvh - 100svh);
    transform: translateX(-50%);
    font-family: var(--font-ui);
    font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--text-muted);
    opacity: var(--sf-hint, 1);
    transition: opacity .4s;
    pointer-events: none;
}
.sf-hint::after {
    content: ''; display: block;
    width: 1px; height: 36px; margin: 10px auto 0;
    background: linear-gradient(var(--accent), transparent);
    animation: sfHint 1.8s var(--ease-out) infinite;
}
@keyframes sfHint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.sf-skip {
    position: absolute; right: clamp(16px, 3vw, 40px); bottom: 24px; bottom: calc(24px + 100lvh - 100svh);
    font-family: var(--font-ui);
    font-size: 0.78rem; letter-spacing: 0.08em;
    color: var(--text-light);
    background: rgba(10,10,10,0.45);
    border: 1px solid rgba(250,250,248,0.18);
    border-radius: 999px;
    padding: 10px 18px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: border-color .3s, background .3s, opacity .4s;
    opacity: var(--sf-skip, 1);
}
.sf-skip:hover, .sf-skip:focus-visible { border-color: var(--accent); background: rgba(212,23,122,0.18); }

/* Ladebalken (nur bis genug Bilder da sind) */
.sf-load {
    position: absolute; left: 0; bottom: 0; bottom: calc(100lvh - 100svh); height: 2px;
    width: calc(var(--sf-load, 0) * 100%);
    background: var(--accent);
    transition: width .2s, opacity .6s;
}
.sf-ready .sf-load { opacity: 0; }



/* Hero-Einblendungen erst starten, wenn der Hero sichtbar wird */
.js-sf .hero:not(.sf-hero-in) *,
.js-sf .hero:not(.sf-hero-in) *::before,
.js-sf .hero:not(.sf-hero-in) *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
    .sf-hint::after { animation: none; }
    .sf-line { transform: none !important; }
}

/* Website schiebt sich ueber die letzte Filmszene (statt Abblende) */
.js-sf .sf { margin-bottom: -100vh; margin-bottom: -100lvh; }
.js-sf .hero {
    z-index: 2;
    background: var(--bg);
    box-shadow: 0 -60px 120px rgba(0,0,0,0.55);
}
.js-sf .hero ~ * { position: relative; z-index: 2; }

/* Subline in Magenta, mit Schatten für Lesbarkeit auf hellen Stellen */
#sfL3 small { text-shadow: 0 1px 12px rgba(0,0,0,.9), 0 0 3px rgba(0,0,0,.8); }

/* ---------- Preloader (nur beim ersten Besuch pro Sitzung) ---------- */
.sf-pre { display: none; }
.sf-first .sf-pre {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg, #0A0A0A);
    transition: opacity .6s ease, visibility 0s linear .6s;
    /* Sicherheitsnetz: verschwindet auch ohne JavaScript nach 8 s */
    animation: sfPreFailsafe .6s ease 8s forwards;
}
.sf-first.sf-pre-done .sf-pre { opacity: 0; visibility: hidden; }
.sf-first:not(.sf-pre-done) body { overflow: hidden; }
.sf-pre-mark { width: 72px; height: 72px; animation: sfPreHop 1.4s cubic-bezier(.45,0,.25,1) infinite; }
.sf-pre-bar { width: 160px; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.sf-pre-bar span {
    display: block; height: 100%; width: 100%; background: var(--accent, #D4177A);
    transform-origin: left; transform: scaleX(var(--sf-pre, 0)); transition: transform .25s ease-out;
}
.sf-pre-txt {
    margin: 0; font-family: var(--font-ui, sans-serif); font-size: .72rem; font-weight: 500;
    letter-spacing: .24em; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums;
}
@keyframes sfPreHop {
    0%, 100% { transform: translateY(0) scaleY(1); }
    35%      { transform: translateY(-10px) scaleY(1.04); }
    60%      { transform: translateY(0) scaleY(.96); }
}
@keyframes sfPreFailsafe { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .sf-pre-mark { animation: none; } }

/* Magenta-Wörter mit dunklem Schatten, damit sie auch vor pinkem Licht lesbar bleiben */
.sf-line em { text-shadow: 0 2px 18px rgba(0,0,0,.85), 0 0 4px rgba(0,0,0,.6); }

/* Claim-Zeilen dürfen breiter laufen, damit jede Zeile einzeilig bleibt */
.sf-line--claim span { white-space: nowrap; }
.sf-line--claim { max-width: none; }
@media (max-width: 760px), (orientation: portrait) { .sf-line--claim span { white-space: normal; } }

/* Zeilenumbrüche nur fürs Handy (z. B. "Jedes gute Projekt / beginnt mit den / richtigen Fragen.") */
br.sf-mob { display: none; }
@media (max-width: 600px) {
    br.sf-mob { display: inline; }
    #sfL4 span { display: inline; }
}
