/* monopole.systems - Pop-Art Particle Collider */
/* Hexagonal honeycomb layout with sepia-nostalgic palette + neon accents */

:root {
    --sepia-base: #f5edd6;
    --ink: #3b2510;
    --dot-color: #8b6842;
    --amber: #c4953a;
    --neon-pink: #ff2d78;
    --neon-cyan: #00e5cc;
    --shadow-depth: #1e1208;
    --halftone: #e8d5b0;
    --hex-width: 240px;
    --hex-height: calc(var(--hex-width) * 1.1547);
    --hex-gap: 6px;
    --border-thick: 4px;
    --border-thicker: 6px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--sepia-base);
    color: var(--ink);
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ============================
   ZONE BASE STYLES
   ============================ */

.zone {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 20px;
}

#zone-detection {
    background:
        radial-gradient(circle, var(--dot-color) 30%, transparent 31%),
        var(--sepia-base);
    background-size: 32px 32px;
    background-position: 0 0;
}

#zone-systems {
    background: var(--halftone);
}

#zone-isolation {
    background: var(--shadow-depth);
    min-height: 100vh;
}

#zone-output {
    background:
        radial-gradient(circle, var(--dot-color) 30%, transparent 31%),
        var(--sepia-base);
    background-size: 16px 16px;
}

#zone-archive {
    background: var(--shadow-depth);
    min-height: 80vh;
}

/* ============================
   HEXAGONAL GRID SYSTEM
   ============================ */

.hex-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1;
    position: relative;
}

.hex-row {
    display: flex;
    gap: var(--hex-gap);
}

.hex-row-odd {
    margin-left: calc(var(--hex-width) / 2 + var(--hex-gap) / 2);
    margin-top: calc(var(--hex-height) * -0.12);
}

.hex-row-even + .hex-row-odd,
.hex-row-odd + .hex-row-even {
    margin-top: calc(var(--hex-height) * -0.12);
}

.hex-cell {
    width: var(--hex-width);
    height: var(--hex-height);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    position: relative;
    transition:
        transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 250ms ease,
        filter 250ms ease;
    cursor: pointer;
    flex-shrink: 0;
}

.hex-cell:hover {
    transform: scale(1.08);
    z-index: 10;
    filter: drop-shadow(0 0 24px rgba(255, 45, 120, 0.3));
}

.hex-cell.hex-spacer {
    visibility: hidden;
}

.hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

/* ============================
   BENDAY DOT PATTERNS
   ============================ */

.benday-dots {
    background:
        radial-gradient(circle, var(--dot-color) 30%, transparent 31%);
    background-size: 16px 16px;
    background-color: var(--sepia-base);
}

.benday-dots-alt {
    background:
        radial-gradient(circle, var(--halftone) 30%, transparent 31%);
    background-size: 8px 8px;
    background-color: var(--sepia-base);
}

/* Neon dot overlay for hover */
.hex-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background:
        radial-gradient(circle, var(--neon-pink) 30%, transparent 31%);
    background-size: 16px 16px;
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
    z-index: 2;
}

.hex-cell:hover::after {
    opacity: 0.15;
}

/* ============================
   ZONE 1: DETECTION GRID
   ============================ */

.hex-title-cell .hex-inner {
    background: var(--ink);
    border: none;
}

.hex-title-fragment {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sepia-base);
    text-transform: lowercase;
}

.hex-dormant .hex-inner {
    background: var(--sepia-base);
    border: var(--border-thick) solid var(--ink);
    clip-path: none;
}

.hex-dormant {
    opacity: 0.75;
}

.hex-log {
    font-family: 'Azeret Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.04em;
    color: var(--dot-color);
    word-break: break-all;
}

.hex-monopole-detect .hex-inner {
    background: var(--shadow-depth);
    box-shadow:
        0 0 8px var(--neon-pink),
        0 0 20px var(--neon-pink),
        0 0 40px rgba(255, 45, 120, 0.3);
}

.hex-monopole-detect {
    opacity: 1;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 12px var(--neon-pink)); }
    50% { filter: drop-shadow(0 0 30px var(--neon-pink)) drop-shadow(0 0 60px rgba(255, 45, 120, 0.4)); }
}

.monopole-mini {
    width: 80px;
    height: 80px;
}

.monopole-core {
    animation: core-pulse 2s ease-in-out infinite;
}

