/* ============================================
   infra.day - Styles
   Isometric Technical Blueprint Aesthetic
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0A0F1A;
    color: #E8ECF1;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Isometric Grid Background --- */
#iso-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Coordinate Marker --- */
.coord-marker {
    position: fixed;
    top: 8px;
    left: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #6B7A8D;
    letter-spacing: 0.1em;
    z-index: 100;
    opacity: 0.5;
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 40px;
    background: transparent;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.nav-link {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #B0BAC9;
    text-decoration: none;
    padding: 4px 16px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: #00D4FF;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #E8ECF1;
}

.nav-link.active::after {
    transform: scaleX(1);
}

.nav-pipe {
    color: #3A4A5E;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    user-select: none;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 1;
    padding: 80px 60px;
    min-height: 100vh;
}

/* --- Hero Section --- */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

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

#hero-title-svg {
    width: 500px;
    max-width: 80vw;
    height: auto;
    margin-bottom: 24px;
    opacity: 0;
}

#hero-title-svg.animating,
#hero-title-svg.visible {
    opacity: 1;
}

#hero-title-fallback {
    display: none;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 56px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E8ECF1;
}

.title-letter {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.title-letter.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s ease;
}

.title-letter.filled {
    fill: #E8ECF1;
    fill-opacity: 1;
    stroke-opacity: 0.4;
    transition: fill-opacity 0.4s ease, stroke-opacity 0.4s ease;
}

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #6B7A8D;
    min-height: 1.5em;
}

.hero-subtitle .cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #00D4FF;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
    vertical-align: middle;
}

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

/* --- Dimension Lines --- */
.dimension-line {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dim-horizontal {
    bottom: 40px;
    left: 60px;
    right: 60px;
    height: 1px;
    background: #3A4A5E;
    opacity: 0.3;
}

.dim-horizontal::before,
.dim-horizontal::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 10px;
    background: #3A4A5E;
    top: -5px;
}

.dim-horizontal::before { left: 0; }
.dim-horizontal::after { right: 0; }

.dim-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #6B7A8D;
    letter-spacing: 0.1em;
    background: #0A0F1A;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

.dim-footer {
    margin-top: 24px;
    position: relative;
    width: 200px;
    height: 1px;
    background: #3A4A5E;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Grid Container (6-column blueprint) --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Content Blocks --- */
.content-block {
    border: 1px solid #3A4A5E;
    padding: 32px;
    position: relative;
    background: rgba(19, 27, 46, 0.5);
    transition: border-color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.content-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-block.reveal-left {
    transform: translateX(-40px);
}
.content-block.reveal-left.visible {
    transform: translateX(0);
}

.content-block.reveal-right {
    transform: translateX(40px);
}
.content-block.reveal-right.visible {
    transform: translateX(0);
}

.content-block.reveal-bottom {
    transform: translateY(40px);
}
.content-block.reveal-bottom.visible {
    transform: translateY(0);
}

/* Border draw animation */
.content-block.border-animate {
    border-color: transparent;
    background-clip: padding-box;
}

.content-block.border-animate::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid #3A4A5E;
    clip-path: inset(0 100% 100% 0);
    transition: clip-path 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.content-block.border-animate.visible::before {
    clip-path: inset(0 0 0 0);
}

/* Hover effects */
.content-block:hover {
    border-color: #00D4FF;
}

.content-block:hover .block-expand-icon {
    opacity: 1;
}

/* Revision stamp (from data-rev attribute) */
.content-block::after {
    content: attr(data-rev);
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #3A4A5E;
    letter-spacing: 0.1em;
}

/* Column spans */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

/* --- Block Labels --- */
.block-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6B7A8D;
    margin-bottom: 16px;
}

/* --- Typography --- */
.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E8ECF1;
    margin-bottom: 16px;
    line-height: 1.2;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: #B0BAC9;
    margin-bottom: 16px;
}

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

/* --- SVG Labels --- */
.svg-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    fill: #6B7A8D;
    letter-spacing: 0.1em;
}

/* --- Isometric Illustrations --- */
.iso-illustration {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 20px auto 0;
    display: block;
}

.server-rack {
    max-width: 300px;
}

.bridge-truss {
    max-width: 500px;
}

.network-map {
    max-width: 400px;
}

.pipe-network {
    max-width: 400px;
}

/* --- LED Pulse Animation --- */
.led-pulse {
    animation: ledPulse 2s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.1; }
}

/* --- Data Dots --- */
.data-dot {
    opacity: 0.8;
}

.network-map:hover .data-dot animateMotion {
    dur: 1s;
}

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.metric-item {
    text-align: center;
    padding: 16px;
    border: 1px solid #3A4A5E;
}

.metric-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 36px;
    color: #00D4FF;
    display: inline;
}

.metric-unit {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #6B7A8D;
    margin-left: 4px;
}

.metric-label {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #6B7A8D;
    margin-top: 8px;
}

/* --- Structure Layout --- */
.structure-layout {
    display: flex;
    gap: 40px;
    align-items: center;
}

.structure-text {
    flex: 1;
}

.structure-layout .iso-illustration {
    flex: 1.5;
    margin: 0;
}

/* --- Scroll Infrastructure Decorations --- */
.scroll-infra {
    position: fixed;
    top: 0;
    width: 60px;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scroll-infra.visible {
    opacity: 1;
}

.left-infra {
    left: 0;
}

.right-infra {
    right: 0;
}

.scroll-infra svg {
    width: 100%;
    height: 200%;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 1;
    padding: 60px;
    text-align: center;
    border-top: 1px solid #3A4A5E;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.revision-stamp {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #3A4A5E;
    margin-bottom: 16px;
}

.footer-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E8ECF1;
}

.footer-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: #6B7A8D;
}

/* --- Animations --- */
@keyframes slideReveal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

.content-block {
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.3s ease;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-2, .span-3, .span-4, .span-6 {
        grid-column: span 2;
    }

    .section {
        padding: 60px 24px;
    }

    #main-nav {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-link {
        font-size: 11px;
        padding: 4px 8px;
    }

    .structure-layout {
        flex-direction: column;
    }

    .hero-section {
        padding-top: 100px;
    }

    #hero-title-svg {
        width: 320px;
    }

    .section-heading {
        font-size: 22px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .span-2, .span-3, .span-4, .span-6 {
        grid-column: span 1;
    }

    .scroll-infra {
        display: none;
    }
}
