/* ============================================
   BASE STYLES & CSS VARIABLES
   GXM - Cyberpunk Digital Theme
   ============================================ */

:root {
    /* Primary - Deep black */
    --primary: #0a0a0a;
    --primary-light: #151515;

    /* Main Accent - Neon Red */
    --accent: #ff3333;
    --accent-warm: #cc2020;
    --accent-glow: #ff5555;
    --accent-dim: #991515;

    /* Secondary Accent - Neon Green */
    --accent-secondary: #00ff41;
    --accent-secondary-dim: rgba(0, 255, 65, 0.3);
    --glow-secondary: 0 0 15px rgba(0, 255, 65, 0.4);

    /* Digital Colors */
    --matrix-green: #ff3333;
    --matrix-dark: #330505;
    --terminal-green: #cc2020;
    --code-green: #bb3333;

    /* Backgrounds */
    --sand: #0d1a0d;
    --sand-light: #0a0f0a;
    --desert-gold: #00ff41;

    /* Dark Theme */
    --canyon-shadow: #050505;
    --desert-sky: #0a150a;
    --sunset-pink: #00ff41;

    /* Neutrals - Dark Mode */
    --dark-charcoal: #000000;
    --medium-gray: #3a3a3a;
    --light-gray: #1a1a1a;
    --off-white: #0a0a0a;
    --pure-white: #ffffff;
    --text-dark: #e0e0e0;
    --text-medium: #88aa88;
    --text-light: #558855;

    /* Gradients */
    --gradient-canyon: linear-gradient(135deg, #00ff41 0%, #00cc33 50%, #009922 100%);
    --gradient-sunset: linear-gradient(180deg, #001a00 0%, #0a0a0a 100%);
    --gradient-rock: linear-gradient(135deg, #0a0a0a 0%, #151515 100%);

    /* Glow Effects */
    --glow-green: 0 0 20px rgba(255, 51, 51, 0.5);
    --glow-green-strong: 0 0 30px rgba(255, 51, 51, 0.7);

    /* Legacy mappings */
    --primary-green: var(--accent);
    --secondary-green: var(--accent-warm);
    --accent-green: var(--accent);
    --light-green: var(--sand);
    --cream: var(--sand-light);
    --terracotta: var(--accent);
}

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

html,
body {
    overflow-x: hidden;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    line-height: 1.6;
    color: var(--text-dark);
    scroll-behavior: smooth;
    background-color: #000000;
}

/* Accessibility */
*:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

::selection {
    background: var(--light-green);
    color: var(--text-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Smooth scroll offset for fixed navbar */
html {
    scroll-padding-top: 100px;
}

/* Section base */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    text-shadow: var(--glow-green);
}

.section-header p {
    color: var(--text-medium);
    font-size: 1.1rem;
}

/* Work Section - Matrix Theme */
.work-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.alien-motif {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 120px;
    height: 180px;
    opacity: 0.9;
    animation: tower-glow 15s ease-out infinite;
}

@keyframes tower-glow {
    0%, 5% {
        filter: hue-rotate(0deg) drop-shadow(0 0 8px rgba(255, 51, 51, 0.4));
    }
    8% {
        filter: hue-rotate(90deg) brightness(1.4) drop-shadow(0 0 20px rgba(0, 255, 65, 0.7));
    }
    18% {
        filter: hue-rotate(90deg) brightness(1.4) drop-shadow(0 0 20px rgba(0, 255, 65, 0.7));
    }
    28% {
        filter: hue-rotate(0deg) drop-shadow(0 0 8px rgba(255, 51, 51, 0.4));
    }
    100% {
        filter: hue-rotate(0deg) drop-shadow(0 0 8px rgba(255, 51, 51, 0.4));
    }
}

.alien-motif.left {
    left: 6%;
}

.alien-motif.right {
    right: 6%;
}

@media (max-width: 968px) {
    .alien-motif {
        display: none;
    }
}

.work-header .ufo-icon {
    width: 150px;
    height: 120px;
    margin-top: -5rem;
    margin-bottom: 3rem;
    filter: drop-shadow(0 0 15px rgba(255, 51, 51, 0.4));
    animation: ufo-hover 4s ease-in-out infinite;
}

@keyframes ufo-hover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Tractor beam effect - 15s total cycle */
.tractor-beam {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 0;
    background: transparent;
    opacity: 0;
    z-index: 10;
    animation: beam-fire 15s ease-out infinite;
    pointer-events: none;
}

/* Pulse wave rings */
.tractor-beam .pulse-ring {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 255, 65, 0.9);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.9), 0 0 25px rgba(0, 255, 65, 0.6);
    opacity: 0;
    animation: pulse-wave 15s ease-out infinite;
}

.tractor-beam .pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.tractor-beam .pulse-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes beam-fire {
    0% {
        opacity: 0;
        height: 0;
    }
    4% {
        opacity: 0.6;
        height: 0;
    }
    20% {
        opacity: 0.8;
        height: 300px;
    }
    35% {
        opacity: 0.6;
        height: 300px;
    }
    45% {
        opacity: 0;
        height: 300px;
    }
    46%, 100% {
        opacity: 0;
        height: 0;
    }
}

@keyframes pulse-wave {
    0% {
        top: 0;
        opacity: 0;
        transform: translateX(-50%) scale(1);
    }
    4% {
        top: 0;
        opacity: 0.9;
        transform: translateX(-50%) scale(1);
    }
    20% {
        top: 300px;
        opacity: 0;
        transform: translateX(-50%) scale(3);
    }
    21%, 100% {
        top: 0;
        opacity: 0;
        transform: translateX(-50%) scale(1);
    }
}

/* Project cards beam hit effect */
.projects-grid {
    animation: grid-pulse 15s ease-out infinite;
}

@keyframes grid-pulse {
    0%, 14% {
        filter: none;
    }
    16% {
        filter: drop-shadow(0 -20px 30px rgba(0, 255, 65, 0.4));
    }
    18% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.3));
    }
    25% {
        filter: none;
    }
    100% {
        filter: none;
    }
}

