:root {
    --bg-color: #05050a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00ff;
    --neon-violet: #7b5cff;
    --glass-bg: rgba(15, 15, 25, 0.4);
    --glass-border: rgba(255, 255, 255, 0.06);
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 243, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 255, 0.04) 0%, transparent 50%);
}

/* Hide native cursor only on fine-pointer (desktop) devices */
@media (hover: hover) and (pointer: fine) {
    body, body * { cursor: none; }
}
@media (hover: none), (pointer: coarse) {
    #cosmic-cursor { display: none; }
}

::selection { background: rgba(0, 243, 255, 0.3); color: #fff; }

/* ---------- Star field canvas ---------- */
#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* ---------- Cosmic intro loader ---------- */
.loader {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }

.loader-ring {
    position: relative;
    width: 80px;
    height: 80px;
}
.loader-ring span {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1.6s linear infinite;
}
.loader-ring span:nth-child(1) { border-top-color: var(--neon-cyan); }
.loader-ring span:nth-child(2) { border-right-color: var(--neon-magenta); animation-duration: 2.2s; inset: 10px; }
.loader-ring span:nth-child(3) { border-bottom-color: var(--neon-violet); animation-duration: 2.8s; inset: 20px; }

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

.loader-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 6px;
    color: var(--text-secondary);
    animation: flicker 2.5s infinite;
}
@keyframes flicker { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------- Scroll progress comet ---------- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    z-index: 10001;
    background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan), var(--neon-magenta));
    box-shadow: 0 0 12px var(--neon-cyan);
    transition: width 0.1s linear;
}

/* ---------- Custom cosmic cursor ---------- */
#cosmic-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 243, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: width 0.3s var(--ease), height 0.3s var(--ease), background-color 0.3s, border-color 0.3s;
    will-change: transform;
}
#cosmic-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--neon-cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--neon-cyan);
}
#cosmic-cursor.hovering {
    width: 60px;
    height: 60px;
    border-color: rgba(255, 0, 255, 0.8);
    background-color: rgba(255, 0, 255, 0.08);
}
#cosmic-cursor.hovering::after {
    background: var(--neon-magenta);
    box-shadow: 0 0 15px var(--neon-magenta);
}

/* ---------- Nebulas ---------- */
.nebula {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.4;
    animation: floatNebula 30s infinite alternate linear;
    will-change: transform;
    pointer-events: none;
}
.nebula-1 {
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(0,243,255,0.15) 0%, transparent 70%);
    top: -20%; left: -10%;
}
.nebula-2 {
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(255,0,255,0.1) 0%, transparent 70%);
    bottom: -10%; right: -20%;
    animation-delay: -15s;
}
.nebula-3 {
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(123,92,255,0.12) 0%, transparent 70%);
    top: 40%; left: 50%;
    animation-delay: -8s;
}
@keyframes floatNebula {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.15); }
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem;
}
.logo-wrapper { margin-bottom: 3rem; z-index: 10; }
.glow-logo {
    max-width: 350px;
    width: 80vw;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.4));
    animation: pulseLogo 4s infinite alternate;
}
@keyframes pulseLogo {
    0% { filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.3)); }
    100% { filter: drop-shadow(0 0 30px rgba(0, 243, 255, 0.7)); }
}
.hero-text { z-index: 10; }
.hologram-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    letter-spacing: 12px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-left: 12px; /* compensate trailing letter-spacing */
}
.neon-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 6px;
    font-size: clamp(1.6rem, 5vw, 4rem);
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,0.8);
    position: relative;
}
.neon-text::before {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    color: var(--text-primary);
    -webkit-text-stroke: 0;
    background: linear-gradient(90deg, var(--neon-cyan), #ffffff, var(--neon-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255,0,255,0.5));
    opacity: 0.85;
    z-index: -1;
}
.hero-tagline {
    margin-top: 1.4rem;
    font-size: 0.85rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
.scroll-indicator:hover { color: var(--neon-cyan); }
.scroll-arrow { animation: bounce 2s infinite; font-size: 1rem; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* ---------- Gallery ---------- */
.space-gallery {
    padding: 10vh 5vw 14vh 5vw;
    display: flex;
    flex-direction: column;
    gap: 14vh;
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
}
.space-item {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    perspective: 1200px;
}
.space-item.right-align { justify-content: flex-end; }
.space-item.center-align { justify-content: center; }

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.glass-frame {
    width: 80%;
    max-width: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px;
    position: relative;
    margin: 0;
    transition: box-shadow 0.6s ease, border-color 0.6s ease;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 0 20px rgba(255,255,255,0.02);
    transform-style: preserve-3d;
    will-change: transform;
}
.glass-frame.wide { max-width: 900px; width: 95%; }
.glass-frame.tall { max-width: 500px; }

.glass-frame img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    filter: sepia(0.3) hue-rotate(-30deg) contrast(1.2) brightness(0.8);
    transition: filter 0.6s ease, transform 0.6s var(--ease);
}

/* Aurora ring that lights up on hover */
.glass-frame::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(135deg, var(--neon-cyan), transparent 40%, transparent 60%, var(--neon-magenta));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.glass-frame:hover::before { opacity: 0.7; }

.overlay {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 14px 28px;
    border-radius: 30px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    transform: translateZ(50px);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s var(--ease);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.2);
}
.img-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 4px;
    color: var(--neon-cyan);
}