@keyframes core-pulse {
    0%, 100% { r: 8; }
    50% { r: 12; }
}

.field-line {
    filter: drop-shadow(0 0 4px var(--neon-pink));
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: flow-out 3s linear infinite;
}

@keyframes flow-out {
    to { stroke-dashoffset: 0; }
}

.detect-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-pink);
    letter-spacing: 0.1em;
    margin-top: 4px;
    text-shadow: 0 0 8px var(--neon-pink);
}

/* ============================
   FLOATING BADGES
   ============================ */

.floating-badge {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.float-1 { top: 10%; left: 5%; animation: float-drift-1 12s ease-in-out infinite; }
.float-2 { top: 60%; right: 8%; animation: float-drift-2 10s ease-in-out infinite; }
.float-3 { bottom: 15%; left: 12%; animation: float-drift-3 14s ease-in-out infinite; }
.float-4 { top: 25%; right: 15%; animation: float-drift-1 11s ease-in-out infinite reverse; }
.float-5 { bottom: 25%; right: 20%; animation: float-drift-2 13s ease-in-out infinite; }

.float-word {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--amber);
    letter-spacing: 0.1em;
    opacity: 0.6;
}

.float-word.neon-pink {
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
}

@keyframes float-drift-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -10px) rotate(3deg); }
    50% { transform: translate(-5px, 12px) rotate(-2deg); }
    75% { transform: translate(8px, -8px) rotate(1deg); }
}

@keyframes float-drift-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-12px, 8px) rotate(-3deg); }
    66% { transform: translate(10px, -6px) rotate(2deg); }
}

@keyframes float-drift-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -15px); }
}

/* ============================
   ZONE 2: SYSTEMS MAP
   ============================ */

.systems-grid {
    max-width: 900px;
}

.hex-module .hex-inner {
    background: var(--sepia-base);
    border: var(--border-thicker) solid var(--ink);
    clip-path: none;
}

.module-inner {
    padding: 15px;
}

.module-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
}

.module-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ink);
    text-transform: uppercase;
}

/* Speech Bubbles */
.speech-bubble {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -80px;
    width: 200px;
    background: var(--sepia-base);
    border: var(--border-thick) solid var(--ink);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 6px 6px 0 var(--ink);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease, transform 300ms ease;
    z-index: 20;
}

.speech-bubble.speech-below {
    transform: translateX(-50%) translateY(10px);
}

.hex-module:hover .speech-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.speech-bubble p {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--ink);
    margin: 0;
}

.bubble-tail {
    position: absolute;
    top: -12px;
    left: 50%;
    margin-left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid var(--ink);
}

.bubble-tail::after {
    content: '';
    position: absolute;
    top: 4px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 9px solid var(--sepia-base);
}

/* Connection Lines */
.system-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.connection-line {
    stroke-dasharray: 8 4;
    filter: drop-shadow(0 0 4px var(--neon-cyan));
    animation: dash-flow 2s linear infinite;
}

.connection-line.pink {
    filter: drop-shadow(0 0 4px var(--neon-pink));
}

@keyframes dash-flow {
    to { stroke-dashoffset: -24; }
}

/* ============================
   ZONE 3: ISOLATION CHAMBER
   ============================ */

.isolation-container {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-hex {
    width: 100%;
    height: 100%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--ink);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--border-thicker) solid var(--amber);
}

.hex-ring {
    position: absolute;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 3px solid var(--neon-pink);
    opacity: 0.3;
}

.ring-1 {
    width: 95%;
    height: 95%;
    animation: ring-pulse 4s ease-in-out infinite;
    border-color: var(--neon-pink);
}

.ring-2 {
    width: 75%;
    height: 75%;
    animation: ring-pulse 4s ease-in-out infinite 1s;
    border-color: var(--amber);
}

.ring-3 {
    width: 55%;
    height: 55%;
    animation: ring-pulse 4s ease-in-out infinite 2s;
    border-color: var(--neon-cyan);
}

.ring-4 {
    width: 35%;
    height: 35%;
    animation: ring-pulse 4s ease-in-out infinite 3s;
    border-color: var(--neon-pink);
    background:
        radial-gradient(circle, var(--neon-pink) 30%, transparent 31%);
    background-size: 8px 8px;
    opacity: 0.1;
}

