/* ========================================
   koomimi.com - Glitch-Neon CRT Aesthetic
   ======================================== */

/* CSS Custom Properties */
:root {
    --void: #0a0a12;
    --deep: #12121f;
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00e5;
    --signal-green: #39ff14;
    --warning-amber: #ffae00;
    --text-primary: #e8e8f0;
    --text-muted: #7a7a9e;
    --grid-line: #1a1a2e;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5vh;
}

body {
    background-color: var(--void);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    position: relative;
}

/* ========== SCANLINE OVERLAY ========== */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    opacity: 0.1;
    animation: scanlineFlicker 8s infinite;
}

@keyframes scanlineFlicker {
    0%, 92%, 100% { opacity: 0.1; }
    93% { opacity: 0.25; }
    94% { opacity: 0.1; }
    96% { opacity: 0.22; }
    97% { opacity: 0.1; }
}

/* ========== NOISE CANVAS ========== */
#noise-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    opacity: 0.04;
}

/* ========== CRT VIGNETTE ========== */
.crt-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 98;
    box-shadow: inset 0 0 150px 60px rgba(0, 0, 0, 0.7);
}

/* ========== NAVIGATION GLYPH ========== */
.nav-glyph {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 200;
    cursor: pointer;
}

.nav-glyph-icon {
    width: 36px;
    height: 36px;
    position: relative;
}

.nav-bracket-tl,
.nav-bracket-br {
    position: absolute;
    width: 12px;
    height: 12px;
}

.nav-bracket-tl {
    top: 0;
    left: 0;
    border-top: 2px solid var(--neon-cyan);
    border-left: 2px solid var(--neon-cyan);
}

.nav-bracket-br {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
}

.nav-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--neon-cyan);
    animation: navPulse 2s ease-in-out infinite;
}

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

.nav-glyph:hover .nav-bracket-tl,
.nav-glyph:hover .nav-bracket-br {
    border-color: var(--neon-magenta);
}

.nav-glyph:hover .nav-dot {
    background: var(--neon-magenta);
}

.nav-overlay {
    position: absolute;
    top: 50px;
    left: 0;
    background: rgba(10, 10, 18, 0.95);
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(0, 240, 255, 0.2);
    min-width: 200px;
}

.nav-overlay.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-link {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s, transform 0.15s;
    display: block;
    padding: 4px 0;
}

.nav-link::before {
    content: attr(data-label) ' > ';
    color: var(--neon-cyan);
}

.nav-link:hover {
    color: var(--neon-cyan);
    transform: skewX(2deg);
    text-shadow: -2px 0 var(--neon-magenta), 2px 0 var(--neon-cyan);
}

/* ========== GLITCH LINES ========== */
.glitch-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
}

.glitch-line-1 {
    animation: glitchLineSweep 6s 0s infinite;
    background: var(--neon-cyan);
}

.glitch-line-2 {
    animation: glitchLineSweep 8s 2s infinite;
    background: var(--neon-magenta);
}

.glitch-line-3 {
    animation: glitchLineSweep 10s 4s infinite;
    background: var(--signal-green);
}

@keyframes glitchLineSweep {
    0% { top: -2px; opacity: 0; }
    5% { opacity: 0.6; }
    95% { opacity: 0.6; }
    100% { top: 100vh; opacity: 0; }
}

