/* ── Base & Smooth Scroll ─────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    background-color: #020617;
    color: #dae2fd;
    font-family: 'Geist', sans-serif;
    overflow-x: hidden;
    position: relative;
    cursor: default;
}

/* ══════════════════════════════════════════════════════════════════
   EPIC LOADING SCREEN (OPTIMIZED FOR PERFORMANCE)
══════════════════════════════════════════════════════════════════ */

/* Add hardware acceleration */
.ls-bg,
.ls-grid,
.ls-shockwave,
.ls-scan-beam,
.ls-shard,
.ls-orbit-ring,
.ls-logo-wrap,
.ls-title,
.ls-bar-fill,
.ls-bar-spark {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* ── Background ── */
.ls-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(128, 131, 255, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(162, 0, 255, 0.1) 0%, transparent 70%),
        #020617;
    animation: ls-bg-pulse 4s ease-in-out infinite alternate;
}

@keyframes ls-bg-pulse {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

/* ── Perspective grid ── */
.ls-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(128, 131, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 131, 255, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(600px) rotateX(30deg) scale(1.8) translateY(15%);
    transform-origin: bottom center;
    /* Removed heavy mask-image for better performance */
    background-position: 0 0;
    animation: ls-grid-scroll 8s linear infinite;
}

@keyframes ls-grid-scroll {
    0% {
        transform: perspective(600px) rotateX(30deg) scale(1.8) translateY(15%) translateY(0);
    }

    100% {
        transform: perspective(600px) rotateX(30deg) scale(1.8) translateY(15%) translateY(60px);
    }
}

/* ── Shockwave rings ── */
.ls-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    /* Fixed size */
    height: 700px;
    margin-top: -350px;
    margin-left: -350px;
    border-radius: 50%;
    border: 2px solid rgba(128, 131, 255, 0.7);
    animation: ls-shockwave 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    opacity: 0;
    transform: scale(0);
}

