/*!
 * HBI C-Flex Video Splash
 *
 * Aufbau: Der Splash Screen ist ein <dialog>, der die ganze Seite bedeckt.
 * Eine Zeitachse (Linie mit Strichen und Pfeilspitze, wie im Projektvideo)
 * trägt zuerst den Play-Button und wird danach zur Fortschrittsanzeige.
 *
 * Zustände am <dialog>:
 *   (ohne)      Startbild mit Überschrift und Play-Button
 *   .is-active  Video wird geladen oder läuft
 *   .is-loaded  Video ist sichtbar
 *   .is-closing Ausblenden
 */

/* Seite dahinter nicht scrollen, solange der Splash Screen offen ist. */
html.hbicf-splash-lock,
html.hbicf-splash-lock body {
	overflow: hidden !important;
}

/* ---------- Grundgerüst ---------- */

#hbicf-splash {
	--hbicf-bg: #ffffff;
	--hbicf-ink: #003a62;
	--hbicf-text: #3d3d3d;
	--hbicf-muted: #5c6873;
	--hbicf-line: #7baee0;
	--hbicf-accent: #1f5f8b;
	--hbicf-stroke: var(--hbicf-accent);
	--hbicf-focus: #003a62;

	--hbicf-header-h: 88px;
	--hbicf-footer-h: 100px;
	--hbicf-pad: 36px;
	--hbicf-node: 96px;
	--hbicf-from: 6%;
	--hbicf-to: 94%;
	--hbicf-y: 57%;
	--hbicf-p: 0;
	--hbicf-ease: cubic-bezier(0.65, 0, 0.2, 1);

	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	background: var(--hbicf-bg);
	color: var(--hbicf-text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	opacity: 1;
	transition: opacity 0.5s ease;
	touch-action: pinch-zoom;
	overscroll-behavior: contain;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

#hbicf-splash.hbicf-splash--dark {
	--hbicf-bg: #00243d;
	--hbicf-ink: #ffffff;
	--hbicf-text: #d5e2ee;
	--hbicf-muted: #a3b9cb;
	--hbicf-line: #3f73a3;
	--hbicf-stroke: #9cc6ee;
	--hbicf-focus: #ffe9b3;
}

#hbicf-splash:not([open]) {
	display: none;
}

#hbicf-splash[open] {
	display: block;
}

#hbicf-splash.is-fallback {
	z-index: 2147483647;
}

#hbicf-splash::backdrop {
	background: transparent;
}

#hbicf-splash.is-closing {
	opacity: 0;
	pointer-events: none;
}

#hbicf-splash,
#hbicf-splash *,
#hbicf-splash *::before,
#hbicf-splash *::after {
	box-sizing: border-box;
}

#hbicf-splash [hidden] {
	display: none !important;
}

/* ---------- Kopfzeile ---------- */

#hbicf-splash .hbicf-splash__header {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: var(--hbicf-header-h);
	padding: 0 var(--hbicf-pad);
}

#hbicf-splash .hbicf-splash__logo {
	display: block;
	width: auto;
	height: 52px;
	max-width: 50vw;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
}

#hbicf-splash.hbicf-splash--dark .hbicf-splash__logo {
	height: 56px;
	padding: 6px 10px;
	border-radius: 10px;
	background: #ffffff;
}

#hbicf-splash .hbicf-splash__brand {
	color: var(--hbicf-ink);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

/* ---------- Buttons ---------- */

#hbicf-splash .hbicf-splash__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 0;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0 22px;
	border: 2px solid var(--hbicf-stroke);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--hbicf-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#hbicf-splash .hbicf-splash__btn:hover,
#hbicf-splash .hbicf-splash__btn.is-muted {
	border-color: var(--hbicf-stroke);
	background: var(--hbicf-stroke);
	color: var(--hbicf-bg);
}

#hbicf-splash .hbicf-splash__btn.is-muted:hover {
	border-color: var(--hbicf-ink);
	background: var(--hbicf-ink);
}

#hbicf-splash .hbicf-splash__btn:focus-visible,
#hbicf-splash .hbicf-splash__privacy a:focus-visible {
	outline: 3px solid var(--hbicf-focus);
	outline-offset: 3px;
}

/* ---------- Startbild: Überschrift ---------- */

#hbicf-splash .hbicf-splash__intro {
	position: absolute;
	right: 0;
	bottom: calc(100% - var(--hbicf-y) + var(--hbicf-node) / 2 + 40px);
	left: 0;
	z-index: 2;
	padding: 0 var(--hbicf-pad);
	text-align: center;
	transition: opacity 0.25s ease, visibility 0s linear 0s;
}

