/* ============================================================
   BLATTI // GLOBAL STYLESHEET
   lizard-skin.neocities.org
   ============================================================ */

/* ── VARIABLES ── */
:root {
    --green:        #39ff14;
    --green-dim:    #1a6608;
    --green-glow:   rgba(57, 255, 20, 0.15);
    --green-faint:  rgba(57, 255, 20, 0.06);
    --red:          #cc2200;
    --bg:           #000000;
    --font-mono:    'Share Tech Mono', monospace;
    --font-display: 'VT323', monospace;
}


/* ── RESET ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ── BASE ── */
html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--green);
    font-family: var(--font-mono);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    cursor: crosshair;
}


/* ── GLOBAL SCROLLBAR ── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--green-dim) var(--bg);
}
::-webkit-scrollbar       { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--green); }


/* ── TEXT SELECTION ── */
::selection {
    background: var(--green);
    color: #000;
}
::-moz-selection {
    background: var(--green);
    color: #000;
}


/* ── FOCUS STYLES ── */
:focus-visible {
    outline: 1px solid var(--green);
    outline-offset: 3px;
    box-shadow: 0 0 10px var(--green-glow);
}


/* ── CRT SCANLINES (global) ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 1000;
}


/* ── VIGNETTE (global) ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 999;
}


/* ── GLITCH ANIMATION ──
   Apply with class="glitch" data-text="YOUR TITLE"
   Example: <h1 class="glitch" data-text="BLATTI">BLATTI</h1>
   ── */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glitch::before {
    color: var(--red);
    animation: glitch-before 3.5s infinite steps(1);
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
}

.glitch::after {
    color: var(--green);
    animation: glitch-after 3.5s infinite steps(1);
    clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
}

@keyframes glitch-before {
    0%,  90%          { transform: translate(0);        opacity: 0; }
    91%               { transform: translate(-3px, 1px); opacity: 1; }
    92%               { transform: translate(3px, -1px); opacity: 1; }
    93%               { transform: translate(-2px, 2px); opacity: 1; }
    94%, 100%         { transform: translate(0);        opacity: 0; }
}

@keyframes glitch-after {
    0%,  91%          { transform: translate(0);        opacity: 0; }
    92%               { transform: translate(3px, 1px);  opacity: 1; }
    93%               { transform: translate(-3px, -1px);opacity: 1; }
    94%               { transform: translate(2px, -2px); opacity: 1; }
    95%, 100%         { transform: translate(0);        opacity: 0; }
}


/* ── LINK HOVER WIPE ──
   Apply with class="wipe-link" on any <a>
   Reveals text left-to-right on hover like a terminal sweep.
   ── */
.wipe-link {
    position: relative;
    color: var(--green-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.wipe-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0;
    height: 1px;
    background: var(--green);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wipe-link:hover {
    color: var(--green);
}

.wipe-link:hover::after {
    width: 100%;
}


/* ── PAGE TRANSITION FLASH ──
   Wraps your page content. Add <div class="page-enter"> around body content.
   Triggers a fast curtain flash on load.
   ── */
.page-enter {
    animation: page-flash 0.35s ease-out both;
}

@keyframes page-flash {
    0%   { opacity: 0; }
    40%  { opacity: 1; }
    55%  { opacity: 0.6; }
    100% { opacity: 1; }
}


/* ── BLINK UTILITY ── */
.blink {
    animation: blink 1.1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}


/* ── NOISE TEXTURE OVERLAY ──
   Adds fine grain over the background without changing color.
   Purely decorative depth.
   ── */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    background-repeat: repeat;
}


/* ── PRINT STYLES ──
   Clean black-on-white output, strips all CRT effects.
   ── */
@media print {
    body::before,
    body::after,
    .noise-overlay,
    #eyes-layer,
    .ticker-wrap {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-family: Georgia, serif;
        font-size: 12pt;
        line-height: 1.7;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }

    h1, h2, h3 {
        font-family: Georgia, serif;
        color: #000 !important;
        text-shadow: none !important;
    }

    .glitch::before,
    .glitch::after {
        display: none;
    }
}


/* ── RESPONSIVE BASE ── */
@media (max-width: 620px) {
    body {
        font-size: 0.9rem;
    }
}