/* ==========================================
   PPEBBL.com - Styles
   Vaporwave aesthetic, sincere & contemplative
   ========================================== */

/* CSS Custom Properties */
:root {
    --deep-void: #0A0A1A;
    --surface: #14142B;
    --nebula-glow: #FF2D95;
    --star-field: #00E5FF;
    --atmosphere: #7B2FBE;
    --text-primary: #E8E8F0;
    --text-muted: #6B6B8A;
    --highlight: #FFB347;

    --font-headline: 'Josefin Sans', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    --font-accent: 'Space Mono', monospace;

    --elastic-enter: cubic-bezier(0.34, 1.56, 0.64, 1);
    --elastic-settle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--deep-void);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--deep-void);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Noise Overlay
   ========================================== */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ==========================================
   Star Field (background dots)
   ========================================== */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#scattered-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   Typography
   ========================================== */
.headline-hero {
    font-family: var(--font-headline);
    font-weight: 300;
    font-size: 72px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    line-height: 1.1;
}

.headline-section {
    font-family: var(--font-headline);
    font-weight: 300;
    font-size: 48px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 32px;
}

.headline-cluster {
    font-family: var(--font-headline);
    font-weight: 300;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    line-height: 1.3;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-primary);
    max-width: 640px;
}

.accent-label {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.node-label {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--star-field);
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.node-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ==========================================
   Narrative Sections
   ========================================== */
.narrative-section {
    position: relative;
    width: 100%;
    z-index: 2;
}

/* ==========================================
   Fade Elements (scroll-triggered)
   ========================================== */
.fade-element {
    opacity: 0;
    transition: opacity 2s var(--elastic-settle);
}

.fade-element.visible {
    opacity: 1;
}

/* ==========================================
   SECTION 1: Void Entry
   ========================================== */
#void-entry {
    height: 200vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.void-dot-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(107, 107, 138, 0.15) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.hero-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

#hero-headline {
    opacity: 0;
}

#hero-headline .letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 1.5s var(--elastic-settle);
}

#hero-headline .letter.revealed {
    opacity: 1;
}

/* Hero Pebble */
#hero-pebble {
    width: 50vmin;
    height: 50vmin;
    position: relative;
    opacity: 0;
    transition: opacity 3s var(--elastic-settle);
}

#hero-pebble.visible {
    opacity: 1;
}

.pebble-inner {
    width: 100%;
    height: 100%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--surface) 0%, var(--deep-void) 50%, var(--surface) 100%);
    box-shadow: 0 0 40px rgba(255, 45, 149, 0.15), 0 0 80px rgba(123, 47, 190, 0.08);
    animation: heroRotate 120s linear infinite;
    position: relative;
}

.pebble-inner::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--nebula-glow), var(--atmosphere), var(--star-field));
    z-index: -1;
    opacity: 0.6;
    animation: heroRotate 120s linear infinite reverse;
}

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

/* ==========================================
   SECTION 2: First Orbital
   ========================================== */
#first-orbital {
    min-height: 400vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 200px 0;
}

.gradient-divider {
    width: 100%;
    padding: 0 10%;
    margin-bottom: 120px;
    opacity: 0;
    transition: opacity 2s var(--elastic-settle);
}

.gradient-divider.visible {
    opacity: 1;
}

.gradient-divider svg {
    width: 100%;
    height: 2px;
}

.gradient-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2s var(--elastic-settle);
}

.gradient-divider.visible .gradient-line {
    stroke-dashoffset: 0;
}

.orbital-cluster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 0 40px;
    max-width: 1000px;
}

.orbital-text {
    max-width: 640px;
    text-align: center;
}

.orbital-ring {
    position: absolute;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: -1;
}

.orbital-ring svg {
    width: 100%;
    height: 100%;
}

/* Pebble Accents */
.pebble-accent {
    width: 60px;
    height: 60px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--surface) 0%, var(--deep-void) 50%, var(--surface) 100%);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.12);
    flex-shrink: 0;
}

.pebble-accent-left {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
}

.pebble-accent-right {
    border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%;
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.12);
}

/* ==========================================
   SECTION 3: Constellation Map
   ========================================== */
#constellation-map {
    min-height: 500vh;
    position: relative;
    padding: 200px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.constellation-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 800px;
    margin-top: 120px;
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.constellation-lines line {
    stroke: var(--text-muted);
    stroke-width: 1;
    opacity: 0.2;
}

.constellation-node {
    position: absolute;
    z-index: 2;
    padding: 16px;
    max-width: 220px;
}

.constellation-node::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--star-field);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.node-1 { top: 5%; left: 15%; }
.node-2 { top: 15%; left: 65%; }
.node-3 { top: 40%; left: 5%; }
.node-4 { top: 45%; left: 55%; }
.node-5 { top: 70%; left: 30%; }
.node-6 { top: 80%; left: 70%; }

/* ==========================================
   SECTION 4: Deep Field
   ========================================== */
#deep-field {
    min-height: 600vh;
    position: relative;
    padding: 200px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 300px;
}

