/*!
 * rb-effects.css: CSS-Teile der Vanilla-Ports aus React Bits.
 * Copyright (c) David Haz (React Bits). Lizenz: MIT + Commons Clause.
 * Quellen (Originale in tools/rb-src/):
 *   Star Border    https://reactbits.dev/animations/star-border        (StarBorder.jsx/.css)
 *   Shiny Text     https://reactbits.dev/text-animations/shiny-text    (ShinyText.jsx/.css)
 *   Split Text     https://reactbits.dev/text-animations/split-text    (SplitText.jsx)
 *   Blur Text      https://reactbits.dev/text-animations/blur-text     (BlurText.jsx)
 *   Scroll Velocity https://reactbits.dev/text-animations/scroll-velocity (ScrollVelocity.jsx/.css)
 *   Magic Bento    https://reactbits.dev/components/magic-bento        (MagicBento.jsx/.css)
 *   Chroma Grid    https://reactbits.dev/components/chroma-grid        (ChromaGrid.jsx/.css)
 *   Scroll Reveal  https://reactbits.dev/text-animations/scroll-reveal (ScrollReveal.jsx/.css)
 *   Profile Card   https://reactbits.dev/components/profile-card       (ProfileCard.jsx/.css)
 *   Scroll Stack   https://reactbits.dev/components/scroll-stack       (ScrollStack.jsx/.css)
 *   Card Swap      https://reactbits.dev/components/card-swap          (CardSwap.jsx/.css)
 *   Click Spark    https://reactbits.dev/animations/click-spark        (ClickSpark.jsx)
 *   Gradual Blur   https://reactbits.dev/animations/gradual-blur       (GradualBlur.jsx/.css)
 * Anpassungen MH Software: ohne React/GSAP/motion, Farben auf MH-Blau, Intro-Effekte einmal.
 */

/* ---------- Star Border: Lichtpunkt läuft um den Button (Intro einmal, dann nur bei Hover) ---------- */
@property --sb-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.star { position: relative; isolation: isolate; }
.star::before, .star__light {
  content: ""; position: absolute; inset: -2px; padding: 2px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--sb-a), transparent 0deg 290deg, rgba(150, 190, 255, .55) 325deg, #fff 345deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  animation: sb-run 2.8s linear 1.5s 1 both;
}
.star__light { inset: -6px; padding: 6px; filter: blur(6px); z-index: -1; }
.star:hover::before, .star:hover .star__light, .star:focus-visible::before, .star:focus-visible .star__light {
  animation: sb-loop 2.4s linear infinite;
}
@keyframes sb-run { 0% { --sb-a: 0deg; opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { --sb-a: 360deg; opacity: 0; } }
@keyframes sb-loop { from { --sb-a: 0deg; opacity: 1; } to { --sb-a: 360deg; opacity: 1; } }
.magnet { display: inline-flex; will-change: transform; transition: transform .45s cubic-bezier(.2, .9, .25, 1.2); }
.magnet.is-pulled { transition: transform .18s ease-out; }

/* ---------- Split Text + Shiny Text ---------- */
.split__char { display: inline-block; white-space: pre; }
.is-splitting .split__char { will-change: transform, opacity, filter; }
.shiny {
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent) 38%, #eef4ff 50%, var(--accent) 62%, var(--accent) 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.is-splitting .shiny { background: none; color: var(--accent); -webkit-text-fill-color: var(--accent); }
.shiny.is-shining { animation: shine 1.7s cubic-bezier(.45, 0, .2, 1) 1; }
.shiny:hover { animation: shine 1.4s cubic-bezier(.45, 0, .2, 1) 1; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Blur Text ---------- */
.is-blur .bw {
  display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(-10px);
  transition: opacity .35s ease, filter .35s ease, transform .35s ease;
}
.is-in .is-blur .bw, .is-blur.is-in .bw {
  opacity: 1; filter: blur(0); transform: none;
  transition: opacity .6s ease, filter .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--w, 0) * 45ms + 120ms);
}

