/* === infra.day - Blueprint Infrastructure === */
/* Palette: #0d1b2a #1b2d3a #3a6b7c #c47a3a #2ec4b6 #e8edf0 #8aa0ad #e8a838 #c44a3a #ffffff */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0d1b2a;
    color: #e8edf0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* === Blueprint Grid Background === */
.blueprint-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: gridFadeIn 1.2s ease-in-out 0.2s forwards;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(58, 107, 124, 0.08) 19px, rgba(58, 107, 124, 0.08) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(58, 107, 124, 0.08) 19px, rgba(58, 107, 124, 0.08) 20px),
        repeating-linear-gradient(0deg, transparent, transparent 99px, rgba(58, 107, 124, 0.15) 99px, rgba(58, 107, 124, 0.15) 100px),
        repeating-linear-gradient(90deg, transparent, transparent 99px, rgba(58, 107, 124, 0.15) 99px, rgba(58, 107, 124, 0.15) 100px);
}

@keyframes gridFadeIn {
    to { opacity: 1; }
}

/* === Cross-Section Progress Strip === */
.cross-section {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
}

.cs-band {
    width: 100%;
    transition: height 0.6s ease-in-out;
    height: 0%;
}

.cs-physical { background: #6b6b6b; }
.cs-copper { background: #c47a3a; }
.cs-digital { background: #2ec4b6; }
.cs-policy { background: #e8a838; }

/* === Watermarks === */
.watermark {
    position: fixed;
    font-family: 'Share Tech Mono', monospace;
    font-size: 200px;
    color: #e8edf0;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    transform: rotate(-90deg);
    transform-origin: left bottom;
}

.watermark-1 { left: 100px; bottom: 20%; }
.watermark-2 { left: 200px; bottom: 50%; font-size: 160px; }
.watermark-3 { left: 300px; bottom: 30%; font-size: 180px; }
.watermark-4 { left: 400px; bottom: 60%; font-size: 150px; }

/* === Layers / Sections === */
.layer {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 80px 100px 80px 120px;
}

.layer-content {
    max-width: 900px;
    margin: 0 auto;
}

/* === Fold Crease === */
.fold-crease {
    border-top: 1px dashed rgba(58, 107, 124, 0.4);
    margin: 0 80px 0 120px;
    position: relative;
    z-index: 2;
}

/* === Diagonal Transition === */
.diagonal-transition {
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 40px;
    background: #1b2d3a;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* === Foundation / Title === */
#foundation {
    display: flex;
    align-items: center;
}

.site-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    color: #e8edf0;
    text-transform: uppercase;
}

.title-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: charReveal 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.title-rule {
    margin: 16px 0 32px;
    overflow: visible;
}

.rule-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: ruleDraw 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s forwards;
}

@keyframes ruleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes charReveal {
    to { opacity: 1; transform: translateY(0); }
}

.intro-text {
    font-size: 18px;
    color: #e8edf0;
    max-width: 56ch;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.intro-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === Physical Layer === */
.layer-physical {
    background: #1b2d3a;
}

.layer-heading {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e8edf0;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.layer-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.isometric-diagram,
.topology-diagram {
    margin: 40px 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.isometric-diagram.revealed,
.topology-diagram.revealed {
    opacity: 1;
    transform: translateY(0);
}

.iso-svg,
.topo-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.iso-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.revealed .iso-path {
    stroke-dashoffset: 0;
}

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

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

.layer-text {
    font-size: 17px;
    color: #e8edf0;
    max-width: 56ch;
    line-height: 1.7;
    margin: 24px 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.layer-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === Gauges === */
.gauge-row {
    display: flex;
    gap: 40px;
    align-items: center;
    margin: 32px 0;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.gauge-row.revealed {
    opacity: 1;
}

.gauge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gauge-needle {
    transform-origin: 30px 30px;
    transition: transform 0.6s ease-in-out;
}

.gauge:hover .gauge-needle {
    animation: needleOscillate 0.6s ease-in-out;
}

@keyframes needleOscillate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
    100% { transform: rotate(0deg); }
}

.gauge-label {
    font-family: 'Overpass Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    color: #5a8a9a;
}

/* === Logical Layer === */
.layer-logical {
    background: #0d1b2a;
}

/* === Callout Box === */
.callout-box {
    border-left: 2px solid #3a6b7c;
    padding: 16px 24px;
    margin: 32px 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.callout-box.revealed {
    opacity: 1;
    transform: translateY(0);
}

.callout-text {
    font-family: 'Archivo Narrow', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #8aa0ad;
    line-height: 1.6;
}

/* === Abstract Layer === */
.layer-abstract {
    background: #1b2d3a;
}

.packet-dot {
    opacity: 0.8;
}

/* === Coda === */
.layer-coda {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coda-content {
    text-align: center;
    max-width: 50ch;
}

.coda-text {
    font-size: 20px;
    color: #e8edf0;
    line-height: 1.75;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.coda-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.coda-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(100px, 20vw, 300px);
    color: #e8edf0;
    opacity: 0.04;
    letter-spacing: 0.1em;
    white-space: nowrap;
    user-select: none;
}

/* === Responsive === */
@media (max-width: 768px) {
    .layer {
        padding: 60px 20px 60px 80px;
    }

    .cross-section {
        width: 40px;
    }

    .watermark {
        display: none;
    }

    .fold-crease {
        margin: 0 20px 0 80px;
    }

    .gauge-row {
        flex-direction: column;
        gap: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .blueprint-grid { opacity: 1; }
    .iso-path { stroke-dashoffset: 0; }
    .rule-line { stroke-dashoffset: 0; }
}
