/* ══════════════════════════════════════════════════════════════
   CATHODE ARC — Landing Page Styles
   Dark theme · CRT aesthetic · Green (#00FF41) & Gold (#FFD700)
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green: #00FF41;
    --green-dim: rgba(0, 255, 65, 0.4);
    --green-glow: rgba(0, 255, 65, 0.15);
    --gold: #FFD700;
    --gold-dim: rgba(255, 215, 0, 0.4);
    --gold-glow: rgba(255, 215, 0, 0.15);
    --bg: #0a0a0a;
    --bg-card: #0d1117;
    --bg-card-hover: #111820;
    --text: #c9d1d9;
    --text-dim: #6e7681;
    --border: #1e2a3a;
    --font-mono: 'Courier New', 'Lucida Console', 'Consolas', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Matrix Rain Background Canvas ───────────────────────────── */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* ── CRT Scanline Overlay ────────────────────────────────────── */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

.nav-scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--border), 0 0 20px rgba(0, 255, 65, 0.05);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--green);
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.nav-logo img {
    filter: drop-shadow(0 0 4px var(--green-dim));
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s, text-shadow 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--green);
    text-shadow: 0 0 10px var(--green-dim);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--green);
    box-shadow: 0 0 6px var(--green-dim);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.hero-logo {
    display: block;
    filter: drop-shadow(0 0 30px rgba(0, 255, 65, 0.3)) drop-shadow(0 0 60px rgba(255, 215, 0, 0.15));
    animation: logoPulse 4s ease-in-out infinite;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, var(--green-glow) 0%, transparent 70%);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

.tagline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2.5rem;
}

.tagline-line {
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    color: var(--text);
    position: relative;
    cursor: default;
    transition: color 0.3s, text-shadow 0.3s;
}

.tagline-line:nth-child(1) {
    animation: typeIn 0.8s steps(22) 0.5s both;
}

.tagline-line:nth-child(2) {
    animation: typeIn 0.8s steps(20) 1.0s both;
    color: var(--green);
}

.tagline-line:nth-child(3) {
    animation: typeIn 0.6s steps(12) 1.5s both;
    color: var(--gold);
}

.tagline-line:hover {
    text-shadow: 0 0 20px var(--green-dim);
}

/* Glitch effect */
.tagline-line.glitch-active {
    animation: glitch 0.3s linear;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    border: 1px solid var(--green);
    color: var(--green);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: transparent;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--green-glow), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background: rgba(0, 255, 65, 0.08);
    box-shadow: 0 0 20px var(--green-glow), inset 0 0 20px var(--green-glow);
    transform: translateY(-2px);
}

.cta-arrow {
    animation: bounce 2s infinite;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--green), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* ── Section Titles ──────────────────────────────────────────── */
.section-title {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    margin-bottom: 3rem;
    color: var(--text);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s, transform 0.6s;
}

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

.section-title-bracket {
    color: var(--green);
    font-weight: normal;
}

/* ── Games Section ───────────────────────────────────────────── */
.games {
    position: relative;
    z-index: 2;
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.game-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.game-card:nth-child(2) {
    transition-delay: 0.2s;
}

.game-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-card-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    height: 100%;
}

.game-card:first-child .game-card-inner:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 30px var(--green-glow), 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

.game-card:last-child .game-card-inner:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 0 30px var(--gold-glow), 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

/* Screenshot wrapper */
.game-screenshot-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #000;
}

.game-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s, filter 0.5s;
}

.game-card-inner:hover .game-screenshot {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.screenshot-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

/* Badge */
.game-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 2px;
}

.badge-green {
    background: rgba(0, 255, 65, 0.15);
    color: var(--green);
    border: 1px solid var(--green-dim);
    box-shadow: 0 0 10px var(--green-glow);
}

.badge-gold {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Game info */
.game-info {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.title-green {
    color: var(--green);
    text-shadow: 0 0 10px var(--green-glow);
}

.title-gold {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.game-genre {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.game-description {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.game-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    transition: border-color 0.3s, color 0.3s;
}

.game-card:first-child .game-card-inner:hover .tech-tag {
    border-color: var(--green-dim);
    color: var(--green);
}

.game-card:last-child .game-card-inner:hover .tech-tag {
    border-color: var(--gold-dim);
    color: var(--gold);
}

/* ── About Section ───────────────────────────────────────────── */
.about {
    position: relative;
    z-index: 2;
    padding: 6rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.about-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}

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

.about-text {
    margin-bottom: 3rem;
}

.about-lead {
    font-size: 1.1rem;
    color: var(--green);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    text-shadow: 0 0 20px var(--green-glow);
}

.about-text p {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: var(--text);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat {
    padding: 1.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.stat:hover {
    border-color: var(--green-dim);
    box-shadow: 0 0 20px var(--green-glow);
    transform: translateY(-4px);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--green);
    text-shadow: 0 0 15px var(--green-glow);
    margin-bottom: 0.25rem;
}

.stat:nth-child(even) .stat-value {
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold-glow);
}

.stat:nth-child(even):hover {
    border-color: var(--gold-dim);
    box-shadow: 0 0 20px var(--gold-glow);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: color 0.3s, text-shadow 0.3s;
}

.footer-link:hover {
    color: var(--green);
    text-shadow: 0 0 10px var(--green-glow);
}

.footer-icon {
    opacity: 0.6;
    transition: opacity 0.3s;
}

.footer-link:hover .footer-icon {
    opacity: 1;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.terminal-prompt {
    color: var(--green);
}

.footer-colophon {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.highlight-green {
    color: var(--green);
}

.highlight-gold {
    color: var(--gold);
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */

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

@keyframes logoPulse {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(0, 255, 65, 0.3)) drop-shadow(0 0 60px rgba(255, 215, 0, 0.15));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(0, 255, 65, 0.5)) drop-shadow(0 0 80px rgba(255, 215, 0, 0.25));
    }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes typeIn {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

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

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
    40% { transform: translate(3px, -2px); filter: hue-rotate(180deg); }
    60% { transform: translate(-2px, -1px); filter: hue-rotate(270deg); }
    80% { transform: translate(2px, 1px); filter: hue-rotate(360deg); }
    100% { transform: translate(0); filter: none; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .nav {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.7rem;
    }

    .hero-logo {
        width: 220px;
        height: 220px;
    }

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

    .games {
        padding: 4rem 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .about {
        padding: 4rem 1rem;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

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

    .tagline-line {
        font-size: 0.85rem;
    }

    .cta-button {
        font-size: 0.75rem;
        padding: 0.6rem 1.5rem;
    }

    .game-description {
        font-size: 0.8rem;
    }

    .about-lead {
        font-size: 0.95rem;
    }

    .about-text p {
        font-size: 0.85rem;
    }
}

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

    #bg-canvas {
        display: none;
    }
}
