/* ============================================
   saram.quest — Glassmorphic Observatory
   ============================================ */

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

:root {
    --mind: #c4687a;
    --body: #3a8f8b;
    --connection: #c9a227;
    --void: #0d0f1a;
    --void-deep: #1a1520;
    --text-primary: #e8e4df;
    --text-subtle: #9b8fa8;
    --glass-fill: rgba(255,255,255,0.06);
    --glass-edge: rgba(255,255,255,0.08);
    --blur-transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--text-primary);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Scroll Container */
#scroll-container {
    position: relative;
    z-index: 1;
    perspective: 1200px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-title-wrap {
    text-align: center;
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(5rem, 15vw, 12rem);
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.1;
    animation: breatheFocus 8s ease-in-out infinite;
}

@keyframes breatheFocus {
    0%, 100% { filter: blur(0px); }
    50% { filter: blur(12px); }
}

.hero-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: var(--text-subtle);
    opacity: 0.6;
    margin-top: 0.5rem;
    animation: subtitleSway 6s ease-in-out infinite;
}

@keyframes subtitleSway {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(2px); }
}

.hero-icons {
    display: flex;
    gap: 80px;
    margin-top: 3rem;
    opacity: 0;
    animation: heroIconsFadeIn 1.5s ease-out 2s forwards;
}

@keyframes heroIconsFadeIn {
    to { opacity: 1; }
}

.hero-icon {
    filter: blur(2px);
    animation: iconPulse 4s ease-in-out infinite;
}

.hero-icon--mind { animation-delay: 0s; }
.hero-icon--body { animation-delay: 1.3s; }
.hero-icon--connection { animation-delay: 2.6s; }

@keyframes iconPulse {
    0%, 100% { filter: blur(2px); transform: scale(0.95); }
    50% { filter: blur(0); transform: scale(1.05); }
}

/* ============================================
   GLASS PANELS
   ============================================ */
.glass-panel {
    position: relative;
    margin: 15vh auto;
    padding: 3rem 3.5rem;
    border-radius: 24px;
    border: 1px solid var(--glass-edge);
    background: var(--glass-fill);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    filter: blur(16px);
    transform: translateZ(-120px);
    transition:
        opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, filter, transform;
}

.glass-panel.in-focus {
    opacity: 1;
    filter: blur(0);
    transform: translateZ(-60px);
}

.glass-panel.past-focus {
    opacity: 0.6;
    filter: blur(8px);
    transform: translateZ(-20px);
}

/* Panel sizes and offsets */
.glass-panel--left {
    width: min(70vw, 900px);
    margin-left: 8vw;
    margin-right: auto;
}

.glass-panel--center {
    width: min(80vw, 1000px);
    margin-left: auto;
    margin-right: auto;
}

.glass-panel--right {
    width: min(65vw, 850px);
    margin-left: auto;
    margin-right: 8vw;
}

/* Color tints */
.glass-panel--mind {
    background: rgba(196, 104, 122, 0.05);
    box-shadow: 0 0 80px rgba(196, 104, 122, 0.04);
}

.glass-panel--body {
    background: rgba(58, 143, 139, 0.05);
    box-shadow: 0 0 80px rgba(58, 143, 139, 0.04);
}

.glass-panel--connection {
    background: rgba(201, 162, 39, 0.05);
    box-shadow: 0 0 80px rgba(201, 162, 39, 0.04);
}

/* Refraction lines */
.glass-panel::before,
.glass-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 24px;
    overflow: hidden;
}

.glass-panel::before {
    background: linear-gradient(15deg, transparent 40%, rgba(255,255,255,0.02) 40.5%, rgba(255,255,255,0.02) 41%, transparent 41.5%);
}

.glass-panel::after {
    background: linear-gradient(72deg, transparent 55%, rgba(255,255,255,0.015) 55.5%, rgba(255,255,255,0.015) 56%, transparent 56.5%);
}

/* Panel content */
.panel-content {
    position: relative;
}

.panel-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.panel-text {
    max-width: 65ch;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    opacity: 0.9;
}

.panel-text:last-of-type {
    margin-bottom: 0;
}

/* Panel icons */
.panel-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.panel-icon {
    position: absolute;
    opacity: 0.6;
    filter: blur(2px);
    transition: var(--blur-transition), transform 0.6s ease;
}

.panel-icon:first-child {
    top: 10%;
    right: 5%;
}

.glass-panel.in-focus .panel-icon {
    filter: blur(0);
    opacity: 0.7;
}

/* Annotations */
.annotation {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--text-subtle);
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-color: rgba(155, 143, 168, 0.3);
    text-underline-offset: 4px;
}

.glass-panel.in-focus .annotation {
    opacity: 0.7;
}

/* ============================================
   CLOSING
   ============================================ */
.closing {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.closing-icons {
    display: flex;
    gap: 24px;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.closing-icons.visible {
    opacity: 1;
}

.closing-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: var(--text-primary);
    opacity: 0.5;
    animation: breatheFocus 8s ease-in-out infinite;
}

/* ============================================
   NAVIGATION CIRCLES
   ============================================ */
#nav-circles {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-edge);
    background: var(--glass-fill);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--blur-transition), transform 0.3s ease, border-color 0.3s ease;
    filter: blur(1px);
    opacity: 0.7;
}

.nav-circle:hover,
.nav-circle.active {
    filter: blur(0);
    opacity: 1;
    transform: scale(1.1);
}

.nav-circle--mind.active { border-color: var(--mind); }
.nav-circle--body.active { border-color: var(--body); }
.nav-circle--connection.active { border-color: var(--connection); }

/* ============================================
   FOCAL RING ANIMATION
   ============================================ */
.focal-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    pointer-events: none;
    animation: focalExpand 1.2s ease-out forwards;
}

@keyframes focalExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.15;
        border: 1px solid currentColor;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border: 1px solid currentColor;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .glass-panel--left,
    .glass-panel--center,
    .glass-panel--right {
        width: 90vw;
        margin-left: auto;
        margin-right: auto;
        padding: 2rem 1.5rem;
    }

    .hero-icons {
        gap: 40px;
    }

    .panel-icon {
        display: none;
    }

    #nav-circles {
        bottom: 1rem;
        right: 1rem;
    }
}