/* First row - hits first */
.project-card:nth-child(1) { animation-delay: 0s; }
.project-card:nth-child(2) { animation-delay: 0.15s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
/* Second row - hits after */
.project-card:nth-child(4) { animation-delay: 0.6s; }
.project-card:nth-child(5) { animation-delay: 0.75s; }
.project-card:nth-child(6) { animation-delay: 0.9s; }

/* Recent Landings beam activation belongs on project titles only. */
.recent-landings-grid .project-card h3 {
    animation: project-title-beam-hit 15s ease-out infinite;
}

.recent-landings-grid .project-card:nth-child(1) h3 { animation-delay: 0s; }
.recent-landings-grid .project-card:nth-child(2) h3 { animation-delay: 0.15s; }
.recent-landings-grid .project-card:nth-child(3) h3 { animation-delay: 0.3s; }
.recent-landings-grid .project-card:nth-child(4) h3 { animation-delay: 0.6s; }
.recent-landings-grid .project-card:nth-child(5) h3 { animation-delay: 0.75s; }
.recent-landings-grid .project-card:nth-child(6) h3 { animation-delay: 0.9s; }

@keyframes project-title-beam-hit {
    0%, 14% {
        color: #fff;
        text-shadow: none;
    }
    16% {
        color: #00ff41;
        text-shadow:
            0 0 16px rgba(0, 255, 65, 0.74),
            0 0 34px rgba(0, 255, 65, 0.34);
    }
    22% {
        color: #00ff41;
        text-shadow: 0 0 14px rgba(0, 255, 65, 0.52);
    }
    30%, 100% {
        color: #fff;
        text-shadow: none;
    }
}

.recent-landings-grid .project-card:hover h3 {
    animation-play-state: paused;
    color: #00ff41;
    text-shadow: 0 0 18px rgba(0, 255, 65, 0.52);
}

/* Keep pills and badges quiet; titles carry the periodic signal. */
.project-card:hover .project-type,
.project-card:hover .project-tech span {
    animation: none !important;
    color: #00ff41 !important;
    background: rgba(0, 255, 65, 0.15) !important;
    border-color: rgba(0, 255, 65, 0.8) !important;
    box-shadow: none !important;
}

.project-card:hover .link-icon {
    animation: none !important;
    background: transparent !important;
    border-color: #00ff41 !important;
    color: #00ff41 !important;
    box-shadow: none !important;
}

.work-header h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.8rem;
    letter-spacing: 0.05em;
    color: var(--accent);
    text-shadow: var(--glow-green);
}

.work-header p {
    font-style: normal;
    color: var(--text-medium);
    opacity: 0.85;
    font-family: monospace;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 28px;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-primary:hover {
    background: var(--accent);
    color: #000;
    box-shadow: var(--glow-green-strong);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 28px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: var(--glow-secondary);
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* Typography utilities */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-light); }
.text-center { text-align: center; }

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
