/* ==========================================================================
   PEXUSCODE /playground – bewusst überladenes Showcase-Stylesheet
   Jeder Effekt ist als eigener Block kommentiert und einzeln herauslösbar.
   ========================================================================== */

:root {
    --pg-bg: #0b0e17;
    --pg-bg-2: #111527;
    --pg-text: #eef2ff;
    --pg-muted: #8b93b8;
    --pg-accent: #3b82f6;        /* PexusCode-Blau */
    --pg-accent-2: #a855f7;      /* Violett für Verläufe */
    --pg-accent-3: #22d3ee;      /* Cyan für Verläufe */
    --pg-card: rgba(255, 255, 255, 0.04);
    --pg-border: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--pg-bg);
    color: var(--pg-text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
    /* Eigener Cursor ist aktiv -> Systemcursor ausblenden (nur Desktop, s. Media Query unten) */
    cursor: none;
}

a { color: inherit; }
code { background: rgba(255,255,255,.08); padding: .1em .4em; border-radius: 4px; font-size: .9em; }

/* --------------------------------------------------------------------------
   EFFEKT: Canvas-Ebenen (Partikel-Netz-Hintergrund + FX-Ebene für
   Cursor-Trail & Klick-Explosionen). Fixed & pointer-events: none,
   damit sie nie Interaktionen blockieren.
   -------------------------------------------------------------------------- */
#bgCanvas, #fxCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#bgCanvas { z-index: 0; }
#fxCanvas { z-index: 60; } /* über dem Content, unter dem Cursor */

/* --------------------------------------------------------------------------
   EFFEKT: Animierter Mesh-Gradient-Hintergrund
   Mehrere radiale Verläufe, die langsam wandern (nur transform/opacity ->
   GPU-freundlich). Liegt hinter dem Partikelnetz.
   -------------------------------------------------------------------------- */
.mesh-bg {
    position: fixed;
    inset: -20%;
    z-index: -1;
    background:
        radial-gradient(40% 40% at 20% 30%, rgba(59, 130, 246, 0.25), transparent 70%),
        radial-gradient(35% 35% at 80% 20%, rgba(168, 85, 247, 0.2), transparent 70%),
        radial-gradient(45% 45% at 60% 80%, rgba(34, 211, 238, 0.15), transparent 70%);
    animation: meshDrift 24s ease-in-out infinite alternate;
    filter: blur(40px);
}
@keyframes meshDrift {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
    50%  { transform: translate(4%, -3%) rotate(4deg) scale(1.08); }
    100% { transform: translate(-4%, 3%) rotate(-4deg) scale(1.02); }
}

/* --------------------------------------------------------------------------
   EFFEKT: Individueller Cursor
   Kleiner Punkt folgt sofort, der Ring zieht weich hinterher (JS lerpt die
   Position). .cursor-hover wird per JS gesetzt, wenn ein interaktives
   Element unter der Maus liegt.
   -------------------------------------------------------------------------- */
.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.cursor-dot {
    width: 8px; height: 8px;
    background: var(--pg-accent);
    box-shadow: 0 0 12px var(--pg-accent);
}
.cursor-ring {
    width: 36px; height: 36px;
    border: 1.5px solid rgba(59, 130, 246, 0.7);
    transition: width .25s ease, height .25s ease, border-color .25s ease, background .25s ease;
}
.cursor-ring.cursor-hover {
    width: 56px; height: 56px;
    border-color: var(--pg-accent-3);
    background: rgba(34, 211, 238, 0.08);
}

