/* ═══════════════════════════════════════════════════════════════
   soulOS — Mythopoetic Computing Interface
   Design System: Celestial Maximalist / Theurgic Dark UI
   ═══════════════════════════════════════════════════════════════ */

:root {
    --void-deep: #010108;
    --void-card: #040411;
    --gold: #DBB155;
    --gold-dim: #DBB15580;
    --gold-faint: #DBB15526;
    --gold-ghost: #DBB1550d;
    --violet: #6928B0;
    --violet-bright: #9754ED;
    --violet-dim: #6928B066;
    --silver: #B3B8BE;
    --silver-dim: #B3B8BE80;
    --foreground: #E8DCC8;
    --foreground-dim: #E8DCC899;
    --font-display: "Playfair Display", serif;
    --font-heading: "Cormorant", serif;
    --font-body: "Source Serif 4", serif;
    --font-mono: "Fira Code", monospace;
    --panel-blur: 12px;
    --panel-bg: rgba(4, 4, 17, 0.8);
    --panel-border: rgba(219, 177, 85, 0.2);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    background: var(--void-deep);
    color: var(--foreground);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; line-height: 1.2; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { color: #ECE3D6; background: rgba(105, 40, 176, 0.4); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--void-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── Cosmic Background ─────────────────────── */
#starfield { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.nebula-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.nebula-1 { background: radial-gradient(ellipse at 30% 40%, rgba(105,40,176,0.08) 0%, transparent 60%); }
.nebula-2 { background: radial-gradient(ellipse at 70% 60%, rgba(219,177,85,0.04) 0%, transparent 50%); }
.nebula-3 { background: radial-gradient(ellipse at 50% 80%, rgba(151,84,237,0.06) 0%, transparent 70%); animation: nebulaShift 30s ease-in-out infinite alternate; }

@keyframes nebulaShift { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 1; transform: scale(1.1); } }

#particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; pointer-events: none; animation: particleFloat linear infinite; }
@keyframes particleFloat {
    0% { transform: translateY(100vh) translateX(0) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(90vh) translateX(10px) scale(1); }
    90% { opacity: 0.6; }
    100% { transform: translateY(-10vh) translateX(-20px) scale(0.5); opacity: 0; }
}

/* ── Utilities ─────────────────────────────── */
.text-gold { color: var(--gold); }
.glow-gold { text-shadow: 0 0 20px rgba(219,177,85,0.4), 0 0 40px rgba(219,177,85,0.2); }

/* ── Navigation ────────────────────────────── */
.nav-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    background: rgba(1,1,8,0.7);
    border-bottom: 1px solid var(--panel-border);
    transition: all 0.3s ease;
}
.nav-bar.scrolled { background: rgba(1,1,8,0.92); box-shadow: 0 4px 30px rgba(219,177,85,0.05); }

.nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 0.75rem 2rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; }
.nav-sigil { animation: rotateSlowly 60s linear infinite; }
.nav-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 600; letter-spacing: 0.05em; color: var(--silver); }
.nav-version { font-family: var(--font-mono); font-size: 0.65rem; color: var(--gold-dim); letter-spacing: 0.1em; margin-left: 0.25rem; opacity: 0.6; }

.nav-links { display: flex; gap: 0.25rem; }
.nav-link {
    font-family: var(--font-heading); font-size: 0.85rem; letter-spacing: 0.15em;
    text-transform: uppercase; padding: 0.5rem 1rem; color: var(--silver-dim);
    border: 1px solid transparent; border-radius: 4px; transition: all 0.3s ease;
}
.nav-link:hover { color: var(--gold); background: var(--gold-ghost); }
.nav-link.active { color: var(--gold); border-color: var(--gold-faint); background: var(--gold-ghost); }

.nav-enter-btn {
    font-family: var(--font-heading); font-size: 0.8rem; letter-spacing: 0.2em;
    text-transform: uppercase; padding: 0.6rem 1.5rem;
    border: 1px solid var(--gold-faint); border-radius: 4px;
    background: transparent; color: var(--gold); cursor: pointer;
    position: relative; overflow: hidden; transition: all 0.4s ease;
}
.nav-enter-btn:hover {
    background: rgba(219,177,85,0.08); border-color: var(--gold-dim);
    box-shadow: 0 0 20px rgba(219,177,85,0.1), inset 0 0 20px rgba(219,177,85,0.05);
}
.btn-glow {
    position: absolute; top: 50%; left: 50%; width: 200%; height: 200%;
    transform: translate(-50%,-50%);
    background: radial-gradient(circle, rgba(219,177,85,0.1) 0%, transparent 70%);
    opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
.nav-enter-btn:hover .btn-glow { opacity: 1; }

/* ── Sections ──────────────────────────────── */
.section {
    position: relative; z-index: 10; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 6rem 2rem;
}

/* ── Hero ───────────────────────────────────── */
.hero-section { padding-top: 8rem; }
.hero-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; animation: fadeInUp 1s ease-out; }