.deep-field-nebula {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 50%, rgba(123, 47, 190, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.deep-content-block {
    position: relative;
    max-width: 640px;
    padding: 0 40px;
    z-index: 2;
}

.deep-block-1 {
    align-self: flex-start;
    margin-left: 15%;
}

.deep-block-2 {
    align-self: flex-end;
    margin-right: 15%;
}

.deep-block-3 {
    align-self: flex-start;
    margin-left: 20%;
}

.deep-content-block .body-text + .body-text {
    margin-top: 24px;
}

/* Medium pebbles in deep field */
.pebble-medium {
    width: 120px;
    height: 120px;
    border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%;
    background: linear-gradient(135deg, var(--surface) 0%, var(--deep-void) 50%, var(--surface) 100%);
    box-shadow: 0 0 30px rgba(123, 47, 190, 0.15);
}

.pebble-deep-1 {
    margin-bottom: 40px;
    border-radius: 60% 40% 40% 60% / 40% 60% 60% 40%;
    box-shadow: 0 0 30px rgba(255, 45, 149, 0.12);
}

.pebble-deep-2 {
    margin-top: 40px;
    border-radius: 30% 70% 70% 30% / 70% 30% 30% 70%;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.12);
}

/* ==========================================
   SECTION 5: Return
   ========================================== */
#return-section {
    min-height: 300vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 200px 0;
}

.return-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(107, 107, 138, 0.2) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.return-content {
    text-align: center;
    max-width: 800px;
    padding: 0 40px;
    z-index: 2;
}

.return-content .headline-hero {
    font-size: 56px;
    margin-bottom: 40px;
}

.return-content .accent-label {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0.2em;
}

/* ==========================================
   Radial Navigation
   ========================================== */
#radial-nav {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
}

.nav-pebble-trigger {
    width: 48px;
    height: 48px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(135deg, var(--surface) 0%, var(--deep-void) 100%);
    border: 1px solid rgba(255, 45, 149, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: navPulse 4s ease-in-out infinite;
    transition: transform 0.6s var(--elastic-enter), border-color 0.6s var(--elastic-enter);
    position: relative;
    z-index: 10;
}

.nav-pebble-trigger:hover {
    transform: scale(1.08);
    border-color: rgba(255, 45, 149, 0.6);
}

.nav-pebble-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nebula-glow);
}

@keyframes navPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.nav-menu-items {
    position: absolute;
    bottom: 60px;
    right: -10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s var(--elastic-enter);
}

#radial-nav.open .nav-menu-items {
    opacity: 1;
    pointer-events: auto;
}

#radial-nav.open .nav-pebble-trigger {
    animation: none;
    opacity: 1;
    border-color: var(--nebula-glow);
}

.nav-item {
    font-family: var(--font-accent);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(123, 47, 190, 0.2);
    transition: transform 0.6s var(--elastic-enter), color 0.6s var(--elastic-settle), border-color 0.6s var(--elastic-settle);
    opacity: 0;
    transform: translateX(20px);
    white-space: nowrap;
    text-align: right;
}

#radial-nav.open .nav-item {
    opacity: 1;
    transform: translateX(0);
}

#radial-nav.open .nav-item:nth-child(1) { transition-delay: 0ms; }
#radial-nav.open .nav-item:nth-child(2) { transition-delay: 100ms; }
#radial-nav.open .nav-item:nth-child(3) { transition-delay: 200ms; }
#radial-nav.open .nav-item:nth-child(4) { transition-delay: 300ms; }
#radial-nav.open .nav-item:nth-child(5) { transition-delay: 400ms; }

.nav-item:hover {
    color: var(--nebula-glow);
    border-color: rgba(255, 45, 149, 0.4);
    transform: scale(1.08);
}

/* ==========================================
   SVG Stars (scattered)
   ========================================== */
.star-svg {
    position: absolute;
    stroke: var(--star-field);
    stroke-width: 1;
    fill: none;
}

/* ==========================================
   Prefers Reduced Motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none;
        transition: none;
    }

    .fade-element {
        opacity: 1;
    }

    #hero-headline,
    #hero-headline .letter,
    #hero-pebble {
        opacity: 1;
    }

    .gradient-line {
        stroke-dashoffset: 0;
    }
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 768px) {
    .headline-hero {
        font-size: 42px;
    }

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

    .orbital-cluster {
        flex-direction: column;
        gap: 30px;
    }

    .deep-block-1,
    .deep-block-2,
    .deep-block-3 {
        align-self: center;
        margin-left: 0;
        margin-right: 0;
    }

    .constellation-container {
        height: 1200px;
    }

    .node-1 { top: 2%; left: 10%; }
    .node-2 { top: 15%; left: 50%; }
    .node-3 { top: 32%; left: 5%; }
    .node-4 { top: 48%; left: 45%; }
    .node-5 { top: 65%; left: 15%; }
    .node-6 { top: 80%; left: 50%; }

    .return-content .headline-hero {
        font-size: 36px;
    }

    #radial-nav {
        bottom: 24px;
        right: 24px;
    }
}