/* --------------------------------------------------------------------------
   EFFEKT: Scroll-Fortschrittsbalken (Breite wird per JS gesetzt)
   -------------------------------------------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    z-index: 90;
    background: linear-gradient(90deg, var(--pg-accent), var(--pg-accent-2), var(--pg-accent-3));
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.pg-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 80;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .8rem 1.5rem;
    backdrop-filter: blur(12px);
    background: rgba(11, 14, 23, 0.6);
    border-bottom: 1px solid var(--pg-border);
}
.pg-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; }
.pg-logo img { height: 38px; }
.pg-logo em { color: var(--pg-accent); font-style: normal; font-weight: 400; }
.pg-header-right { display: flex; align-items: center; gap: .8rem; }
.pg-badge {
    font-size: .75rem;
    padding: .3rem .7rem;
    border: 1px solid var(--pg-border);
    border-radius: 999px;
    color: var(--pg-muted);
}
.pg-icon-btn {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--pg-border);
    background: var(--pg-card);
    color: var(--pg-text);
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
/* EFFEKT: Micro-Interaction – Buttons wachsen & glühen beim Hover */
.pg-icon-btn:hover {
    border-color: var(--pg-accent);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
    transform: scale(1.1);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 7rem 1.5rem 4rem;
    overflow: hidden;
}
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-kicker {
    letter-spacing: .35em;
    text-transform: uppercase;
    font-size: .85rem;
    color: var(--pg-accent-3);
    margin-bottom: 1rem;
}
.hero-sub { font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 600; margin-top: 1.5rem; }
.hero-note { color: var(--pg-muted); margin-top: 1rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2.5rem; }

/* --------------------------------------------------------------------------
   EFFEKT: Parallax-Ebenen mit schwebenden Deko-Formen
   Position der Ebene steuert JS über --px/--py (Maus) + Scroll-Offset.
   Die Formen selbst schweben zusätzlich per CSS-Keyframes.
   -------------------------------------------------------------------------- */
.parallax-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform: translate(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px));
    will-change: transform;
}
.float-shape {
    position: absolute;
    display: grid; place-items: center;
    opacity: .5;
    animation: floatY 6s ease-in-out infinite alternate;
}
@keyframes floatY {
    from { transform: translateY(-14px) rotate(-4deg); }
    to   { transform: translateY(14px) rotate(6deg); }
}
.shape-ring   { top: 18%; left: 10%; width: 90px; height: 90px; border: 3px solid var(--pg-accent); border-radius: 50%; }
.shape-blob   { bottom: 20%; right: 8%; width: 140px; height: 140px; background: radial-gradient(circle, rgba(168,85,247,.5), transparent 70%); border-radius: 50%; animation-duration: 8s; }
.shape-square { top: 25%; right: 18%; width: 46px; height: 46px; border: 3px solid var(--pg-accent-3); transform: rotate(20deg); animation-duration: 7s; }
.shape-triangle { bottom: 28%; left: 16%; width: 0; height: 0; border-left: 26px solid transparent; border-right: 26px solid transparent; border-bottom: 44px solid rgba(59,130,246,.6); animation-duration: 5s; }
.shape-cross  { top: 60%; left: 6%; font-size: 3rem; color: var(--pg-accent-2); font-weight: 200; }
.shape-dot    { top: 12%; left: 55%; width: 14px; height: 14px; background: var(--pg-accent-3); border-radius: 50%; box-shadow: 0 0 20px var(--pg-accent-3); }

/* --------------------------------------------------------------------------
   EFFEKT: Glitch-Text
   Zwei Kopien der Headline (::before/::after) werden farbversetzt und per
   clip-path in Streifen zerhackt – läuft in Intervallen, nicht permanent.
   -------------------------------------------------------------------------- */
.glitch {
    position: relative;
    font-size: clamp(2.2rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.05;
}
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: .8;
}
.glitch::before {
    color: var(--pg-accent-3);
    animation: glitchShift 3s infinite steps(1);
}
.glitch::after {
    color: var(--pg-accent-2);
    animation: glitchShift 3s infinite steps(1) reverse;
}
@keyframes glitchShift {
    0%, 86%, 100% { transform: none; clip-path: none; opacity: 0; }
    88% { transform: translate(-4px, 2px); clip-path: inset(10% 0 60% 0); opacity: .8; }
    91% { transform: translate(4px, -2px);  clip-path: inset(55% 0 15% 0); opacity: .8; }
    94% { transform: translate(-2px, 1px);  clip-path: inset(30% 0 40% 0); opacity: .8; }
    97% { transform: translate(3px, -1px);  clip-path: inset(70% 0 5% 0);  opacity: .8; }
}

