/* ============================================
   DIRK'S TECH SHOP - Epic Gaming Intro
   ============================================ */

/* --- Intro Overlay --- */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: #0a0a0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* --- Animated Grid Background --- */
.intro-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridPulse 3s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* --- Scanning Line --- */
.intro-scanline {
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    box-shadow: 0 0 15px var(--accent-cyan), 0 0 30px var(--accent-cyan);
    animation: scanDown 2s ease-in-out forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

@keyframes scanDown {
    0% { top: 0; opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* --- Logo Container --- */
.intro-logo-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* --- Glitch Text Effect --- */
.intro-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    color: #fff;
    position: relative;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    animation: glitchReveal 0.8s steps(1) forwards;
    animation-delay: 0.5s;
}

.intro-title::before,
.intro-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.intro-title::before {
    color: var(--accent-cyan);
    animation: glitchLeft 0.3s steps(2) 3;
    animation-delay: 1.3s;
    clip-path: inset(0 0 60% 0);
}

.intro-title::after {
    color: var(--accent-magenta);
    animation: glitchRight 0.3s steps(2) 3;
    animation-delay: 1.3s;
    clip-path: inset(40% 0 0 0);
}

@keyframes glitchReveal {
    0% { opacity: 0; transform: scale(1.5); filter: blur(20px); }
    30% { opacity: 1; transform: scale(1.02); filter: blur(2px); }
    50% { transform: scale(0.98); filter: blur(0); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes glitchLeft {
    0% { opacity: 0.8; transform: translateX(-4px); }
    50% { opacity: 0; transform: translateX(2px); }
    100% { opacity: 0.8; transform: translateX(-2px); }
}

@keyframes glitchRight {
    0% { opacity: 0.8; transform: translateX(4px); }
    50% { opacity: 0; transform: translateX(-2px); }
    100% { opacity: 0.8; transform: translateX(2px); }
}

/* --- Subtitle --- */
.intro-subtitle {
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    color: var(--accent-cyan);
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-top: 12px;
    opacity: 0;
    animation: subtitleType 0.6s steps(20) forwards;
    animation-delay: 1.5s;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-cyan);
}

@keyframes subtitleType {
    0% { opacity: 1; width: 0; }
    100% { opacity: 1; width: 100%; }
}

/* --- Loading Bar --- */
.intro-loader {
    position: relative;
    width: min(300px, 80vw);
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 40px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    animation-delay: 2s;
}

.intro-loader-bar {
    height: 100%;
    width: 0;
    background: var(--gradient-main);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: loadProgress 1.5s ease-in-out forwards;
    animation-delay: 2.1s;
}

@keyframes loadProgress {
    0% { width: 0; }
    20% { width: 25%; }
    40% { width: 45%; }
    60% { width: 70%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

/* --- Loading Text --- */
.intro-loading-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 16px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    animation-delay: 2s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Corner Decorations --- */
.intro-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0;
    animation: cornerReveal 0.4s forwards;
}

.intro-corner::before,
.intro-corner::after {
    content: '';
    position: absolute;
    background: var(--accent-cyan);
}

.intro-corner--tl { top: 20px; left: 20px; animation-delay: 0.8s; }
.intro-corner--tl::before { top: 0; left: 0; width: 20px; height: 2px; }
.intro-corner--tl::after { top: 0; left: 0; width: 2px; height: 20px; }

.intro-corner--tr { top: 20px; right: 20px; animation-delay: 0.9s; }
.intro-corner--tr::before { top: 0; right: 0; width: 20px; height: 2px; }
.intro-corner--tr::after { top: 0; right: 0; width: 2px; height: 20px; }

.intro-corner--bl { bottom: 20px; left: 20px; animation-delay: 1.0s; }
.intro-corner--bl::before { bottom: 0; left: 0; width: 20px; height: 2px; }
.intro-corner--bl::after { bottom: 0; left: 0; width: 2px; height: 20px; }

.intro-corner--br { bottom: 20px; right: 20px; animation-delay: 1.1s; }
.intro-corner--br::before { bottom: 0; right: 0; width: 20px; height: 2px; }
.intro-corner--br::after { bottom: 0; right: 0; width: 2px; height: 20px; }

@keyframes cornerReveal {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 0.6; transform: scale(1); }
}

/* --- Floating Particles --- */
.intro-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.intro-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
}

.intro-particle:nth-child(1) { left: 15%; top: 20%; background: var(--accent-cyan); animation: particleFloat 3s ease-in-out infinite; animation-delay: 0.5s; }
.intro-particle:nth-child(2) { left: 80%; top: 30%; background: var(--accent-magenta); animation: particleFloat 2.5s ease-in-out infinite; animation-delay: 0.8s; }
.intro-particle:nth-child(3) { left: 40%; top: 70%; background: var(--accent-purple); animation: particleFloat 3.5s ease-in-out infinite; animation-delay: 0.3s; }
.intro-particle:nth-child(4) { left: 65%; top: 80%; background: var(--accent-cyan); animation: particleFloat 2.8s ease-in-out infinite; animation-delay: 1.0s; }
.intro-particle:nth-child(5) { left: 25%; top: 50%; background: var(--accent-green); animation: particleFloat 3.2s ease-in-out infinite; animation-delay: 0.6s; }
.intro-particle:nth-child(6) { left: 90%; top: 60%; background: var(--accent-magenta); animation: particleFloat 2.6s ease-in-out infinite; animation-delay: 1.2s; }

@keyframes particleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
    20% { opacity: 0.8; }
    50% { opacity: 0.4; transform: translateY(-30px) scale(1.5); }
    80% { opacity: 0.6; }
}

/* --- Hex Code Decoration --- */
.intro-hex {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(0, 240, 255, 0.15);
    opacity: 0;
    animation: hexFade 2s ease-in-out forwards;
}

.intro-hex--1 { top: 15%; left: 5%; animation-delay: 1.2s; }
.intro-hex--2 { top: 75%; right: 8%; animation-delay: 1.5s; }
.intro-hex--3 { bottom: 15%; left: 12%; animation-delay: 1.8s; }

@keyframes hexFade {
    0% { opacity: 0; }
    50% { opacity: 0.2; }
    100% { opacity: 0.1; }
}

/* --- Page Elements Build-In Animation --- */
.page-build-in .site-header {
    animation: slideDown 0.5s ease-out forwards;
    animation-delay: 0.1s;
    opacity: 0;
    transform: translateY(-100%);
}

.page-build-in .hero {
    animation: scaleUp 0.6s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.page-build-in .product-card {
    opacity: 0;
    animation: cardDrop 0.4s ease-out forwards;
}

.page-build-in .product-card:nth-child(1) { animation-delay: 0.3s; }
.page-build-in .product-card:nth-child(2) { animation-delay: 0.4s; }
.page-build-in .product-card:nth-child(3) { animation-delay: 0.5s; }
.page-build-in .product-card:nth-child(4) { animation-delay: 0.6s; }
.page-build-in .product-card:nth-child(5) { animation-delay: 0.7s; }
.page-build-in .product-card:nth-child(6) { animation-delay: 0.8s; }

.page-build-in .site-footer {
    animation: slideUp 0.5s ease-out forwards;
    animation-delay: 0.9s;
    opacity: 0;
    transform: translateY(50px);
}

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

@keyframes scaleUp {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes cardDrop {
    0% { opacity: 0; transform: translateY(-40px) rotateX(20deg); }
    60% { transform: translateY(5px) rotateX(0); }
    100% { opacity: 1; transform: translateY(0) rotateX(0); }
}

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

/* --- Skip Intro on tap --- */
.intro-skip {
    position: absolute;
    bottom: 30px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    animation-delay: 2.5s;
    cursor: pointer;
    z-index: 3;
}

.intro-skip:hover {
    color: var(--text-secondary);
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .intro-overlay { display: none !important; }
    .page-build-in * { animation: none !important; opacity: 1 !important; transform: none !important; }
}
