/* =========================================================
   GMZ STUDIOS — Effekte & Animationen
   Cursor, Seitenübergänge, Glitch, Split-Text, Tilt,
   Border-Beam, Horizontal-Scroll, Preloader
   ========================================================= */

/* ---------- Custom Cursor (nur Maus) ---------- */
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor input, html.has-cursor textarea { cursor: text !important; }
.cursor, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 170; pointer-events: none;
  border-radius: 50%; transition: opacity .3s;
}
.cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor-ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid rgba(255,255,255,.55);
  display: grid; place-items: center;
  mix-blend-mode: difference;
  transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease),
              background .3s, border-color .3s, opacity .3s;
}
.cursor-ring span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: #000; opacity: 0; transition: opacity .25s;
}
.cursor-ring.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: #fff; border-color: #fff; }
.cursor-ring.has-label { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: #fff; border-color: #fff; mix-blend-mode: normal; }
.cursor-ring.has-label span { opacity: 1; }
.cursor-ring.is-down { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.cursor.is-hidden, .cursor-ring.is-hidden { opacity: 0; }

/* ---------- Scroll-Fortschritt ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 61;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, rgba(255,255,255,.3), #fff);
  box-shadow: 0 0 12px rgba(255,255,255,.7);
}

/* ---------- Navigation ein-/ausblenden ---------- */
.nav { transition: background .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease); }
.nav.is-hidden { transform: translateY(-100%); }
/* Offenes Handy-Menü: Leiste nie verschieben oder weichzeichnen (sonst ist das Menü in der Leiste eingesperrt) */
.nav.is-open { transform: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- Seitenübergang ---------- */
html.is-wiping::before { content: ""; position: fixed; inset: 0; z-index: 141; background: #000; }
.page-wipe {
  position: fixed; inset: 0; z-index: 142; background: #000;
  display: grid; place-items: center; pointer-events: none;
  transform: translateY(100%); visibility: hidden;
  border-top: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 -10px 40px rgba(255,255,255,.12);
}
.page-wipe img { width: 54px; opacity: 0; transition: opacity .3s; }
.page-wipe.is-in, .page-wipe.is-out { visibility: visible; }
.page-wipe.is-in { pointer-events: auto; animation: wipeIn .6s var(--ease) forwards; }
.page-wipe.is-in img { opacity: 1; transition-delay: .3s; }
.page-wipe.is-out { transform: none; animation: wipeOut .8s var(--ease) .05s forwards; }
.page-wipe.is-out img { opacity: 1; }
@keyframes wipeIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes wipeOut { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* ---------- Preloader mit Ladebalken ---------- */
.preloader__inner { display: grid; justify-items: center; gap: 28px; width: min(260px, 70vw); }
.preloader__bar { width: 100%; height: 1px; background: rgba(255,255,255,.15); overflow: hidden; }
.preloader__bar span { display: block; height: 100%; background: #fff; box-shadow: 0 0 10px #fff; transform-origin: 0 50%; transform: scaleX(var(--load, 0)); }
.preloader__meta {
  width: 100%; display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase;
}
.preloader.is-done { opacity: 1; visibility: visible; transform: translateY(-100%); transition: transform .9s var(--ease); }
html.is-loading .hero__logo, html.is-loading .hero__logo-wrap::after, html.is-loading .hero__tagline,
html.is-loading .hero__sub, html.is-loading .hero .btn-row { animation-play-state: paused !important; }

/* ---------- Hero-Logo: Neon-Flackern + Lichtschweif ---------- */
.hero__logo-wrap { position: relative; width: min(560px, 78vw); margin-bottom: 36px; }
.hero__logo-wrap .hero__logo {
  width: 100%; margin: 0;
  animation: heroIn 1.6s var(--ease) .3s both, neonFlicker 9s linear 2s infinite;
}
.hero__logo-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 44%, #fff 50%, transparent 56%) no-repeat;
  background-size: 300% 100%; background-position: 150% 0;
  -webkit-mask: url("/assets/img/logo-gmz-studios.png") center / contain no-repeat;
  mask: url("/assets/img/logo-gmz-studios.png") center / contain no-repeat;
  animation: logoShine 7s var(--ease) 2.2s infinite;
}
@keyframes logoShine { 0% { background-position: 150% 0; } 30%, 100% { background-position: -50% 0; } }
@keyframes neonFlicker {
  0%, 88%, 90%, 92.5%, 94%, 100% { opacity: 1; }
  89%, 91.5%, 93% { opacity: .35; }
}

/* ---------- Split-Text (Wort für Wort) ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .05em .1em; margin: 0 -.05em -.1em; }
.w__i { display: inline-block; transform: translateY(110%) rotate(4deg); transform-origin: 0 100%;
  transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.is-split-in .w__i { transform: none; }

/* ---------- Glitch ---------- */
/* :where() = Spezifität 0, damit absolut positionierte Titel ihre Position behalten */
:where(.glitch) { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  opacity: 0; pointer-events: none; white-space: nowrap;
}
.glitch.is-glitching { animation: glitchShake .35s steps(2) 2; }
.glitch.is-glitching::before { opacity: .9; animation: glitchA .5s steps(3) infinite; -webkit-text-stroke-color: rgba(255,255,255,.9); }
.glitch.is-glitching::after { opacity: .6; animation: glitchB .45s steps(3) infinite; -webkit-text-stroke-color: rgba(160,160,170,.9); }
@keyframes glitchShake { 0% { transform: translate(0); } 50% { transform: translate(-3px, 1px); } 100% { transform: translate(2px, -1px); } }
@keyframes glitchA {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-6px, 0); }
  33% { clip-path: inset(55% 0 20% 0); transform: translate(5px, 0); }
  66% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(80% 0 5% 0); transform: translate(4px, 0); }
}
@keyframes glitchB {
  0% { clip-path: inset(65% 0 10% 0); transform: translate(6px, 0); }
  33% { clip-path: inset(15% 0 60% 0); transform: translate(-5px, 0); }
  66% { clip-path: inset(40% 0 35% 0); transform: translate(3px, 0); }
  100% { clip-path: inset(5% 0 80% 0); transform: translate(-4px, 0); }
}

/* ---------- Rotierender Lichtrand ---------- */
@property --beam { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.beam { position: relative; }
.beam::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 6; pointer-events: none;
  background: conic-gradient(from var(--beam), transparent 0 70%, rgba(255,255,255,.95) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beamSpin 6s linear infinite;
}
@keyframes beamSpin { to { --beam: 360deg; } }

/* ---------- Tilt + Glanz ---------- */
[data-tilt] { transform-style: preserve-3d; will-change: transform; }
.tilt-glare {
  position: absolute; inset: 0; z-index: 5; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.14), transparent 55%);
  opacity: 0; transition: opacity .4s;
}
[data-tilt]:hover .tilt-glare { opacity: 1; }