/* --------------------------------------------------------------------------
   EFFEKT: Animierter Gradient-Text
   Verlauf ist breiter als der Text und wandert per background-position.
   -------------------------------------------------------------------------- */
.gradient-text {
    background: linear-gradient(90deg, var(--pg-accent), var(--pg-accent-2), var(--pg-accent-3), var(--pg-accent));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientSlide 6s linear infinite;
}
@keyframes gradientSlide {
    to { background-position: 300% 0; }
}

/* --------------------------------------------------------------------------
   EFFEKT: Buttons – Glow, Shine-Sweep, Puls
   .magnetic wird zusätzlich per JS zur Maus hingezogen.
   -------------------------------------------------------------------------- */
.btn-wild, .btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .3s ease;
}
.btn-wild {
    background: linear-gradient(135deg, var(--pg-accent), var(--pg-accent-2));
    color: #fff;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.45);
}
.btn-wild:hover { box-shadow: 0 0 42px rgba(168, 85, 247, 0.7); }
/* Shine-Sweep: heller Streifen läuft beim Hover über den Button */
.btn-wild::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,.5), transparent);
    transform: skewX(-20deg);
    transition: left .5s ease;
}
.btn-wild:hover::after { left: 130%; }
.btn-ghost {
    border: 1px solid var(--pg-border);
    color: var(--pg-muted);
}
.btn-ghost:hover { border-color: var(--pg-accent); color: var(--pg-text); }
/* Dauerhafter Puls für den finalen CTA */
.pulse { animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
    50%      { box-shadow: 0 0 55px rgba(168, 85, 247, 0.85); }
}

/* --------------------------------------------------------------------------
   EFFEKT: Scroll-Hinweis (animiertes Maus-Icon, reines CSS)
   -------------------------------------------------------------------------- */
.scroll-hint {
    position: absolute;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 42px;
    border: 2px solid var(--pg-muted);
    border-radius: 14px;
}
.scroll-hint span {
    position: absolute;
    top: 7px; left: 50%;
    width: 4px; height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--pg-accent);
    animation: scrollWheel 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
    0%   { transform: translateY(0); opacity: 1; }
    70%  { transform: translateY(14px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* --------------------------------------------------------------------------
   EFFEKT: Endlos-Marquee (Track ist doppelt befüllt und wird um 50% bewegt)
   -------------------------------------------------------------------------- */
.marquee {
    overflow: hidden;
    border-top: 1px solid var(--pg-border);
    border-bottom: 1px solid var(--pg-border);
    padding: 1rem 0;
    background: rgba(255,255,255,.02);
    position: relative;
    z-index: 2;
}
.marquee-track {
    display: flex;
    width: max-content;
    white-space: nowrap;
    font-weight: 800;
    letter-spacing: .15em;
    color: var(--pg-muted);
    animation: marqueeMove 22s linear infinite;
}
@keyframes marqueeMove {
    to { transform: translateX(-50%); }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 7rem 1.5rem;
}
.section-title { font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 900; text-align: center; }
.section-sub { text-align: center; color: var(--pg-muted); margin: 1rem auto 3.5rem; max-width: 600px; }

/* --------------------------------------------------------------------------
   EFFEKT: Scroll-Reveals
   .reveal startet unsichtbar; JS fügt .in hinzu, sobald das Element im
   Viewport ist. data-reveal steuert die Richtung/Art, --d den Delay.
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transition: opacity .8s ease var(--d, 0s), transform .8s cubic-bezier(.2, .8, .2, 1) var(--d, 0s);
    will-change: transform, opacity;
}
.reveal[data-reveal="up"]    { transform: translateY(50px); }
.reveal[data-reveal="left"]  { transform: translateX(-70px) rotate(-2deg); }
.reveal[data-reveal="right"] { transform: translateX(70px) rotate(2deg); }
.reveal[data-reveal="pop"]   { transform: scale(.6) rotate(-4deg); }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   EFFEKT: 3D-Tilt-Cards mit wanderndem Glow
   JS setzt --rx/--ry (Rotation) und --gx/--gy (Glow-Position) je nach Maus.
   -------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    perspective: 1000px; /* nötig für den 3D-Effekt der Kinder */
}
.tilt-card {
    position: relative;
    border-radius: 18px;
    border: 1px solid var(--pg-border);
    background: var(--pg-card);
    transform-style: preserve-3d;
    transform: rotateX(calc(var(--rx, 0) * 1deg)) rotateY(calc(var(--ry, 0) * 1deg));
    transition: transform .15s ease, border-color .3s ease;
}
.tilt-card:hover { border-color: rgba(59, 130, 246, 0.6); }
/* Glow-Punkt, der der Maus über die Karte folgt */
.tilt-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%), rgba(59, 130, 246, 0.25), transparent 65%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.tilt-card:hover::before { opacity: 1; }
.tilt-inner {
    padding: 2rem;
    transform: translateZ(30px); /* Inhalt schwebt vor der Karte */
}
.card-icon {
    font-size: 1.8rem;
    color: var(--pg-accent);
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform .3s ease, color .3s ease;
}
/* EFFEKT: Micro-Interaction – Icon dreht & färbt sich beim Card-Hover */
.tilt-card:hover .card-icon { transform: rotate(-12deg) scale(1.25); color: var(--pg-accent-3); }
.tilt-inner h3 { margin-bottom: .6rem; }
.tilt-inner p { color: var(--pg-muted); line-height: 1.6; }