/* ========== HERO SECTION ========== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.hero-title {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: clamp(5rem, 14vw, 12rem);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text-primary);
    text-shadow:
        -2px 0 var(--neon-magenta),
        2px 0 var(--neon-cyan),
        0 0 12px rgba(0, 240, 255, 0.4);
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    animation: charReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(0.6s + var(--i) * 0.06s);
}

@keyframes charReveal {
    0% {
        opacity: 0;
        transform: translateY(40px);
        text-shadow:
            -6px 0 var(--neon-magenta),
            6px 0 var(--neon-cyan),
            0 0 30px rgba(0, 240, 255, 0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px);
        text-shadow:
            -4px 0 var(--neon-magenta),
            4px 0 var(--neon-cyan),
            0 0 20px rgba(0, 240, 255, 0.6);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        text-shadow:
            -2px 0 var(--neon-magenta),
            2px 0 var(--neon-cyan),
            0 0 12px rgba(0, 240, 255, 0.4);
    }
}

.hero-tagline {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.55rem, 1vw, 0.75rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInTagline 0.5s ease forwards;
    animation-delay: 1.6s;
}

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

.blink-cursor {
    animation: blinkCursor 1s step-end infinite;
    color: var(--neon-cyan);
    font-size: 0.8em;
}

@keyframes blinkCursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-coords {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    pointer-events: none;
}

.coord {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--text-muted);
    opacity: 0.4;
    position: absolute;
}

.coord-tl {
    top: -60px;
    left: 5%;
}

.coord-br {
    bottom: -60px;
    right: 5%;
}

/* ========== GLITCH BARS ========== */
.glitch-bar {
    position: absolute;
    height: 4px;
    width: var(--bar-w, 30%);
    background: var(--bar-c, var(--neon-cyan));
    top: var(--bar-y, 50%);
    left: -10%;
    opacity: 0.6;
    animation: glitchBarSlide var(--bar-speed, 3s) linear infinite;
    z-index: 5;
}

@keyframes glitchBarSlide {
    0% { transform: translateX(-100%); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateX(calc(100vw + 200%)); opacity: 0; }
}

.hero-bars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ========== VOID SPACE ========== */
.void-space {
    position: relative;
}

.diagonal-hatch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(26, 26, 46, 0.15) 20px,
        rgba(26, 26, 46, 0.15) 21px
    );
    pointer-events: none;
}

/* ========== SECTION GLITCH DIVIDER ========== */
.section-glitch-divider {
    position: relative;
    height: 40px;
    overflow: hidden;
}

.section-glitch-divider .glitch-bar {
    position: absolute;
}

/* ========== TRANSMISSION SECTIONS ========== */
.transmission {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
}

.transmission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(122, 122, 158, 0.2);
}

.tx-label {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.55rem, 1vw, 0.75rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tx-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.transmission-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.transmission-body.reverse {
    direction: rtl;
}

.transmission-body.reverse > * {
    direction: ltr;
}

/* ========== CONTENT BLOCKS ========== */
.content-block {
    position: relative;
    padding: 2rem;
}

.corner-frame .corner {
    position: absolute;
    width: 20px;
    height: 20px;
}

.corner-tl {
    top: 0;
    left: 0;
    border-top: 2px solid var(--neon-cyan);
    border-left: 2px solid var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
}

.corner-tr {
    top: 0;
    right: 0;
    border-top: 2px solid var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.5s ease 0.4s;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid var(--neon-cyan);
    border-left: 2px solid var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.5s ease 0.5s;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.5s ease 0.6s;
}

.content-block.revealed .corner {
    opacity: 1;
}

.block-text p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

.block-text p:last-child {
    margin-bottom: 0;
}

.block-heading {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-shadow:
        -2px 0 var(--neon-magenta),
        2px 0 var(--neon-cyan),
        0 0 12px rgba(0, 240, 255, 0.4);
    margin-bottom: 1.5rem;
}

.data-list {
    list-style: none;
}

.data-list li {
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-weight: 300;
    transition: color 0.15s, transform 0.15s;
}

.data-list li:hover {
    color: var(--neon-cyan);
    transform: translateX(8px) skewX(1deg);
    text-shadow: -1px 0 var(--neon-magenta), 1px 0 var(--neon-cyan);
}

.list-marker {
    color: var(--neon-cyan);
    margin-right: 0.5rem;
}

.coord-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    color: var(--text-muted);
    opacity: 0.3;
    position: absolute;
}

.coord-label-tl {
    top: 4px;
    left: 24px;
}

.coord-label-br {
    bottom: 4px;
    right: 24px;
}

/* ========== GEOMETRIC VISUALS ========== */
.geometric-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    position: relative;
    transform: translateX(var(--displacement, 0));
}

.chromatic-shape {
    position: relative;
    width: 180px;
    height: 180px;
}

.shape-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Circle */
.shape-circle .shape-layer {
    border-radius: 50%;
    border: 2px solid;
}

