/* =========================================================================
   Fundament FX · "2028"
   Moderne Browser-Features statt Bibliotheken: @property, scroll-driven
   animations, view timelines, 3D-Transforms, color-mix, container queries.
   Jeder Effekt hat einen ruhigen Fallback (ältere Browser, reduced motion).
   ========================================================================= */

@property --fx-a  { syntax: '<angle>';      inherits: false; initial-value: 0deg; }
@property --fx-mx { syntax: '<percentage>'; inherits: true;  initial-value: 70%; }
@property --fx-my { syntax: '<percentage>'; inherits: true;  initial-value: 30%; }

:root {
	--fx-ink: var(--wp--preset--color--contrast);
	--fx-paper: var(--wp--preset--color--base);
	--fx-accent: var(--wp--preset--color--accent);
	--fx-surface: var(--wp--preset--color--surface);
	--fx-line: var(--wp--preset--color--border);
	--fx-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Labels auf der Labor-Seite ---------- */
.fx-label { font-size: var(--wp--preset--font-size--s); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .6; }

/* ---------- 01 Aurora-Hero: lebender Farbraum, folgt dem Cursor ---------- */
.fx-aurora { position: relative; isolation: isolate; overflow: hidden; background: #0d0f0a; color: #f4f6ef; min-height: min(88vh, 860px); display: grid; align-content: center; }
.fx-aurora::before {
	content: ""; position: absolute; inset: -35%; z-index: -2;
	background:
		radial-gradient(28% 36% at var(--fx-mx) var(--fx-my), color-mix(in oklab, var(--fx-accent) 90%, transparent), transparent 70%),
		radial-gradient(30% 40% at 18% 78%, #2b6bff66, transparent 70%),
		conic-gradient(from var(--fx-a) at 50% 50%, #95c11f40, #00d1b240, #6a5cff40, #ff5fa240, #95c11f40);
	filter: blur(70px) saturate(150%);
	animation: fx-spin 22s linear infinite;
	transition: --fx-mx .9s var(--fx-ease), --fx-my .9s var(--fx-ease);
}
.fx-aurora::after { /* Filmkorn */
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
@keyframes fx-spin { to { --fx-a: 360deg; } }
.fx-aurora .wp-block-heading, .fx-aurora p { color: inherit; }
.fx-chip { display: inline-block; justify-self: start; width: fit-content; padding: .45em .9em; border-radius: 999px; font-size: var(--wp--preset--font-size--s); font-weight: 600; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .16); backdrop-filter: blur(10px); }
.fx-kinetic { font-size: clamp(2.8rem, 9vw, 8.5rem) !important; line-height: .95 !important; letter-spacing: -.045em !important; font-weight: 300; text-wrap: balance; }
.fx-kinetic .fx-w { display: inline-block; font-variation-settings: "wght" 300; transition: font-variation-settings .35s var(--fx-ease), transform .35s var(--fx-ease); }
.fx-kinetic mark { background: none; color: var(--fx-accent); }
.fx-lead { max-width: 38ch; font-size: var(--wp--preset--font-size--l); opacity: .78; }

/* ---------- 02 Magnetische Buttons mit rotierendem Rand ---------- */
.fx-magnetic .wp-block-button__link { position: relative; transition: transform .25s var(--fx-ease); will-change: transform; }
.fx-magnetic .wp-block-button__link::before {
	content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; padding: 2px;
	background: conic-gradient(from var(--fx-a), var(--fx-accent), #00d1b2, #6a5cff, var(--fx-accent));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
	animation: fx-spin 4s linear infinite;
}

/* ---------- 03 Scroll-Fill: Text füllt sich beim Lesen ---------- */
.fx-fill { font-size: clamp(1.8rem, 4.6vw, 4.2rem) !important; line-height: 1.12 !important; font-weight: 700; letter-spacing: -.03em; text-wrap: pretty; }
@supports (animation-timeline: view()) {
	.fx-fill {
		color: transparent;
		background: linear-gradient(180deg, var(--fx-ink) 50%, color-mix(in oklab, var(--fx-ink) 14%, transparent) 50%) 0 100% / 100% 200% no-repeat;
		-webkit-background-clip: text; background-clip: text;
		animation: fx-fill linear both; animation-timeline: view(); animation-range: entry 35% cover 60%;
	}
	@keyframes fx-fill { to { background-position: 0 0; } }
}

/* ---------- 04 Coverflow: 3D-Karussell, nur CSS ---------- */
.fx-coverflow { display: flex !important; gap: clamp(1rem, 3vw, 2.5rem); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 3rem max(8vw, calc(50% - 190px)) !important; perspective: 1400px; scrollbar-width: none; }
.fx-coverflow::-webkit-scrollbar { display: none; }
.fx-coverflow > * { flex: 0 0 min(76vw, 380px); margin: 0 !important; scroll-snap-align: center; aspect-ratio: 4 / 5; border-radius: 28px; padding: 2rem !important; display: flex; flex-direction: column; justify-content: flex-end; gap: .5rem; color: #fff; position: relative; overflow: hidden; isolation: isolate; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .45); }
.fx-coverflow > *::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fx-card-bg, linear-gradient(160deg, #1b1b1b, #3a4a14)); }
.fx-coverflow > *:nth-child(6n+1) { --fx-card-bg: linear-gradient(160deg, #10140a, #5b7d08); }
.fx-coverflow > *:nth-child(6n+2) { --fx-card-bg: linear-gradient(160deg, #0d1330, #3b5bff); }
.fx-coverflow > *:nth-child(6n+3) { --fx-card-bg: linear-gradient(160deg, #1f0d1d, #c23b8c); }
.fx-coverflow > *:nth-child(6n+4) { --fx-card-bg: linear-gradient(160deg, #06201d, #0aa58f); }
.fx-coverflow > *:nth-child(6n+5) { --fx-card-bg: linear-gradient(160deg, #241405, #e07b11); }
.fx-coverflow > *:nth-child(6n+6) { --fx-card-bg: linear-gradient(160deg, #141414, #6d6d6d); }
.fx-coverflow > * :is(h2, h3, p) { color: inherit; margin: 0; }
.fx-coverflow > * p:first-child { font-size: var(--wp--preset--font-size--s); letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-bottom: auto; }
@supports (animation-timeline: view()) {
	.fx-coverflow > * { animation: fx-cover linear both; animation-timeline: view(inline); }
	@keyframes fx-cover {
		0%   { transform: rotateY(48deg) scale(.82) translateZ(-120px); filter: brightness(.55) saturate(.6); }
		50%  { transform: none; filter: none; }
		100% { transform: rotateY(-48deg) scale(.82) translateZ(-120px); filter: brightness(.55) saturate(.6); }
	}
}

/* ---------- 05 Spotlight-Bento: Licht folgt dem Cursor ---------- */
.fx-bento { display: grid !important; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.fx-bento > * { margin: 0 !important; grid-column: span 2; }
.fx-bento > *:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.fx-bento > *:nth-child(4) { grid-column: span 3; }
.fx-bento > *:nth-child(5) { grid-column: span 3; }
@media (max-width: 781px) { .fx-bento { grid-template-columns: 1fr; } .fx-bento > * { grid-column: auto !important; grid-row: auto !important; } }
.fx-glow { position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; padding: clamp(1.25rem, 3vw, 2.25rem) !important; background: #111; color: #f4f6ef; container-type: inline-size; min-height: 180px; display: flex; flex-direction: column; justify-content: flex-end; }
.fx-glow :is(h3, p) { color: inherit; margin: 0; }
.fx-glow h3 { font-size: clamp(1.2rem, 6cqi, 2.6rem) !important; line-height: 1.05; }
.fx-glow p { opacity: .7; font-size: var(--wp--preset--font-size--s); margin-top: .5rem; }
.fx-glow::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s; background: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), color-mix(in oklab, var(--fx-accent) 38%, transparent), transparent 45%); }
.fx-glow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: .25; transition: opacity .4s;
	background: radial-gradient(260px circle at var(--x, 50%) var(--y, 50%), var(--fx-accent), rgb(255 255 255 / .15) 60%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.fx-bento:hover .fx-glow::before, .fx-bento:hover .fx-glow::after { opacity: 1; }
@container (min-width: 520px) { .fx-glow p { font-size: var(--wp--preset--font-size--m); max-width: 40ch; } }

/* ---------- 06 Orbit: Begriffe kreisen in 3D ---------- */
.fx-orbit { position: relative; height: clamp(360px, 60vw, 560px); display: grid !important; place-items: center; perspective: 1100px; overflow: hidden; }
.fx-orbit > * { margin: 0 !important; grid-area: 1 / 1; }
.fx-orbit-core { font-size: clamp(4rem, 14vw, 11rem) !important; font-weight: 800; letter-spacing: -.06em; line-height: 1 !important;
	background: linear-gradient(135deg, var(--fx-ink), var(--fx-accent)); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.fx-ring { width: 0; height: 0; transform-style: preserve-3d; animation: fx-orbit 26s linear infinite; }
.fx-ring > * { position: absolute; margin: 0 !important; left: 0; top: 0; white-space: nowrap; padding: .5em 1em; border-radius: 999px; font-weight: 600;
	background: color-mix(in oklab, var(--fx-paper) 70%, transparent); border: 1px solid var(--fx-line); backdrop-filter: blur(8px);
	transform: translate(-50%, -50%) rotateY(calc(var(--i, 0) * 360deg / var(--n, 8))) translateZ(clamp(150px, 30vw, 300px)); }
@keyframes fx-orbit { from { transform: rotateX(-14deg) rotateY(0); } to { transform: rotateX(-14deg) rotateY(360deg); } }
.fx-orbit:hover .fx-ring { animation-duration: 60s; }

/* ---------- 07 Zähler ---------- */
.fx-count { font-size: clamp(3rem, 8vw, 6.5rem) !important; font-weight: 800; line-height: 1 !important; letter-spacing: -.05em; font-variant-numeric: tabular-nums;
	background: linear-gradient(180deg, var(--fx-ink) 30%, color-mix(in oklab, var(--fx-ink) 35%, var(--fx-accent))); -webkit-background-clip: text; background-clip: text; color: transparent !important; }

/* ---------- 08 Marquee: endloses Band, reagiert auf Scroll-Tempo ---------- */
.fx-marquee { overflow: hidden; white-space: nowrap; padding-block: 1.5rem; border-block: 1px solid var(--fx-line); }
.fx-marquee .fx-track { display: inline-flex !important; gap: 3rem; animation: fx-marquee var(--fx-dur, 30s) linear infinite; will-change: transform; }
.fx-marquee .fx-track > * { margin: 0 !important; font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.fx-marquee .fx-track > *:nth-child(even) { color: transparent; -webkit-text-stroke: 1.5px var(--fx-ink); }
.fx-marquee .fx-track > *::after { content: "✦"; color: var(--fx-accent); -webkit-text-stroke: 0; margin-left: 3rem; font-size: .5em; vertical-align: middle; }
.fx-marquee:hover .fx-track { animation-play-state: paused; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }

/* ---------- Scroll-Reveal für alle FX-Abschnitte ---------- */
@supports (animation-timeline: view()) {
	.fx-reveal { animation: fx-reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
	@keyframes fx-reveal { from { opacity: 0; transform: translateY(60px) scale(.97); filter: blur(8px); } }
}

/* ---------- Ruhige Fassung ---------- */
@media (prefers-reduced-motion: reduce) {
	.fx-aurora::before, .fx-magnetic .wp-block-button__link::before, .fx-ring, .fx-marquee .fx-track, .fx-reveal, .fx-fill, .fx-coverflow > * { animation: none !important; }
	.fx-fill { color: var(--fx-ink); background: none; }
	.fx-ring > * { position: static; transform: none; display: inline-block; margin: .25rem !important; }
	.fx-ring { width: auto; height: auto; text-align: center; transform: none; }
}

/* ---------- 09 Shader-Hero ---------- */
.fx-shader { position: relative; isolation: isolate; overflow: hidden; color: #f4f6ef; min-height: min(92vh, 900px); display: grid; align-content: end; background: radial-gradient(120% 90% at 70% 30%, color-mix(in oklab, var(--fx-accent) 55%, #000), #050605 70%); }
.fx-shader .fx-shader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.fx-shader :is(h1, h2, p) { color: inherit; }
.fx-shader h1 { font-size: clamp(3rem, 10vw, 9.5rem) !important; line-height: .92 !important; letter-spacing: -.05em !important; font-weight: 800; text-wrap: balance; text-shadow: 0 2px 30px rgb(0 0 0 / .35); }
.fx-shader .fx-lead { opacity: .85; }

/* ---------- 10 Partikel-Schrift ---------- */
.fx-particles { position: relative; min-height: clamp(220px, 32vw, 420px); display: grid !important; place-items: center; touch-action: pan-y; }
.fx-particles > * { margin: 0 !important; }
.fx-particles :is(h1, h2) { font-size: clamp(3rem, 11vw, 10rem) !important; font-weight: 800; letter-spacing: -.05em; line-height: 1 !important; text-align: center; }
.fx-particles-on :is(h1, h2) { color: transparent !important; }
.fx-particles-canvas { position: absolute; inset: 0; pointer-events: none; }


/* ---------- Coverflow-Bedienung ---------- */
.fx-coverflow { cursor: grab; }
.fx-coverflow.fx-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.fx-coverflow:focus-visible { outline: 3px solid var(--fx-accent); outline-offset: -3px; }
.fx-cf-nav { display: flex; justify-content: center; gap: .75rem; margin-top: 1.25rem; }
.fx-cf-nav button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--fx-line); background: var(--fx-paper); color: var(--fx-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.fx-cf-nav button:hover { background: var(--fx-ink); color: var(--fx-paper); transform: scale(1.06); }
.fx-cf-nav button:focus-visible { outline: 3px solid var(--fx-accent); outline-offset: 2px; }

/* ---------- Mobil ---------- */
.fx-bento.fx-auto .fx-glow::before, .fx-bento.fx-auto .fx-glow::after { opacity: 1; }
@media (max-width: 781px) {
	.fx-aurora, .fx-shader { min-height: 88svh; }
	.fx-kinetic { font-size: clamp(2.6rem, 13vw, 4.5rem) !important; }
	.fx-shader h1 { font-size: clamp(2.8rem, 14vw, 4.8rem) !important; }
	.fx-fill { font-size: clamp(1.6rem, 7.5vw, 2.6rem) !important; }
	.fx-coverflow { padding: 2rem 12vw !important; }
	.fx-coverflow > * { flex-basis: 76vw; }
	.fx-orbit { height: 320px; perspective: 600px; }
	.fx-ring > * { font-size: .7rem; padding: .35em .7em; transform: translate(-50%, -50%) rotateY(calc(var(--i, 0) * 360deg / var(--n, 8))) translateZ(105px); }
	.fx-orbit-core { font-size: 5.5rem !important; }
	.fx-marquee .fx-track > * { font-size: 2.6rem; }
	.fx-glow { min-height: 140px; }
	.fx-cf-nav button { width: 46px; height: 46px; }
}

.fx-shader mark { background: none; color: var(--fx-accent); }
:is(.fx-shader, .fx-aurora) .is-style-outline .wp-element-button { color: #fff !important; border-color: rgb(255 255 255 / .6) !important; }
:is(.fx-shader, .fx-aurora) .is-style-outline .wp-element-button:hover { background: #fff !important; color: #111 !important; }

/* Ruhige Fassung hat immer Vorrang (steht bewusst ganz am Ende) */
@media (prefers-reduced-motion: reduce) {
	.fx-ring > * { transform: none !important; position: static !important; display: inline-block !important; margin: .25rem !important; }
	.fx-ring { width: auto !important; height: auto !important; transform: none !important; text-align: center; max-width: 90%; }
	.fx-orbit { height: auto !important; padding-block: 2rem; gap: 1.5rem; }
	.fx-orbit > * { grid-area: auto !important; }
}
.fx-cf-nav button { font-family: inherit; display: grid; place-items: center; padding: 0; }

/* Hero-Layout: Leinwand volle Breite, Inhalte bündig links in der Inhaltsbreite */
.fx-shader > .fx-shader-canvas { max-width: none !important; width: 100% !important; margin: 0 !important; }
:is(.fx-shader, .fx-aurora) > :is(p, h1, h2, .wp-block-buttons) { width: 100%; max-width: 1240px !important; margin-inline: auto !important; box-sizing: border-box; }
:is(.fx-shader, .fx-aurora) > .wp-block-buttons { display: flex; }
.fx-lead { padding-right: max(0px, calc(100% - 40ch)); }
.fx-chip { background: none !important; border: 0 !important; padding: 0 !important; backdrop-filter: none !important; border-radius: 0 !important; letter-spacing: .1em; text-transform: uppercase; font-size: .78rem !important; }
.fx-chip::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--fx-accent); margin-right: .7em; vertical-align: .05em; box-shadow: 0 0 14px var(--fx-accent); animation: fx-pulse 2.4s ease-in-out infinite; }
@keyframes fx-pulse { 50% { transform: scale(1.5); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .fx-chip::before { animation: none; } }
.fx-ring > * { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
:is(.fx-shader, .fx-aurora) > p.fx-lead { max-width: 40ch !important; width: auto !important; padding-right: 0 !important; margin-left: max(0px, calc((100% - 1240px) / 2)) !important; margin-right: auto !important; }
