:root {
    --gold: #C5A44E;
    --deep-gold: #8B7332;
    --dim-gold: #3D3520;
    --bg: #08080A;
    --surface: #121216;
    --text-primary: #D4CFC4;
    --text-secondary: #7A756B;
    --aurora-green: #3EC9A7;
    --aurora-violet: #7B5EA7;
    --signal-red: #A7423E;
    --grid-color: #151518;
    --ease-telescope: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* Coordinate Grid */
.coordinate-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 0.5px, transparent 0.5px),
        linear-gradient(90deg, var(--grid-color) 0.5px, transparent 0.5px);
    background-size: 48px 48px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    transition: opacity 1.5s var(--ease-telescope);
}

.coordinate-grid.focused {
    opacity: 0.08;
}

/* Aurora Background */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, var(--aurora-green), transparent),
        radial-gradient(ellipse 60% 80% at 80% 60%, var(--aurora-violet), transparent),
        radial-gradient(ellipse 70% 50% at 50% 20%, var(--gold), transparent);
    animation: auroraShift 45s ease-in-out infinite;
    transition: opacity 2s var(--ease-telescope);
}

@keyframes auroraShift {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 0%;
    }
    33% {
        background-position: 30% 20%, 70% 80%, 20% 50%;
    }
    66% {
        background-position: 60% 40%, 40% 20%, 80% 30%;
    }
}

/* Navigation Dashes */
.nav-dashes {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.nav-dash {
    width: 24px;
    height: 2px;
    background: var(--dim-gold);
    display: block;
    cursor: pointer;
    transition: all 0.6s var(--ease-telescope);
    position: relative;
}

.nav-dash.active {
    background: var(--gold);
    box-shadow: 0 0 8px var(--aurora-green), 0 0 20px rgba(62, 201, 167, 0.3);
}

/* Observation Sections */
.observation {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8vw;
}

.observation-1 {
    min-height: 100vh;
    justify-content: center;
}

.observation-2 {
    min-height: 110vh;
    gap: 4vw;
}

.observation-3 {
    min-height: 120vh;
    flex-direction: column;
    justify-content: center;
    gap: 8vh;
}

.observation-4 {
    min-height: 100vh;
    justify-content: center;
}

.observation-5 {
    min-height: 90vh;
    flex-direction: column;
    justify-content: center;
}

.observation-6 {
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Hero */
.hero-content {
    position: relative;
    margin-top: -10vh;
    margin-left: 5vw;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 8rem);
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s var(--ease-telescope);
}

.hero-title .letter.visible {
    opacity: 1;
}

.hero-coord {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.8s var(--ease-telescope);
}

.hero-coord.visible {
    opacity: 1;
}

/* Observation Panels */
.obs-panel {
    background: var(--surface);
    border: 1px solid var(--dim-gold);
    padding: clamp(2rem, 4vw, 4rem);
    max-width: 75%;
    position: relative;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s var(--ease-telescope);
}

.obs-panel.in-view {
    opacity: 1;
    transform: translateX(0);
    border-color: var(--gold);
    box-shadow:
        0 0 40px rgba(62, 201, 167, 0.05),
        0 0 80px rgba(123, 94, 167, 0.03);
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 4vw, 3.5rem);
    letter-spacing: 0.04em;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.panel-body {
    color: var(--text-primary);
    max-width: 65ch;
}

/* Side Wireframe */
.side-wireframe {
    flex-shrink: 0;
}

.icosahedron {
    width: clamp(120px, 15vw, 200px);
    height: clamp(120px, 15vw, 200px);
}

.ico-group {
    animation: rotateWireframe 60s linear infinite;
    transform-origin: center;
}

@keyframes rotateWireframe {
    from { transform: translate(100px,100px) rotate(0deg); }
    to { transform: translate(100px,100px) rotate(360deg); }
}

/* Waveform */
.waveform {
    width: 100%;
    height: 40px;
    margin-top: 2rem;
}

.wave-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: waveTransmit 4s var(--ease-telescope) infinite;
}

@keyframes waveTransmit {
    0% { stroke-dashoffset: 1600; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1600; }
}

/* Circuit Separator */
.circuit-separator {
    width: 100%;
    max-width: 75%;
}

.circuit-separator svg {
    width: 100%;
    height: 60px;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-target.shaking {
    animation: shake 0.6s ease;
    border-color: var(--signal-red) !important;
    box-shadow: 0 0 20px rgba(167, 66, 62, 0.15);
}

/* Frequency Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 2rem;
}

.data-pair {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.data-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.data-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--aurora-green);
    letter-spacing: 0.06em;
}

.data-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.panel-frequency {
    max-width: 85%;
}

.panel-frequency.in-view {
    animation: borderCycle 12s linear infinite;
}

@keyframes borderCycle {
    0%, 100% { border-color: var(--aurora-green); }
    33% { border-color: var(--aurora-violet); }
    66% { border-color: var(--gold); }
}

/* Clarity Section */
.clarity-content {
    width: 100%;
}

.clarity-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.04em;
    color: var(--gold);
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s var(--ease-telescope);
}

.clarity-heading.in-view {
    opacity: 1;
    transform: translateY(0);
}

.clarity-waveform {
    width: 100%;
    height: 30px;
    margin-bottom: 3rem;
}

.clarity-waveform path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 2s var(--ease-telescope);
}

.clarity-waveform.in-view path {
    stroke-dashoffset: 0;
}

.clarity-body {
    color: var(--text-primary);
    max-width: 65ch;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.8s var(--ease-telescope) 0.3s;
}

.clarity-body.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Horizon Section */
.horizon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

.horizon-circle {
    width: clamp(150px, 20vw, 250px);
    height: clamp(150px, 20vw, 250px);
    animation: horizonPulse 4s ease-in-out infinite;
}

@keyframes horizonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.horizon-circle circle {
    stroke: var(--gold);
}

.horizon-info {
    text-align: center;
}

.horizon-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.horizon-coord {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .observation {
        padding: 0 5vw;
    }

    .obs-panel {
        max-width: 100%;
    }

    .panel-frequency {
        max-width: 100%;
    }

    .data-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .observation-2 {
        flex-direction: column;
    }

    .nav-dashes {
        right: 1rem;
    }

    .circuit-separator {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aurora-bg {
        animation: none;
    }

    .ico-group {
        animation: none;
    }

    .wave-path {
        animation: none;
        stroke-dashoffset: 0;
    }

    .horizon-circle {
        animation: none;
    }
}
