/* ============================================
   addrproxy.com — Bauhaus Switchboard Design
   ============================================ */

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

:root {
    --routing-red: #d42d2d;
    --signal-blue: #1a3a6e;
    --proxy-gold: #e8b829;
    --switch-black: #0a0a0a;
    --paper-white: #f2efe8;
    --grid-gray: #3a3a42;
    --ease-bauhaus: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--switch-black);
    color: var(--paper-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Page Container (Scroll Snap) ---------- */
.page-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
}

/* ---------- Persistent Grid Overlay ---------- */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    pointer-events: none;
    z-index: 100;
}

.grid-col {
    border-right: 1px solid rgba(212, 45, 45, 0.15);
    height: 100vh;
}

.grid-col:first-child {
    border-left: 1px solid rgba(212, 45, 45, 0.15);
}

/* ---------- Station Indicator ---------- */
.station-indicator {
    position: fixed;
    top: 2rem;
    right: 2rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    color: var(--paper-white);
    z-index: 200;
    opacity: 0.7;
    transition: opacity 0.4s var(--ease-bauhaus);
}

/* ---------- Station Base ---------- */
.station {
    min-height: 100vh;
    width: 100%;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

/* ============================================
   Station 1 — The Switchboard (Hero)
   ============================================ */
.station-1 {
    background: var(--switch-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.switchboard-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 1px;
    pointer-events: none;
}

.switchboard-cell {
    border: 1px solid rgba(212, 45, 45, 0.10);
    position: relative;
    transition: background-color 0.3s ease;
}

.switchboard-cell.pulse {
    background-color: rgba(232, 184, 41, 0.05);
}

.switchboard-cell .cell-label {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(212, 45, 45, 0.30);
    line-height: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    padding: 0 4vw;
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 9vw, 10rem);
    letter-spacing: 0.06em;
    line-height: 0.92;
    color: var(--paper-white);
    text-transform: uppercase;
}

.hero-line {
    width: 100%;
    height: 2px;
    background: var(--routing-red);
    margin: 1.5rem auto;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 2.5s var(--ease-bauhaus);
}

.hero-line.animate {
    transform: scaleX(1);
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: rgba(242, 239, 232, 0.6);
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
}

/* ============================================
   Station 2 — The Routing Map
   ============================================ */
.station-2 {
    background: var(--signal-blue);
}

.station-2-grid {
    display: grid;
    grid-template-columns: 1fr repeat(4, 1fr) 1fr repeat(6, 1fr) 1fr;
    min-height: 100vh;
    align-items: center;
}

.routing-text {
    grid-column: 2 / 6;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.routing-gap {
    grid-column: 6 / 7;
}

.routing-image {
    grid-column: 7 / 13;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.infra-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
}

.image-duotone {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.image-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(212, 45, 45, 0.08) 0px,
            rgba(212, 45, 45, 0.08) 1px,
            transparent 1px,
            transparent calc(100% / 6)
        );
    mix-blend-mode: multiply;
    pointer-events: none;
}

.routing-text p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    color: var(--paper-white);
    letter-spacing: 0.01em;
}

/* ---------- Reveal Blocks ---------- */
.reveal-block {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-bauhaus), transform 0.6s var(--ease-bauhaus);
}

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

.reveal-dash {
    width: 0;
    height: 2px;
    background: var(--routing-red);
    margin-bottom: 1rem;
    transition: width 0.3s var(--ease-bauhaus);
}

.reveal-block.visible .reveal-dash {
    width: 48px;
}

/* ============================================
   Station 3 — The Protocol
   ============================================ */
.station-3 {
    background: var(--paper-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 0;
}

.protocol-list {
    width: 100%;
    max-width: 100%;
    padding: 2rem 4vw;
}

.protocol-item {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    align-items: center;
    border-bottom: 1px solid rgba(212, 45, 45, 0.4);
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s var(--ease-bauhaus), transform 0.4s var(--ease-bauhaus);
}

.protocol-item:first-child {
    border-top: 1px solid rgba(212, 45, 45, 0.4);
}

.protocol-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.protocol-content {
    grid-column: 1 / 9;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.protocol-content .reveal-dash {
    width: 0;
    min-width: 0;
    flex-shrink: 0;
    height: 2px;
    background: var(--routing-red);
    transition: width 0.3s var(--ease-bauhaus) 0.1s;
    margin-bottom: 0;
}

.protocol-item.visible .protocol-content .reveal-dash {
    width: 48px;
    min-width: 48px;
}

.protocol-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.04em;
    line-height: 0.92;
    color: var(--switch-black);
    text-transform: uppercase;
}

.protocol-indicator {
    grid-column: 12 / 13;
    display: flex;
    justify-content: center;
    align-items: center;
}

.indicator-square {
    width: 24px;
    height: 24px;
    border: 2px solid var(--routing-red);
    position: relative;
    overflow: hidden;
}

.indicator-square::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--routing-red);
    transform: scale(0);
    transition: transform 0.4s var(--ease-bauhaus) 0.5s;
    transform-origin: center;
}

.protocol-item.visible .indicator-square::after {
    transform: scale(1);
}

/* ============================================
   Station 4 — The Architecture
   ============================================ */
.station-4 {
    background: var(--switch-black);
    position: relative;
    display: flex;
    align-items: flex-end;
}

.architecture-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.arch-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.architecture-panel {
    position: relative;
    z-index: 10;
    background: rgba(10, 10, 10, 0.88);
    padding: 3rem 2.5rem;
    margin: 0;
    width: 42%;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-bauhaus), transform 0.6s var(--ease-bauhaus);
}

.architecture-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.architecture-headline {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: 0.04em;
    line-height: 0.92;
    color: var(--proxy-gold);
    text-transform: uppercase;
}