/* ---------- Scroll Velocity ---------- */
.vel { position: relative; padding: 150px 0 40px; overflow: hidden; }
.vel__row {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.vel__track { display: flex; width: max-content; will-change: transform; }
.vel__copy { display: flex; flex: none; align-items: center; }
.vel__word, .vel__sep { font: 550 120px/1.12 var(--sans); letter-spacing: -.045em; white-space: nowrap; }
.vel__word {
  padding: 0 .16em; color: transparent; -webkit-text-stroke: 1.4px #3d3d3d;
  transition: color .45s ease, -webkit-text-stroke-color .45s ease;
}
.vel__word.is-hot { color: #fff; -webkit-text-stroke-color: #fff; }
.vel__row + .vel__row .vel__word.is-hot { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.vel__sep { color: #2a2a2a; padding: 0 .1em; }

/* ---------- Magic Bento ---------- */
.mb { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 250px; gap: 12px; }
.mb__card {
  --near: 0; position: relative; z-index: 1; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 26px;
  background: #0e0e0e; border: 1px solid #1e1e1e; border-radius: 14px; color: inherit; text-decoration: none;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), border-color .25s;
}
.mb__card.is-tilt { transition: transform .12s ease-out, border-color .25s; }
.mb__card::before {   /* sanfter Innenschein am Cursor */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(320px circle at var(--gx, -999px) var(--gy, -999px), rgba(59, 130, 246, calc(.10 * var(--near))), transparent 70%);
}
.mb__card::after {    /* Border Glow */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 3;
  background: radial-gradient(240px circle at var(--gx, -999px) var(--gy, -999px), rgba(120, 170, 255, calc(.95 * var(--near))), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.mb__spot {
  position: absolute; left: 0; top: 0; z-index: 2; width: 800px; height: 800px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(59, 130, 246, .13), rgba(59, 130, 246, .04) 55%, transparent);
  opacity: 0; transition: opacity .35s ease; will-change: transform;
}
.mb.is-hot .mb__spot { opacity: 1; }
.mb__particles { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.mb__p { position: absolute; left: 0; top: 0; width: 4px; height: 4px; border-radius: 50%; background: #8ab6ff; box-shadow: 0 0 10px 2px rgba(91, 155, 255, .55); }
.mb__label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); position: relative; z-index: 2; }
.mb__title { color: var(--text); font-size: 22px; font-weight: 550; letter-spacing: -.03em; line-height: 1.15; position: relative; z-index: 2; }
.mb__text { font-size: 14.5px; line-height: 1.55; color: #a3a3a3; position: relative; z-index: 2; max-width: 34em; }
.mb__more { position: absolute; top: 20px; right: 22px; color: #5a5a5a; font-size: 18px; z-index: 2; transition: color .2s, transform .3s cubic-bezier(.2, .8, .2, 1); }
a.mb__card:hover .mb__more, a.mb__card:focus-visible .mb__more { color: var(--accent); transform: translate(2px, -2px); }
a.mb__card:hover, a.mb__card:focus-visible { border-color: #2a2a2a; }
.mb__card--big { grid-column: span 2; grid-row: span 2; justify-content: flex-start; padding: 34px; }
.mb__card--big .mb__title { font-size: 40px; letter-spacing: -.045em; line-height: 1.02; margin-top: 4px; max-width: 8em; }
.mb__card--big .mb__text { max-width: 20em; font-size: 15.5px; }
.mb__phone { position: absolute; right: 9%; bottom: -150px; z-index: 1; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.mb__phone .iphone { --iw: 220px; transform: perspective(1400px) rotateY(-20deg) rotateX(8deg) rotateZ(5deg); }
a.mb__card:hover .mb__phone { transform: translateY(-14px); }
.mb__card--wide { grid-column: 1 / -1; justify-content: center; }
.mb__card--wide .mb__title, .mb__card--wide .mb__text, .mb__card--wide .mb__label { max-width: 36%; }
.mb__card--wide .mb__title { font-size: 30px; letter-spacing: -.04em; }
.mb__browser { position: absolute; right: -2%; top: 34px; width: 56%; z-index: 1; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
a.mb__card:hover .mb__browser { transform: translateY(-10px); }

/* ---------- Chroma Grid ---------- */
.cg { --cr: 280px; --cx: -9999px; --cy: -9999px; --cp: 0; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cg__item[hidden] { display: none; }
.cg__card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 8px; border-radius: 12px;
  background: #0e0e0e; border: 1px solid #1c1c1c; text-decoration: none; color: inherit; overflow: hidden;
  transition: border-color .25s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.cg__media { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #111; }
.cg__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cg__color { opacity: 1; }
.cg.is-live .cg__mono { filter: grayscale(1) brightness(.5); }
.cg.is-live .cg__color {
  opacity: 0; will-change: opacity;
}
.cg.is-live .cg__card:hover .cg__color, .cg.is-live .cg__card:focus-visible .cg__color { opacity: 1 !important; transition: opacity .25s ease; }
.cg__info { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 2px 6px 4px; min-width: 0; }
.cg__name { color: #e5e5e5; font-size: 15px; font-weight: 550; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .25s; }
.cg__dom { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .25s; }
.cg.is-live .cg__name { color: #9a9a9a; }
.cg__card:hover .cg__name, .cg__card:focus-visible .cg__name { color: #fff; }
.cg__card:hover .cg__dom, .cg__card:focus-visible .cg__dom { color: var(--accent); }
.cg__glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; box-shadow: inset 0 0 0 1px rgba(91, 155, 255, .55), inset 0 0 24px -10px rgba(91, 155, 255, .8); }
.cg__card:hover .cg__glow, .cg__card:focus-visible .cg__glow { opacity: 1; }

/* ---------- Scroll Reveal ---------- */
.reveal { max-width: 900px; margin: 0 auto; text-align: center; color: #fff; font-size: 44px; font-weight: 500; line-height: 1.28; letter-spacing: -.032em; text-wrap: pretty; }
.reveal.is-live .reveal__w { opacity: .14; }
.reveal__w { display: inline; }

/* ---------- Profile Card ---------- */
.pc { --px: 50%; --py: 50%; --act: 0; position: relative; width: 100%; max-width: 380px; perspective: 1000px; }
.pc__body {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 24px;
  background: linear-gradient(160deg, #1a1a1a, #0f0f0f); border: 1px solid #272727;
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  transform-style: preserve-3d; will-change: transform;
}
.pc__tile { position: relative; aspect-ratio: 4 / 5; border-radius: 17px; overflow: hidden; isolation: isolate; background: #111; }
.pc__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.pc__holo {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge;
  background-image:
    repeating-linear-gradient(0deg, hsl(2, 100%, 73%) 5%, hsl(53, 100%, 69%) 10%, hsl(93, 100%, 69%) 15%, hsl(176, 100%, 76%) 20%, hsl(228, 100%, 74%) 25%, hsl(260, 100%, 76%) 30%, hsl(2, 100%, 73%) 35%),
    repeating-linear-gradient(-45deg, #0e152e 0%, hsl(180, 10%, 60%) 3.8%, hsl(180, 29%, 66%) 4.5%, hsl(180, 10%, 60%) 5.2%, #0e152e 10%, #0e152e 12%);
  background-size: 500% 500%, 300% 300%;
  background-position: 0 var(--py), var(--px) var(--py);
  background-blend-mode: color, hard-light;
  filter: brightness(.7) contrast(1.3) saturate(.55);
  opacity: calc(.04 + .28 * var(--act));
  -webkit-mask-image: radial-gradient(farthest-corner circle at var(--px) var(--py), #000 0%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .15) 100%);
  mask-image: radial-gradient(farthest-corner circle at var(--px) var(--py), #000 0%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .15) 100%);
}
.pc__glare {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: var(--act);
  background: radial-gradient(farthest-corner circle at var(--px) var(--py), rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .08) 35%, transparent 60%);
}
.pc__scrim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .1) 38%, transparent 55%); }
.pc__head { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.pc__name { color: #fff; font-size: 30px; font-weight: 550; letter-spacing: -.04em; line-height: 1; }
.pc__role { color: #d8d8d8; font: 500 11.5px/1.45 var(--mono); letter-spacing: .01em; }
.pc__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 12px; }
.pc__status { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: #cfcfcf; letter-spacing: .04em; }
.pc__on { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pc__btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border: 1px solid #333; border-radius: 999px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; transition: border-color .2s, background-color .2s; }
.pc__btn:hover { border-color: var(--accent); background: rgba(37, 99, 235, .15); }

/* ---------- Scroll Stack ---------- */
.stack { position: relative; padding-bottom: 12vh; }
.stack__slot { position: sticky; top: 112px; }
.stack__slot:nth-child(2) { top: 136px; }
.stack__slot:nth-child(3) { top: 160px; }
.stack__slot:nth-child(4) { top: 184px; }
.stack__slot + .stack__slot { margin-top: 16vh; }
.stack__card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; gap: 40px;
  height: 380px; padding: 40px 48px; border-radius: 22px; background: #101010; border: 1px solid #232323;
  box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, .9); transform-origin: 50% 0; will-change: transform;
}
.stack__slot:nth-child(2n) .stack__card { background: #121212; }
.stack__n { display: block; font: 500 220px/.8 var(--mono); letter-spacing: -.07em; color: #f2f2f2; }
.stack__step { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.stack__title { color: #fff; font-size: 40px; font-weight: 550; letter-spacing: -.045em; line-height: 1.05; margin-bottom: 14px; }
.stack__text { font-size: 17px; line-height: 1.55; color: #b0b0b0; max-width: 30em; }
.stack__shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; border-radius: inherit; }

/* ---------- Card Swap ---------- */
.swap { position: relative; display: grid; perspective: 1500px; padding: 72px 84px 0 0; cursor: pointer; outline-offset: 10px; border-radius: 18px; }
.swap__card {
  --slot: 0; grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; margin: 0;
  padding: 36px 38px; border-radius: 18px; background: #141414; border: 1px solid #303030;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .95);
  transform: translate3d(calc(var(--slot) * 42px), calc(var(--slot) * -42px), calc(var(--slot) * -80px)) skewY(calc(var(--slot) * 3deg));
  transition: transform .65s cubic-bezier(.2, .8, .2, 1), opacity .45s ease, filter .45s ease;
  filter: brightness(calc(1 - var(--slot) * .22));
}
.swap__card blockquote { margin: 0; color: #ededed; font-size: 21px; font-weight: 450; line-height: 1.5; letter-spacing: -.02em; }
.swap__card figcaption { display: flex; flex-direction: column; gap: 4px; }
.swap__card.is-drop { transform: translate3d(0, 70%, 60px) rotate(3deg); opacity: 0; transition: transform .5s cubic-bezier(.55, 0, .75, .2), opacity .4s ease .08s; }
.swap__ctrl { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.swap__btn { width: 44px; height: 44px; background: transparent; border: 1px solid #333; color: #fff; font-size: 17px; cursor: pointer; border-radius: 999px; transition: border-color .2s; }
.swap__btn:hover { border-color: var(--accent); }
.swap__count { font-size: 13px; color: #cfcfcf; min-width: 3.5em; text-align: center; }

/* ---------- Click Spark ---------- */
.spark { position: relative; display: inline-flex; }
.spark__canvas { position: absolute; left: -60px; top: -60px; width: calc(100% + 120px); height: calc(100% + 120px); pointer-events: none; z-index: 2; }

/* ---------- Gradual Blur (fixiert, unten, nur Desktop) ---------- */
.gblur { position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 40; pointer-events: none; display: none; }
.gblur span { display: none; }
/* K3g: statt 5 fixierter backdrop-filter-Ebenen (teuerster Effekt beim Scrollen) ein Verlauf */
.gblur { background: linear-gradient(rgba(10, 10, 10, 0), rgba(10, 10, 10, .72)); }
@media (min-width: 961px) { .gblur { display: block; } }

@media (prefers-reduced-motion: reduce) {
  .star::before, .star__light, .star:hover::before, .star:hover .star__light { animation: none; opacity: 0; }
  .shiny.is-shining, .shiny:hover { animation: none; }
  .vel__word { transition: none; }
  .mb__card, .mb__phone, .mb__browser, .cg__card, .swap__card, .magnet { transition: none; }
}
