/* ============================================================
   gabs.boo — Deep Space Observatory Interface
   Sci-fi watercolor aesthetic | Parallax sections layout
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --observatory-midnight: #1C2A3A;
    --nebula-slate: #2E4156;
    --watercolor-amber: #D4956A;
    --diluted-apricot: #E8C9A8;
    --bleached-parchment: #E8DFD0;
    --steel-mist: #9CAAB8;
    --signal-blue: #7B9EBC;
    --void-black: #0D1520;
    --twilight-ink: #3A4E62;

    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
    --font-data: 'Overpass Mono', 'Courier New', monospace;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--void-black);
    color: var(--steel-mist);
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Parallax Background Layers --- */
.parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 200vh;
    pointer-events: none;
    will-change: transform;
    z-index: 0;
}

.parallax-layer-1 {
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(13, 21, 32, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 70% 60%, rgba(28, 42, 58, 0.8) 0%, transparent 60%),
        radial-gradient(ellipse 90% 50% at 50% 80%, rgba(13, 21, 32, 0.9) 0%, transparent 50%);
    z-index: 1;
}

.parallax-layer-2 {
    background:
        radial-gradient(ellipse 50% 40% at 30% 40%, rgba(46, 65, 86, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 40% 50% at 65% 25%, rgba(123, 158, 188, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 35% at 80% 70%, rgba(46, 65, 86, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse 35% 45% at 15% 75%, rgba(123, 158, 188, 0.08) 0%, transparent 50%);
    z-index: 2;
}

.parallax-layer-3 {
    background:
        radial-gradient(ellipse 20% 15% at 25% 20%, rgba(212, 149, 106, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 15% 20% at 60% 45%, rgba(212, 149, 106, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 25% 18% at 80% 30%, rgba(212, 149, 106, 0.08) 0%, transparent 65%),
        radial-gradient(ellipse 18% 22% at 40% 75%, rgba(212, 149, 106, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 12% 12% at 10% 55%, rgba(232, 201, 168, 0.04) 0%, transparent 50%);
    z-index: 3;
}

/* --- Navigation Diamonds --- */
.deck-nav {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-diamond {
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-diamond span {
    display: block;
    width: 6px;
    height: 6px;
    border: 1px solid var(--signal-blue);
    transform: rotate(45deg);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.5;
}

.nav-diamond.active span {
    background-color: var(--watercolor-amber);
    border-color: var(--watercolor-amber);
    opacity: 1;
    box-shadow: 0 0 8px rgba(212, 149, 106, 0.4);
}

.nav-diamond:hover span {
    border-color: var(--diluted-apricot);
    opacity: 0.8;
}

/* --- Observatory (Main) --- */
.observatory {
    position: relative;
    z-index: 10;
}

/* --- Deck (Section) Base --- */
.deck {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
    padding: 60px;
}

.deck-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* --- Typography --- */
.telemetry-label {
    font-family: var(--font-data);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--signal-blue);
    opacity: 0.7;
}

.section-title {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--bleached-parchment);
    margin: 12px 0 20px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--bleached-parchment);
    margin: 12px 0 16px;
}

.card-body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--steel-mist);
}

.card-label {
    display: block;
    margin-bottom: 4px;
}

/* --- Decorative Line --- */
.decorative-line {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(123, 158, 188, 0.3) 50%,
        transparent 100%
    );
    width: 0;
    margin: 16px 0;
    transition: width 1.2s ease-out;
}

.decorative-line.visible {
    width: 100%;
}

/* --- Deck 1: The Aperture --- */
.deck-aperture {
    min-height: 100vh;
}

.aperture-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

.aperture-telemetry {
    display: flex;
    gap: 40px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 1s ease-out 0.5s;
}

.aperture-telemetry.visible {
    opacity: 1;
    transform: translateY(0);
}

.aperture-title {
    font-family: var(--font-display);
    font-size: 80px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--bleached-parchment);
    display: flex;
    gap: 0;
    overflow: hidden;
}

.aperture-title .letter {
    display: inline-block;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.aperture-title .letter.visible {
    opacity: 1;
    transform: translateX(0) translateY(0) !important;
}

.aperture-subtitle {
    font-family: var(--font-body);
    font-size: 19px;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--steel-mist);
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease-out;
}

.aperture-subtitle.visible {
    opacity: 0.8;
    transform: translateY(0);
}

.aperture-line {
    width: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--watercolor-amber),
        transparent
    );
    transition: width 1.5s ease-out;
}

.aperture-line.visible {
    width: 200px;
}