/* ---------- Magnetische Buttons + Lichtschweif ---------- */
.btn { transition: transform .3s var(--ease), translate .5s var(--ease), box-shadow .3s, color .3s, border-color .3s; }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(0,0,0,.14) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn--primary:hover::after { transform: translateX(120%); }

/* ---------- Clip-Reveal ---------- */
.reveal-clip { clip-path: inset(0 0 100% 0); transition: clip-path 1.4s var(--ease); }
.reveal-clip.is-visible { clip-path: inset(0 0 0 0); }

/* ---------- Horizontal-Scroll "Vom Funken zum Spiel" ---------- */
.hscroll { position: relative; }
.hscroll__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.hscroll__track { display: flex; gap: 24px; width: max-content; padding: 0 var(--gutter); will-change: transform; }
.hscroll__intro { width: min(520px, 80vw); flex: none; display: flex; flex-direction: column; justify-content: center; padding-right: 40px; }
.hscroll__panel {
  position: relative; flex: none; overflow: hidden;
  width: min(460px, 80vw); height: min(62vh, 540px);
  padding: 36px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: border-color .4s;
}
.hscroll__panel:hover { border-color: var(--line-strong); }
.hscroll__panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 32px 32px,
              linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 32px 32px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.hscroll__num { font-family: var(--font-display); font-weight: 300; font-size: clamp(110px, 12vw, 180px); line-height: .8; position: relative; }