@keyframes ls-shockwave {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    70% {
        opacity: 0.2;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ── Scanning horizontal beam ── */
.ls-scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    top: 0;
    background: linear-gradient(to right, transparent, rgba(128, 131, 255, 0.7), rgba(162, 0, 255, 0.7), transparent);
    box-shadow: 0 0 10px rgba(128, 131, 255, 0.4);
    animation: ls-scan 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    opacity: 0;
}

@keyframes ls-scan {
    0% {
        transform: translateY(-4px);
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    95% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* ── Corner HUD brackets ── */
.ls-hud {
    position: absolute;
    width: 40px;
    height: 40px;
    animation: ls-hud-appear 0.8s ease forwards;
    opacity: 0;
}

.ls-hud-tl {
    top: 15px;
    left: 15px;
    animation-delay: 0.3s;
}

.ls-hud-tr {
    top: 15px;
    right: 15px;
    animation-delay: 0.5s;
}

.ls-hud-bl {
    bottom: 15px;
    left: 15px;
    animation-delay: 0.7s;
}

.ls-hud-br {
    bottom: 15px;
    right: 15px;
    animation-delay: 0.9s;
}

.ls-hud span {
    position: absolute;
    background: rgba(128, 131, 255, 0.6);
}

.ls-hud span:nth-child(1) {
    width: 100%;
    height: 2px;
    top: 0;
    left: 0;
}

.ls-hud span:nth-child(2) {
    width: 2px;
    height: 100%;
    top: 0;
    left: 0;
}

.ls-hud-tr span:nth-child(2) {
    left: auto;
    right: 0;
}

.ls-hud-bl span:nth-child(1) {
    top: auto;
    bottom: 0;
}

.ls-hud-br span:nth-child(1) {
    top: auto;
    bottom: 0;
}

.ls-hud-br span:nth-child(2) {
    left: auto;
    right: 0;
}

@keyframes ls-hud-appear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Energy shards ── */
.ls-shard {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    /* Slightly smaller */
    height: 8px;
    border-radius: 3px;
    transform-origin: center;
}

.ls-shard-1 {
    background: linear-gradient(135deg, #8083ff, #c084fc);
    animation: ls-fly-1 1.2s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-1 4s 1.4s linear infinite;
}

.ls-shard-2 {
    background: linear-gradient(135deg, #c084fc, #38bdf8);
    animation: ls-fly-2 1.2s 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-2 4s 1.5s linear infinite;
    width: 6px;
    height: 6px;
}

.ls-shard-3 {
    background: linear-gradient(135deg, #38bdf8, #8083ff);
    animation: ls-fly-3 1.2s 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-3 4s 1.6s linear infinite;
}

.ls-shard-4 {
    background: linear-gradient(135deg, #f472b6, #8083ff);
    animation: ls-fly-4 1.2s 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-4 4s 1.7s linear infinite;
    width: 5px;
    height: 10px;
}

.ls-shard-5 {
    background: linear-gradient(135deg, #8083ff, #34d399);
    animation: ls-fly-5 1.2s 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-5 5s 1.45s linear infinite;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.ls-shard-6 {
    background: linear-gradient(135deg, #fbbf24, #f472b6);
    animation: ls-fly-6 1.2s 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-6 5s 1.55s linear infinite;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.ls-shard-7 {
    background: linear-gradient(135deg, #c084fc, #38bdf8);
    animation: ls-fly-7 1.2s 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-7 6s 1.8s linear infinite;
    width: 5px;
    height: 12px;
}

.ls-shard-8 {
    background: linear-gradient(135deg, #8083ff, #f472b6);
    animation: ls-fly-8 1.2s 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards, ls-orbit-8 6s 1.65s linear infinite;
    width: 10px;
    height: 5px;
}

/* Fly-in */
@keyframes ls-fly-1 {
    from {
        transform: translate(-50vw, -50vh) rotate(-45deg) scale(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes ls-fly-2 {
    from {
        transform: translate(60vw, -45vh) rotate(60deg) scale(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes ls-fly-3 {
    from {
        transform: translate(-50vw, 50vh) rotate(120deg) scale(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes ls-fly-4 {
    from {
        transform: translate(55vw, 50vh) rotate(-60deg) scale(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes ls-fly-5 {
    from {
        transform: translate(0vw, -60vh) scale(0);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes ls-fly-6 {
    from {
        transform: translate(0vw, 60vh) scale(0);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes ls-fly-7 {
    from {
        transform: translate(-60vw, 0vh) rotate(90deg) scale(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

@keyframes ls-fly-8 {
    from {
        transform: translate(60vw, 0vh) rotate(-90deg) scale(0);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
}

/* Orbit */
@keyframes ls-orbit-1 {
    from {
        transform: translate(-50%, -50%) rotate(0deg) translateX(120px) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) translateX(120px) rotate(-360deg);
    }
}

@keyframes ls-orbit-2 {
    from {
        transform: translate(-50%, -50%) rotate(45deg) translateX(150px) rotate(-45deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(405deg) translateX(150px) rotate(-405deg);
    }
}

@keyframes ls-orbit-3 {
    from {
        transform: translate(-50%, -50%) rotate(90deg) translateX(110px) rotate(-90deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(450deg) translateX(110px) rotate(-450deg);
    }
}

@keyframes ls-orbit-4 {
    from {
        transform: translate(-50%, -50%) rotate(135deg) translateX(140px) rotate(-135deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(495deg) translateX(140px) rotate(-495deg);
    }
}

@keyframes ls-orbit-5 {
    from {
        transform: translate(-50%, -50%) rotate(180deg) translateX(170px) rotate(-180deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(540deg) translateX(170px) rotate(-540deg);
    }
}

@keyframes ls-orbit-6 {
    from {
        transform: translate(-50%, -50%) rotate(225deg) translateX(130px) rotate(-225deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(585deg) translateX(130px) rotate(-585deg);
    }
}

@keyframes ls-orbit-7 {
    from {
        transform: translate(-50%, -50%) rotate(270deg) translateX(180px) rotate(-270deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(630deg) translateX(180px) rotate(-630deg);
    }
}

@keyframes ls-orbit-8 {
    from {
        transform: translate(-50%, -50%) rotate(315deg) translateX(150px) rotate(-315deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(675deg) translateX(150px) rotate(-675deg);
    }
}

/* ── Central stage ── */
.ls-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 10;
}

/* ── Orbit rings ── */
.ls-orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-left: -100px;
    margin-top: -100px;
    border-radius: 50%;
    border: 1px dashed rgba(128, 131, 255, 0.3);
    /* Simplified border */
    animation: ls-ring-spin 10s linear infinite;
}

.ls-orbit-ring-2 {
    width: 250px;
    height: 250px;
    margin-left: -125px;
    margin-top: -125px;
    animation-duration: 15s;
    animation-direction: reverse;
    border: 1px dotted rgba(162, 0, 255, 0.3);
}

@keyframes ls-ring-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Logo pair ── */
.ls-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
    animation: ls-logos-appear 1s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ls-logos-appear {
    from {
        opacity: 0;
        transform: scale(0.3);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ls-logo-1 {
    position: relative;
    animation: ls-logo-float-1 0.6s 0.4s cubic-bezier(0.22, 1, 0.36, 1) both,
        ls-logo-bob 3s 1.2s ease-in-out infinite alternate;
}

.ls-logo-2 {
    position: relative;
    animation: ls-logo-float-2 0.6s 0.6s cubic-bezier(0.22, 1, 0.36, 1) both,
        ls-logo-bob 3s 1.4s ease-in-out infinite alternate-reverse;
}

@keyframes ls-logo-float-1 {
    from {
        opacity: 0;
        transform: translateY(-40px) rotate(-10deg) scale(0.4);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes ls-logo-float-2 {
    from {
        opacity: 0;
        transform: translateY(40px) rotate(10deg) scale(0.4);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes ls-logo-bob {
    from {
        transform: translateY(-4px);
    }

    to {
        transform: translateY(4px);
    }
}

.ls-logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    /* Reduced heavy drop-shadows */
    filter: drop-shadow(0 0 10px rgba(128, 131, 255, 0.6));
}

.ls-logo-aura {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 131, 255, 0.2) 0%, transparent 70%);
    animation: ls-aura-pulse 2s ease-in-out infinite alternate;
    z-index: 1;
}

.ls-logo-aura-2 {
    background: radial-gradient(circle, rgba(162, 0, 255, 0.2) 0%, transparent 70%);
    animation-delay: 0.5s;
}

@keyframes ls-aura-pulse {
    from {
        transform: scale(1);
        opacity: 0.5;
    }

    to {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ── Glitch title ── */
.ls-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 10px rgba(128, 131, 255, 0.6);
    position: relative;
    animation: ls-title-appear 0.8s 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
    margin-bottom: 4px;
}

@keyframes ls-title-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Subtitle ── */
.ls-subtitle {
    font-family: 'Geist', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(165, 180, 252, 0.7);
    margin-bottom: 24px;
    animation: ls-title-appear 0.8s 1.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Progress bar ── */
.ls-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: ls-fade-up 0.8s 1.5s ease both;
}

@keyframes ls-fade-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ls-bar-track {
    width: min(280px, 70vw);
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    /* Changed to hidden for easier transform scaling */
}

.ls-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    transform-origin: left;
    border-radius: 99px;
    background: linear-gradient(90deg, #8083ff, #c084fc, #38bdf8);
    animation: ls-bar-run 2.5s cubic-bezier(0.65, 0, 0.35, 1) 1.5s infinite;
}

@keyframes ls-bar-run {
    0% {
        transform: scaleX(0);
    }

    50% {
        transform: scaleX(0.7);
    }

    100% {
        transform: scaleX(1);
        opacity: 0;
    }
}

.ls-bar-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: rgba(128, 131, 255, 0.5);
    animation: ls-text-flicker 0.2s 1.5s step-end infinite;
}

@keyframes ls-text-flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ── Screen exit animation ── */
#loading-screen.ls-exit {
    animation: ls-screen-exit 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ls-screen-exit {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        pointer-events: none;
    }
}

/* ── Mobile tweaks for loading ── */
@media (max-width: 480px) {
    .ls-logo-img {
        width: 55px;
        height: 55px;
    }

    .ls-orbit-ring {
        width: 160px;
        height: 160px;
        margin-left: -80px;
        margin-top: -80px;
    }

    .ls-orbit-ring-2 {
        width: 200px;
        height: 200px;
        margin-left: -100px;
        margin-top: -100px;
    }

    .ls-shockwave {
        width: 400px;
        height: 400px;
        margin-left: -200px;
        margin-top: -200px;
    }
}

/* ── Custom Selection ─────────────────────────────────────────── */
::selection {
    background: rgba(128, 131, 255, 0.3);
    color: #a5b4fc;
}

/* ── Fixed Background (Mobile-Safe & Bounce-Safe) ────────────── */
body::before {
    content: '';
    position: fixed;
    top: -10vh;
    left: -10vw;
    width: 120vw;
    height: 120vh;
    background-image:
        linear-gradient(rgba(2, 6, 23, 0.75), rgba(2, 6, 23, 0.92)),
        url('./background.jpeg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -2;
    transform: translate3d(0, 0, 0);
    pointer-events: none;
}

/* ── Grain Overlay for Depth ──────────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Ambient Animated Blobs ───────────────────────────────────── */
.ambient-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    z-index: -1;
    pointer-events: none;
    animation: blob-float 22s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate3d(0, 0, 0);
}

.blob-1 {
    top: -5%;
    left: -5%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(128, 131, 255, 0.5) 0%, rgba(128, 131, 255, 0) 70%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -5%;
    right: -5%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(162, 0, 255, 0.35) 0%, rgba(162, 0, 255, 0) 70%);
    animation-delay: -7s;
}

.blob-3 {
    top: 45%;
    left: 35%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.2) 0%, rgba(0, 210, 255, 0) 70%);
    animation-delay: -14s;
}

@keyframes blob-float {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    33% {
        transform: translate3d(40px, -60px, 0) scale(1.12);
    }

    66% {
        transform: translate3d(-25px, 30px, 0) scale(0.88);
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* ── Scroll Reveal Animations ─────────────────────────────────── */
.reveal-fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-fade-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* ── Glass Panel (Premium) ────────────────────────────────────── */
.glass-panel {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Shimmer sweep on hover */
.glass-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.04), transparent);
    transform: skewX(-15deg);
    transition: left 0.8s ease;
    pointer-events: none;
}

.glass-panel:hover::after {
    left: 160%;
}

/* ── Text Utilities ───────────────────────────────────────────── */
.text-glow {
    text-shadow: 0 0 25px rgba(192, 193, 255, 0.4), 0 0 60px rgba(128, 131, 255, 0.15);
}

.gradient-text {
    background: linear-gradient(135deg, #a5b4fc, #8083ff, #d8b4fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Cursor Glow (Desktop Only) ──────────────────────────────── */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 131, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    will-change: transform;
}

/* ── Header ───────────────────────────────────────────────────── */
header {
    transition: background 0.4s ease, height 0.4s ease, box-shadow 0.4s ease;
}

header.scrolled {
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}

.nav-link {
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(218, 226, 253, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(to right, #8083ff, #d8b4fe);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover {
    color: #dae2fd;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #a5b4fc;
}

.nav-link.active::after {
    width: 100%;
}

/* ── Ticker ───────────────────────────────────────────────────── */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: rgba(8, 14, 36, 0.7);
    border-top: 1px solid rgba(128, 131, 255, 0.1);
    border-bottom: 1px solid rgba(128, 131, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.ticker-content {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker 50s linear infinite;
    width: max-content;
    gap: 3rem;
}

.ticker-content span {
    opacity: 0.7;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #7c7fff 0%, #6f00be 100%);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(128, 131, 255, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 8px 40px rgba(128, 131, 255, 0.5), 0 0 0 1px rgba(128, 131, 255, 0.3);
    transform: translateY(-3px);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* ── Section Headings ─────────────────────────────────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid rgba(128, 131, 255, 0.25);
    background: rgba(128, 131, 255, 0.08);
    color: #a5b4fc;
    margin-bottom: 1.25rem;
}

.section-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8083ff;
    box-shadow: 0 0 8px 2px rgba(128, 131, 255, 0.6);
    animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

/* ── Feature Cards ────────────────────────────────────────────── */
.feature-card {
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(128, 131, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(128, 131, 255, 0.1);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(-3deg);
}

.feature-tag {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

/* ── Schedule Table ───────────────────────────────────────────── */
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table thead tr {
    background: rgba(128, 131, 255, 0.05);
    border-bottom: 1px solid rgba(128, 131, 255, 0.15);
}

.schedule-table thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8083ff;
}

.schedule-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.schedule-table tbody tr:last-child {
    border-bottom: none;
}

.schedule-table tbody tr:hover {
    background: rgba(128, 131, 255, 0.06);
}

.schedule-table td {
    padding: 1.25rem 1.5rem;
}

/* ── Stat Bubbles ─────────────────────────────────────────────── */
.stat-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-bubble::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent 0deg, rgba(128, 131, 255, 0.08) 60deg, transparent 120deg);
    animation: stat-spin 8s linear infinite;
}

@keyframes stat-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.stat-bubble:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ── Gallery ──────────────────────────────────────────────────── */
.gallery-track-wrapper {
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 7%, black 93%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 7%, black 93%, transparent 100%);
}

.gallery-track {
    display: flex;
    gap: 16px;
    width: max-content;
}

.gallery-track--ltr {
    animation: gallery-ltr 35s linear infinite;
}

.gallery-track--rtl {
    animation: gallery-rtl 30s linear infinite;
}

.gallery-track-wrapper:hover .gallery-track {
    animation-play-state: paused;
}

@keyframes gallery-ltr {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes gallery-rtl {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.gallery-slide {
    flex-shrink: 0;
    width: 290px;
    height: 210px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s ease,
        border-color 0.45s ease;
}

.gallery-slide:hover {
    transform: scale(1.06) translateY(-5px);
    box-shadow: 0 24px 60px rgba(128, 131, 255, 0.2), 0 0 0 1px rgba(128, 131, 255, 0.25);
    border-color: rgba(128, 131, 255, 0.3);
    z-index: 2;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-slide:hover img {
    transform: scale(1.08);
}

@media (max-width: 640px) {
    .gallery-slide {
        width: 230px;
        height: 165px;
    }
}

/* ── CTA Section ──────────────────────────────────────────────── */
.cta-section {
    position: relative;
    border-radius: 2.5rem;
    overflow: hidden;
    border: 1px solid rgba(128, 131, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 60% at 80% 20%, rgba(128, 131, 255, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 20% 80%, rgba(162, 0, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.cta-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23a5b4fc' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}

/* ── Footer ───────────────────────────────────────────────────── */
footer {
    position: relative;
    background: rgba(2, 6, 23, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(128, 131, 255, 0.4), transparent);
}

.footer-link {
    color: rgba(218, 226, 253, 0.45);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #dae2fd;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(218, 226, 253, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-btn:hover {
    transform: translateY(-3px);
    color: #dae2fd;
}

.social-btn.instagram:hover {
    border-color: #E1306C;
    background: rgba(225, 48, 108, 0.12);
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.25);
    color: #F76BA3;
}

.social-btn.whatsapp:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.2);
    color: #25D366;
}

/* ── Developer Credit ─────────────────────────────────────────── */
.dev-credit-wrapper {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 3rem;
    padding-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.dev-credit-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 300px;
    background: radial-gradient(ellipse, rgba(128, 131, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.dev-name {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ff3a80 0%, #c084fc 45%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    filter: drop-shadow(0 0 40px rgba(192, 132, 252, 0.3));
    transition: filter 0.4s ease, transform 0.4s ease;
    cursor: default;
}

.dev-name:hover {
    filter: drop-shadow(0 0 60px rgba(192, 132, 252, 0.6));
    transform: scale(1.03);
}

/* ── Floating Animation ───────────────────────────────────────── */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }
}

.animate-float {
    animation: float 7s ease-in-out infinite;
}

/* ── Loading Screen ───────────────────────────────────────────── */
@keyframes fade-in-out {

    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.93) translateY(0);
        filter: drop-shadow(0 0 5px rgba(128, 131, 255, 0.15));
    }

    50% {
        opacity: 1;
        transform: scale(1.04) translateY(-7px);
        filter: drop-shadow(0 0 30px rgba(128, 131, 255, 1));
    }
}

.animate-fade-in-out {
    animation: fade-in-out 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loading-line {
    0% {
        left: -100%;
        width: 10%;
    }

    50% {
        width: 45%;
    }

    100% {
        left: 200%;
        width: 10%;
    }
}

.animate-loading-line {
    animation: loading-line 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.filter-game-glow {
    transition: filter 3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Syntax Highlighting ──────────────────────────────────────── */
.syntax-keyword {
    color: #c084fc;
}

.syntax-string {
    color: #67e8f9;
}

.syntax-variable {
    color: #e2e8f0;
}

.syntax-comment {
    color: #475569;
    font-style: italic;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Struktur Organisasi ────────────────────────────────────────────── */
.org-chart {
    position: relative;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.org-bottom-row {
    display: flex;
    justify-content: center;
    gap: 80px;
    width: 100%;
}
.org-card {
    padding: 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    width: 220px;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.org-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px -10px rgba(128,131,255,0.2);
}
.org-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}
.org-avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.org-card:hover .org-avatar::after {
    transform: translateX(100%);
}
.org-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
}
.org-role {
    font-family: 'Geist', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ── Connecting Lines with Animation ── */
.org-lines {
    position: relative;
    height: 60px;
    width: 300px; /* 220px card width + 80px gap = 300px between centers */
    margin: 0 auto;
}
.line-vertical, .line-horizontal-left, .line-horizontal-right, .line-vertical-left, .line-vertical-right {
    position: absolute;
    background: rgba(255,255,255,0.15);
}
.line-vertical {
    width: 2px;
    height: 30px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    overflow: hidden;
}
.line-horizontal-left, .line-horizontal-right {
    height: 2px;
    width: 50%;
    top: 30px;
    overflow: hidden;
}
.line-horizontal-left { left: 0; }
.line-horizontal-right { right: 0; }

.line-vertical-left, .line-vertical-right {
    width: 2px;
    height: 30px;
    top: 30px;
    overflow: hidden;
}
.line-vertical-left { left: 0; }
.line-vertical-right { right: 0; }

/* Animated glow on lines */
.line-vertical::after, .line-horizontal-left::after, .line-horizontal-right::after, .line-vertical-left::after, .line-vertical-right::after {
    content: '';
    position: absolute;
    background: #8083ff;
    box-shadow: 0 0 10px #8083ff, 0 0 20px #8083ff;
    border-radius: 99px;
}
.line-vertical::after {
    width: 100%;
    height: 15px;
    top: -15px;
    left: 0;
    animation: line-flow-1 4s infinite linear;
}
.line-horizontal-left::after {
    width: 25px;
    height: 100%;
    top: 0;
    right: -25px; /* start at center */
    animation: line-flow-2-left 4s infinite linear;
}
.line-horizontal-right::after {
    width: 25px;
    height: 100%;
    top: 0;
    left: -25px; /* start at center */
    animation: line-flow-2-right 4s infinite linear;
}
.line-vertical-left::after, .line-vertical-right::after {
    width: 100%;
    height: 15px;
    top: -15px;
    left: 0;
    animation: line-flow-3 4s infinite linear;
}

@keyframes line-flow-1 {
    0% { top: -15px; opacity: 0; }
    5% { opacity: 1; }
    25% { top: 100%; opacity: 0; }
    100% { top: 100%; opacity: 0; }
}
@keyframes line-flow-2-left {
    0%, 20% { right: -25px; opacity: 0; }
    25% { opacity: 1; }
    50% { right: 100%; opacity: 0; }
    100% { right: 100%; opacity: 0; }
}
@keyframes line-flow-2-right {
    0%, 20% { left: -25px; opacity: 0; }
    25% { opacity: 1; }
    50% { left: 100%; opacity: 0; }
    100% { left: 100%; opacity: 0; }
}
@keyframes line-flow-3 {
    0%, 45% { top: -15px; opacity: 0; }
    50% { opacity: 1; }
    75% { top: 100%; opacity: 0; }
    100% { top: 100%; opacity: 0; }
}

/* ── Org Card Custom Animations ── */
.org-card-pembina {
    animation: org-float 4s ease-in-out infinite alternate;
}
.org-card-ketua {
    animation: org-pulse 4s ease-in-out infinite alternate 1s; /* delayed so they don't sync completely */
}
.org-card-waka {
    animation: org-swing 5s ease-in-out infinite alternate 0.5s;
}

@keyframes org-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}
@keyframes org-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}
@keyframes org-swing {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(2deg); }
}

/* ── Web Developer Special Card ── */
.org-card-webdev {
    animation: org-levitate 6s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
}

@keyframes org-levitate {
    0% { transform: translateY(0) rotate(0deg) scale(1); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); }
    50% { transform: translateY(-8px) rotate(1deg) scale(1.02); box-shadow: 0 20px 40px -10px rgba(128,131,255,0.15); }
    100% { transform: translateY(-4px) rotate(-1deg) scale(1); box-shadow: 0 15px 35px -10px rgba(162,0,255,0.1); }
}

/* Pause animations on hover */
.org-card:hover, .org-card-webdev:hover {
    animation-play-state: paused !important;
}
.org-card:hover {
    transform: translateY(-5px) scale(1.05) rotate(0deg) !important;
}
.org-card-webdev:hover {
    transform: translateY(-5px) scale(1.03) !important;
    box-shadow: 0 25px 50px -12px rgba(128,131,255,0.25), inset 0 0 20px rgba(128,131,255,0.1) !important;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stat-bubble {
        width: 140px;
        height: 140px;
    }
    .org-bottom-row { gap: 16px; }
    .org-card { width: 140px; padding: 1rem; }
    .org-lines { width: 156px; /* 140 + 16 */ }
    .org-avatar { width: 50px; height: 50px; }
    .org-name { font-size: 0.85rem; }
    .org-role { font-size: 0.6rem; }
}