.aperture-coordinates {
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.aperture-coordinates.visible {
    opacity: 0.7;
}

/* --- Deck 2: The Signal Array --- */
.signal-grid {
    display: grid;
    grid-template-columns: 38% 24% 38%;
    gap: 0;
    min-height: 80vh;
    align-items: start;
    padding-top: 40px;
}

.signal-col {
    padding: 20px;
}

.signal-col-left,
.signal-col-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.signal-col-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-card {
    background:
        radial-gradient(ellipse 70% 60% at 30% 40%, rgba(212, 149, 106, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 70% at 70% 60%, rgba(123, 158, 188, 0.08) 0%, transparent 60%),
        linear-gradient(135deg, rgba(46, 65, 86, 0.6) 0%, rgba(28, 42, 58, 0.4) 100%);
    padding: 32px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    clip-path: polygon(
        0% 3%, 2% 0%, 8% 1%, 15% 0%, 25% 2%, 35% 0%, 45% 1%, 55% 0%,
        65% 2%, 75% 0%, 85% 1%, 92% 0%, 98% 2%, 100% 0%,
        100% 15%, 99% 30%, 100% 45%, 99% 60%, 100% 75%, 99% 85%, 100% 97%,
        98% 100%, 90% 99%, 80% 100%, 70% 98%, 60% 100%, 50% 99%, 40% 100%,
        30% 98%, 20% 100%, 10% 99%, 2% 100%, 0% 98%,
        1% 85%, 0% 70%, 1% 55%, 0% 40%, 1% 25%, 0% 12%
    );
}

.signal-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Unique clip-paths for individual cards */
.signal-col-left .signal-card:nth-child(2) {
    clip-path: polygon(
        1% 2%, 4% 0%, 12% 1%, 20% 0%, 30% 3%, 42% 0%, 50% 2%, 60% 0%,
        70% 1%, 78% 0%, 88% 2%, 95% 0%, 100% 3%,
        99% 18%, 100% 35%, 98% 50%, 100% 65%, 99% 80%, 100% 95%, 97% 100%,
        88% 98%, 78% 100%, 68% 99%, 55% 100%, 42% 98%, 30% 100%, 18% 99%,
        8% 100%, 0% 97%,
        2% 82%, 0% 65%, 1% 48%, 0% 32%, 2% 18%
    );
}

.signal-col-right .signal-card:first-child {
    clip-path: polygon(
        0% 1%, 5% 0%, 15% 2%, 28% 0%, 38% 1%, 48% 0%, 58% 3%, 68% 0%,
        80% 1%, 90% 0%, 97% 2%, 100% 0%,
        100% 12%, 98% 28%, 100% 42%, 99% 58%, 100% 72%, 98% 88%, 100% 100%,
        92% 98%, 82% 100%, 72% 99%, 58% 100%, 45% 97%, 32% 100%, 20% 98%,
        8% 100%, 0% 99%,
        1% 82%, 0% 68%, 2% 52%, 0% 38%, 1% 22%, 0% 8%
    );
}

.signal-col-right .signal-card:nth-child(2) {
    clip-path: polygon(
        2% 0%, 10% 2%, 22% 0%, 35% 1%, 45% 0%, 58% 2%, 72% 0%,
        82% 3%, 92% 0%, 100% 1%,
        99% 15%, 100% 32%, 98% 48%, 100% 62%, 99% 78%, 100% 92%, 98% 100%,
        85% 99%, 72% 100%, 60% 98%, 48% 100%, 35% 99%, 22% 100%, 10% 97%,
        0% 100%,
        1% 88%, 0% 72%, 2% 55%, 0% 42%, 1% 28%, 0% 15%
    );
}

/* --- Data Stream (center column glyphs) --- */
.data-stream {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px 0;
}

.data-glyph {
    width: 24px;
    height: 24px;
    opacity: 0.4;
    animation: glyph-pulse 4s ease-in-out infinite;
}

.data-glyph:nth-child(1) { animation-delay: 0s; }
.data-glyph:nth-child(2) { animation-delay: 0.2s; }
.data-glyph:nth-child(3) { animation-delay: 0.4s; }
.data-glyph:nth-child(4) { animation-delay: 0.6s; }
.data-glyph:nth-child(5) { animation-delay: 0.8s; }
.data-glyph:nth-child(6) { animation-delay: 1.0s; }
.data-glyph:nth-child(7) { animation-delay: 1.2s; }
.data-glyph:nth-child(8) { animation-delay: 1.4s; }
.data-glyph:nth-child(9) { animation-delay: 1.6s; }
.data-glyph:nth-child(10) { animation-delay: 1.8s; }
.data-glyph:nth-child(11) { animation-delay: 2.0s; }
.data-glyph:nth-child(12) { animation-delay: 2.2s; }
.data-glyph:nth-child(13) { animation-delay: 2.4s; }
.data-glyph:nth-child(14) { animation-delay: 2.6s; }
.data-glyph:nth-child(15) { animation-delay: 2.8s; }
.data-glyph:nth-child(16) { animation-delay: 3.0s; }

@keyframes glyph-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* --- Deck 3: The Spectral Reading --- */
.spectral-content {
    padding-left: 80px;
}

.spectral-header {
    margin-bottom: 60px;
}

.spectral-charts {
    display: flex;
    gap: 60px;
    overflow: hidden;
}

.chart-container {
    flex: 1;
    min-width: 280px;
    opacity: 0;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-container.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

.chart-1 { transform: translateX(-80px); transition-delay: 0s; }
.chart-2 { transform: translateX(-80px); transition-delay: 0.2s; }
.chart-3 { transform: translateX(-80px); transition-delay: 0.4s; }

.chart-label {
    margin-bottom: 20px;
    display: block;
}

.watercolor-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 260px;
    padding: 0 12px;
}

.chart-bar {
    flex: 1;
    height: var(--bar-height, 50%);
    background: linear-gradient(
        to top,
        rgba(212, 149, 106, 0.6) 0%,
        rgba(212, 149, 106, 0.3) 40%,
        rgba(123, 158, 188, 0.2) 70%,
        rgba(123, 158, 188, 0.05) 100%
    );
    border-radius: 3px 3px 0 0;
    position: relative;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chart-container.visible .chart-bar {
    transform: scaleY(1);
}

.chart-bar:nth-child(1) { transition-delay: 0.1s; }
.chart-bar:nth-child(2) { transition-delay: 0.15s; }
.chart-bar:nth-child(3) { transition-delay: 0.2s; }
.chart-bar:nth-child(4) { transition-delay: 0.25s; }
.chart-bar:nth-child(5) { transition-delay: 0.3s; }
.chart-bar:nth-child(6) { transition-delay: 0.35s; }
.chart-bar:nth-child(7) { transition-delay: 0.4s; }
.chart-bar:nth-child(8) { transition-delay: 0.45s; }

.chart-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    height: 6px;
    background: radial-gradient(ellipse at center, rgba(212, 149, 106, 0.5) 0%, transparent 70%);
    filter: blur(2px);
}

.chart-baseline {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(123, 158, 188, 0.3), transparent);
    margin-top: 8px;
}

/* --- Deck 4: The Archive --- */
.archive-content {
    padding-left: 80px;
}

.archive-header {
    margin-bottom: 48px;
}

.timeline {
    position: relative;
    padding: 40px 0;
}

.timeline-axis {
    position: absolute;
    left: 35%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(123, 158, 188, 0.2) 10%,
        rgba(123, 158, 188, 0.2) 90%,
        transparent
    );
}