.central-sigil { position: relative; width: 280px; height: 280px; display: flex; align-items: center; justify-content: center; }
.sigil-ring { position: absolute; border-radius: 50%; border: 1px solid; }
.sigil-ring-outer { width: 280px; height: 280px; border-color: rgba(219,177,85,0.2); animation: rotateSlowly 60s linear infinite; }
.sigil-ring-middle { width: 220px; height: 220px; border-color: rgba(151,84,237,0.25); animation: rotateSlowly 45s linear infinite reverse; }
.sigil-ring-inner { width: 160px; height: 160px; border-color: rgba(219,177,85,0.3); animation: rotateSlowly 30s linear infinite; }
.sigil-runes { position: absolute; width: 260px; height: 260px; animation: rotateSlowly 90s linear infinite reverse; }
.sigil-rune { position: absolute; font-size: 0.75rem; color: var(--gold-dim); font-family: serif; }

.sigil-core { position: relative; z-index: 2; width: 120px; height: 120px; animation: pulseGlow 4s ease-in-out infinite; }
.sigil-core-svg { filter: drop-shadow(0 0 20px rgba(219,177,85,0.4)) drop-shadow(0 0 40px rgba(151,84,237,0.2)); }

.hero-title { font-family: var(--font-heading); font-size: 5rem; font-weight: 300; letter-spacing: 0.1em; line-height: 1; margin-top: 0.5rem; }
.title-soul { color: var(--silver); }
.title-os { color: var(--gold); text-shadow: 0 0 30px rgba(219,177,85,0.3); }

.hero-subtitle { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--silver-dim); margin-top: -0.5rem; }

.glyph-row { display: flex; gap: 1.5rem; align-items: center; justify-content: center; margin: 1rem 0; }
.glyph-item { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.2rem; opacity: 0.6; transition: all 0.3s ease; cursor: pointer; }
.glyph-item:hover { opacity: 1; transform: scale(1.2); text-shadow: 0 0 15px rgba(219,177,85,0.5); }

.hero-tagline { font-family: var(--font-body); font-size: 1rem; color: var(--silver-dim); letter-spacing: 0.05em; max-width: 500px; }

/* ── Section Headers ───────────────────────── */
.glyph-row-small { display: flex; gap: 1rem; justify-content: flex-end; margin-bottom: 0.5rem; }
.glyph-icon { color: var(--gold); font-size: 1.3rem; opacity: 0.5; transition: opacity 0.3s ease; }
.glyph-icon:hover { opacity: 0.9; }

.section-header { text-align: right; margin-bottom: 2rem; width: 100%; max-width: 1200px; }
.section-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--silver); }
.section-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--silver-dim); letter-spacing: 0.1em; margin-top: 0.25rem; }
.section-desc { font-family: var(--font-body); font-size: 1.05rem; color: var(--silver-dim); max-width: 600px; margin: 1rem auto 2.5rem; line-height: 1.8; text-align: center; }

/* ── Panels (Glassmorphism) ────────────────── */
.panel {
    backdrop-filter: blur(var(--panel-blur)); -webkit-backdrop-filter: blur(var(--panel-blur));
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    box-shadow: 0 0 30px rgba(219,177,85,0.05), inset 0 1px 0 rgba(219,177,85,0.1);
    overflow: hidden; transition: all 0.4s ease; position: relative;
}
.panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-faint), transparent);
    animation: borderShimmer 4s ease-in-out infinite;
}
.panel:hover { border-color: rgba(219,177,85,0.3); box-shadow: 0 0 40px rgba(219,177,85,0.08), inset 0 1px 0 rgba(219,177,85,0.15); }

.panel-header { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(219,177,85,0.08); display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-family: var(--font-display); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--foreground); }
.panel-body { padding: 1.25rem; position: relative; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulseGlow 2s ease-in-out infinite; box-shadow: 0 0 10px rgba(219,177,85,0.5); }

