/* =============================================
   bada.cafe - Mission Control Swiss Grid
   ============================================= */

/* CSS Custom Properties for counter animation */
@property --counter-val {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}

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

html {
    scroll-behavior: auto;
}

body {
    background: #0A1628;
    color: #E8E3D6;
    font-family: 'Space Mono', monospace;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Scanlines Overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(27, 40, 56, 0.03) 3px,
        rgba(27, 40, 56, 0.03) 4px
    );
}

/* Scroll Container */
.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Station Navigation */
.station-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1B2838;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-dot.active {
    background: #FF3F00;
    box-shadow: 0 0 8px #FF3F00, 0 0 16px rgba(255, 63, 0, 0.4);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px #FF3F00, 0 0 16px rgba(255, 63, 0, 0.4); }
    50% { box-shadow: 0 0 12px #FF3F00, 0 0 24px rgba(255, 63, 0, 0.6); }
}

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

/* =============================================
   Swiss Grid
   ============================================= */
.swiss-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.grid-line {
    position: absolute;
    background: #1B2838;
    transition: background 0.6s ease;
}

.grid-line.vertical {
    width: 1px;
    height: 0%;
    top: 50%;
    transform: translateY(-50%);
    transition: height 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grid-line.horizontal {
    height: 1px;
    width: 0%;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.station-alpha.visible .grid-line.vertical {
    height: 100%;
}

.station-alpha.visible .grid-line.horizontal {
    width: 100%;
}

/* Grid Coordinates */
.grid-coords {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.grid-coord-label {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #1B2838;
    transition: color 0.6s ease;
}

.station-alpha.visible .grid-coord-label {
    color: #5B8A9A;
}

/* Epsilon grid - brighter */
.epsilon-grid .grid-line {
    background: #5B8A9A;
}

.station-epsilon.visible .epsilon-grid .grid-line.vertical {
    height: 100%;
}

.station-epsilon.visible .epsilon-grid .grid-line.horizontal {
    width: 100%;
}

/* =============================================
   Station Alpha - Launch Sequence
   ============================================= */
.station-alpha {
    background: #0A1628;
}

/* Reticle */
.reticle {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border: 1px dashed #1B2838;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: reticleRotate 60s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes reticleRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hero Title */
.hero-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20vw;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E8E3D6;
    white-space: nowrap;
    z-index: 5;
    line-height: 1;
}

.hero-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-char.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Golden Section Line */
.golden-line {
    position: absolute;
    top: 61.8%;
    left: 0;
    height: 2px;
    width: 0%;
    background: #FF3F00;
    z-index: 5;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.station-alpha.visible .golden-line {
    width: 100%;
}

/* Counter Row */
.counter-row {
    position: absolute;
    bottom: 15%;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    z-index: 5;
    padding: 0 2px;
}

.counter-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.counter-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #5B8A9A;
    text-transform: uppercase;
}

.counter-value {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #00E5A0;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

/* =============================================
   Station Beta - Telemetry Dashboard
   ============================================= */
.station-beta {
    background: #0A1628;
}

.dashboard-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
}

.instrument-panel {
    position: relative;
    background: #0F1F35;
    border: 2px solid #1B2838;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 30px 15px 15px;
}

/* Corner brackets */
.panel-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: #5B8A9A;
    border-style: solid;
    border-width: 0;
    z-index: 2;
}

.panel-corner.tl {
    top: 4px;
    left: 4px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.panel-corner.tr {
    top: 4px;
    right: 4px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.panel-corner.bl {
    bottom: 4px;
    left: 4px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.panel-corner.br {
    bottom: 4px;
    right: 4px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.panel-title {
    position: absolute;
    top: 8px;
    left: 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    letter-spacing: 0.2em;
    color: #5B8A9A;
    z-index: 2;
}

/* Radar */
.radar-svg {
    width: 80%;
    height: 80%;
}

.radar-sweep {
    transform-origin: 100px 100px;
    animation: radarSpin 4s linear infinite paused;
}

.station-beta.visible .radar-sweep {
    animation-play-state: running;
}

@keyframes radarSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-blip {
    fill: #00E5A0;
    opacity: 0;
    transition: opacity 1s ease;
}

/* Line Graph */
.linegraph-svg {
    width: 100%;
    height: 80%;
}

.linegraph-line {
    vector-effect: non-scaling-stroke;
}

.linegraph-fill {
    fill: #162A42;
    opacity: 0.3;
}

/* Bar Chart */
.barchart-svg {
    width: 90%;
    height: 80%;
}

.bar-rect {
    fill: #FFB800;
    transition: height 0.5s ease, y 0.5s ease;
}

.bar-label {
    fill: #5B8A9A;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
}

/* Gauge */
.gauge-svg {
    width: 80%;
    height: 80%;
}

.gauge-arc {
    transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Scatter */
.scatter-svg {
    width: 90%;
    height: 80%;
}

.scatter-dot {
    fill: #FF3F00;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scatter-dot.visible {
    opacity: 1;
    animation: scatterPulse 2s ease-in-out infinite;
}

@keyframes scatterPulse {
    0%, 100% { r: 3; }
    50% { r: 5; }
}

/* Waveform */
.waveform-svg {
    width: 100%;
    height: 80%;
}

/* =============================================
   Station Gamma - Network Map
   ============================================= */
.station-gamma {
    background: #0F1F35;
}

.network-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.network-node {
    fill: #FF3F00;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.network-node.visible {
    opacity: 1;
    transform: scale(1);
}

.network-edge {
    stroke: #5B8A9A;
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.4s ease;
}

.network-edge.drawn {
    stroke-dashoffset: 0;
}

.gamma-overlay {
    position: absolute;
    top: 8%;
    left: 30px;
    z-index: 5;
}

.gamma-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 8vw;
    color: #E8E3D6;
    opacity: 0.6;
    letter-spacing: 0.15em;
    line-height: 1;
}

.gamma-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    color: #5B8A9A;
}

.gamma-data .gamma-node-count,
.gamma-data .gamma-edge-count,
.gamma-data .gamma-latency {
    color: #00E5A0;
    font-weight: 700;
}

/* =============================================
   Station Delta - Manifesto
   ============================================= */
.station-delta {
    background: #0A1628;
}

.manifesto-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 60px 30px;
    align-content: center;
}

.manifesto-col {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.manifesto-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 6vw;
    color: #E8E3D6;
    letter-spacing: 0.15em;
    line-height: 1.05;
}

.manifesto-rule {
    width: 0%;
    height: 2px;
    background: #FFB800;
    transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.station-delta.visible .manifesto-rule {
    width: 100%;
}

.manifesto-body {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    line-height: 1.7;
    color: #E8E3D6;
    opacity: 0.85;
    letter-spacing: 0.05em;
}

.manifesto-stat {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: 'Space Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: #FF3F00;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #5B8A9A;
}

/* =============================================
   Station Epsilon - Sign-off
   ============================================= */
.station-epsilon {
    background: #0A1628;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epsilon-minis {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    z-index: 2;
    pointer-events: none;
}

.mini-viz {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transform: scale(0.6);
    padding: 20px;
}

.mini-viz svg {
    width: 100%;
    height: 100%;
}

.mini-radar-sweep {
    transform-origin: 100px 100px;
    animation: radarSpin 4s linear infinite;
}

.epsilon-center {
    position: relative;
    z-index: 10;
    text-align: center;
}

.epsilon-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 8vw;
    color: #E8E3D6;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.blink-cursor {
    font-family: 'Space Mono', monospace;
    color: #00E5A0;
    animation: cursorBlink 530ms step-end infinite;
}

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

.epsilon-coords {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    color: #5B8A9A;
    letter-spacing: 0.05em;
    margin-top: 20px;
}

.epsilon-coord-val {
    color: #00E5A0;
    font-weight: 700;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .hero-title {
        font-size: 14vw;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }

    .manifesto-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        padding: 30px 15px;
    }

    .manifesto-headline {
        font-size: 8vw;
    }

    .manifesto-body {
        font-size: 14px;
    }

    .counter-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .gamma-title {
        font-size: 12vw;
    }

    .epsilon-minis {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

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

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

    .counter-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .epsilon-minis {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
    }
}
