/* ========================================
   SPIRAL GATE - GLYPH NAVIGATION SYSTEM
   Based on Helper's guidance: "Not menus, glyphs"
   A living spiral temple you walk through
   ======================================== */

/* ========================================
   CENTRAL SPIRAL PORTAL - The Anchor Point
   ======================================== */

.spiral-portal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: none;
}

.spiral-portal-container.active {
    pointer-events: auto;
}

/* The central spiral - always pulsing, always present */
.central-spiral {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 70px;
    height: 70px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
}

.central-spiral:hover {
    transform: scale(1.15) rotate(15deg);
    filter: drop-shadow(0 0 35px rgba(212, 175, 55, 0.6));
}

.central-spiral.expanded {
    position: fixed;
    bottom: auto;
    right: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(2);
    width: 120px;
    height: 120px;
}

/* Return to center - always accessible */
.return-to-center {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 5, 8, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--spiral-gold);
    padding: 0.6rem 1.5rem;
    font-family: "Cinzel", serif;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 1002;
    border-radius: 30px;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
}

.return-to-center.visible {
    opacity: 1;
    visibility: visible;
}

.return-to-center:hover {
    background: var(--spiral-gold);
    color: var(--spiral-deep);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

/* ========================================
   GLYPH NAVIGATION - The Portals
   ======================================== */

.glyph-nav {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glyph-nav.active {
    opacity: 1;
    pointer-events: auto;
}

/* Glyph portals orbiting the center */
.glyph-portal {
    position: absolute;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    opacity: 0;
    transform: scale(0.5);
}

.glyph-nav.active .glyph-portal {
    opacity: 1;
    transform: scale(1);
}

/* Orbital positioning - spiral pattern */
.glyph-portal:nth-child(1) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -250px);
    transition-delay: 0.1s;
}

.glyph-portal:nth-child(2) {
    top: 50%;
    left: 50%;
    transform: translate(150px, -150px);
    transition-delay: 0.2s;
}

.glyph-portal:nth-child(3) {
    top: 50%;
    left: 50%;
    transform: translate(200px, 50px);
    transition-delay: 0.3s;
}

.glyph-portal:nth-child(4) {
    top: 50%;
    left: 50%;
    transform: translate(50px, 180px);
    transition-delay: 0.4s;
}

.glyph-portal:nth-child(5) {
    top: 50%;
    left: 50%;
    transform: translate(-150px, 150px);
    transition-delay: 0.5s;
}

.glyph-portal:nth-child(6) {
    top: 50%;
    left: 50%;
    transform: translate(-220px, -20px);
    transition-delay: 0.6s;
}

/* Active state positioning */
.glyph-nav.active .glyph-portal:nth-child(1) { transform: translate(-50%, -250px) scale(1); }
.glyph-nav.active .glyph-portal:nth-child(2) { transform: translate(150px, -150px) scale(1); }
.glyph-nav.active .glyph-portal:nth-child(3) { transform: translate(200px, 50px) scale(1); }
.glyph-nav.active .glyph-portal:nth-child(4) { transform: translate(50px, 180px) scale(1); }
.glyph-nav.active .glyph-portal:nth-child(5) { transform: translate(-150px, 150px) scale(1); }
.glyph-nav.active .glyph-portal:nth-child(6) { transform: translate(-220px, -20px) scale(1); }

/* The glyph symbol itself */
.glyph-symbol {
    font-size: 2.5rem;
    color: var(--spiral-gold);
    margin-bottom: 0.5rem;
    transition: all 0.4s ease;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
    animation: glyph-float 4s ease-in-out infinite;
}

.glyph-portal:nth-child(1) .glyph-symbol { animation-delay: 0s; }
.glyph-portal:nth-child(2) .glyph-symbol { animation-delay: 0.5s; }
.glyph-portal:nth-child(3) .glyph-symbol { animation-delay: 1s; }
.glyph-portal:nth-child(4) .glyph-symbol { animation-delay: 1.5s; }
.glyph-portal:nth-child(5) .glyph-symbol { animation-delay: 2s; }
.glyph-portal:nth-child(6) .glyph-symbol { animation-delay: 2.5s; }

@keyframes glyph-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

/* Glyph portal text */
.glyph-text {
    font-family: "Cinzel", serif;
    font-size: 0.7rem;
    color: var(--spiral-light);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.7;
    transition: all 0.3s ease;
    max-width: 120px;
}

/* Hover states */
.glyph-portal:hover .glyph-symbol {
    transform: scale(1.3) rotate(15deg);
    color: var(--spiral-violet);
    filter: drop-shadow(0 0 30px rgba(155, 89, 182, 0.8));
}

.glyph-portal:hover .glyph-text {
    opacity: 1;
    color: var(--spiral-gold);
}

/* Portal activation ring */
.glyph-portal::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    transition: all 0.5s ease;
    animation: portal-pulse 3s ease-in-out infinite;
}

.glyph-portal:hover::before {
    border-color: rgba(155, 89, 182, 0.6);
    transform: scale(1.3);
    box-shadow: 0 0 40px rgba(155, 89, 182, 0.3);
}

@keyframes portal-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Spiral connection lines */
.glyph-nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    animation: spin-slow 60s linear infinite;
}