/* ── Dashboard ─────────────────────────────── */
.dashboard-section { padding-top: 5rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; width: 100%; max-width: 1200px; }
.dashboard-right { display: flex; flex-direction: column; gap: 1.5rem; }

#metricsChart { width: 100%; height: auto; }
.metrics-labels { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.metric-label { position: absolute; font-family: var(--font-mono); font-size: 0.7rem; color: var(--foreground-dim); text-align: center; }
.metric-label .pct { display: block; font-size: 0.85rem; font-weight: 600; color: var(--foreground); }
.metric-label .code { display: block; font-size: 0.55rem; color: var(--silver-dim); letter-spacing: 0.05em; }

.energy-body { display: flex; gap: 1.25rem; align-items: flex-start; }
.dna-helix { flex-shrink: 0; }
.glyph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; flex: 1; }
.glyph-grid-item {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(151,84,237,0.2); border-radius: 6px;
    background: rgba(105,40,176,0.08); color: var(--violet-bright);
    font-size: 1rem; cursor: pointer; transition: all 0.3s ease;
}
.glyph-grid-item:hover { border-color: rgba(219,177,85,0.3); background: rgba(219,177,85,0.08); color: var(--gold); transform: scale(1.05); box-shadow: 0 0 12px rgba(219,177,85,0.15); }

#harmonyCanvas { width: 100%; height: auto; }

/* ── Archives ──────────────────────────────── */
.archives-section { padding-top: 5rem; }
.archives-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 2rem; width: 100%; max-width: 1200px; align-items: start; }
.archives-center { display: flex; align-items: center; justify-content: center; padding: 2rem 0; }
.large-sigil-display { position: relative; }
#sigilCanvas { filter: drop-shadow(0 0 30px rgba(219,177,85,0.2)) drop-shadow(0 0 60px rgba(105,40,176,0.15)); }

.archives-body { padding: 0.75rem; }
.archive-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.archive-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1rem 0.5rem; border: 1px solid rgba(219,177,85,0.1); border-radius: 8px;
    background: rgba(4,4,17,0.5); cursor: pointer; transition: all 0.3s ease; text-align: center;
}
.archive-card:hover { border-color: rgba(219,177,85,0.25); background: rgba(219,177,85,0.04); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.archive-card-icon { opacity: 0.8; transition: opacity 0.3s ease; }
.archive-card:hover .archive-card-icon { opacity: 1; }
.archive-card-label { font-family: var(--font-heading); font-size: 0.75rem; letter-spacing: 0.05em; color: var(--silver-dim); }
.archive-card:hover .archive-card-label { color: var(--gold); }

/* ── Ethereal Interface ────────────────────── */
.interface-body { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.interface-sigil { animation: float 6s ease-in-out infinite; }
.interface-controls { width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }
.control-row { display: flex; align-items: center; gap: 0.75rem; }
.control-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--silver-dim); width: 50px; flex-shrink: 0; }
.control-slider { flex: 1; }
.slider-track { height: 4px; background: rgba(219,177,85,0.1); border-radius: 2px; position: relative; overflow: hidden; }
.slider-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--violet-bright)); border-radius: 2px; box-shadow: 0 0 8px rgba(219,177,85,0.3); transition: width 0.5s ease; }
.control-value { font-family: var(--font-mono); font-size: 0.7rem; color: var(--silver-dim); width: 45px; text-align: right; flex-shrink: 0; }

