:root {
    /* Core Color Palette */
    --abyss-blue: #0B1A24;
    --deep-night: #0F2430;
    --steel-blue: #2F4F5E;
    --fog-blue: #5E7C87;
    --cold-mist: #A8C0C8;
    --cyan-highlight: #7FAAB5;
    --bone-white: #E6E1D3;
    --rune-red: #8B1E2D;
    
    /* Derived */
    --glass-bg: rgba(15, 36, 48, 0.6);
    --glass-border: rgba(168, 192, 200, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: var(--abyss-blue);
    color: var(--bone-white);
    overflow-x: hidden;
}

/* Typography Classes */
.font-cinzel {
    font-family: 'Cinzel', serif;
}

.font-cormorant {
    font-family: 'Cormorant Garamond', serif;
}

/* Background Colors */
.bg-abyss {
    background-color: var(--abyss-blue);
}

.bg-deep-night {
    background-color: var(--deep-night);
}

/* Text Colors */
.text-bone {
    color: var(--bone-white);
}

.text-cyan-light {
    color: var(--cold-mist);
}

.text-cyan-highlight {
    color: var(--cyan-highlight);
}

.text-rune-red {
    color: var(--rune-red);
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.glass-nav {
    background: rgba(11, 26, 36, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(168, 192, 200, 0.05);
}

/* Mist Effects */
.mist-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.mist-layer {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(127, 170, 181, 0.15) 0%, transparent 70%);
    animation: drift 20s infinite linear;
}

.mist-1 {
    top: -50%;
    left: -50%;
    animation-duration: 25s;
    opacity: 0.4;
}

.mist-2 {
    top: 0%;
    right: -50%;
    animation-duration: 30s;
    animation-direction: reverse;
    opacity: 0.3;
}

.mist-3 {
    bottom: -50%;
    left: -25%;
    animation-duration: 35s;
    opacity: 0.2;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(-5%, -5%) rotate(360deg);
    }
}

/* Ambient Particles */
.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: var(--cyan-highlight);
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--cyan-highlight);
}

.particle-1 { top: 20%; left: 10%; animation: drift-particle 15s infinite linear; }
.particle-2 { top: 60%; right: 20%; animation: drift-particle 20s infinite linear reverse; }
.particle-3 { bottom: 30%; left: 30%; animation: drift-particle 25s infinite linear; }

@keyframes drift-particle {
    0% {
        transform: translate(0, 0);
        opacity: 0.1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: translate(100px, -50px);
        opacity: 0.1;
    }
}

/* Animations */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.05;
        transform: scale(1);
    }
    50% {
        opacity: 0.1;
        transform: scale(1.05);
    }
}

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

@keyframes reverse-spin {
    from { transform: rotate(360deg); }
    to   { transform: rotate(0deg); }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(127, 170, 181, 0.5);
    }
    50% {
        text-shadow: 0 0 40px rgba(127, 170, 181, 0.8), 0 0 60px rgba(127, 170, 181, 0.4);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 8s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

.animate-reverse-spin {
    animation: reverse-spin 25s linear infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

/* =========================================
   Rune Circle & Orbit Runners
   ========================================= */

.rune-circle {
    position: relative;
}

/* The orbit track — spins as a whole */
.orbit-runners {
    position: absolute;
    inset: 0;
    animation: spin-slow 30s linear infinite;
}

.runner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;   /* half of height */
    margin-left: -12px;  /* half of width  */
    color: var(--cold-mist);
}

/* Top */
.runner-1 {
    transform: rotate(0deg) translateY(-1000%) rotate(0deg);
    animation: counter-orbit-1 30s linear infinite;
}

/* Right */
.runner-2 {
    transform: rotate(90deg) translateY(-1000%) rotate(-90deg);
    animation: counter-orbit-2 30s linear infinite;
}

/* Bottom */
.runner-3 {
    transform: rotate(180deg) translateY(-1000%) rotate(-180deg);
    animation: counter-orbit-3 30s linear infinite;
}

/* Left */
.runner-4 {
    transform: rotate(270deg) translateY(-1000%) rotate(-270deg);
    animation: counter-orbit-4 30s linear infinite;
}

@keyframes counter-orbit-1 {
    from { transform: rotate(0deg)   translateY(-1000%) rotate(0deg); }
    to   { transform: rotate(360deg) translateY(-1000%) rotate(-360deg); }
}

@keyframes counter-orbit-2 {
    from { transform: rotate(90deg)  translateY(-1000%) rotate(-90deg); }
    to   { transform: rotate(450deg) translateY(-1000%) rotate(-450deg); }
}

@keyframes counter-orbit-3 {
    from { transform: rotate(180deg) translateY(-1000%) rotate(-180deg); }
    to   { transform: rotate(540deg) translateY(-1000%) rotate(-540deg); }
}

@keyframes counter-orbit-4 {
    from { transform: rotate(270deg) translateY(-1000%) rotate(-270deg); }
    to   { transform: rotate(630deg) translateY(-1000%) rotate(-630deg); }
}

/* Realm Cards 3D Effect */
.perspective-1000 {
    perspective: 1000px;
}

.realm-card {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.realm-card:hover {
    transform: translateZ(20px) rotateY(0deg);
}

/* Navigation Link Hover Effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--cyan-highlight);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--cyan-highlight);
}

.nav-link:hover::after {
    width: 100%;
}

/* Input Focus States */
input:focus, textarea:focus {
    background: rgba(15, 36, 48, 0.8) !important;
}

/* Selection Color */
::selection {
    background: var(--rune-red);
    color: var(--bone-white);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--abyss-blue);
}

::-webkit-scrollbar-thumb {
    background: var(--steel-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fog-blue);
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rune Icon Glow */
.rune-icon {
    transition: all 0.7s ease;
}

/* Rune Divider Animation */
.rune-divider span:first-child,
.rune-divider span:last-child {
    transition: width 0.5s ease;
}

.group:hover .rune-divider span:first-child,
.group:hover .rune-divider span:last-child {
    width: 24px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .rune-bg {
        font-size: 4rem;
    }
    
    .mist-layer {
        opacity: 0.2;
    }
    
    .hero-rune {
        font-size: 10rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
