/* ===========================================
   monopole.boo - Vaporwave Ghost Cyberpunk
   =========================================== */

/* CSS Custom Properties */
:root {
    --void-black: #0A0A0E;
    --neon-pink: #FF2080;
    --electric-cyan: #00F0FF;
    --neon-purple: #A020FF;
    --ghost-white: #E0E0F0;
    --dim-violet: #2A1A3A;
    --scanline-gray: rgba(255, 255, 255, 0.03);

    --font-pixel: 'Press Start 2P', monospace;
    --font-body: 'IBM Plex Mono', monospace;
    --font-label: 'VT323', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-black);
    color: var(--ghost-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(13px, 0.9vw, 15px);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Geometric Tessellation Background */
.geo-tessellation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    animation: patternScroll 30s linear infinite;
}

.geo-tessellation svg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
}

@keyframes patternScroll {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-80px, -92px);
    }
}

/* Parallax Ghost Layers */
.parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.parallax-far {
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(160, 32, 255, 0.15), transparent),
        radial-gradient(1px 1px at 30% 60%, rgba(0, 240, 255, 0.1), transparent),
        radial-gradient(1px 1px at 70% 40%, rgba(255, 32, 128, 0.1), transparent),
        radial-gradient(1px 1px at 90% 80%, rgba(160, 32, 255, 0.12), transparent);
    opacity: 0.6;
}

.parallax-mid {
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 32, 128, 0.2), transparent),
        radial-gradient(2px 2px at 50% 70%, rgba(0, 240, 255, 0.15), transparent),
        radial-gradient(2px 2px at 80% 50%, rgba(160, 32, 255, 0.18), transparent);
    opacity: 0.5;
}

.parallax-near {
    background:
        radial-gradient(3px 3px at 15% 50%, rgba(0, 240, 255, 0.25), transparent),
        radial-gradient(3px 3px at 60% 20%, rgba(255, 32, 128, 0.2), transparent),
        radial-gradient(3px 3px at 85% 70%, rgba(160, 32, 255, 0.22), transparent);
    opacity: 0.4;
}

