:root {
    --bg-deep: #0b0f19;
    --bg-elevated: #151b2b;
    --accent-cyan: #00f5d4;
    --accent-amber: #ffb703;
    --text-primary: #e0e6ed;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glow-cyan: 0 0 20px rgba(0, 245, 212, 0.4);
    --glow-amber: 0 0 20px rgba(255, 183, 3, 0.4);
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.accent-dot {
    color: var(--accent-cyan);
}

.desktop-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.desktop-nav a:hover {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--accent-cyan);
    transition: 0.3s;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1000px;
}

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.6;
    animation: floatUp 8s infinite linear;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.hero-3d-container {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    z-index: 2;
}

.process-stage {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: translateZ(-50px);
}

.process-stage.active {
    opacity: 1;
    transform: translateZ(0);
}

.stage-label {
    margin-top: 2rem;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-amber);
    text-shadow: var(--glow-amber);
}

/* Stage 1: Problem */
.wireframe-box {
    width: 120px;
    height: 120px;
    border: 2px dashed #ef4444;
    position: relative;
    animation: glitch 2s infinite;
}

.wireframe-box::before, .wireframe-box::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

/* Stage 2: Preparation */
.laser-line {
    position: absolute;
    background: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.laser-line.horizontal {
    width: 0;
    height: 2px;
    top: 50%;
    left: 50%;
    animation: drawHorizontal 1.5s forwards;
}

.laser-line.vertical {
    width: 2px;
    height: 0;
    top: 50%;
    left: 50%;
    animation: drawVertical 1.5s 0.5s forwards;
}

@keyframes drawHorizontal { to { width: 200px; left: 25%; } }
@keyframes drawVertical { to { height: 200px; top: 25%; } }

/* Stage 3: Process */
.cabinet-panel {
    position: absolute;
    background: rgba(255, 183, 3, 0.1);
    border: 1px solid var(--accent-amber);
    transition: all 1s ease;
}

.cabinet-panel.back { width: 140px; height: 140px; transform: translateZ(-20px); }
.cabinet-panel.side.left { width: 40px; height: 140px; left: -20px; transform: rotateY(-90deg); transform-origin: right; }
.cabinet-panel.side.right { width: 40px; height: 140px; right: -20px; transform: rotateY(90deg); transform-origin: left; }
.cabinet-panel.bottom { width: 140px; height: 40px; bottom: -20px; transform: rotateX(-90deg); transform-origin: top; }
.cabinet-panel.top { width: 140px; height: 40px; top: -20px; transform: rotateX(90deg); transform-origin: bottom; }

.stage-3.active .cabinet-panel {
    background: rgba(255, 183, 3, 0.2);
    box-shadow: var(--glow-amber);
}

/* Stage 4: Transformation */
.cabinet-door {
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid var(--accent-cyan);
    transform: rotateY(-90deg);
    transform-origin: left;
    transition: transform 1s ease;
    backdrop-filter: blur(4px);
}

.hardware-knob {
    width: 12px;
    height: 12px;
    background: var(--accent-amber);
    border-radius: 50%;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: var(--glow-amber);
    opacity: 0;
    transition: opacity 0.5s 0.5s;
}

.stage-4.active .cabinet-door { transform: rotateY(0deg); }
.stage-4.active .hardware-knob { opacity: 1; }

/* Stage 5: Result */
.final-cabinet-glow {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-amber));
    filter: blur(40px);
    opacity: 0.4;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from { opacity: 0.3; transform: scale(1); }
    to { opacity: 0.6; transform: scale(1.1); }
}

.hero-business-name {
    position: absolute;
    bottom: -60px;
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0.5s;
}

.stage-5.active .hero-business-name {
    opacity: 1;
    transform: translateY(0);
}

.accent-text { color: var(--accent-cyan); }

.hero-overlay {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    width: 90%;
    max-width: 800px;
}

.hero-overlay h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero-overlay p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    padding-top: 100px;
    padding-bottom: 4rem;
}

/* TOC */
.toc-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.toc-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-amber);
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.5rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.toc-link:hover, .toc-link.active {
    color: var(--accent-cyan);
    border-left-color: var(--accent-cyan);
    background: rgba(0, 245, 212, 0.05);
}

.toc-toggle-mobile {
    display: none;
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1rem;
}

/* Content */
.content-area article {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
}

.content-area h2 {
    font-size: 1.8rem;
    color: var(--accent-cyan);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.content-area h2:first-child {
    margin-top: 0;
}

.content-area p {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

.content-area ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.content-area li {
    margin-bottom: 0.8rem;
}

.content-area a {
    color: var(--accent-amber);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-amber);
    transition: all 0.3s ease;
}

.content-area a:hover {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

/* CTA Section */
.cta-section {
    padding: 4rem 1.5rem;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.glass-card-3d {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(16px);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.glass-card-3d:hover {
    transform: translateY(-5px) rotateX(2deg);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 245, 212, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.glass-card-3d h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.business-details {
    margin: 2rem 0;
    text-align: left;
    display: inline-block;
}

.business-details p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.business-details a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.business-details a:hover {
    text-shadow: var(--glow-cyan);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-amber));
    color: var(--bg-deep);
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 245, 212, 0.3);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 245, 212, 0.5);
}

/* Footer */
.glass-footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(11, 15, 25, 0.9);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.social-links a:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-3px);
}

.glass-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .toc-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    
    .toc-list {
        display: none;
        margin-top: 1rem;
    }
    
    .toc-list.open {
        display: block;
    }
    
    .toc-toggle-mobile {
        display: block;
    }
}

@media (max-width: 600px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-overlay h1 {
        font-size: 2rem;
    }
    
    .content-area article {
        padding: 1.5rem;
    }
    
    .glass-card-3d {
        padding: 2rem 1.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}