/* ==========================================================================
   STATS – Counter
   ========================================================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}
.stat-num {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--pg-accent), var(--pg-accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-label { color: var(--pg-muted); }

/* ==========================================================================
   KETTENREAKTION
   ========================================================================== */
.chain { list-style: none; max-width: 620px; margin: 0 auto; display: grid; gap: 1rem; }
.chain-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--pg-border);
    border-radius: 14px;
    background: var(--pg-card);
    font-weight: 600;
    transition: border-color .3s ease, transform .3s ease;
}
.chain-step:hover { border-color: var(--pg-accent); transform: translateX(8px); }
.chain-step span {
    display: grid; place-items: center;
    min-width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pg-accent), var(--pg-accent-2));
    font-weight: 800;
}

/* ==========================================================================
   FINALER CTA & FOOTER
   ========================================================================== */
.cta-final { text-align: center; }
.cta-final p { color: var(--pg-muted); margin-top: 1.2rem; }

.pg-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--pg-muted);
    border-top: 1px solid var(--pg-border);
    font-size: .9rem;
}
.pg-footer a { color: var(--pg-accent); }
.pg-footer-hint { opacity: .25; margin-top: .5rem; font-size: .75rem; }

/* ==========================================================================
   EFFEKT: Easter Egg – Party-Mode (Konami-Code)
   JS setzt body.party – dann dreht sich der Farbton der ganzen Seite
   und alle Karten wackeln.
   ========================================================================== */
body.party { animation: hueSpin 3s linear infinite; }
@keyframes hueSpin { to { filter: hue-rotate(360deg); } }
body.party .tilt-card { animation: wiggle .4s ease-in-out infinite alternate; }
@keyframes wiggle {
    from { transform: rotate(-1.5deg) scale(1.01); }
    to   { transform: rotate(1.5deg) scale(.99); }
}

/* ==========================================================================
   ZUGÄNGLICHKEIT & MOBILE
   ========================================================================== */
/* Auf Touch-Geräten: Systemcursor lassen, Custom-Cursor ausblenden */
@media (hover: none), (pointer: coarse) {
    body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
}
@media (max-width: 640px) {
    .pg-badge { display: none; }
}
/* Nutzer mit Bewegungsempfindlichkeit: alles Wesentliche abschalten */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    #bgCanvas, #fxCanvas { display: none; }
}
