/* ============================================
   TKS QR — Capas 3D + profundidad (Void Club Electric)
   Inspiración: Guestii door ops HUD, NeonTech glass panels,
   Discotext high-contrast nightlife UI. Sin assets de terceros.
   ============================================ */

@property --tilt-x {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

@property --tilt-y {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

@property --shine-x {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 50%;
}

@property --shine-y {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 40%;
}

:root {
    --depth-1: 0 2px 4px rgba(0, 0, 0, 0.3);
    --depth-2: 0 12px 32px rgba(0, 0, 0, 0.4);
    --depth-3: 0 28px 64px rgba(0, 0, 0, 0.5);
    --depth-4: 0 44px 96px rgba(0, 0, 0, 0.6);
    --glow-cyan: 0 0 32px rgba(0, 232, 255, 0.26);
    --glow-magenta: 0 0 28px rgba(255, 61, 154, 0.16);
    --glow-lime: 0 0 24px rgba(184, 255, 60, 0.18);
    --ease-out-expo: linear(0, 0.2178 2.1%, 1.1144 8.49%, 1.2959 10.7%, 1.3463 11.81%, 1.3705 12.92%, 1.3726 13.72%, 1.3643 14.71%, 1.3151 17.21%, 1.0317 28.93%, 0.957 33.48%, 0.9247 36.88%, 0.917 39.28%, 0.9229 41.68%, 0.9949 49.59%, 1.0115 53.1%, 1.0175 56.7%, 1.0004 75.2%, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---------- Scene / perspective helpers ---------- */
.scene-3d {
    perspective: 1400px;
    perspective-origin: 50% 40%;
    transform-style: preserve-3d;
}

.tilt-3d {
    --tilt-x: 0;
    --tilt-y: 0;
    --shine-x: 50%;
    --shine-y: 40%;
    transform-style: preserve-3d;
    transform:
        rotateX(calc(var(--tilt-x) * 1deg))
        rotateY(calc(var(--tilt-y) * 1deg))
        translateZ(0);
    transition: transform 0.5s var(--ease-out-expo);
    will-change: transform;
}

.tilt-3d.is-tilting {
    transition: transform 0.07s linear;
}

.tilt-3d::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(
            520px circle at var(--shine-x) var(--shine-y),
            rgba(0, 232, 255, 0.22),
            transparent 40%
        ),
        radial-gradient(
            280px circle at calc(var(--shine-x) + 12%) calc(var(--shine-y) + 18%),
            rgba(255, 61, 154, 0.08),
            transparent 45%
        );
    opacity: 0;
    transition: opacity 0.35s ease;
    mix-blend-mode: soft-light;
    z-index: 4;
}

.tilt-3d.is-tilting::after,
.tilt-3d:hover::after {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .tilt-3d,
    .ticket-3d,
    .hero-media,
    .hero-orb,
    .float-y,
    .section-mesh {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* ---------- Atmospheric mesh / grid overlays ---------- */
.section-paper::before,
.section-alt::before,
.section-ink::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    background-image:
        linear-gradient(rgba(0, 232, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 232, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 18%, transparent 75%);
    z-index: 0;
}

/* Soft scanline wash over sections (desktop) */
.section-ink::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(0, 232, 255, 0.12) 3px,
        rgba(0, 232, 255, 0.12) 4px
    );
    mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

.section > .site-wrap {
    position: relative;
    z-index: 1;
}

.section-paper::after,
.section-alt::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        url("https://images.unsplash.com/photo-1492684223066-81342ee5ff30?auto=format&fit=crop&w=1600&q=60") center/cover no-repeat;
    opacity: 0.045;
    mix-blend-mode: luminosity;
    z-index: 0;
}

/* ---------- Hero depth layers ---------- */
.hero {
    isolation: isolate;
}

.hero-media {
    transform-origin: 60% 40%;
    will-change: transform;
}

.hero-depth {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    transform-style: preserve-3d;
    perspective: 1200px;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: orbDrift 12s ease-in-out infinite alternate;
}

.hero-orb-a {
    width: min(42vw, 420px);
    height: min(42vw, 420px);
    right: 8%;
    top: 18%;
    background: radial-gradient(circle, rgba(0, 232, 255, 0.4), transparent 68%);
}

.hero-orb-b {
    width: min(28vw, 280px);
    height: min(28vw, 280px);
    left: 12%;
    bottom: 16%;
    background: radial-gradient(circle, rgba(255, 61, 154, 0.28), transparent 70%);
    animation-delay: -4s;
}

.hero-orb-c {
    width: min(20vw, 180px);
    height: min(20vw, 180px);
    right: 28%;
    bottom: 28%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
    animation-delay: -7s;
    opacity: 0.4;
}

@keyframes orbDrift {
    from { transform: translate3d(0, 0, 40px) scale(1); }
    to { transform: translate3d(24px, -30px, 80px) scale(1.08); }
}

.hero-content {
    transform: translateZ(60px);
    text-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.hero-brand {
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.4));
}

.hero-brand .qr {
    display: inline-block;
    transform: translateZ(24px);
    text-shadow:
        0 0 24px rgba(0, 232, 255, 0.55),
        0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Floor / horizon glow under hero */
.hero::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -8%;
    height: 28%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 232, 255, 0.16), transparent 70%);
    filter: blur(20px);
}

