/* ============================================
   DIMENSION X — Ultimate 3D WebGL Experience
   ============================================ */

:root {
    --primary: #00f0ff;
    --secondary: #a855f7;
    --accent: #ff006e;
    --bg: #000000;
    --surface: rgba(255, 255, 255, 0.03);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.5);
    --glow-primary: 0 0 30px rgba(0, 240, 255, 0.3);
    --glow-secondary: 0 0 30px rgba(168, 85, 247, 0.3);
    --glow-accent: 0 0 30px rgba(255, 0, 110, 0.3);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    cursor: none;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: transform 0.1s;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease-out;
}

body:has(.btn-primary:hover) .cursor-ring,
body:has(.nav-link:hover) .cursor-ring,
body:has(.morph-btn:hover) .cursor-ring,
body:has(.feature-card:hover) .cursor-ring {
    width: 60px;
    height: 60px;
    border-color: var(--primary);
}

/* ============================================
   LOADER
   ============================================ */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-ring {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 0 auto 30px;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.r1 {
    border-top-color: var(--primary);
    animation: spin 1.2s linear infinite;
}

.r2 {
    inset: 10px;
    border-right-color: var(--secondary);
    animation: spin 1.5s linear infinite reverse;
}

.r3 {
    inset: 20px;
    border-bottom-color: var(--accent);
    animation: spin 1s linear infinite;
}

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

.loader-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.loader-bar {
    width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto 15px;
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transition: width 0.3s;
    border-radius: 2px;
}

.loader-text {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ============================================
   CANVAS
   ============================================ */
#webgl {
    position: fixed;
    inset: 0;
    z-index: 1;
}

/* ============================================
   UI BUTTON
   ============================================ */
.ui-btn {
    position: fixed;
    z-index: 100;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.ui-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

#audioToggle {
    bottom: 30px;
    left: 30px;
}

/* ============================================
   NAVIGATION
   ============================================ */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    transition: transform 0.5s;
}

#nav.hidden {
    transform: translateY(-100%);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    color: var(--primary);
    font-size: 1.5rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 10px var(--primary); }
    50% { text-shadow: 0 0 30px var(--primary), 0 0 60px var(--primary); }
}

.brand-text {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3em;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s;
    cursor: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

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

/* ============================================
   SCROLL INDICATOR
   ============================================ */
#scrollIndicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 1s ease 2s both;
    transition: opacity 0.5s;
}

#scrollIndicator.hidden {
    opacity: 0;
    pointer-events: none;
}

#scrollIndicator span {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
}

.scroll-mouse {
    width: 24px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 3px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-anim 1.5s ease-in-out infinite;
}

@keyframes scroll-anim {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ============================================
   SECTION PROGRESS
   ============================================ */
#sectionProgress {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: none;
    transition: all 0.3s;
    position: relative;
}

.progress-dot::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s;
}

.progress-dot.active {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.progress-dot.active::before {
    background: var(--primary);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
#content {
    position: relative;
    z-index: 10;
}

.content-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 80px;
    position: relative;
}

.section-inner {
    max-width: 700px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-content {
    max-width: 900px;
    text-align: center;
    margin: 0 auto;
}

.hero-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   GLITCH EFFECT
   ============================================ */
.glitch-wrapper {
    position: relative;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.glitch {
    animation: glitch-skew 4s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glitch::before {
    animation: glitch-before 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch::after {
    animation: glitch-after 2s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-before {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-after {
    0% { transform: translate(0); }
    20% { transform: translate(3px, -3px); }
    40% { transform: translate(-3px, 3px); }
    60% { transform: translate(2px, -2px); }
    80% { transform: translate(-2px, 2px); }
    100% { transform: translate(0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(0deg); }
    21% { transform: skew(2deg); }
    22% { transform: skew(0deg); }
    50% { transform: skew(0deg); }
    51% { transform: skew(-1deg); }
    52% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-dim);
    margin-top: 20px;
    letter-spacing: 0.1em;
}

/* ============================================
   HERO STATS
   ============================================ */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
    margin-top: 5px;
    display: block;
}

/* ============================================
   CTA BUTTON
   ============================================ */
.hero-cta {
    margin-top: 50px;
}

.btn-primary {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--primary);
    padding: 16px 40px;
    cursor: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s;
}

.btn-primary:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: var(--glow-primary), inset 0 0 30px rgba(0, 240, 255, 0.1);
}

.btn-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 400% 400%;
    animation: glow-rotate 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    filter: blur(10px);
}

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

@keyframes glow-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   SECTION LABELS & TITLES
   ============================================ */
.section-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    color: var(--primary);
    margin-bottom: 20px;
    opacity: 0.7;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin-bottom: 20px;
}

.accent {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dim);
    font-weight: 300;
    max-width: 550px;
}

/* ============================================
   FEATURE GRID
   ============================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    border-radius: 12px;
    transition: all 0.4s;
    cursor: none;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    background: rgba(0, 240, 255, 0.03);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.1);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
    font-weight: 300;
}

/* ============================================
   TECH STACK
   ============================================ */
.tech-stack {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 300;
    padding: 12px 20px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s;
}

.tech-item:hover {
    border-color: rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.03);
}

.tech-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
    flex-shrink: 0;
}

/* ============================================
   MORPH CONTROLS
   ============================================ */
.morph-controls {
    display: flex;
    gap: 12px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.morph-btn {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: none;
    transition: all 0.3s;
}

.morph-btn:hover,
.morph-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255, 0, 110, 0.05);
    box-shadow: var(--glow-accent);
}

/* ============================================
   VOID INFO
   ============================================ */
.void-info {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 300;
}

.info-value {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}

/* ============================================
   FOOTER
   ============================================ */
.footer-credit {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-credit p {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 300;
}

.footer-sub {
    font-size: 0.7rem !important;
    margin-top: 8px;
    opacity: 0.5;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    #cursor {
        display: none;
    }

    .content-section {
        padding: 80px 30px;
    }

    .hero-stats {
        gap: 30px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    #sectionProgress {
        right: 15px;
    }

    .morph-controls {
        flex-direction: column;
    }

    .btn-primary,
    .morph-btn,
    .nav-link,
    .progress-dot {
        cursor: auto;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .content-section {
        padding: 60px 20px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
}