.glyph-nav::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(155, 89, 182, 0.15);
    border-radius: 50%;
    animation: spin-slow 45s linear infinite reverse;
}

@keyframes spin-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   OVERLAY - The Cosmic Backdrop
   ======================================== */

.spiral-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(5, 5, 8, 0.85) 0%, 
        rgba(5, 5, 8, 0.95) 50%,
        rgba(5, 5, 8, 0.98) 100%);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s ease;
    backdrop-filter: blur(10px);
}

.spiral-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   HIDE TRADITIONAL HEADER WHEN NAV ACTIVE
   ======================================== */

body.nav-active .site-header {
    transform: translateY(-100%);
    opacity: 0;
}

body.nav-active {
    overflow: hidden;
}

/* ========================================
   JOURNEY INDICATOR - Where You Are
   Hidden on desktop to avoid overlap with spiral-journey-map
   ======================================== */

.journey-indicator {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: none; /* Hidden by default - spiral-journey-map provides this functionality */
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
}

.journey-node {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
}

.journey-node::before {
    content: attr(data-label);
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Cinzel", serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--spiral-light);
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.journey-node:hover::before {
    opacity: 1;
}

.journey-node:hover {
    border-color: var(--spiral-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.journey-node.current {
    background: var(--spiral-gold);
    border-color: var(--spiral-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.journey-node.visited {
    background: rgba(155, 89, 182, 0.5);
    border-color: var(--spiral-violet);
}

/* Connection line between nodes */
.journey-indicator::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, 
        transparent, 
        rgba(212, 175, 55, 0.3) 10%, 
        rgba(155, 89, 182, 0.3) 90%, 
        transparent);
}

/* ========================================
   SPIRAL TRANSITION - Page Navigation
   ======================================== */

.spiral-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--spiral-deep);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.spiral-transition.active {
    opacity: 1;
    visibility: visible;
}

.spiral-transition .spiral-symbol {
    width: 150px;
    height: 150px;
    animation: spiral-into 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes spiral-into {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(0deg); opacity: 1; }
    100% { transform: scale(20) rotate(180deg); opacity: 0; }
}

/* ========================================
   MINIMAL HEADER - For when viewing pages
   ======================================== */

.site-header.minimal {
    background: transparent;
    border-bottom: none;
    padding: 1rem 2rem;
}

.site-header.minimal .main-navigation {
    display: none;
}

.site-header.minimal .site-logo {
    opacity: 0.6;
    font-size: 1rem;
}

.site-header.minimal .site-logo:hover {
    opacity: 1;
}

/* ========================================
   RESPONSIVE - Mobile Glyph Navigation
   ======================================== */

@media (max-width: 768px) {
    .glyph-nav {
        width: 100%;
        height: 100%;
    }
    
    .glyph-portal {
        width: 80px;
        height: 80px;
    }
    
    .glyph-symbol {
        font-size: 2rem;
    }
    
    .glyph-text {
        font-size: 0.6rem;
    }
    
    /* Reposition for mobile - vertical flow */
    .glyph-nav.active .glyph-portal:nth-child(1) { transform: translate(-50%, -180px) scale(1); }
    .glyph-nav.active .glyph-portal:nth-child(2) { transform: translate(80px, -100px) scale(1); }
    .glyph-nav.active .glyph-portal:nth-child(3) { transform: translate(100px, 50px) scale(1); }
    .glyph-nav.active .glyph-portal:nth-child(4) { transform: translate(0px, 150px) scale(1); }
    .glyph-nav.active .glyph-portal:nth-child(5) { transform: translate(-100px, 50px) scale(1); }
    .glyph-nav.active .glyph-portal:nth-child(6) { transform: translate(-80px, -100px) scale(1); }
    
    .central-spiral {
        width: 60px;
        height: 60px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .journey-indicator {
        display: none;
    }
    
    .return-to-center {
        font-size: 0.65rem;
        padding: 0.5rem 1rem;
    }
}

/* ========================================
   SCROLL REVEAL FOR CONTENT
   ======================================== */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveals */
.reveal-on-scroll[data-delay="1"] { transition-delay: 0.1s; }
.reveal-on-scroll[data-delay="2"] { transition-delay: 0.2s; }
.reveal-on-scroll[data-delay="3"] { transition-delay: 0.3s; }
.reveal-on-scroll[data-delay="4"] { transition-delay: 0.4s; }
.reveal-on-scroll[data-delay="5"] { transition-delay: 0.5s; }


/* 7th Glyph Position - The Codex */
.glyph-portal:nth-child(7) {
    top: 50%;
    left: 50%;
    transform: translate(-150px, -200px);
    transition-delay: 0.7s;
}

.glyph-nav.active .glyph-portal:nth-child(7) { 
    transform: translate(-150px, -200px) scale(1); 
}

.glyph-portal:nth-child(7) .glyph-symbol { 
    animation-delay: 3s; 
}

/* Mobile adjustment for 7th glyph */
@media (max-width: 768px) {
    .glyph-nav.active .glyph-portal:nth-child(7) { 
        transform: translate(-50%, 200px) scale(1); 
    }
}

