/* ============================================
   continu.st — Art-Deco Observatory at Twilight
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0a0a12;
    --bg-elevated: #12122a;
    --surface: #1a1a3e;
    --neon-mint: #00ffc8;
    --neon-mauve: #e0b0ff;
    --deco-gold: #c8a84e;
    --text-body: #d4d8e8;
    --dim-violet: #4a4a6e;
    --neon-fuchsia: #ff2d7b;
    --gradient-sweep: linear-gradient(135deg, #00ffc8 0%, #e0b0ff 50%, #ff2d7b 100%);
    --gradient-mountain: linear-gradient(180deg, #1a1a3e 0%, #0a0a12 100%);
    --skeleton-shimmer: linear-gradient(90deg, transparent 0%, rgba(0, 255, 200, 0.06) 50%, transparent 100%);
    --font-display: 'Poiret One', cursive;
    --font-body: 'Space Mono', monospace;
    --font-accent: 'Cormorant Garamond', serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.1vw, 1.125rem);
    line-height: 1.85;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* --- Sunburst Background --- */
#sunburst-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
}

/* --- Neon Circuit Lines --- */
#neon-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 500vh;
    z-index: 1;
    pointer-events: none;
}

.neon-path.mint {
    stroke: var(--neon-mint);
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.neon-path.mauve {
    stroke: var(--neon-mauve);
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

/* --- Navigation --- */
#elevation-nav {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.nav-chevron {
    color: var(--dim-violet);
    text-decoration: none;
    transition: color 0.4s ease, filter 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-chevron.active {
    color: var(--neon-mint);
    filter: drop-shadow(0 0 6px var(--neon-mint));
    animation: chevron-pulse 2s ease-in-out infinite;
}

@keyframes chevron-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px var(--neon-mint)); }
    50% { filter: drop-shadow(0 0 10px var(--neon-mint)); }
}

/* --- Elevation Sections --- */
.elevation-section {
    position: relative;
    min-height: 100vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 89px 4vw;
}

/* --- Skeleton Loading --- */
.skeleton-block {
    position: relative;
}

.skeleton-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--surface);
    background-size: 200% 100%;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.skeleton-block.shimmer::before {
    background: var(--surface);
    background-image: var(--skeleton-shimmer);
    background-size: 200% 100%;
    animation: skeleton-sweep 1.5s ease-in-out infinite;
}

.skeleton-block.revealed::before {
    opacity: 0;
    pointer-events: none;
}

@keyframes skeleton-sweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Chevron Frieze --- */
.chevron-frieze {
    width: 100%;
    height: 30px;
    margin-bottom: 55px;
    opacity: 0.3;
}

.frieze-svg {
    width: 100%;
    height: 100%;
}

.frieze-line {
    stroke: var(--deco-gold);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset 0.8s ease;
}

.frieze-line.drawn {
    stroke-dashoffset: 0;
}

/* ============================================
   Section 1: The Threshold
   ============================================ */
#threshold {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.mountain-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 1;
}

.mountains-svg {
    width: 100%;
    height: 100%;
}

.mountain-layer {
    transition: transform 0.1s linear;
}

.threshold-content {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 34px;
}

.monogram {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--neon-mauve);
    display: flex;
    align-items: center;
    justify-content: center;
}

.monogram-dot {
    display: inline-block;
    width: 0.15em;
    height: 0.15em;
    background: transparent;
    border: 1px solid var(--neon-mint);
    transform: rotate(45deg);
    margin: 0 0.05em;
    position: relative;
    top: 0.05em;
    box-shadow: 0 0 8px var(--neon-mint);
}

.threshold-epigraph {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.375rem);
    color: var(--dim-violet);
    max-width: 600px;
    opacity: 0;
    animation: fade-in-up 1.5s ease 0.8s forwards;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Section 2: The Terrace
   ============================================ */
#terrace {
    padding-top: 55px;
}

.terrace-grid {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.terrace-left {
    position: relative;
}

.skel-tall {
    height: 70vh;
    min-height: 400px;
}

.terrace-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.terrace-right {
    display: flex;
    flex-direction: column;
    gap: 34px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--neon-mauve);
    font-weight: 400;
    line-height: 1.1;
    padding: 0.2em 0;
}

#terrace .section-title {
    color: var(--neon-mint);
}

.ziggurat-stack {
    display: flex;
    flex-direction: column;
    gap: 34px;
}

.ziggurat-block {
    background: var(--bg-elevated);
    padding: 34px 40px;
    border-left: 1px solid var(--deco-gold);
    clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.ziggurat-block:nth-child(1) { width: 100%; }
.ziggurat-block:nth-child(2) { width: 90%; }
.ziggurat-block:nth-child(3) { width: 78%; }

.ziggurat-block p {
    color: var(--text-body);
}

/* ============================================
   Section 3: The Observatory
   ============================================ */
#observatory {
    padding-top: 55px;
}

.observatory-layout {
    display: grid;
    grid-template-columns: 3fr 4fr 3fr;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    align-items: center;
}

.observatory-text-left,
.observatory-text-right {
    padding: 34px;
}

.observatory-text-left .section-title {
    color: var(--neon-mauve);
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 34px;
}

.observatory-text-left p,
.observatory-text-right p {
    margin-bottom: 21px;
}

.accent-text {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.375rem);
    color: #a89ec8;
}

.observatory-viewport {
    position: relative;
    width: 100%;
    padding-top: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-deep);
    box-shadow: 0 0 30px rgba(0, 255, 200, 0.1), inset 0 0 60px rgba(0, 255, 200, 0.05);
    border: 1px solid rgba(0, 255, 200, 0.15);
}

#starfield-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* ============================================
   Section 4: The Ridgeline
   ============================================ */
#ridgeline {
    padding-top: 55px;
}

.ridgeline-panorama {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.ridgeline-panorama .section-title {
    color: var(--neon-mint);
    margin-bottom: 55px;
}

.panorama-bands {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 55px;
}

.panorama-band {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
}

.ridge-svg {
    width: 100%;
    height: 100%;
}

.ridgeline-caption {
    max-width: 700px;
    padding: 21px 0;
}

/* ============================================
   Section 5: The Continuum
   ============================================ */
#continuum {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.continuum-content {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.continuum-text-wrapper {
    width: 100%;
    text-align: center;
    mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
}

.continuum-text {
    font-family: var(--font-display);
    font-size: 8vw;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--gradient-sweep);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 20s linear infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .skeleton-block::before {
        animation: none;
    }
    .skeleton-block.shimmer::before {
        animation: none;
    }
    .threshold-epigraph {
        animation: none;
        opacity: 1;
    }
    .continuum-text {
        animation: none;
        background-position: 50% 50%;
    }
    @keyframes chevron-pulse {
        0%, 100% { filter: drop-shadow(0 0 4px var(--neon-mint)); }
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .terrace-grid {
        grid-template-columns: 1fr;
    }

    .skel-tall {
        height: 40vh;
    }

    .observatory-layout {
        grid-template-columns: 1fr;
    }

    .observatory-viewport {
        max-width: 80vw;
        margin: 0 auto;
    }

    .ziggurat-block:nth-child(1),
    .ziggurat-block:nth-child(2),
    .ziggurat-block:nth-child(3) {
        width: 100%;
    }

    #elevation-nav {
        right: 0.75rem;
        gap: 1rem;
    }

    .elevation-section {
        padding: 55px 3vw;
    }

    .panorama-band {
        height: 50px;
    }
}
