/* infra.day - brutalist neon grids agency */
/* Palette: #1a1a1a, #252525, #39ff14, #ff6b35, #d4d4d4 */
/* Fonts: Space Grotesk 700, Inter 400, Fira Code 400 */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #1a1a1a;
    color: #d4d4d4;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   NEON GRID OVERLAY
   ======================================== */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            rgba(57, 255, 20, 0.05) 0px,
            transparent 1px,
            transparent 60px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(57, 255, 20, 0.05) 0px,
            transparent 1px,
            transparent 60px
        );
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   SHARED
   ======================================== */
.section-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: #39ff14;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
}

.section-line {
    width: 60px;
    height: 2px;
    background: rgba(57, 255, 20, 0.4);
    margin-top: 8px;
}

/* ========================================
   HERO: EXPOSE (0-100vh)
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

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

.hero-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #39ff14;
    letter-spacing: 0.3em;
    display: block;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease 0.3s forwards;
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 6rem);
    color: #d4d4d4;
    line-height: 1;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease 0.5s forwards;
}

.brand-dot {
    color: #39ff14;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #d4d4d4;
    opacity: 0;
    margin-top: 1rem;
    animation: fadeSlideUp 0.8s ease 0.8s forwards;
}

.hero-bar {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 2.5rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease 1.1s forwards;
}

.hero-bar-seg {
    width: 40px;
    height: 3px;
    background: #39ff14;
    opacity: 0.5;
}

.hero-bar-seg:first-child {
    opacity: 1;
}

/* Hero corner grid markers */
.hero-grid-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(57, 255, 20, 0.3);
    border-style: solid;
    border-width: 0;
    z-index: 1;
}

.hero-grid-marker--tl {
    top: 40px;
    left: 40px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.hero-grid-marker--tr {
    top: 40px;
    right: 40px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.hero-grid-marker--bl {
    bottom: 40px;
    left: 40px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.hero-grid-marker--br {
    bottom: 40px;
    right: 40px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* ========================================
   STRUCTURE: INFRASTRUCTURE BLOCKS (100-260vh)
   ======================================== */
.structure {
    max-width: 760px;
    margin: 0 auto;
    padding: 6rem 1.5rem;
    position: relative;
    z-index: 1;
}

.structure-header {
    margin-bottom: 3rem;
}

.infra-block {
    border: 2px solid rgba(57, 255, 20, 0.8);
    padding: 2rem;
    background: #252525;
    margin-bottom: 2rem;
    position: relative;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.infra-block:hover {
    border-color: #39ff14;
    background: #2a2a2a;
}

/* Grid-crossing effect: blocks extend beyond container */
.infra-block[data-grid-cross="left"] {
    margin-left: -30px;
}

.infra-block[data-grid-cross="right"] {
    margin-right: -30px;
}

.infra-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.node-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #39ff14;
    opacity: 0.6;
    letter-spacing: 0.15em;
}

.node-status {
    width: 6px;
    height: 6px;
    background: #39ff14;
    display: inline-block;
    animation: statusBlink 3s ease infinite;
}

.node-status--warn {
    background: #ff6b35;
    animation: statusBlinkWarn 2s ease infinite;
}

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

@keyframes statusBlinkWarn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.block-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #39ff14;
    margin-bottom: 0.5rem;
}

.block-text {
    font-size: 0.85rem;
    color: #d4d4d4;
    opacity: 0.75;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.block-metrics {
    display: flex;
    gap: 1.5rem;
    border-top: 1px solid rgba(57, 255, 20, 0.15);
    padding-top: 1rem;
}

.metric {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: #d4d4d4;
    opacity: 0.6;
}

.metric-val {
    color: #39ff14;
    opacity: 1;
    font-size: 0.75rem;
    margin-right: 3px;
}

.metric-unit {
    opacity: 0.5;
}

/* ========================================
   PIPELINE (260-340vh)
   ======================================== */
.pipeline {
    padding: 6rem 1.5rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.pipeline-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pipeline-header .section-line {
    margin: 8px auto 0;
}

.pipe-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.pipe-node-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pipe-node-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.5rem;
    color: #39ff14;
    opacity: 0.4;
    letter-spacing: 0.1em;
}

.pipe-node {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #1a1a1a;
    background: #39ff14;
    padding: 0.6rem 1rem;
    font-weight: 400;
    text-align: center;
    min-width: 60px;
    border: none;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease;
}

.pipe-node:hover {
    background: #d4d4d4;
    color: #1a1a1a;
}

.pipe-line {
    width: 40px;
    height: 2px;
    background: rgba(57, 255, 20, 0.6);
    position: relative;
    overflow: hidden;
}

.pipe-packet {
    position: absolute;
    top: -1px;
    left: -8px;
    width: 8px;
    height: 4px;
    background: #39ff14;
    animation: packetMove 2s linear infinite;
}

@keyframes packetMove {
    0% { left: -8px; }
    100% { left: 40px; }
}

.pipeline-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.pipe-stat {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #d4d4d4;
    opacity: 0.5;
}

.pipe-stat-val {
    color: #39ff14;
    opacity: 1;
}

.pipe-stat-val--ok {
    color: #39ff14;
}

/* ========================================
   FOUNDATION (340vh+)
   ======================================== */
.foundation {
    position: relative;
    padding: 8rem 2rem;
    z-index: 1;
    overflow: hidden;
    background: #151515;
}

.crosshatch-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(57, 255, 20, 0.02) 0px,
            transparent 1px,
            transparent 12px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(57, 255, 20, 0.02) 0px,
            transparent 1px,
            transparent 12px
        );
    pointer-events: none;
}

.foundation-inner {
    position: relative;
    text-align: center;
    z-index: 2;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #39ff14;
    margin: 0 auto 2rem;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(57, 255, 20, 0.6); }
    50% { opacity: 0.3; box-shadow: 0 0 2px rgba(57, 255, 20, 0.2); }
}

.foundation-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #d4d4d4;
}

.foundation-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: #39ff14;
    opacity: 0.3;
    display: block;
    margin-top: 1rem;
    letter-spacing: 0.15em;
}

.foundation-line {
    width: 40px;
    height: 1px;
    background: rgba(57, 255, 20, 0.2);
    margin: 2rem auto;
}

.foundation-sig {
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: #d4d4d4;
    opacity: 0.2;
    letter-spacing: 0.2em;
    text-transform: lowercase;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .infra-block[data-grid-cross="left"],
    .infra-block[data-grid-cross="right"] {
        margin-left: 0;
        margin-right: 0;
    }

    .pipe-row {
        flex-direction: column;
        gap: 0;
    }

    .pipe-line {
        width: 2px;
        height: 24px;
    }

    .pipe-packet {
        top: -8px;
        left: -1px;
        width: 4px;
        height: 8px;
        animation: packetMoveVert 2s linear infinite;
    }

    @keyframes packetMoveVert {
        0% { top: -8px; }
        100% { top: 24px; }
    }

    .pipeline-stats {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .block-metrics {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero-grid-marker {
        display: none;
    }

    .foundation-text {
        font-size: 1.8rem;
    }
}