.transport-controls { display: flex; gap: 0.5rem; justify-content: center; }
.transport-btn {
    width: 32px; height: 32px; border: 1px solid rgba(219,177,85,0.15); border-radius: 4px;
    background: transparent; color: var(--silver-dim); font-size: 0.7rem;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.transport-btn:hover, .transport-btn.active { border-color: var(--gold-dim); color: var(--gold); background: var(--gold-ghost); }

.interface-meters { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.meter-row { display: flex; align-items: center; gap: 0.5rem; }
.meter-icon { color: var(--silver-dim); font-size: 0.8rem; width: 20px; text-align: center; }
.meter-bar { flex: 1; height: 6px; background: rgba(219,177,85,0.08); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--gold); border-radius: 3px; box-shadow: 0 0 6px rgba(219,177,85,0.3); transition: width 1s ease; }
.meter-fill.violet { background: var(--violet-bright); box-shadow: 0 0 6px rgba(151,84,237,0.3); }
.meter-val { font-family: var(--font-mono); font-size: 0.65rem; color: var(--silver-dim); width: 30px; text-align: right; }

.interface-nav-options { width: 100%; display: flex; flex-direction: column; gap: 0.4rem; }
.nav-option-btn {
    width: 100%; padding: 0.6rem 1rem; border: 1px solid rgba(219,177,85,0.12); border-radius: 6px;
    background: rgba(4,4,17,0.6); color: var(--silver); font-family: var(--font-heading);
    font-size: 0.8rem; letter-spacing: 0.1em; text-align: center; cursor: pointer; transition: all 0.3s ease;
}
.nav-option-btn:hover { border-color: var(--gold-dim); color: var(--gold); background: rgba(219,177,85,0.05); box-shadow: 0 0 15px rgba(219,177,85,0.08); }

/* ── Community ─────────────────────────────── */
.community-section { padding-top: 5rem; }
.community-content { text-align: center; max-width: 1000px; width: 100%; }
.community-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.community-card {
    backdrop-filter: blur(var(--panel-blur)); -webkit-backdrop-filter: blur(var(--panel-blur));
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    padding: 2rem 1.5rem; text-align: center; transition: all 0.4s ease; position: relative; overflow: hidden;
}
.community-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-faint), transparent);
    animation: borderShimmer 4s ease-in-out infinite;
}
.community-card:hover { border-color: rgba(219,177,85,0.3); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px rgba(219,177,85,0.06); }
.community-card-icon { margin: 0 auto 1rem; opacity: 0.7; transition: opacity 0.3s ease; }
.community-card:hover .community-card-icon { opacity: 1; }
.community-card-title { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.75rem; }
.community-card-desc { font-family: var(--font-body); font-size: 0.85rem; color: var(--silver-dim); line-height: 1.6; }

/* ── About ─────────────────────────────────── */
.about-section { padding-top: 5rem; min-height: 80vh; }
.about-content { max-width: 700px; text-align: center; }
.about-text { margin-top: 2rem; }
.about-text p { font-family: var(--font-body); font-size: 1rem; color: var(--silver); line-height: 1.8; margin-bottom: 1.25rem; }
.about-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--gold-faint); }
.about-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--gold-dim); letter-spacing: 0.1em; font-style: italic; }

/* ── Footer ────────────────────────────────── */
.site-footer { position: relative; z-index: 10; padding: 3rem 2rem; border-top: 1px solid var(--gold-faint); text-align: center; }
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-sigil { font-size: 1.5rem; color: var(--gold); opacity: 0.5; margin-bottom: 1rem; animation: pulseGlow 4s ease-in-out infinite; }
.footer-text { font-family: var(--font-mono); font-size: 0.75rem; color: var(--silver-dim); letter-spacing: 0.1em; }
.footer-sub { font-family: var(--font-body); font-size: 0.85rem; color: var(--gold-dim); font-style: italic; margin-top: 0.5rem; }

/* ── Animations ────────────────────────────── */
@keyframes borderShimmer { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.7; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseGlow { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
@keyframes rotateSlowly { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }

.fade-in-up { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .archives-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .archives-center { order: -1; }
    .community-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .nav-links { display: none; }
    .nav-enter-btn { font-size: 0.7rem; padding: 0.5rem 1rem; letter-spacing: 0.1em; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 3.5rem; }
    .hero-subtitle { font-size: 1rem; letter-spacing: 0.3em; }
    .central-sigil { width: 200px; height: 200px; }
    .sigil-ring-outer { width: 200px; height: 200px; }
    .sigil-ring-middle { width: 160px; height: 160px; }
    .sigil-ring-inner { width: 120px; height: 120px; }
    .sigil-runes { width: 190px; height: 190px; }
    .section { padding: 4rem 1rem; }
    .section-header { text-align: center; }
    .glyph-row-small { justify-content: center; }
    .glyph-grid { grid-template-columns: repeat(3, 1fr); }
    .section-title { font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.5rem; }
    .central-sigil { width: 160px; height: 160px; }
    .sigil-ring-outer { width: 160px; height: 160px; }
    .sigil-ring-middle { width: 130px; height: 130px; }
    .sigil-ring-inner { width: 100px; height: 100px; }
    .glyph-row { gap: 1rem; }
    .archive-cards { grid-template-columns: 1fr; }
    .nav-inner { padding: 0.75rem 1rem; }
}
