/* Web-only extras (see enhance.js) */
html.x-lock { overflow: hidden; }
.x-progress { position: fixed; left: 0; top: 0; right: 0; height: 3px; background: #A60000; transform-origin: 0 50%; transform: scaleX(0); z-index: 1000; pointer-events: none; }

/* sticky header that tightens on scroll */
#app header { position: sticky; top: 0; z-index: 90; transition: height .45s cubic-bezier(.2,.7,.2,1), margin .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s, background-color .45s; }
#app header img { transition: height .45s cubic-bezier(.2,.7,.2,1); }
#app header.x-scrolled { height: 76px !important; margin-bottom: var(--hdiff, 0px); background: rgba(255,255,255,.88) !important; backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 10px 30px rgba(20,20,20,.08); }
#app header.x-scrolled img { height: 46px !important; }
#app header nav a { position: relative; }
#app header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: #A60000; transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
#app header nav a:hover::after, #app header nav a.x-on::after { transform: scaleX(1); }

/* reveals */
.x-up { opacity: 0; transform: translateY(46px); transition: opacity .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.x-up.x-in { opacity: 1; transform: none; }
.x-words .x-w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.x-words .x-w > span { display: inline-block; transform: translateY(110%); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.x-words.x-in .x-w > span { transform: none; }
.x-clip { clip-path: inset(0 0 100% 0 round 18px); transition: clip-path 1.2s cubic-bezier(.7,0,.2,1); }
.x-clip img { transform: scale(1.18); transition: transform 1.6s cubic-bezier(.2,.7,.2,1) !important; }
.x-clip.x-in { clip-path: inset(0 0 0 0 round 0px); }
.x-clip.x-in img { transform: none; }
.x-clip.x-in:hover img { transform: scale(1.06); transition-duration: .9s !important; }

/* buttons: a little life */

/* chapter navigation (desktop) */
.x-chapters { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 95; display: flex; flex-direction: column; gap: 4px; font: 500 13px/1 'Instrument Sans', system-ui, sans-serif; }
.x-chapters a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; height: 26px; color: #1E1E1E; text-decoration: none; }
.x-chapters .x-num { font-weight: 700; font-size: 11px; opacity: 0; transition: opacity .3s; }
.x-chapters .x-label { opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .3s; white-space: nowrap; background: rgba(255,255,255,.92); padding: 5px 9px; border-radius: 7px; }
.x-chapters i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .55; transition: all .35s cubic-bezier(.2,1.4,.4,1); }
.x-chapters a.on i { width: 8px; height: 26px; border-radius: 6px; background: #A60000; border-color: #A60000; opacity: 1; }
.x-chapters:hover .x-label, .x-chapters a:focus-visible .x-label { opacity: 1; transform: none; }
.x-chapters:hover .x-num { opacity: .6; }
.x-chapters.x-dark a { color: #F6F5F2; }
.x-chapters.x-dark .x-label { background: rgba(30,30,30,.9); }
@media (max-width: 1100px) { .x-chapters { display: none; } }

/* mobile menu */
.x-menu { position: fixed; inset: 0; z-index: 1100; background: #1E1E1E; color: #F6F5F2; padding: 84px 28px 32px; display: flex; flex-direction: column; gap: 2px; opacity: 0; pointer-events: none; transition: opacity .35s; font-family: 'Schibsted Grotesk', sans-serif; overflow-y: auto; }
.x-menu.open { opacity: 1; pointer-events: auto; }
.x-menu > a { display: flex; align-items: baseline; gap: 14px; color: #F6F5F2; text-decoration: none; font-weight: 800; font-size: 32px; letter-spacing: -.02em; padding: 8px 0; border-bottom: 1px solid #333; opacity: 0; transform: translateY(18px); transition: opacity .5s calc(var(--i) * .04s + .1s), transform .5s calc(var(--i) * .04s + .1s) cubic-bezier(.2,.8,.2,1); }
.x-menu > a span { font-size: 13px; color: #ABA9A4; font-weight: 700; }
.x-menu.open > a { opacity: 1; transform: none; }
.x-menu-close { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid #555; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.x-menu-foot { margin-top: auto; padding-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.x-menu-foot a { height: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; font: 600 16px 'Instrument Sans', sans-serif; background: #A60000; }
.x-menu-foot a + a { background: none; border: 1.5px solid #666; }

@media (prefers-reduced-motion: reduce) {
  .x-up, .x-words .x-w > span, .x-clip, .x-clip img, .x-menu > a { transition: none !important; opacity: 1; transform: none; clip-path: none; }
}

/* hero film stays pinned behind the page and zooms while the page slides over it */
#app #top { position: sticky !important; top: 0; z-index: 0; }
#app #top .lf-slide img { transform: scale(calc(1 + var(--hp, 0) * .22)); transform-origin: 50% 60%; }
#app #top > div:last-child { opacity: calc(1 - var(--hp, 0) * 1.6); transform: translateY(calc(var(--hp, 0) * -90px)); }
#app #top::after { content: ""; position: absolute; inset: 0; z-index: 5; background: #141414; opacity: calc(var(--hp, 0) * .6); pointer-events: none; }
#app #top.x-gone { visibility: hidden; }
#app section:not(#top), #app footer { position: relative; z-index: 1; }
#app section:not(#top):not([style*="background"]) { background: #F6F5F2; }
#app section.x-first-over { box-shadow: 0 -30px 60px rgba(0,0,0,.25); }
.x-form-note { margin: 0; font-size: 14px; line-height: 1.5; color: #A60000; }
/* Ablauf follows the scroll: fill the active line quickly instead of the 3 s timer */
.ab-step.on .ab-line b { animation-duration: .7s !important; }

/* full-screen gallery: above header + chapter nav, content centred on very wide screens */
#app section:has(.lb) { z-index: 1300 !important; }
html.x-lock .x-chapters, html.x-lock .x-progress { display: none; }
#app .lb { left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important; width: auto !important;
  padding-left: max(24px, calc((100vw - 1440px) / 2 + 48px)) !important; padding-right: max(24px, calc((100vw - 1440px) / 2 + 48px)) !important; }

/* buttons: calm but refined - a colour sweep from the left, arrow nudge, soft lift, press feedback */
.x-btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .4s cubic-bezier(.2,1.2,.4,1), box-shadow .4s, color .35s .05s, border-color .35s; }
.x-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; transform: scaleX(0); transform-origin: left center; transition: transform .5s cubic-bezier(.7,0,.2,1); pointer-events: none; }
.x-btn:hover::before, .x-btn:focus-visible::before { transform: scaleX(1); }
.x-btn:hover { transform: translateY(-2px); }
.x-btn:active { transform: translateY(0) scale(.97); transition-duration: .12s; }
.x-btn svg { transition: transform .4s cubic-bezier(.2,1.2,.4,1); }
.x-btn:hover svg { transform: translateX(4px); }
.x-btn-fill::before { background: rgba(0,0,0,.24); }
.x-btn-fill:hover { box-shadow: 0 14px 30px -10px rgba(166,0,0,.55); }
.x-btn-line.x-on-dark::before { background: #F6F5F2; }
.x-btn-line.x-on-dark:hover { color: #1E1E1E !important; border-color: #F6F5F2 !important; }
.x-btn-line.x-on-light::before { background: #1E1E1E; }
.x-btn-line.x-on-light:hover { color: #FFFFFF !important; }
@media (prefers-reduced-motion: reduce) { .x-btn, .x-btn::before, .x-btn svg { transition: none; } }

/* logo intro only on the first visit per browser session */
.x-no-intro .lf-intro { display: none !important; }
.x-no-intro .lf .rv > span { animation-delay: 0s !important; }

/* Ablauf: pinned while the steps advance with the scroll (desktop) */
#app #ablauf.x-pin { position: sticky !important; top: 76px; justify-content: center; box-sizing: border-box; }
/* Ablauf heading types itself letter by letter */
.x-type .x-ch { opacity: 0; transition: opacity .01s linear; }
.x-type.x-in .x-ch { opacity: 1; }
.x-type::after { content: ""; display: inline-block; width: .07em; height: .82em; margin-left: .08em; vertical-align: -.04em; background: #A60000; animation: x-caret 1s steps(1) infinite; }
@keyframes x-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .x-type .x-ch { opacity: 1; } .x-type::after { display: none; } }

/* Halt im Alltag: cards take turns while scrolling */
#halt .x-seq { transition: transform .55s cubic-bezier(.2,1.4,.4,1), box-shadow .5s, border-color .4s, opacity .45s !important; transform-origin: 50% 50%; }
#halt .x-seq.x-dim { opacity: .5; transform: scale(.97); }
#halt .x-seq.x-act { opacity: 1; transform: scale(1.03); box-shadow: 0 26px 50px -20px rgba(20,20,20,.35); border-color: #A60000 !important; }
#halt .x-seq h3 { transition: font-size .5s cubic-bezier(.2,1.4,.4,1), color .3s; }
#halt .x-seq.x-act h3 { font-size: 27px !important; }
@media (max-width: 767px) { #halt .x-seq.x-act h3 { font-size: 22px !important; } }
@media (prefers-reduced-motion: reduce) { #halt .x-seq, #halt .x-seq h3 { transition: none !important; } }