.shape-circle .shape-cyan {
    border-color: var(--neon-cyan);
    transform: translate(-5px, -3px);
    opacity: 0.7;
}

.shape-circle .shape-magenta {
    border-color: var(--neon-magenta);
    transform: translate(5px, 3px);
    opacity: 0.7;
}

.shape-circle .shape-base {
    border-color: var(--text-primary);
    opacity: 0.9;
}

/* Rectangle */
.shape-rect .shape-layer {
    border: 2px solid;
}

.shape-rect .shape-cyan {
    border-color: var(--neon-cyan);
    transform: translate(-4px, -4px);
    opacity: 0.7;
}

.shape-rect .shape-magenta {
    border-color: var(--neon-magenta);
    transform: translate(4px, 4px);
    opacity: 0.7;
}

.shape-rect .shape-base {
    border-color: var(--text-primary);
    opacity: 0.9;
}

/* Triangle */
.shape-triangle {
    width: 200px;
    height: 200px;
}

.shape-triangle .shape-layer {
    width: 0;
    height: 0;
    border-left: 90px solid transparent;
    border-right: 90px solid transparent;
    border-bottom: 160px solid transparent;
    position: absolute;
}

.shape-triangle .shape-cyan {
    border-bottom-color: var(--neon-cyan);
    transform: translate(-4px, -3px);
    opacity: 0.5;
}

.shape-triangle .shape-magenta {
    border-bottom-color: var(--neon-magenta);
    transform: translate(4px, 3px);
    opacity: 0.5;
}

.shape-triangle .shape-base {
    border-bottom-color: var(--text-primary);
    opacity: 0.3;
}

/* Diamond */
.shape-diamond .shape-layer {
    width: 130px;
    height: 130px;
    border: 2px solid;
    transform-origin: center;
}

.shape-diamond .shape-cyan {
    border-color: var(--neon-cyan);
    transform: rotate(45deg) translate(-4px, -4px);
    opacity: 0.7;
}

.shape-diamond .shape-magenta {
    border-color: var(--neon-magenta);
    transform: rotate(45deg) translate(4px, 4px);
    opacity: 0.7;
}

.shape-diamond .shape-base {
    border-color: var(--text-primary);
    transform: rotate(45deg);
    opacity: 0.9;
}

.data-grid-pattern {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* ========== CONTACT BLOCK ========== */
.contact-block {
    margin-top: 2rem;
}

.glitch-link {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.55rem, 1vw, 0.75rem);
    letter-spacing: 0.15em;
    color: var(--neon-cyan);
    text-decoration: none;
    border: 1px solid var(--neon-cyan);
    padding: 12px 24px;
    display: inline-block;
    position: relative;
    transition: all 0.15s;
}

.glitch-link:hover {
    color: var(--neon-magenta);
    border-color: var(--neon-magenta);
    transform: skewX(2deg);
    text-shadow: -2px 0 var(--neon-magenta), 2px 0 var(--neon-cyan);
    background: rgba(255, 0, 229, 0.05);
}

/* ========== FOOTER / SIGNAL END ========== */
.signal-end {
    text-align: center;
    padding: 4rem 5% 6rem;
}

.signal-end-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-line {
    width: 60px;
    height: 1px;
    background: var(--text-muted);
    opacity: 0.3;
    margin: 0.5rem 0;
}

.footer-domain {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.footer-year {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--text-muted);
    opacity: 0.4;
}

/* ========== REVEAL ANIMATIONS ========== */
.reveal-element {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-element.glitch-jitter {
    animation: glitchJitter 0.1s linear 3;
}

@keyframes glitchJitter {
    0% { transform: translateX(6px); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .transmission-body,
    .transmission-body.reverse {
        grid-template-columns: 1fr;
        gap: 2rem;
        direction: ltr;
    }

    .geometric-visual {
        transform: none;
        min-height: 180px;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .nav-glyph {
        top: 16px;
        left: 16px;
    }

    .content-block {
        padding: 1.5rem;
    }

    .transmission {
        padding: 0 4%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.5rem, 15vw, 4rem);
    }

    .transmission-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .chromatic-shape {
        width: 120px;
        height: 120px;
    }
}