#hbicf-splash .hbicf-splash__title {
	max-width: 17em;
	margin: 0 auto;
	padding: 0;
	color: var(--hbicf-ink);
	font-family: inherit;
	font-size: clamp(30px, 4.6vw, 60px);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.025em;
	text-transform: none;
	text-wrap: balance;
}

#hbicf-splash .hbicf-splash__sub {
	max-width: 34em;
	margin: 18px auto 0;
	padding: 0;
	color: var(--hbicf-text);
	font-size: clamp(16px, 1.35vw, 19px);
	line-height: 1.5;
	text-wrap: pretty;
}

/* ---------- Startbild: Play-Button auf der Zeitachse ---------- */

#hbicf-splash .hbicf-splash__action {
	position: absolute;
	top: var(--hbicf-y);
	right: 0;
	left: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 var(--hbicf-pad);
	transform: translateY(calc(var(--hbicf-node) / -2));
	transition: opacity 0.2s ease, visibility 0s linear 0s;
}

#hbicf-splash .hbicf-splash__play {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--hbicf-ink);
	font-family: inherit;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

#hbicf-splash .hbicf-splash__play:focus {
	outline: 0;
}

#hbicf-splash .hbicf-splash__playicon {
	display: grid;
	place-items: center;
	width: var(--hbicf-node);
	height: var(--hbicf-node);
	border-radius: 50%;
	color: var(--hbicf-stroke);
	transition: color 0.15s ease;
}

#hbicf-splash .hbicf-splash__playicon svg {
	display: block;
	width: 36%;
	height: 36%;
	margin-left: 5%;
	fill: currentColor;
}

#hbicf-splash .hbicf-splash__play:hover .hbicf-splash__playicon,
#hbicf-splash .hbicf-splash__play:focus-visible .hbicf-splash__playicon {
	color: var(--hbicf-bg);
}

#hbicf-splash .hbicf-splash__play:focus-visible .hbicf-splash__playicon {
	outline: 3px solid var(--hbicf-focus);
	outline-offset: 5px;
}

#hbicf-splash .hbicf-splash__privacy {
	max-width: 38em;
	margin: 20px auto 0;
	padding: 0;
	color: var(--hbicf-muted);
	font-size: 13.5px;
	line-height: 1.45;
	text-align: center;
	text-wrap: pretty;
}

#hbicf-splash .hbicf-splash__privacy a {
	color: var(--hbicf-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------- Zeitachse ---------- */

#hbicf-splash .hbicf-splash__timeline {
	position: absolute;
	top: var(--hbicf-y);
	right: 0;
	left: 0;
	z-index: 1;
	height: 0;
	color: var(--hbicf-line);
	pointer-events: none;
	transition: top 0.65s var(--hbicf-ease);
}

#hbicf-splash .hbicf-splash__line {
	position: absolute;
	top: -1px;
	left: 0;
	width: var(--hbicf-to);
	height: 2px;
	background: currentColor;
	transform-origin: left center;
}

#hbicf-splash .hbicf-splash__ticks {
	position: absolute;
	top: -7px;
	left: var(--hbicf-from);
	width: calc(var(--hbicf-to) - var(--hbicf-from));
	height: 14px;
	background: repeating-linear-gradient(90deg, currentColor 0, currentColor 2px, transparent 2px, transparent 12.5%);
}

#hbicf-splash .hbicf-splash__arrow {
	position: absolute;
	top: -9px;
	left: var(--hbicf-to);
	display: block;
	width: 18px;
	height: 18px;
	margin-left: -2px;
	overflow: visible;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}

#hbicf-splash .hbicf-splash__fill {
	position: absolute;
	top: -2px;
	left: var(--hbicf-from);
	width: calc((var(--hbicf-to) - var(--hbicf-from)) * var(--hbicf-p));
	height: 4px;
	border-radius: 2px;
	background: var(--hbicf-stroke);
	opacity: 0;
	transition: width 0.25s linear, opacity 0.3s ease;
}

#hbicf-splash .hbicf-splash__thumb {
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--hbicf-node);
	height: var(--hbicf-node);
	margin: calc(var(--hbicf-node) / -2) 0 0 calc(var(--hbicf-node) / -2);
	border: 2.5px solid var(--hbicf-stroke);
	border-radius: 50%;
	background: var(--hbicf-bg);
	transition: left 0.65s var(--hbicf-ease), transform 0.65s var(--hbicf-ease), background-color 0.2s ease;
}