@keyframes ring-pulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.03); }
}

.monopole-main {
    width: 60%;
    height: 60%;
    position: relative;
    z-index: 3;
}

.monopole-core-main {
    animation: main-core-pulse 2s ease-in-out infinite;
}

@keyframes main-core-pulse {
    0%, 100% { r: 12; }
    50% { r: 18; }
}

.main-field-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: main-flow 4s linear infinite;
    filter: drop-shadow(0 0 8px var(--neon-pink));
}

@keyframes main-flow {
    to { stroke-dashoffset: 0; }
}

/* Caption Boxes */
.caption-box {
    position: absolute;
    background: var(--sepia-base);
    border: var(--border-thick) solid var(--ink);
    padding: 8px 14px;
    box-shadow: 4px 4px 0 var(--ink);
    z-index: 5;
    animation: caption-float 8s ease-in-out infinite;
}

.caption-1 { top: 5%; left: 5%; animation-delay: 0s; }
.caption-2 { top: 5%; right: 5%; animation-delay: 2s; }
.caption-3 { bottom: 5%; left: 5%; animation-delay: 4s; }
.caption-4 { bottom: 5%; right: 5%; animation-delay: 6s; }

@keyframes caption-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.caption-label {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--dot-color);
    display: block;
}

.caption-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    display: block;
}

/* ============================
   ZONE 4: OUTPUT TERMINAL
   ============================ */

.output-grid {
    max-width: 1100px;
}

.hex-readout .hex-inner {
    background: var(--sepia-base);
    border: var(--border-thick) solid var(--ink);
    clip-path: none;
    box-shadow: 4px 4px 0 var(--ink);
}

.readout-inner {
    padding: 15px 10px;
}

.oscilloscope {
    width: 100%;
    max-width: 120px;
    height: auto;
    margin-bottom: 8px;
}

.wave-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: wave-draw 3s linear infinite;
}

@keyframes wave-draw {
    to { stroke-dashoffset: 0; }
}

.readout-label {
    font-family: 'Azeret Mono', monospace;
    font-size: clamp(0.55rem, 0.7vw, 0.7rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--dot-color);
    text-transform: uppercase;
    display: block;
    margin-top: 4px;
}

.speech-bubble-inline {
    background: var(--halftone);
    border: 2px solid var(--ink);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    box-shadow: 3px 3px 0 var(--ink);
}

.binary-data {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    color: var(--neon-cyan);
    word-break: break-all;
}

.readout-text {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--ink);
}

/* ============================
   ZONE 5: ARCHIVE PLATE
   ============================ */

.archive-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    max-width: 800px;
    padding: 40px;
}

.hex-archive {
    width: 180px;
    height: calc(180px * 1.1547);
    opacity: 0.8;
    transition: opacity 600ms ease;
}

.hex-archive:hover {
    opacity: 1;
}

.hex-archive .hex-inner {
    background: var(--ink);
    border: 2px solid var(--amber);
}

.archive-inner {
    padding: 10px;
}

.archive-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--sepia-base);
    font-size: 0.85rem;
}

.archive-domain-main {
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
}

.archive-date {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.8rem;
    color: var(--amber);
}

.archive-code {
    font-family: 'Azeret Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--halftone);
}

.archive-small {
    font-size: 0.7rem;
    color: var(--dot-color);
    letter-spacing: 0.15em;
}

.archive-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--halftone);
    opacity: 0.7;
}

/* Archive floating animation */
.hex-float-1 { animation: archive-drift 15s ease-in-out infinite; }
.hex-float-2 { animation: archive-drift 12s ease-in-out infinite 2s; }
.hex-float-3 { animation: archive-drift 14s ease-in-out infinite 4s; }
.hex-float-4 { animation: archive-drift 11s ease-in-out infinite 1s; }
.hex-float-5 { animation: archive-drift 13s ease-in-out infinite 3s; }
.hex-float-6 { animation: archive-drift 10s ease-in-out infinite 5s; }
.hex-float-7 { animation: archive-drift 16s ease-in-out infinite 2.5s; }

@keyframes archive-drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(8px, -6px) rotate(1deg); }
    50% { transform: translate(-4px, 10px) rotate(-1deg); }
    75% { transform: translate(6px, -3px) rotate(0.5deg); }
}

/* ============================
   GLOW PULSE EFFECT
   ============================ */