/* ---------- Buttons with tangible press ---------- */
.btn {
    position: relative;
    transform: translateZ(0);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 10px 24px rgba(0, 0, 0, 0.28);
}

.btn-primary {
    background: linear-gradient(165deg, #5ef0ff 0%, #00e8ff 55%, #00a8c4 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.38) inset,
        0 8px 26px rgba(0, 232, 255, 0.4),
        0 0 40px rgba(0, 232, 255, 0.18),
        0 2px 0 rgba(0, 100, 130, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.015);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 16px 36px rgba(0, 232, 255, 0.48),
        0 0 48px rgba(0, 232, 255, 0.28),
        0 2px 0 rgba(0, 100, 130, 0.3);
}

.btn-primary:active {
    transform: translateY(0) scale(0.99);
}

.btn-ghost {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 10px 28px rgba(0, 0, 0, 0.28),
        var(--glow-cyan);
}

.btn-dark {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 12px 28px rgba(0, 0, 0, 0.35);
}

/* ---------- Feature cards 3D ---------- */
.feature-grid {
    perspective: 1600px;
}

.feature-box {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(165deg, rgba(18, 24, 34, 0.78), rgba(6, 8, 12, 0.9));
    border: 1px solid rgba(0, 232, 255, 0.14);
    box-shadow: var(--depth-2);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    transform-style: preserve-3d;
    transition:
        transform 0.5s var(--ease-out-expo),
        box-shadow 0.5s var(--ease),
        border-color 0.35s ease;
}

.feature-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(0, 232, 255, 0.08), transparent 45%);
    opacity: 0.7;
    pointer-events: none;
}

.feature-box > * {
    position: relative;
    z-index: 1;
    transform: translateZ(28px);
}

.feature-box:hover {
    box-shadow: var(--depth-4), var(--glow-cyan);
    border-color: rgba(0, 232, 255, 0.4);
}

.feature-box-icon {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 10px 20px rgba(0, 0, 0, 0.35),
        0 0 16px rgba(0, 232, 255, 0.15);
    transform: translateZ(40px);
}

/* ---------- Split frame 3D ---------- */
.split-visual {
    perspective: 1200px;
}

