/**
 * Landing Page Styles - GhostKey Development
 * Phase 1: Clean entry point with "Begin Journey" button
 * Cyberpunk aesthetic: Deep navy, teal/cyan, purple accents
 */

/* ===== CSS Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --bg-dark: #0a0e27;
    --bg-darker: #050712;
    --primary-cyan: #06b6d4;
    --primary-purple: #8b5cf6;
    --accent-gold: #fbbf24;
    --text-light: #e5e7eb;
    --text-dim: #9ca3af;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.5),
                 0 0 40px rgba(6, 182, 212, 0.3),
                 0 0 60px rgba(6, 182, 212, 0.1);
    --glow-purple: 0 0 20px rgba(139, 92, 246, 0.5),
                   0 0 40px rgba(139, 92, 246, 0.3),
                   0 0 60px rgba(139, 92, 246, 0.1);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    background: linear-gradient(135deg,
        var(--bg-dark) 0%,
        #0d1229 50%,
        var(--bg-dark) 100%);
    color: var(--text-light);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Particle Background Canvas ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

/* Vignette overlay for depth */
#particle-canvas::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 40%,
        rgba(10, 14, 39, 0.3) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
    animation: fadeInUp 1.5s ease-out;
}

/* Logo */
.logo-container {
    margin-bottom: var(--spacing-md);
    animation: float 3s ease-in-out infinite;
}

.hero-logo {
    width: 360px;
    height: auto;
    filter: drop-shadow(var(--glow-cyan));
    transition: transform 0.3s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
}

/* Title */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch-subtle 8s infinite;
}

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

.glitch::before {
    animation: glitch-1 3s infinite;
    color: var(--primary-cyan);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 3s infinite;
    color: var(--primary-purple);
    z-index: -2;
}

/* Tagline */
.hero-tagline {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
    text-shadow: var(--glow-cyan);
    letter-spacing: 0.03em;
}

/* Subtitle */
.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-dim);
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.02em;
}

/* Begin Journey Button */
.begin-journey-btn {
    position: relative;
    padding: 1.2rem 3rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--bg-dark);
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--glow-cyan);
    z-index: 1;
}

.begin-journey-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.7),
                0 0 60px rgba(6, 182, 212, 0.5),
                0 0 90px rgba(6, 182, 212, 0.3);
}

.begin-journey-btn:active {
    transform: translateY(0) scale(1);
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.begin-journey-btn:hover .button-glow {
    left: 100%;
}

/* Hint */
.hero-hint {
    margin-top: var(--spacing-lg);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.hint-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.hint-arrow {
    font-size: 1.5rem;
    color: var(--primary-cyan);
    animation: bounce 2s ease-in-out infinite;
}

/* Decorative Elements */
.hero-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.binary-stream {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary-cyan);
    opacity: 0.3;
    writing-mode: vertical-rl;
    animation: streamFlow 20s linear infinite;
}

.binary-stream.left {
    left: 10%;
    top: -20%;
}

.binary-stream.right {
    right: 10%;
    top: -20%;
    animation-delay: 2s;
}

.hex-code {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary-purple);
    opacity: 0.5;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.hex-code.top {
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInOut 5s ease-in-out infinite;
}

.hex-code.bottom {
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInOut 5s ease-in-out infinite 2.5s;
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(6, 182, 212, 0.1);
    border-top: 4px solid var(--primary-cyan);
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    animation: spin 1s linear infinite;
}

.loading-content h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    text-shadow: var(--glow-cyan);
}

.progress-bar {
    width: 400px;
    max-width: 80vw;
    height: 6px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 3px;
    margin: 0 auto var(--spacing-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: var(--glow-cyan);
}

.loading-tip {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes glitch-1 {
    0%, 90%, 100% {
        opacity: 0;
    }
    91%, 99% {
        opacity: 0.7;
        transform: translate(-2px, 2px);
    }
}

@keyframes glitch-2 {
    0%, 90%, 100% {
        opacity: 0;
    }
    91%, 99% {
        opacity: 0.7;
        transform: translate(2px, -2px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes streamFlow {
    from {
        transform: translateY(-20%);
    }
    to {
        transform: translateY(120%);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-logo {
        width: 240px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
    }

    .begin-journey-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .binary-stream {
        font-size: 0.6rem;
    }

    .hex-code {
        font-size: 0.6rem;
    }

    .progress-bar {
        width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-logo {
        width: 200px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .begin-journey-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ===== Performance Optimizations ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