.glass-frame:hover {
    box-shadow: 0 40px 80px rgba(0,0,0,0.8), 0 0 40px rgba(0, 243, 255, 0.12);
    border-color: rgba(0, 243, 255, 0.3);
}
.glass-frame:hover img {
    filter: sepia(0) hue-rotate(0deg) contrast(1) brightness(1.1);
    transform: scale(1.02);
}
.glass-frame:hover .overlay {
    opacity: 1;
    transform: translateZ(80px) translateY(-10px);
}

/* ---------- About / Contact ---------- */
.about {
    max-width: 900px;
    margin: 0 auto;
    padding: 12vh 6vw 6vh;
    text-align: center;
}
.about-kicker {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 6px;
    color: var(--neon-cyan);
    margin-bottom: 1.5rem;
}
.about-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 4vw, 2.6rem);
    line-height: 1.25;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #fff, var(--neon-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.about-body {
    max-width: 620px;
    margin: 0 auto 2.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}
.about-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.orbit-btn {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 2px;
    font-size: 0.85rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bg-color);
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    padding: 14px 32px;
    border-radius: 40px;
    border: 1px solid transparent;
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}
.orbit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 0, 255, 0.3);
}
.orbit-btn.ghost {
    background: transparent;
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}
.orbit-btn.ghost:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 12px 30px rgba(0, 243, 255, 0.2);
}
.cosmic-footer {
    margin-top: 8vh;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.3);
}

/* ---------- Lightbox ---------- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 100000;
    inset: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.lightbox.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}
.lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(2, 2, 5, 0.95);
    backdrop-filter: blur(25px);
}
.lightbox-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.lightbox-content {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 12px;
    box-shadow: 0 0 80px rgba(255, 0, 255, 0.15);
    transform: scale(0.9) translateZ(-100px);
    transition: transform 0.6s var(--ease);
    border: 1px solid rgba(255,255,255,0.1);
}
.lightbox.show .lightbox-content { transform: scale(1) translateZ(0); }

.lightbox-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Space Grotesk', sans-serif;
}
.lightbox-title { letter-spacing: 4px; color: var(--neon-cyan); font-size: 0.95rem; }
.lightbox-counter { color: var(--text-secondary); font-size: 0.8rem; }

.close-radar {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 3;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--neon-magenta);
    border: 1px solid rgba(255, 0, 255, 0.3);
    background: transparent;
    transition: all 0.3s ease;
}
.close-radar svg { width: 22px; height: 22px; }
.close-radar:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0, 243, 255, 0.25);
    color: var(--neon-cyan);
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.lightbox-nav.prev { left: 4vw; }
.lightbox-nav.next { right: 4vw; }
.lightbox-nav:hover {
    background: rgba(0, 243, 255, 0.12);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .space-gallery { gap: 8vh; padding-top: 6vh; }
    .glass-frame, .glass-frame.wide, .glass-frame.tall { width: 100%; max-width: 100%; }
    .hologram-text { letter-spacing: 8px; font-size: 1.1rem; }
    .lightbox-nav { width: 44px; height: 44px; font-size: 1.5rem; }
    .lightbox-nav.prev { left: 2vw; }
    .lightbox-nav.next { right: 2vw; }
    .overlay { padding: 10px 20px; bottom: -16px; right: -10px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