#hbicf-splash .hbicf-splash__thumb::after {
	content: "";
	position: absolute;
	top: -2.5px;
	right: -2.5px;
	bottom: -2.5px;
	left: -2.5px;
	border: 2px solid var(--hbicf-stroke);
	border-radius: 50%;
	opacity: 0;
}

/* Play-Button unter dem Zeiger oder mit Tastaturfokus: Kreis füllen. */
#hbicf-splash:has(.hbicf-splash__play:hover) .hbicf-splash__thumb,
#hbicf-splash:has(.hbicf-splash__play:focus-visible) .hbicf-splash__thumb {
	background: var(--hbicf-stroke);
}

/* ---------- Video ---------- */

#hbicf-splash .hbicf-splash__stage {
	position: absolute;
	top: var(--hbicf-header-h);
	right: 0;
	bottom: var(--hbicf-footer-h);
	left: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	padding: 0 var(--hbicf-pad);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#hbicf-splash .hbicf-splash__frame {
	position: relative;
	width: 100%;
	max-width: calc((100vh - var(--hbicf-header-h) - var(--hbicf-footer-h)) * 16 / 9);
	max-width: calc((100dvh - var(--hbicf-header-h) - var(--hbicf-footer-h)) * 16 / 9);
	aspect-ratio: 16 / 9;
}

#hbicf-splash .hbicf-splash__media {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	opacity: 0;
	transition: opacity 0.45s ease;
}

#hbicf-splash.is-loaded .hbicf-splash__media {
	opacity: 1;
}

/* Ladeanzeige: drei Pellets, wie im Video. */
#hbicf-splash .hbicf-splash__loader {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 40px;
	margin: -20px 0 0 -22px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

#hbicf-splash .hbicf-splash__loader i {
	position: absolute;
	top: 20px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--hbicf-line);
	opacity: 0.35;
}

#hbicf-splash .hbicf-splash__loader i:nth-child(1) {
	top: 1px;
	left: 13px;
}

#hbicf-splash .hbicf-splash__loader i:nth-child(3) {
	left: 24px;
}

/* ---------- Fußzeile ---------- */

#hbicf-splash .hbicf-splash__footer {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 8px 20px;
	height: calc(var(--hbicf-footer-h) - 34px);
	padding: 0 var(--hbicf-pad) 8px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#hbicf-splash .hbicf-splash__cell {
	display: flex;
	align-items: center;
	min-width: 0;
}

#hbicf-splash .hbicf-splash__cell--end {
	grid-column: 3;
	justify-content: flex-end;
}

#hbicf-splash .hbicf-splash__sound {
	height: 38px;
	padding: 0 18px;
	font-size: 14px;
}

#hbicf-splash .hbicf-splash__note {
	grid-column: 2;
	margin: 0;
	padding: 0;
	color: var(--hbicf-muted);
	font-size: 14px;
	line-height: 1.35;
	text-align: center;
}

#hbicf-splash .hbicf-splash__time {
	color: var(--hbicf-muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* ---------- Zustand: Video aktiv ---------- */

#hbicf-splash.is-active {
	--hbicf-y: calc(100% - var(--hbicf-footer-h) + 24px);
}

#hbicf-splash.is-active .hbicf-splash__intro,
#hbicf-splash.is-active .hbicf-splash__action {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

#hbicf-splash.is-active .hbicf-splash__stage,
#hbicf-splash.is-active .hbicf-splash__footer {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.4s ease 0.35s, visibility 0s linear 0s;
}

#hbicf-splash.is-active .hbicf-splash__fill {
	opacity: 1;
	transition: width 0.25s linear, opacity 0.3s ease 0.6s;
}

#hbicf-splash.is-active .hbicf-splash__thumb {
	left: calc(var(--hbicf-from) + (var(--hbicf-to) - var(--hbicf-from)) * var(--hbicf-p));
	background: var(--hbicf-stroke);
	transform: scale(0.17);
}

#hbicf-splash.is-loaded .hbicf-splash__thumb {
	transition: left 0.25s linear, transform 0.65s var(--hbicf-ease), background-color 0.2s ease;
}

#hbicf-splash.is-active:not(.is-loaded) .hbicf-splash__loader {
	opacity: 1;
	transition: opacity 0.3s ease 0.5s;
}

/* ---------- Bewegung (nur wenn erwünscht) ---------- */

