/* ==========================================================================
   Musterbuch · gemeinsame Basis für alle vier Design-Welten
   Enthält nur Mechanik (Reset, Foto-Rahmen, Enthüllungen, Formular-Schritte).
   Farben, Schriften und Abstände setzt jede Welt in ihrer eigenen style.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { -webkit-tap-highlight-color: transparent; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 3px; }
::selection { background: var(--select-bg, #222); color: var(--select-fg, #fff); }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Lenis (weiches Scrollen am Desktop) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
@media (hover: none), (pointer: coarse) {
  html { scroll-behavior: smooth; }
}

/* --------------------------------------------------------------------------
   Foto-Rahmen. Regel: Fotos werden NIE verzerrt. Das Bild füllt den Rahmen
   per object-fit: cover, Bewegung nur als Verschieben oder gleichmäßiger Zoom.
   -------------------------------------------------------------------------- */
.ph { position: relative; overflow: hidden; background: var(--ph-bg, #ddd); }
.ph > img { width: 100%; height: 100%; object-fit: cover; }

/* Parallax ohne Verformung: Bild ist höher als der Rahmen und wandert langsam.
   --p (0..1) setzt muster.js; der Weg beträgt höchstens 8 % der Rahmenhöhe. */
.par > img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; transform: translate3d(0, calc((var(--p, .5) - .5) * -13.5%), 0); will-change: transform; }

/* --------------------------------------------------------------------------
   Enthüllungen. Standard ist sichtbar; erst mit html.js wird versteckt,
   damit die Seite auch ohne Skript vollständig lesbar bleibt.
   -------------------------------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translate3d(0, var(--rise, 22px), 0); transition: opacity var(--rv-dur, 1.1s) var(--ease), transform calc(var(--rv-dur, 1.1s) * 1.2) var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger, 90ms)); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js [data-reveal="fade"] { transform: none; }

/* Foto-Enthüllung per Maske (clip-path) plus sehr langsamer, gleichmäßiger Zoom.
   Die Maske liegt auf dem Bild, nicht auf dem Rahmen – sonst erkennt der
   IntersectionObserver den (unsichtbaren) Rahmen nicht. */
.js [data-reveal="clip"] { opacity: 1; transform: none; background: transparent; transition: none; }
.js [data-reveal="clip"] > img { clip-path: inset(var(--clip-from, 0 0 100% 0)); transition: clip-path var(--clip-dur, 1.5s) var(--ease), transform 2.4s var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger, 90ms)); }
.js [data-reveal="clip"].in > img { clip-path: inset(0 0 0 0); }
.js [data-reveal="clip"]:not(.par) > img { transform: scale(1.07); }
.js [data-reveal="clip"]:not(.par).in > img { transform: none; }
.js [data-reveal="clip"].par > img { transition: clip-path var(--clip-dur, 1.5s) var(--ease); }

/* Überschriften Zeile für Zeile */
.ln { display: block; overflow: hidden; padding-block: .12em; margin-block: -.12em; }
.ln > span { display: block; }
.js [data-lines] .ln > span { transform: translate3d(0, 108%, 0); transition: transform 1.3s var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
.js [data-lines].in .ln > span { transform: none; }

/* Linien, die sich ziehen */
.js [data-reveal="line"] { opacity: 1; transform: scaleX(0); transform-origin: left center; transition: transform 1.6s var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger, 90ms)); }
.js [data-reveal="line"].in { transform: none; }

/* --------------------------------------------------------------------------
   Mehrstufiges Anfrage-Formular (Mechanik; Aussehen je Welt)
   -------------------------------------------------------------------------- */
[data-steps] fieldset { animation: step-in .7s var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-reveal="line"], .js [data-lines] .ln > span { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js [data-reveal="clip"] > img { transform: none !important; clip-path: none !important; transition: none !important; }
  .par > img { transform: none !important; }
  [data-steps] fieldset { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* Falls ein Foto zu spät fertig ist: statt Maske ein ruhiges Einblenden, nie ein plötzliches Aufploppen */
.js [data-reveal="clip"].weich > img { clip-path: none; opacity: 0; animation: weich-ein 1.4s var(--ease) forwards; }
@keyframes weich-ein { to { opacity: 1; } }
/* Bild-Fläche hat schon vorher die warme Grundfarbe statt Weiß/Schwarz-Loch */
.ph { background-color: color-mix(in srgb, currentColor 6%, transparent); }