.timeline-entry {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 60px;
    min-height: 120px;
}

.timeline-node {
    position: absolute;
    left: 35%;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--watercolor-amber);
    transform: translateX(-50%) scale(0.3);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.timeline-node.bloomed {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    box-shadow: 0 0 20px rgba(212, 149, 106, 0.3);
}

.timeline-card {
    max-width: 420px;
    padding: 28px;
    background:
        radial-gradient(ellipse 60% 50% at 40% 30%, rgba(212, 149, 106, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 60% 70%, rgba(123, 158, 188, 0.07) 0%, transparent 60%),
        linear-gradient(135deg, rgba(46, 65, 86, 0.5) 0%, rgba(28, 42, 58, 0.3) 100%);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-card.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

.timeline-left .timeline-card {
    margin-right: auto;
    margin-left: 0;
    width: calc(35% - 140px);
    transform: translateX(-30px);
}

.timeline-right .timeline-card {
    margin-left: calc(35% + 40px);
    transform: translateX(30px);
}

/* --- Deck 5: The Transmission --- */
.deck-transmission {
    min-height: 100vh;
}

.transmission-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70vh;
}

.transmission-text {
    max-width: 800px;
    margin: 0 auto;
}

.transmission-statement {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--bleached-parchment);
    min-height: 200px;
}

.transmission-statement .word {
    display: inline-block;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    margin-right: 0.25em;
}

.transmission-statement .word.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

.transmission-meta {
    margin-top: 60px;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.transmission-meta .decorative-line {
    margin: 0 auto 20px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .signal-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .signal-col-center {
        order: -1;
    }

    .data-stream {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .spectral-charts {
        flex-direction: column;
    }

    .timeline-left .timeline-card,
    .timeline-right .timeline-card {
        width: auto;
        max-width: 100%;
        margin-left: 60px;
    }

    .timeline-axis {
        left: 20px;
    }

    .timeline-node {
        left: 20px;
    }

    .deck {
        padding: 40px 24px;
    }

    .deck-nav {
        left: 12px;
    }

    .spectral-content,
    .archive-content {
        padding-left: 0;
    }

    .aperture-title {
        font-size: 56px;
    }

    .section-title {
        font-size: 40px;
    }

    .transmission-statement {
        font-size: 36px;
    }

    .aperture-telemetry {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .aperture-title {
        font-size: 40px;
    }

    .section-title {
        font-size: 32px;
    }

    .transmission-statement {
        font-size: 28px;
    }

    .deck {
        padding: 30px 16px;
    }

    .deck-nav {
        display: none;
    }

    .signal-card {
        padding: 20px;
    }
}