@media (prefers-reduced-motion: no-preference) {
	#hbicf-splash[open]:not(.is-active) .hbicf-splash__line {
		animation: hbicf-draw 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) backwards;
	}

	#hbicf-splash[open]:not(.is-active) .hbicf-splash__ticks,
	#hbicf-splash[open]:not(.is-active) .hbicf-splash__arrow {
		animation: hbicf-fade 0.4s ease 0.75s backwards;
	}

	#hbicf-splash[open]:not(.is-active) .hbicf-splash__thumb {
		animation: hbicf-pop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) 0.4s backwards;
	}

	#hbicf-splash[open]:not(.is-active) .hbicf-splash__intro {
		animation: hbicf-fade 0.5s ease 0.15s backwards;
	}

	#hbicf-splash[open]:not(.is-active) .hbicf-splash__action {
		animation: hbicf-fade 0.4s ease 0.6s backwards;
	}

	#hbicf-splash[open]:not(.is-active) .hbicf-splash__thumb::after {
		animation: hbicf-pulse 2.6s ease-out 1.6s infinite;
	}

	#hbicf-splash.is-active:not(.is-loaded) .hbicf-splash__loader i {
		animation: hbicf-pellet 1.2s ease-in-out infinite;
	}

	#hbicf-splash.is-active:not(.is-loaded) .hbicf-splash__loader i:nth-child(2) {
		animation-delay: 0.15s;
	}

	#hbicf-splash.is-active:not(.is-loaded) .hbicf-splash__loader i:nth-child(3) {
		animation-delay: 0.3s;
	}
}

@media (prefers-reduced-motion: reduce) {
	#hbicf-splash,
	#hbicf-splash * {
		transition-duration: 0.01s !important;
		transition-delay: 0s !important;
	}
}

@keyframes hbicf-draw {
	from {
		transform: scaleX(0);
	}
}

@keyframes hbicf-fade {
	from {
		opacity: 0;
	}
}

@keyframes hbicf-pop {
	from {
		opacity: 0;
		transform: scale(0.6);
	}
}

@keyframes hbicf-pulse {
	0% {
		opacity: 0.55;
		transform: scale(1);
	}

	70%,
	100% {
		opacity: 0;
		transform: scale(1.38);
	}
}

@keyframes hbicf-pellet {
	0%,
	100% {
		opacity: 0.35;
	}

	40% {
		opacity: 1;
	}
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 640px) {
	#hbicf-splash {
		--hbicf-header-h: 68px;
		--hbicf-footer-h: 126px;
		--hbicf-pad: 18px;
		--hbicf-node: 84px;
		--hbicf-from: 7%;
		--hbicf-to: 91%;
		--hbicf-y: 55%;
	}

	#hbicf-splash .hbicf-splash__logo {
		height: 42px;
	}

	#hbicf-splash.hbicf-splash--dark .hbicf-splash__logo {
		height: 46px;
		padding: 5px 8px;
	}

	#hbicf-splash .hbicf-splash__btn {
		height: 40px;
		padding: 0 16px;
		font-size: 14px;
	}

	#hbicf-splash .hbicf-splash__stage {
		padding: 0;
	}

	#hbicf-splash .hbicf-splash__footer {
		grid-template-columns: 1fr 1fr;
		align-content: center;
	}

	#hbicf-splash .hbicf-splash__cell--end {
		grid-column: 2;
	}

	#hbicf-splash .hbicf-splash__note {
		grid-row: 2;
		grid-column: 1 / -1;
		font-size: 13px;
	}

	#hbicf-splash .hbicf-splash__sound {
		height: 36px;
	}
}

/* ---------- Niedrige Bildschirme (Handy quer) ---------- */

@media (max-height: 540px) {
	#hbicf-splash {
		--hbicf-header-h: 60px;
		--hbicf-footer-h: 82px;
		--hbicf-node: 68px;
		--hbicf-y: 50%;
	}

	#hbicf-splash .hbicf-splash__logo {
		height: 38px;
	}

	#hbicf-splash .hbicf-splash__title {
		font-size: clamp(22px, 7vh, 32px);
	}

	#hbicf-splash .hbicf-splash__sub,
	#hbicf-splash .hbicf-splash__note {
		display: none;
	}

	#hbicf-splash .hbicf-splash__intro {
		bottom: calc(100% - var(--hbicf-y) + var(--hbicf-node) / 2 + 18px);
	}

	#hbicf-splash .hbicf-splash__play {
		gap: 8px;
		font-size: 15px;
	}

	#hbicf-splash .hbicf-splash__privacy {
		margin-top: 8px;
		font-size: 12px;
	}

	#hbicf-splash .hbicf-splash__footer {
		grid-template-columns: 1fr 1fr;
		height: calc(var(--hbicf-footer-h) - 30px);
	}

	#hbicf-splash .hbicf-splash__cell--end {
		grid-column: 2;
	}
}

@media print {
	#hbicf-splash {
		display: none !important;
	}
}
