/* ===========================
   a6c.xyz — Styles
   Colors: #0A0A0F, #0D0B1A, #00F0FF, #FF00A8, #39FF14, #003B4A, #8A9BA8, #F0F0FF
   Fonts: Orbitron (display), Space Mono (body), Chakra Petch (accent)
   =========================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0A0F;
    color: #F0F0FF;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
}

/* CRT Scan Line Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(240, 240, 255, 0.03) 2px,
        rgba(240, 240, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 999;
}

/* ===========================
   Hex Address Bar
   =========================== */
#hex-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background: #0A0A0F;
    border-bottom: 1px solid #00F0FF;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

#hex-string {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #00F0FF;
    letter-spacing: 0.1em;
    cursor: pointer;
    user-select: none;
}

/* ===========================
   Zone Base Styles
   =========================== */
.zone {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.zone-label {
    position: absolute;
    top: 50px;
    left: 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8A9BA8;
    z-index: 10;
}

/* ===========================
   Zone 0x00 — SIGNAL ACQUIRED
   =========================== */
#zone-0x00 {
    background: #0A0A0F;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zone00-breathe 4s ease-in-out infinite;
}

@keyframes zone00-breathe {
    0%, 100% { background-color: #0A0A0F; }
    50% { background-color: #0D0B1A; }
}

/* Hex Rain */
#hex-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.hex-rain-row {
    position: absolute;
    white-space: nowrap;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: rgba(240, 240, 255, 0.05);
    letter-spacing: 0.05em;
    will-change: transform;
}

@keyframes scroll-left-1 { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes scroll-left-2 { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Hero Text */
#hero-text {
    position: relative;
    z-index: 5;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(100px, 20vw, 300px);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #F0F0FF;
    text-shadow:
        0 0 20px rgba(0, 240, 255, 0.5),
        3px -1px 0 rgba(255, 0, 168, 0.6),
        -2px 1px 0 rgba(57, 255, 20, 0.4);
    animation: glitch 3s infinite steps(1);
    display: flex;
    gap: 0.05em;
}

.hero-letter {
    display: inline-block;
    position: relative;
}

@keyframes glitch {
    0% { transform: translate(0); text-shadow: 0 0 20px rgba(0,240,255,0.5), 3px -1px 0 rgba(255,0,168,0.6), -2px 1px 0 rgba(57,255,20,0.4); }
    5% { transform: translate(-3px, 1px); text-shadow: 0 0 20px rgba(0,240,255,0.5), 5px -2px 0 rgba(255,0,168,0.8), -4px 2px 0 rgba(57,255,20,0.6); }
    6% { transform: translate(0); text-shadow: 0 0 20px rgba(0,240,255,0.5), 3px -1px 0 rgba(255,0,168,0.6), -2px 1px 0 rgba(57,255,20,0.4); }
    15% { transform: translate(2px, -1px); clip-path: inset(20% 0 40% 0); }
    16% { transform: translate(0); clip-path: none; }
    30% { transform: translate(-1px, 2px); text-shadow: 0 0 30px rgba(0,240,255,0.7), 6px -3px 0 rgba(255,0,168,0.9), -5px 2px 0 rgba(57,255,20,0.7); }
    31% { transform: translate(0); text-shadow: 0 0 20px rgba(0,240,255,0.5), 3px -1px 0 rgba(255,0,168,0.6), -2px 1px 0 rgba(57,255,20,0.4); }
    42% { transform: translate(4px, 0); clip-path: inset(60% 0 5% 0); }
    43% { transform: translate(0); clip-path: none; }
    55% { transform: translate(-2px, -1px); text-shadow: 0 0 25px rgba(0,240,255,0.6), 4px -1px 0 rgba(255,0,168,0.7), -3px 1px 0 rgba(57,255,20,0.5); }
    56% { transform: translate(0); text-shadow: 0 0 20px rgba(0,240,255,0.5), 3px -1px 0 rgba(255,0,168,0.6), -2px 1px 0 rgba(57,255,20,0.4); }
    68% { transform: translate(1px, 3px); clip-path: inset(10% 0 70% 0); }
    69% { transform: translate(0); clip-path: none; }
    78% { transform: translate(-3px, 0); text-shadow: 0 0 35px rgba(0,240,255,0.8), 7px -2px 0 rgba(255,0,168,1), -6px 3px 0 rgba(57,255,20,0.8); }
    79% { transform: translate(0); text-shadow: 0 0 20px rgba(0,240,255,0.5), 3px -1px 0 rgba(255,0,168,0.6), -2px 1px 0 rgba(57,255,20,0.4); }
    88% { transform: translate(2px, -2px); clip-path: inset(45% 0 25% 0); }
    89% { transform: translate(0); clip-path: none; }
    100% { transform: translate(0); text-shadow: 0 0 20px rgba(0,240,255,0.5), 3px -1px 0 rgba(255,0,168,0.6), -2px 1px 0 rgba(57,255,20,0.4); }
}

/* ===========================
   Zone 0x01 — DECODE
   =========================== */
#zone-0x01 {
    background: #0A0A0F;
}

.data-panel {
    position: absolute;
    width: clamp(280px, 35vw, 500px);
    padding: 20px 24px;
    border: 1px solid #00F0FF;
    background: rgba(10, 10, 15, 0.85);
    z-index: 5;
    box-shadow:
        0 0 10px rgba(0, 240, 255, 0.1),
        3px -1px 0 rgba(255, 0, 168, 0.15),
        -2px 1px 0 rgba(57, 255, 20, 0.1);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.data-panel.visible {
    opacity: 1;
}

.panel-content {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #F0F0FF;
    line-height: 1.8;
    min-height: 3.6em;
}

.cursor {
    font-family: 'Space Mono', monospace;
    color: #00F0FF;
    animation: blink-cursor 530ms infinite steps(1);
    font-size: 14px;
}

@keyframes blink-cursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ===========================
   Zone 0x02 — CORRUPT
   =========================== */
#zone-0x02 {
    background: #0A0A0F;
}

.glitch-label {
    animation: glitch-text 2s infinite steps(1);
}

@keyframes glitch-text {
    0%, 100% { transform: translate(0); color: #8A9BA8; }
    10% { transform: translate(-2px, 1px); color: #FF00A8; }
    11% { transform: translate(0); color: #8A9BA8; }
    35% { transform: translate(3px, -1px); color: #39FF14; }
    36% { transform: translate(0); color: #8A9BA8; }
    60% { transform: translate(-1px, 2px); color: #00F0FF; }
    61% { transform: translate(0); color: #8A9BA8; }
    80% { transform: translate(2px, 0); color: #FF00A8; }
    81% { transform: translate(0); color: #8A9BA8; }
}

#artifact-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.artifact-block {
    position: absolute;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

.corrupt-panel {
    position: absolute;
    width: clamp(260px, 32vw, 460px);
    padding: 18px 22px;
    border: 1px solid #00F0FF;
    background: rgba(10, 10, 15, 0.7);
    z-index: 5;
    mix-blend-mode: difference;
    animation: corrupt-border 2s infinite steps(1);
}

.corrupt-panel p {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #F0F0FF;
    line-height: 1.8;
}

@keyframes corrupt-border {
    0%, 100% { border-color: #00F0FF; transform: translate(0); }
    15% { border-color: #FF00A8; transform: translate(2px, -1px); }
    16% { border-color: #00F0FF; transform: translate(0); }
    40% { border-color: #39FF14; transform: translate(-3px, 1px); }
    41% { border-color: #00F0FF; transform: translate(0); }
    65% { border-color: #FF00A8; transform: translate(1px, 2px); }
    66% { border-color: #00F0FF; transform: translate(0); }
    85% { border-color: #39FF14; transform: translate(-1px, -2px); box-shadow: 3px -1px 0 rgba(255,0,168,0.5), -2px 1px 0 rgba(57,255,20,0.4); }
    86% { border-color: #00F0FF; transform: translate(0); box-shadow: none; }
}

/* ===========================
   Zone 0x03 — RECONSTRUCT
   =========================== */
#zone-0x03 {
    background: #003B4A;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
}

#triangle-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 90vw;
    max-width: 1000px;
    gap: 4px;
    z-index: 5;
    position: relative;
}

.tri-cell {
    aspect-ratio: 1 / 0.866;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tri-shape {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: clip-path 400ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 300;
    font-size: 11px;
    color: #F0F0FF;
    text-align: center;
    padding: 10px;
    cursor: pointer;
}

.tri-up {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.tri-down {
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
}

.tri-shape:hover {
    clip-path: circle(50%);
    transform: scale(1.2);
    z-index: 10;
}

/* Triangle color fills */
.tri-fill-0 { background: #003B4A; }
.tri-fill-1 { background: #0D0B1A; }
.tri-fill-2 { background: rgba(0, 240, 255, 0.15); }
.tri-fill-3 { background: rgba(138, 155, 168, 0.3); }
.tri-fill-4 { background: rgba(255, 0, 168, 0.1); }
.tri-fill-5 { background: rgba(0, 59, 74, 0.8); }

/* ===========================
   Zone 0x04 — TRANSMIT
   =========================== */
#zone-0x04 {
    background: #0A0A0F;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#sigil-container {
    width: clamp(200px, 30vw, 350px);
    height: clamp(200px, 30vw, 350px);
    perspective: 800px;
    z-index: 5;
}

#hex-sigil {
    width: 100%;
    height: 100%;
    animation: sigil-rotate 12s linear infinite;
}

@keyframes sigil-rotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.hex-ring {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}

.hex-ring.animate-in {
    stroke-dashoffset: 0;
}

.hex-outer { stroke-width: 1.5; }
.hex-middle { stroke-width: 1.2; }
.hex-inner { stroke-width: 1; }

#sigil-container svg line {
    opacity: 0;
    transition: opacity 1.5s ease 0.5s;
}

#sigil-container.animate-in svg line {
    opacity: 1;
}

#transmit-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 2vw, 22px);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #F0F0FF;
    margin-top: 40px;
    z-index: 5;
    opacity: 0;
    transition: opacity 1.5s ease 1s;
}

#transmit-text.visible {
    opacity: 1;
}

/* ===========================
   Glitch Band Flashes (Zone 0x02)
   =========================== */
.glitch-band {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .data-panel {
        width: clamp(200px, 80vw, 400px);
        left: 5% !important;
    }

    .corrupt-panel {
        width: clamp(200px, 80vw, 400px);
        left: 5% !important;
    }

    #triangle-grid {
        grid-template-columns: repeat(4, 1fr);
        width: 95vw;
    }

    #hero-text {
        font-size: clamp(60px, 18vw, 200px);
    }
}