/* Pixel Ghost Sprites */
.ghost-sprites {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.pixel-ghost {
    position: absolute;
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    opacity: 0.35;
}

.pixel-ghost svg {
    width: 100%;
    height: 100%;
}

@keyframes ghostFloat1 {
    0% { transform: translate(-30px, 0) rotate(0deg); }
    25% { transform: translate(0, -15px) rotate(3deg); }
    50% { transform: translate(30px, 0) rotate(0deg); }
    75% { transform: translate(0, 15px) rotate(-3deg); }
    100% { transform: translate(-30px, 0) rotate(0deg); }
}

@keyframes ghostDrift {
    0% { left: -30px; }
    100% { left: calc(100% + 30px); }
}

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

.vaporwave-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 32, 128, 0.1) 0%,
        rgba(0, 240, 255, 0.08) 33%,
        rgba(160, 32, 255, 0.1) 66%,
        rgba(255, 32, 128, 0.08) 100%
    );
    background-size: 400% 400%;
    animation: gradientBreathe 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes gradientBreathe {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Logotype with Glitch Effect */
.logotype {
    position: relative;
    font-family: var(--font-pixel);
    font-size: clamp(20px, 3vw, 36px);
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 24px;
    display: inline-block;
}

.glitch-layer {
    display: block;
}

.glitch-main {
    position: relative;
    color: var(--ghost-white);
    z-index: 3;
}

.glitch-r {
    position: absolute;
    top: 0;
    left: -2px;
    color: var(--neon-pink);
    z-index: 1;
    opacity: 0;
}

.glitch-b {
    position: absolute;
    top: 0;
    left: 2px;
    color: var(--electric-cyan);
    z-index: 2;
    opacity: 0;
}

/* Glitch intro animation */
.logotype.glitch-active .glitch-r,
.logotype.glitch-active .glitch-b {
    opacity: 0.7;
}

.logotype.glitch-active .glitch-r {
    animation: glitchR 0.2s steps(4) 3;
}

.logotype.glitch-active .glitch-b {
    animation: glitchB 0.2s steps(4) 3;
}

.logotype.glitch-active .glitch-main {
    animation: glitchMain 0.2s steps(4) 3;
}

@keyframes glitchR {
    0% { clip-path: inset(0 0 80% 0); transform: translate(-3px, -1px); }
    25% { clip-path: inset(20% 0 40% 0); transform: translate(2px, 1px); }
    50% { clip-path: inset(60% 0 10% 0); transform: translate(-1px, 2px); }
    75% { clip-path: inset(10% 0 60% 0); transform: translate(3px, -1px); }
    100% { clip-path: inset(0 0 0 0); transform: translate(-2px, 0); }
}

@keyframes glitchB {
    0% { clip-path: inset(40% 0 20% 0); transform: translate(3px, 1px); }
    25% { clip-path: inset(0 0 70% 0); transform: translate(-2px, -1px); }
    50% { clip-path: inset(30% 0 30% 0); transform: translate(1px, -2px); }
    75% { clip-path: inset(70% 0 0 0); transform: translate(-3px, 1px); }
    100% { clip-path: inset(0 0 0 0); transform: translate(2px, 0); }
}

@keyframes glitchMain {
    0% { transform: translate(0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, 0); }
    100% { transform: translate(0); }
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(12px, 1vw, 16px);
    color: var(--electric-cyan);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    letter-spacing: 1px;
}

.hero-tagline.visible {
    opacity: 0.8;
    transform: translateY(0);
}

/* Masonry Ghost Gallery */
.masonry-gallery {
    position: relative;
    z-index: 3;
    padding: 40px 24px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.masonry-grid {
    column-count: 4;
    column-gap: 8px;
}

/* Masonry Tile */
.masonry-tile {
    break-inside: avoid;
    margin-bottom: 8px;
    background: var(--dim-violet);
    padding: 20px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.masonry-tile.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Neon border variants */
.masonry-tile.neon-pink {
    --neon-color: var(--neon-pink);
    border: 1px solid var(--neon-pink);
    box-shadow: 0 0 4px var(--neon-pink), inset 0 0 4px var(--neon-pink);
}

.masonry-tile.neon-cyan {
    --neon-color: var(--electric-cyan);
    border: 1px solid var(--electric-cyan);
    box-shadow: 0 0 4px var(--electric-cyan), inset 0 0 4px var(--electric-cyan);
}

.masonry-tile.neon-purple {
    --neon-color: var(--neon-purple);
    border: 1px solid var(--neon-purple);
    box-shadow: 0 0 4px var(--neon-purple), inset 0 0 4px var(--neon-purple);
}

/* Tile hover glitch effect */
.masonry-tile::before,
.masonry-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

.masonry-tile::before {
    background: linear-gradient(
        transparent 0%,
        rgba(255, 32, 128, 0.03) 10%,
        transparent 10.5%,
        transparent 30%,
        rgba(0, 240, 255, 0.03) 30.5%,
        transparent 31%,
        transparent 60%,
        rgba(160, 32, 255, 0.03) 60.5%,
        transparent 61%
    );
    z-index: 5;
}

.masonry-tile.glitching::before {
    opacity: 1;
    animation: tileGlitch 0.2s steps(4) forwards;
}

.masonry-tile.glitching {
    animation: tileShake 0.2s steps(4) forwards;
}

@keyframes tileGlitch {
    0% { clip-path: inset(0 0 85% 0); }
    25% { clip-path: inset(15% 0 45% 0); }
    50% { clip-path: inset(50% 0 20% 0); }
    75% { clip-path: inset(5% 0 70% 0); }
    100% { clip-path: inset(0 0 0 0); opacity: 0; }
}

@keyframes tileShake {
    0% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-2px) translateY(1px); }
    50% { transform: translateX(2px) translateY(-1px); }
    75% { transform: translateX(-1px) translateY(0); }
    100% { transform: translateX(0) translateY(0); }
}

.masonry-tile:hover {
    box-shadow: 0 0 12px var(--neon-color), inset 0 0 8px var(--neon-color);
}

/* Tile content */
.tile-label {
    font-family: var(--font-label);
    font-size: 14px;
    font-weight: 400;
    color: var(--neon-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
    opacity: 0.8;
}

.tile-title {
    font-family: var(--font-pixel);
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 400;
    color: var(--ghost-white);
    margin-bottom: 12px;
    line-height: 1.5;
}

.tile-body {
    font-family: var(--font-body);
    font-size: clamp(13px, 0.9vw, 15px);
    color: var(--ghost-white);
    opacity: 0.85;
    line-height: 1.7;
    margin-bottom: 8px;
}

.tile-body:last-child {
    margin-bottom: 0;
}

.tile-body code {
    font-family: var(--font-body);
    color: var(--electric-cyan);
    background: rgba(0, 240, 255, 0.08);
    padding: 2px 6px;
    font-size: 0.9em;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 60px 24px 40px;
    border-top: 1px solid rgba(160, 32, 255, 0.2);
}

.footer-text {
    font-family: var(--font-label);
    font-size: 16px;
    color: var(--neon-purple);
    opacity: 0.6;
    letter-spacing: 2px;
}

.footer-pattern {
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-pink), var(--electric-cyan), var(--neon-purple), transparent);
    margin: 20px auto 0;
}

/* Responsive */
@media (max-width: 1100px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }

    .masonry-gallery {
        padding: 24px 16px 60px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }

    .logotype {
        font-size: clamp(14px, 5vw, 24px);
    }
}