.split-visual-frame {
    position: relative;
    transform:
        rotateY(-8deg)
        rotateX(4deg)
        translateZ(0);
    transform-style: preserve-3d;
    box-shadow:
        20px 30px 60px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(0, 232, 255, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
    transition: transform 0.6s var(--ease-out-expo);
}

.split-visual:hover .split-visual-frame {
    transform: rotateY(-2deg) rotateX(1deg) translateZ(12px);
}

.split-badge {
    transform: translateZ(50px);
    box-shadow: var(--depth-3), 0 0 20px rgba(0, 232, 255, 0.12);
    backdrop-filter: blur(14px) saturate(1.2);
}

/* ---------- Ticket 3D physical card ---------- */
.ticket-float {
    perspective: 1100px;
    transform-style: preserve-3d;
}

.ticket-3d {
    position: relative;
    width: min(280px, 78%);
    aspect-ratio: 420 / 640;
    transform-style: preserve-3d;
    transform: rotateY(-18deg) rotateX(8deg);
    cursor: grab;
}

.ticket-3d:active { cursor: grabbing; }

.ticket-face {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background:
        linear-gradient(155deg, #141c28 0%, #080c12 45%, #0e141c 100%);
    border: 1px solid rgba(0, 232, 255, 0.45);
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 30px 70px rgba(0, 0, 0, 0.6),
        0 0 42px rgba(0, 232, 255, 0.2);
    backface-visibility: hidden;
    transform: translateZ(10px);
}

.ticket-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ticket-edge {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 100%;
    width: 14px;
    background: linear-gradient(90deg, #1a2830, #0c1418);
    transform-origin: left center;
    transform: rotateY(90deg);
    border-radius: 0 4px 4px 0;
}

.ticket-shadow {
    position: absolute;
    left: 12%;
    right: 8%;
    bottom: -18%;
    height: 28%;
    background: radial-gradient(ellipse at center, rgba(0, 232, 255, 0.18), transparent 70%);
    filter: blur(18px);
    transform: translateZ(-40px) rotateX(90deg);
    pointer-events: none;
}

/* ---------- Type chips / plan panels ---------- */
.type-chip {
    backdrop-filter: blur(12px);
    background: linear-gradient(145deg, rgba(0, 232, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 12px 28px rgba(0, 0, 0, 0.28);
    transform: translateZ(0);
    transition: transform 0.35s var(--ease), background 0.35s ease, border-color 0.35s ease;
}

.type-chip:hover {
    transform: translateY(-4px) translateZ(12px);
    border-color: rgba(0, 232, 255, 0.35);
    background: linear-gradient(145deg, rgba(0, 232, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.plan-panel {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    box-shadow: var(--depth-3), var(--glow-cyan);
    background:
        linear-gradient(165deg, #121a24 0%, #080c12 100%);
}

.plan-panel::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto;
    height: 70%;
    background: radial-gradient(circle at 70% 0%, rgba(0, 232, 255, 0.2), transparent 55%);
    pointer-events: none;
}

.plan-panel > * { position: relative; z-index: 1; }

.plan-panel-dark {
    background:
        linear-gradient(165deg, #1c2634 0%, #0e1218 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        var(--depth-4),
        var(--glow-cyan);
}

/* ---------- Auth glass + depth ---------- */
.auth-panel {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    background: linear-gradient(165deg, rgba(14, 20, 28, 0.78), rgba(5, 7, 12, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 28px 70px rgba(0, 0, 0, 0.55),
        0 0 56px rgba(0, 232, 255, 0.12);
    transform: translateZ(0);
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 40%;
    background: radial-gradient(ellipse at 50% 0%, rgba(0, 232, 255, 0.12), transparent 70%);
    pointer-events: none;
}

.auth-panel.tilt-3d::after {
    border-radius: inherit;
}

.auth-visual-copy {
    transform: translateZ(40px);
    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.auth-form-side {
    perspective: 1000px;
    position: relative;
}

.auth-form-side::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        url("https://images.unsplash.com/photo-1470229722913-7c0e2dbbafd3?auto=format&fit=crop&w=1200&q=50") center/cover no-repeat;
    opacity: 0.07;
    mix-blend-mode: luminosity;
    pointer-events: none;
}

/* ---------- Header glass elevation ---------- */
.site-header {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0);
    transition: background 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.is-scrolled {
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 232, 255, 0.06);
}

.site-nav-cta {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25) inset,
        0 8px 18px rgba(0, 232, 255, 0.3);
}

/* ---------- Scroll reveal with depth ---------- */
.reveal {
    opacity: 0;
    transform: translate3d(0, 40px, -40px) rotateX(6deg);
    transform-origin: center bottom;
    transition:
        opacity 0.85s var(--ease-out-expo),
        transform 0.85s var(--ease-out-expo);
    transform-style: preserve-3d;
}

.reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg);
}

@supports (animation-timeline: view()) {
    .reveal-scroll {
        animation: revealView linear both;
        animation-timeline: view();
        animation-range: entry 10% cover 30%;
    }

    @keyframes revealView {
        from {
            opacity: 0;
            transform: translate3d(0, 36px, -30px);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }
}

/* ---------- Page hero depth ---------- */
.page-hero {
    isolation: isolate;
}

.page-hero-media {
    transform: scale(1.05);
    will-change: transform;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(to top, var(--ink), transparent);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Noise grain (subtle film) ---------- */
.page-home::before,
.page-auth::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* ---------- Mobile 3D soften / performance ---------- */
@media (max-width: 900px) {
    .ticket-3d {
        transform: rotateY(-8deg) rotateX(4deg);
    }

    .split-visual-frame {
        transform: none;
    }

    .feature-box > * {
        transform: none;
    }

    .feature-box,
    .auth-panel {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .section-paper::after,
    .section-alt::after {
        opacity: 0.05;
    }

    .section-ink::after {
        opacity: 0.02;
    }
}

@media (max-width: 768px) {
    .tilt-3d::after { display: none; }

    .hero::after {
        height: 22%;
        opacity: 0.75;
    }

    .hero-orb {
        filter: blur(28px);
        opacity: 0.45;
        animation: none;
    }

    .auth-form-side::before {
        opacity: 0.08;
    }

    .page-home::before,
    .page-auth::before {
        opacity: 0.025;
    }

    .section-paper::before,
    .section-alt::before,
    .section-ink::before {
        opacity: 0.22;
        background-size: 72px 72px;
    }
}

@media (hover: none) {
    .feature-box:hover,
    .type-chip:hover,
    .split-visual:hover .split-visual-frame {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .section-ink::after {
        opacity: 0;
    }
}