.hscroll__panel h3 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 300; margin: 0 0 10px; }
.hscroll__panel p { margin: 0; font-size: 15px; }
.hscroll__panel .card__icon { margin: 0; position: absolute; top: 36px; right: 36px; }
.hscroll__bar { margin: 48px var(--gutter) 0; height: 1px; background: var(--line); position: relative; }
.hscroll__bar span { position: absolute; inset: 0; background: #fff; box-shadow: var(--glow); transform-origin: 0 50%; transform: scaleX(var(--hp, 0)); }
@media (max-width: 860px) {
  .hscroll { height: auto !important; }
  .hscroll__sticky { position: static; height: auto; padding: 100px 0; }
  .hscroll__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; transform: none !important; padding-bottom: 12px; scrollbar-width: none; }
  .hscroll__track::-webkit-scrollbar { display: none; }
  .hscroll__panel, .hscroll__intro { scroll-snap-align: start; }
  .hscroll__intro { width: 85vw; }
  .hscroll__bar { display: none; }
}

/* ---------- Sprachen ---------- */
html.i18n-pending body { visibility: hidden; animation: i18nFailsafe 0s 2s forwards; }
@keyframes i18nFailsafe { to { visibility: visible; } }

.lang-switch button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin: 0 4px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--faint);
  transition: border-color .3s;
}
.lang-switch button:hover { border-color: #fff; }
.lang-switch i { width: 1px; height: 12px; background: var(--line-strong); }
.lang-switch span { transition: color .3s; }
.lang-switch span.is-on { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,.6); }
@media (max-width: 860px) { .lang-switch button { height: 44px; padding: 0 18px; font-size: 13px; margin-top: 8px; } }

.lang-gate {
  position: fixed; inset: 0; z-index: 165; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
    #000;
  transition: opacity .8s var(--ease), transform .9s var(--ease), filter .8s;
}
.lang-gate.is-closing { opacity: 0; transform: scale(1.06); filter: blur(6px); pointer-events: none; }
.lang-gate__inner { display: grid; justify-items: center; text-align: center; gap: 28px; }
.lang-gate__logo { width: min(300px, 64vw); filter: drop-shadow(0 0 20px rgba(255,255,255,.3)); animation: heroIn 1.4s var(--ease) both; }
.lang-gate__title {
  margin: 0; color: var(--text); font-family: var(--font-mono); font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  animation: fadeUp 1s var(--ease) .4s both;
}
.lang-gate__title span { color: var(--faint); margin: 0 8px; }
.lang-gate__options { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.lang-gate__options button {
  position: relative; overflow: hidden; isolation: isolate;
  width: 190px; height: 170px; border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong); background: rgba(13,13,17,.8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .35s, transform .5s var(--ease), box-shadow .35s, color .35s;
  animation: fadeUp 1s var(--ease) both;
}
.lang-gate__options button:nth-child(1) { animation-delay: .55s; }
.lang-gate__options button:nth-child(2) { animation-delay: .65s; }
.lang-gate__options button::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: #fff;
  transform: translateY(101%); transition: transform .5s var(--ease);
}
.lang-gate__options b {
  font-family: var(--font-display); font-weight: 300; font-size: 64px; line-height: 1; letter-spacing: .04em;
  color: #050507; -webkit-text-stroke: 1.6px #fff; paint-order: stroke fill; transition: color .35s, -webkit-text-stroke-color .35s;
}
.lang-gate__options span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); transition: color .35s; }
.lang-gate__options button:hover, .lang-gate__options button:focus-visible { border-color: #fff; transform: translateY(-6px); box-shadow: var(--glow); outline: none; }
.lang-gate__options button.is-suggested { border-color: rgba(255,255,255,.5); }
.lang-gate__options button.is-picked::before { transform: none; }
.lang-gate__options button.is-picked b { color: #000; -webkit-text-stroke-color: #000; }
.lang-gate__options button.is-picked span { color: #000; }
.lang-gate.is-chosen button:not(.is-picked) { opacity: .3; }
.lang-gate small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--faint); text-transform: uppercase; animation: fadeUp 1s var(--ease) .8s both; }
@media (max-width: 480px) { .lang-gate__options button { width: 140px; height: 140px; } .lang-gate__options b { font-size: 48px; } }

/* ---------- Marquee (JS-gesteuert) ---------- */
.marquee.is-js .marquee__track { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .w__i { transform: none; }
  .reveal-clip { clip-path: none; }
}
