/* handy-film engine · Bildschirmfolge für das Handy · nur aktiv unter html.hf */
@property --hf-w { syntax: '<number>'; inherits: true; initial-value: 0; }  /* muss vererben: die Maske liegt auf .hf-dull, dem Kind von .hf-bg */

:root { --hf-chrome: 0px; --hf-safe: 68px; --hf-t0: 180ms; --hf-step: 240ms; --hf-ease: cubic-bezier(.2, .7, .2, 1); }

html.hf { scroll-snap-type: y mandatory; scroll-padding-top: var(--hf-chrome); }
html.hf.hf-frei { scroll-snap-type: none; }  /* Option pager:false: normales Scrollen, kein Einrasten */
html.hf [id] { scroll-margin-top: 0; }
html.hf .hf-screen {
  scroll-snap-align: start; scroll-snap-stop: always;
  height: calc(100svh - var(--hf-chrome)); height: calc(100dvh - var(--hf-chrome));
  box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start;
  padding-bottom: var(--hf-safe); position: relative;
}
html.hf .hf-screen > * { zoom: var(--hf-fit, 1); }
html.hf .hf-screen > .hf-bg { zoom: 1; }

/* Aufbau in Leserichtung */
html.hf .hf-screen .hf-el { opacity: 0; transform: translateY(12px); transition: opacity 560ms var(--hf-ease), transform 560ms var(--hf-ease); transition-delay: 0ms; }
html.hf .hf-screen.in .hf-el { opacity: 1; transform: none; transition-delay: calc(var(--hf-t0) + var(--i, 0) * var(--hf-step)); }
html.hf.hf-fitting .hf-el, html.hf.hf-fitting .hf-bg * { transform: none !important; animation: none !important; }  /* kein transition:none, sonst stirbt ein gerade gestarteter Aufbau */
html.hf.hf-pre .hf-screen .hf-el { opacity: 0 !important; transition: none !important; }
html.hf.hf-pre .hf-bg { --hf-w: 0 !important; transition: none !important; }

/* Fotoseite: Foto hinter dem Text, grau, Strahl, Kamerafahrt, weißer Verlauf von oben */
html.hf .hf-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; --hf-w: 0; }
html.hf .hf-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--hf-focus, 50% 55%); display: block; transform-origin: var(--hf-focus, 50% 55%); }
html.hf .hf-bg .hf-dull { z-index: 2; filter: saturate(0) brightness(.84) contrast(.82) blur(2px);
  -webkit-mask-image: linear-gradient(104deg, transparent calc(var(--hf-w) * 135% - 35%), #000 calc(var(--hf-w) * 135% - 8%));
  mask-image: linear-gradient(104deg, transparent calc(var(--hf-w) * 135% - 35%), #000 calc(var(--hf-w) * 135% - 8%)); }
html.hf .hf-bg .hf-edge { position: absolute; inset: 0; z-index: 3; background: linear-gradient(104deg, transparent calc(var(--hf-w) * 135% - 38%), rgba(255,255,255,.75) calc(var(--hf-w) * 135% - 31%), transparent calc(var(--hf-w) * 135% - 24%)); opacity: .9; }
html.hf .hf-screen.in .hf-bg { --hf-w: 1; transition: --hf-w 1300ms cubic-bezier(.45, 0, .2, 1) var(--hf-wipe-delay, 600ms); }
html.hf .hf-screen.in .hf-bg img { animation: hf-kb 11s cubic-bezier(.2, .5, .3, 1) forwards; }
@keyframes hf-kb { from { transform: scale(1); } to { transform: scale(1.07); } }
html.hf .hf-bg::after { content: ""; position: absolute; inset: 0; z-index: 4; background: linear-gradient(to bottom, rgba(255,255,255,.97) 0%, rgba(255,255,255,.93) 30%, rgba(255,255,255,.72) 46%, rgba(255,255,255,.28) 58%, rgba(255,255,255,0) 70%); opacity: 0; transition: opacity 900ms var(--hf-ease) 1350ms; }
html.hf .hf-screen.in .hf-bg::after { opacity: 1; }
html.hf .hf-screen[data-film="photo"] > :not(.hf-bg) { position: relative; z-index: 1; }
html.hf .hf-screen[data-film="photo"] { --hf-t0: 1550ms; --hf-step: 350ms; }
html.hf .hf-screen[data-film="photo"].hf-scrim-none .hf-bg::after { display: none; }

/* Weiter-Hinweis */
#hf-next { display: none; }
html.hf #hf-next { display: block; position: fixed; left: 50%; bottom: .75rem; transform: translateX(-50%); z-index: 56; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: rgba(255,255,255,.72); border: 1px solid rgba(16,32,46,.08); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 400ms var(--hf-ease); }
html.hf #hf-next svg { width: 100%; height: 100%; color: rgba(16,32,46,.6); }
html.hf #hf-next.on { opacity: 1; animation: hf-bob 1600ms ease-in-out infinite; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.hf #hf-next::before { content: ""; position: absolute; inset: -.75rem; border-radius: 50%; }
@keyframes hf-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 5px); } }
@media (prefers-reduced-motion: reduce) { html.hf #hf-next.on { animation: none; } html.hf .hf-screen.in .hf-bg img { animation: none; } }

/* Verpixeltes Auftauchen (HandyFilm.pixelIn) */
html.hf .hf-pixel { opacity: 0; transition: opacity 320ms var(--hf-ease); }
html.hf .hf-pixel.on { opacity: 1; }