.glow-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    pointer-events: none;
    z-index: 15;
    animation: glow-expand 500ms ease-out forwards;
}

@keyframes glow-expand {
    0% {
        box-shadow: inset 0 0 20px var(--neon-pink);
        opacity: 1;
    }
    100% {
        box-shadow: inset 0 0 80px var(--neon-pink), 0 0 40px var(--neon-pink);
        opacity: 0;
    }
}

/* ============================
   ZONE TRANSITIONS
   ============================ */

.zone[data-zone] .hex-cell {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.zone.zone-visible .hex-cell {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.zone.zone-visible .hex-dormant {
    opacity: 0.75;
}

.zone.zone-visible .hex-cell:nth-child(1) { transition-delay: 0ms; }
.zone.zone-visible .hex-cell:nth-child(2) { transition-delay: 80ms; }
.zone.zone-visible .hex-cell:nth-child(3) { transition-delay: 160ms; }
.zone.zone-visible .hex-cell:nth-child(4) { transition-delay: 240ms; }

.zone.zone-visible .hex-row:nth-child(2) .hex-cell:nth-child(1) { transition-delay: 100ms; }
.zone.zone-visible .hex-row:nth-child(2) .hex-cell:nth-child(2) { transition-delay: 180ms; }
.zone.zone-visible .hex-row:nth-child(2) .hex-cell:nth-child(3) { transition-delay: 260ms; }
.zone.zone-visible .hex-row:nth-child(2) .hex-cell:nth-child(4) { transition-delay: 340ms; }

.zone.zone-visible .hex-row:nth-child(3) .hex-cell:nth-child(1) { transition-delay: 200ms; }
.zone.zone-visible .hex-row:nth-child(3) .hex-cell:nth-child(2) { transition-delay: 280ms; }
.zone.zone-visible .hex-row:nth-child(3) .hex-cell:nth-child(3) { transition-delay: 360ms; }
.zone.zone-visible .hex-row:nth-child(3) .hex-cell:nth-child(4) { transition-delay: 440ms; }

.zone.zone-visible .hex-row:nth-child(4) .hex-cell:nth-child(1) { transition-delay: 300ms; }
.zone.zone-visible .hex-row:nth-child(4) .hex-cell:nth-child(2) { transition-delay: 380ms; }
.zone.zone-visible .hex-row:nth-child(4) .hex-cell:nth-child(3) { transition-delay: 460ms; }
.zone.zone-visible .hex-row:nth-child(4) .hex-cell:nth-child(4) { transition-delay: 540ms; }

/* Isolation zone */
.isolation-container {
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.zone-visible .isolation-container {
    opacity: 1;
    transform: scale(1);
}

/* Archive zone */
#zone-archive .hex-archive {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

#zone-archive.zone-visible .hex-archive {
    opacity: 0.8;
    transform: translateY(0);
}

#zone-archive.zone-visible .hex-float-1 { transition-delay: 0ms; }
#zone-archive.zone-visible .hex-float-2 { transition-delay: 120ms; }
#zone-archive.zone-visible .hex-float-3 { transition-delay: 240ms; }
#zone-archive.zone-visible .hex-float-4 { transition-delay: 360ms; }
#zone-archive.zone-visible .hex-float-5 { transition-delay: 480ms; }
#zone-archive.zone-visible .hex-float-6 { transition-delay: 600ms; }
#zone-archive.zone-visible .hex-float-7 { transition-delay: 720ms; }

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 900px) {
    :root {
        --hex-width: 160px;
    }

    .hex-row-odd {
        margin-left: calc(var(--hex-width) / 2 + var(--hex-gap) / 2);
    }

    .caption-box {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .archive-container {
        gap: 15px;
    }

    .hex-archive {
        width: 130px;
        height: calc(130px * 1.1547);
    }
}

@media (max-width: 600px) {
    :root {
        --hex-width: 120px;
    }

    .hex-title-fragment {
        font-size: 1.5rem;
    }

    .speech-bubble {
        width: 160px;
        font-size: 0.7rem;
    }

    .caption-box {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 5px;
    }

    .isolation-container {
        width: 90vmin;
        height: 90vmin;
    }

    .archive-container {
        gap: 10px;
    }

    .hex-archive {
        width: 100px;
        height: calc(100px * 1.1547);
    }
}