.architecture-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    color: var(--paper-white);
    letter-spacing: 0.01em;
}

/* ============================================
   Station 5 — The Signal
   ============================================ */
.station-5 {
    background: var(--switch-black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 4vw;
}

.signal-cascade {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}

.cascade-line {
    width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-bauhaus), transform 0.5s var(--ease-bauhaus);
}

.cascade-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.cascade-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    color: var(--paper-white);
    line-height: 1;
}

/* Cascade sizing — each 15% smaller, 15% more transparent, tighter letter-spacing */
.cascade-line[data-cascade="0"] .cascade-text {
    font-size: 9vw;
    opacity: 1;
    letter-spacing: 0.06em;
}
.cascade-line[data-cascade="0"] .cascade-rule {
    opacity: 0.6;
}

.cascade-line[data-cascade="1"] .cascade-text {
    font-size: 7.65vw;
    opacity: 0.85;
    letter-spacing: 0.05em;
}
.cascade-line[data-cascade="1"] .cascade-rule {
    opacity: 0.5;
}

.cascade-line[data-cascade="2"] .cascade-text {
    font-size: 6.5vw;
    opacity: 0.70;
    letter-spacing: 0.04em;
}
.cascade-line[data-cascade="2"] .cascade-rule {
    opacity: 0.4;
}

.cascade-line[data-cascade="3"] .cascade-text {
    font-size: 5.53vw;
    opacity: 0.55;
    letter-spacing: 0.03em;
}
.cascade-line[data-cascade="3"] .cascade-rule {
    opacity: 0.3;
}

.cascade-line[data-cascade="4"] .cascade-text {
    font-size: 4.7vw;
    opacity: 0.40;
    letter-spacing: 0.02em;
}
.cascade-line[data-cascade="4"] .cascade-rule {
    opacity: 0.2;
}

.cascade-line[data-cascade="5"] .cascade-text {
    font-size: 3.99vw;
    opacity: 0.22;
    letter-spacing: 0.01em;
}
.cascade-line[data-cascade="5"] .cascade-rule {
    opacity: 0.12;
}

.cascade-line[data-cascade="6"] .cascade-text {
    font-size: 0.7rem;
    opacity: 0.08;
    letter-spacing: 0;
}
.cascade-line[data-cascade="6"] .cascade-rule {
    opacity: 0.04;
}

.cascade-rule {
    width: 100%;
    height: 1px;
    background: var(--routing-red);
    margin: 0.8rem 0;
}

/* ============================================
   Bauhaus Geometric Annotations
   ============================================ */
.geo-annotations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 90;
}

.geo-element {
    position: absolute;
    opacity: 0.5;
}

.geo-circle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--routing-red);
    border-radius: 50%;
}

.geo-triangle {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 18px solid transparent;
    border-bottom-color: var(--proxy-gold);
    opacity: 0.4;
}

.geo-square {
    width: 16px;
    height: 16px;
    border: 2px solid var(--signal-blue);
}

/* ============================================
   Stepped Gradient Strip
   ============================================ */
.stepped-gradient {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        to right,
        #d42d2d 0%,
        #d42d2d 12.5%,
        #d93e2d 12.5%,
        #d93e2d 25%,
        #de5029 25%,
        #de5029 37.5%,
        #e36525 37.5%,
        #e36525 50%,
        #e87b22 50%,
        #e87b22 62.5%,
        #e8932a 62.5%,
        #e8932a 75%,
        #e8a52b 75%,
        #e8a52b 87.5%,
        #e8b829 87.5%,
        #e8b829 100%
    );
    z-index: 300;
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 1024px) {
    .grid-overlay {
        grid-template-columns: repeat(6, 1fr);
    }

    .grid-overlay .grid-col:nth-child(n+7) {
        display: none;
    }

    .station-2-grid {
        grid-template-columns: 1fr;
    }

    .routing-text {
        grid-column: 1 / -1;
        padding: 4rem 6vw;
    }

    .routing-gap {
        display: none;
    }

    .routing-image {
        grid-column: 1 / -1;
        min-height: 50vh;
    }

    .architecture-panel {
        width: 60%;
    }

    .protocol-item {
        grid-template-columns: repeat(6, 1fr);
    }

    .protocol-content {
        grid-column: 1 / 6;
    }

    .protocol-indicator {
        grid-column: 6 / 7;
    }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 640px) {
    .grid-overlay {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }

    .grid-overlay .grid-col:nth-child(n+4) {
        display: none;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .station-indicator {
        top: 1rem;
        right: 1rem;
        font-size: 1rem;
    }

    .routing-text {
        padding: 3rem 5vw;
    }

    .architecture-panel {
        width: 100%;
        min-height: auto;
        padding: 2rem 5vw;
    }

    .architecture-headline {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    .protocol-text {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    .protocol-content {
        gap: 0.75rem;
    }

    .protocol-item.visible .protocol-content .reveal-dash {
        width: 24px;
        min-width: 24px;
    }

    .cascade-line[data-cascade="0"] .cascade-text { font-size: 14vw; }
    .cascade-line[data-cascade="1"] .cascade-text { font-size: 11.9vw; }
    .cascade-line[data-cascade="2"] .cascade-text { font-size: 10.1vw; }
    .cascade-line[data-cascade="3"] .cascade-text { font-size: 8.6vw; }
    .cascade-line[data-cascade="4"] .cascade-text { font-size: 7.3vw; }
    .cascade-line[data-cascade="5"] .cascade-text { font-size: 6.2vw; }

    .station-3 {
        padding: 3rem 0;
    }

    .protocol-list {
        padding: 1rem 3vw;
    }
}
