/**
 * ============================================================================
 * CDARS — EDUCATION DOMAIN CSS
 *
 * Path:    /assets/departments/domains/education/education.css
 * Updated: 2026-03-31
 *
 * Purpose:
 * The visual shell of the Education domain. Identical architecture to
 * church.css — Move as One. DNA replaced: Gold → Emerald Green (#29C46A).
 * All structural CSS, component patterns, animations, and layout rules
 * are preserved exactly. Only the color variable changes.
 *
 * Law:
 * — --gold in :root is set to #29C46A (Emerald Green)
 * — var(--gold) propagates the emerald through all 46 usages automatically
 * — This file must never hardcode gold (#29C46A) anywhere
 * — Shell structure is identical to church.css — domain uniqueness is in :root
 * ============================================================================
 */


/* ============================================================================
   CDARS — CHURCH DOMAIN (v5.0 — LIVING GOLD)
   GOLD JURISDICTION · HONOR · WORTH · GLORY
   ============================================================================ */

:root {
    /* Emerald Green Jurisdiction */
    --gold: #29C46A;
    --gold-dark: #8B7500;
    --gold-light: #FFED4E;
    --gold-dawn: #FFB347;
    --gold-glow: rgba(255, 215, 0, 0.3);
    --gold-soft: rgba(255, 215, 0, 0.1);
    --gold-dim: rgba(255, 215, 0, 0.05);

    /* Text Layers */
    --ink: rgba(255, 255, 255, 0.92);
    --ink-muted: rgba(255, 255, 255, 0.68);
    --ink-soft: rgba(255, 255, 255, 0.45);

    /* Panel Layers */
    --panel: rgba(10, 14, 22, 0.62);
    --panel2: rgba(10, 14, 22, 0.42);
    --panel-deep: rgba(5, 8, 15, 0.72);
    --panel-edge: rgba(255, 255, 255, 0.10);
    --panel-edge-gold: rgba(255, 215, 0, 0.20);

    /* Shadows */
    --shadow-soft: 0 1px 1px rgba(0,0,0,0.04),
                   0 2px 2px rgba(0,0,0,0.04),
                   0 4px 4px rgba(0,0,0,0.04),
                   0 8px 8px rgba(0,0,0,0.04),
                   0 16px 16px rgba(0,0,0,0.04);
    --shadow-medium: 0 14px 40px rgba(0,0,0,0.35);
    --shadow-deep: 0 18px 60px rgba(0,0,0,0.55);
    --shadow-lift: 0 20px 60px rgba(0,0,0,0.65);
    --shadow-glow: 0 0 20px rgba(41,196,106,0.18),
                   0 0 60px rgba(41,196,106,0.08);

    /* Geometry */
    --phi: 1.618;
    --radius: 22px;
    --radius2: 18px;
    --radius3: 14px;
    --radius-pill: 999px; /* FIXED: Added missing variable */

    /* Motion Curves */
    --ease: cubic-bezier(.16,1,.3,1);
    --ease-slow: cubic-bezier(0.4,0,0.2,1);
    --ease-breathe: cubic-bezier(0.2,0.8,0.2,1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-pressure: cubic-bezier(0.2, 0.9, 0.3, 1.2);
    --ease-3d: cubic-bezier(0.23, 1, 0.32, 1);

    /* Mouse Position — UNIFIED: using --mx/--my consistently */
    --mx: 50%;
    --my: 50%;

    /* Z-Index Law */
    --z-underlay: -3;
    --z-geometry: -1;
    --z-base: 0;
    --z-surface: 10;
    --z-nav: 50;
    --z-float: 9000;
    --z-modal: 9999;
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: #05070c;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================================
   DOMAIN TOKENS
   ============================================================================ */
.domain-church {
    --gold: #29C46A;
    --primary-glow: rgba(255, 215, 0, 0.10);
    --secondary-glow: rgba(255, 215, 0, 0.05);
}

/* ============================================================================
   REALM — GOLDEN LIVING SPACE
   ============================================================================ */
.realm {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    padding: 20px 16px 40px;
    transition: background 1.2s var(--ease-slow);
    transform-style: preserve-3d;
    perspective: 1000px;
    z-index: var(--z-base);
    width: 100%;
    overflow-x: hidden;
}

.realm::before,
.realm::after {
    content: "";
    position: absolute;
    inset: -22%;
    z-index: var(--z-underlay);
    pointer-events: none;
}

.realm::before {
    background:
        radial-gradient(800px 500px at 20% 20%, rgba(255, 215, 0, .10), transparent 60%),
        radial-gradient(700px 420px at 80% 30%, rgba(120, 220, 255, .08), transparent 60%),
        radial-gradient(900px 600px at 55% 80%, rgba(160, 120, 255, .10), transparent 62%),
        radial-gradient(1200px 900px at 50% 50%, rgba(255, 255, 255, .03), transparent 65%),
        radial-gradient(2px 2px at 12% 18%, rgba(255, 255, 255, .45) 0, transparent 60%),
        radial-gradient(1px 1px at 28% 76%, rgba(255, 255, 255, .35) 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 72% 38%, rgba(255, 255, 255, .40) 0, transparent 60%),
        radial-gradient(1px 1px at 88% 62%, rgba(255, 255, 255, .28) 0, transparent 60%),
        linear-gradient(180deg, #04060b 0%, #05070c 35%, #03040a 100%);
    filter: saturate(1.15) contrast(1.05);
    animation: realmBreath 16s var(--ease) infinite;
    opacity: .98;
}

.realm::after {
    z-index: calc(var(--z-underlay) + 1);
    inset: -30%;
    background:
        radial-gradient(900px 700px at 30% 55%, rgba(255, 215, 0, .10), transparent 62%),
        radial-gradient(900px 700px at 75% 65%, rgba(120, 220, 255, .07), transparent 62%),
        radial-gradient(1400px 900px at 50% 50%, rgba(0, 0, 0, .35), rgba(0, 0, 0, .88));
    mix-blend-mode: screen;
    animation: realmDrift 26s linear infinite;
    opacity: .20;
    filter: blur(.3px);
}

@keyframes realmBreath {
    0%, 100% { transform: scale(1) translate3d(0, 0, 0); opacity: .95; }
    50% { transform: scale(1.02) translate3d(0, -0.6%, 0); opacity: 1; }
}

@keyframes realmDrift {
    0% { transform: translate3d(-1%, 0, 0) rotate(0deg); }
    50% { transform: translate3d(1%, .6%, 0) rotate(2deg); }
    100% { transform: translate3d(-1%, 0, 0) rotate(0deg); }
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
    z-index: var(--z-surface);
    width: 100%;
    padding: 0;
}

/* ============================================================================
   QUANTUM REALITY LAYER — FIXED FULL PAGE
   ============================================================================ */
.quantum-reality-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.reality-thread {
    position: fixed;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: screen;
    will-change: transform, opacity;
    opacity: 0.5;
    filter: blur(0.8px) brightness(1.3);
    box-shadow: 0 0 15px currentColor;
}

.quantum-particle {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold);
    filter: blur(2px);
    animation: particle-drift linear infinite;
    pointer-events: none;
    z-index: 4;
    opacity: 0.4;
    mix-blend-mode: screen;
}

@keyframes particle-drift {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(100vw, 100vh) rotate(360deg); }
}

/* ============================================================================
   TOPBAR
   ============================================================================ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--panel-edge);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 14, 22, .70), rgba(10, 14, 22, .35));
    box-shadow: var(--shadow-deep);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: var(--z-nav);
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.sigil {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255, 215, 0, .25);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 215, 0, .35), transparent 55%),
        radial-gradient(circle at 70% 75%, rgba(120, 220, 255, .18), transparent 58%),
        rgba(10, 14, 22, .6);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, var(--shadow-glow);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.sigil::after {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(6px 6px at 18% 30%, rgba(255, 255, 255, .45), transparent 55%),
        radial-gradient(3px 3px at 65% 65%, rgba(255, 255, 255, .30), transparent 55%);
    opacity: .8;
    animation: sigilSpin 18s linear infinite;
}

@keyframes sigilSpin {
    to { transform: rotate(360deg); }
}

.brand h1 {
    font-family: "Playfair Display", serif;
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1.05;
    background: linear-gradient(135deg, #fff, var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.brand .sub {
    color: var(--ink-muted);
    font-size: clamp(10px, 2.5vw, 12px);
    line-height: 1.25;
    font-weight: 400;
    white-space: nowrap;
}

.presence-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--gold);
    flex-shrink: 0;
}

.presence-pulse {
    width: 8px;
    height: 8px;
    background: #50ffb4;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.presence-count {
    font-size: 0.8rem;
    color: var(--ink-muted);
    white-space: nowrap;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(10, 14, 22, .40);
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: transform .25s var(--ease), border-color .25s var(--ease);
    will-change: transform;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 215, 0, .28);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .35), 0 0 24px var(--gold-glow);
    background: rgba(10, 14, 22, .55);
    outline: none;
}

.user-badge {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.3rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: calc(18px * var(--phi));
    margin-top: 28px;
    align-items: stretch;
    width: 100%;
}

.panel {
    border: 1px solid var(--panel-edge);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(10, 14, 22, .70), rgba(10, 14, 22, .35));
    box-shadow: var(--shadow-deep);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: transform 0.8s var(--ease);
    z-index: var(--z-surface);
    width: 100%;
}

.heroLeft, .heroRight {
    animation: panel-breathe 4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes panel-breathe {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.008);
        filter: brightness(1.02);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
    }
}

.heroLeft {
    animation-delay: 0s;
}

.heroRight {
    animation-delay: 0.5s;
}

.heroLeft.domain-hero {
    position: relative;
    overflow: hidden;
}

.heroLeft.domain-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/assets/domains/church/hero.webp') center/cover no-repeat;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.heroLeft.domain-hero > * {
    position: relative;
    z-index: 1;
}

.panel::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(600px 360px at 18% 20%, rgba(255, 215, 0, .14), transparent 55%),
        radial-gradient(520px 300px at 82% 78%, rgba(120, 220, 255, .09), transparent 58%);
    opacity: .75;
    pointer-events: none;
    animation: heroDrift 16s var(--ease) infinite;
}

@keyframes heroDrift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(1.2%, -1.2%, 0); }
}

.heroLeft {
    padding: 28px 24px 20px;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 215, 0, .22);
    background: rgba(10, 14, 22, .35);
    color: var(--gold);
    font-weight: 700;
    font-size: clamp(11px, 3vw, 12px);
    letter-spacing: .8px;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, .12);
    flex-wrap: wrap;
}

.title {
    margin: 20px 0 12px;
    font-family: "Playfair Display", serif;
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .75), 0 0 38px var(--gold-glow);
    background: linear-gradient(135deg, #fff, var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    word-break: break-word;
}

.desc {
    margin: 0 0 20px;
    color: var(--ink-muted);
    font-size: clamp(14px, 4vw, 15px);
    line-height: 1.6;
    max-width: 70ch;
    word-break: break-word;
}

.declaration {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: rgba(0, 0, 0, .18);
    padding: 20px 18px 16px;
    display: grid;
    gap: 14px;
}

.declaration .row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(10, 14, 22, .45);
    color: var(--ink-muted);
    font-weight: 600;
    font-size: clamp(12px, 3.5vw, 13px);
    flex-wrap: wrap;
}

.pill strong {
    color: var(--gold);
    font-weight: 800;
}

.mantra {
    color: var(--gold);
    font-style: italic;
    font-weight: 500;
    border-left: 3px solid var(--gold);
    padding-left: 16px;
    margin: 8px 0;
    word-break: break-word;
}

.statsRow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.stat {
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(10, 14, 22, .42);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.stat span {
    color: var(--ink-muted);
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 500;
}

.stat b {
    font-weight: 900;
    letter-spacing: .2px;
    background: linear-gradient(120deg, var(--gold), rgba(255, 255, 255, 0.95));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: clamp(14px, 4vw, 16px);
}

.stat small {
    color: var(--ink-soft);
    font-size: clamp(9px, 2.5vw, 11px);
    font-weight: 400;
}

.heroRight {
    padding: 22px;
    display: grid;
    gap: 18px;
}

/* ============================================================================
   SEAL
   ============================================================================ */
.sealBox {
    border: 1px solid var(--panel-edge);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .06));
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.sealBox::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(500px 320px at 50% 50%, rgba(255, 215, 0, .18), transparent 60%),
        radial-gradient(520px 340px at 55% 60%, rgba(120, 220, 255, .09), transparent 62%);
    opacity: .8;
    animation: sealCloud 18s var(--ease) infinite;
    pointer-events: none;
}

@keyframes sealCloud {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(1.4%, -1.2%, 0) rotate(2deg); }
}

.seal {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    aspect-ratio: 1/1;
    border-radius: 24px;
    border: 1px solid var(--panel-edge-gold);
    background: url('/assets/domains/church/seal.webp') center/contain no-repeat !important;
    background-size: contain !important;
    background-color: transparent !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, 0 0 40px rgba(255, 215, 0, 0.3) !important;
    overflow: hidden;
    cursor: pointer;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
    will-change: transform, box-shadow;
}

.seal:hover {
    box-shadow: 0 0 0 2px var(--gold), 0 0 80px var(--gold-glow), inset 0 0 60px rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.02);
}

.seal::after {
    display: none !important;
}

.domain-church .domain-seal::after {
    display: none !important;
}

.sealCore {
    width: 58%;
    height: 58%;
    border-radius: 50%;
    border: 1px solid var(--panel-edge-gold);
    background: transparent !important;
    box-shadow: inset 0 0 60px var(--gold-glow), 0 0 90px var(--gold-glow);
    display: grid;
    place-items: center;
    animation: corePulse 2.4s var(--ease) infinite;
    position: relative;
    z-index: 3;
    pointer-events: none;
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.sealCore .mark {
    display: none !important;
}

.halo {
    position: absolute;
    inset: -20%;
    border-radius: 50%;
    border: 1px solid var(--panel-edge-gold);
    box-shadow: inset 0 0 80px var(--gold-glow), 0 0 120px var(--gold-glow);
    animation: haloBreath 2.8s var(--ease) infinite;
    z-index: 1;
}

.halo:nth-child(2) {
    inset: -30%;
    border-color: rgba(120, 220, 255, .12);
    box-shadow: inset 0 0 90px rgba(120, 220, 255, .12), 0 0 140px rgba(120, 220, 255, .08);
    animation-duration: 3.6s;
}

@keyframes haloBreath {
    0%, 100% { transform: scale(1); opacity: .70; }
    50% { transform: scale(1.05); opacity: 1; }
}

.sealMeta {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.sealMeta .line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: clamp(12px, 3.5vw, 13px);
    color: var(--ink-muted);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .42);
    flex-wrap: wrap;
}

.sealMeta .line span:last-child {
    color: var(--gold);
    font-weight: 800;
}

/* ============================================================================
   SEAL WISDOM POPUP
   ============================================================================ */
.seal-wisdom {
    position: fixed;
    background: rgba(10, 14, 22, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 12px 24px;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-style: italic;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 30px var(--gold-glow);
    transform: translate(-50%, 20px) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
    pointer-events: none;
}

.seal-wisdom.visible {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.seal-wisdom::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: rgba(10, 14, 22, 0.95);
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
}

/* ============================================================================
   LEGENDARY CROWN
   ============================================================================ */
.legendary-crown {
    margin: 2rem 0 3rem;
    padding: 2rem 0 1.5rem;
    background: var(--panel-deep);
    border-top: 2px solid var(--panel-edge-gold);
    border-bottom: 2px solid var(--panel-edge-gold);
    border-radius: var(--radius);
    position: relative;
    overflow: visible;
    z-index: 50;
    width: 100%;
}

.crown-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at 50% 50%, var(--gold-dim), transparent 70%);
    opacity: 0.3;
    pointer-events: none;
    animation: crown-pulse 8s ease-in-out infinite;
}

@keyframes crown-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
}

.crown-header {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 1.2rem;
    border-radius: 6px;
    letter-spacing: 0.2em;
    white-space: nowrap;
    box-shadow: 0 0 20px var(--gold);
    z-index: 55;
}

.crown-track-container {
    position: relative;
    overflow: visible;
    padding: 0 1rem;
}

.crown-gradient-left,
.crown-gradient-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    z-index: 52;
}

.crown-gradient-left {
    left: 0;
    background: linear-gradient(90deg, var(--panel-deep), transparent);
}

.crown-gradient-right {
    right: 0;
    background: linear-gradient(-90deg, var(--panel-deep), transparent);
}

.crown-track {
    display: flex;
    gap: 1rem;
    padding: 1rem 0.5rem 2rem;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--panel-edge);
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 51;
}

.crown-track::-webkit-scrollbar {
    height: 4px;
}

.crown-track::-webkit-scrollbar-track {
    background: var(--panel-edge);
    border-radius: 10px;
}

.crown-track::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.crown-jewel {
    position: relative;
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    filter: drop-shadow(0 0 10px var(--jewel-color));
    z-index: 53;
}

.crown-jewel::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: var(--jewel-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(10px);
    z-index: -1;
}

.crown-jewel:hover::before {
    opacity: 0.5;
}

.crown-jewel:hover {
    transform: scale(1.1) translateY(-4px);
    z-index: 200;
}

.crown-jewel.active {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px var(--jewel-color));
}

.jewel-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--jewel-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    box-shadow: 0 0 30px var(--jewel-color), inset 0 0 15px rgba(255,255,255,0.6);
    border: 2px solid rgba(255,255,255,0.4);
    position: relative;
    overflow: hidden;
}

.jewel-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crown-jewel:hover .jewel-face::after {
    opacity: 0.6;
}

.jewel-icon {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.crown-jewel:hover .jewel-icon {
    transform: scale(1.1);
}

.jewel-name {
    font-size: clamp(0.6rem, 2vw, 0.7rem);
    font-weight: 800;
    text-transform: uppercase;
    color: #000;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

/* Crown Hover Portal */
.crown-hover-portal {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.crown-hover-portal.visible {
    opacity: 1;
}

.hover-card {
    background: var(--panel-deep);
    border: 2px solid var(--hover-color);
    border-radius: var(--radius2);
    padding: 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 40px var(--hover-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: min(280px, 80vw);
    transform-origin: center;
    animation: hover-appear 0.3s var(--ease-spring);
}

@keyframes hover-appear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.hover-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--panel-deep);
    border-right: 2px solid var(--hover-color);
    border-bottom: 2px solid var(--hover-color);
}

.hover-arrow.above {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.hover-arrow.below {
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(225deg);
}

.hover-title {
    display: block;
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 800;
    color: var(--hover-color);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.hover-domain {
    display: block;
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--panel-edge);
}

.hover-meaning {
    display: block;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.hover-preview {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--ink-soft);
}

/* ============================================================================
   COLOR MEANING PANEL
   ============================================================================ */
.color-meaning {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-edge-gold);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    animation: justice-breathe 4.5s var(--ease-breathe) infinite;
    width: 100%;
}

.color-meaning:hover {
    animation-play-state: paused;
    border-color: var(--gold);
    transform: scale(1.01);
}

@keyframes justice-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    50% { transform: scale(1.01); box-shadow: 0 8px 24px var(--gold-glow); }
}

.meaning-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

.meaning-color {
    width: clamp(40px, 10vw, 60px);
    height: clamp(40px, 10vw, 60px);
    border-radius: 8px;
    background: var(--gold);
    box-shadow: 0 0 30px var(--gold);
}

.meaning-title {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    color: var(--gold);
}

.meaning-text {
    position: relative;
    z-index: 2;
    color: var(--ink-muted);
    font-size: clamp(0.9rem, 3vw, 1rem);
    line-height: 1.7;
    max-width: 800px;
    font-weight: 500;
    word-break: break-word;
}

/* ============================================================================
   LIBRARY SECTION
   ============================================================================ */
.section {
    margin-top: 28px;
    padding: 22px;
    position: relative;
    z-index: var(--z-surface);
    width: 100%;
}

.sectionHeader {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sectionHeader h2 {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.08;
    text-shadow: 0 0 18px var(--gold-glow), 0 0 44px var(--gold-soft);
}

.sectionHeader p {
    color: var(--ink-muted);
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    line-height: 1.5;
    max-width: 74ch;
}

.completion-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--gold-dim);
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: var(--gold);
}

.badge-percent {
    font-weight: 900;
    font-size: clamp(1rem, 4vw, 1.2rem);
}

.badge-label {
    font-weight: 700;
    font-size: clamp(0.6rem, 2.5vw, 0.7rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 18px 0 14px;
}

.search {
    flex: 1 1 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .42);
    padding: 0 16px;
    position: relative;
    z-index: 10;
    min-width: 200px;
}

.search input {
    width: 100%;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--ink);
    font-size: clamp(13px, 3.5vw, 14px);
    font-family: inherit;
}

.search input::placeholder {
    color: var(--ink-soft);
    font-weight: 400;
}

.select select {
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .42);
    color: var(--ink);
    padding: 0 16px;
    font-weight: 700;
    font-size: clamp(12px, 3vw, 13px);
    outline: none;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    z-index: 10;
    min-width: 140px;
}

.select select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-soft);
}

.category {
    margin-bottom: 8px;
    border: 1px solid var(--panel-edge);
    border-radius: var(--radius2);
    background: linear-gradient(180deg, rgba(10, 14, 22, .62), rgba(10, 14, 22, .30));
    overflow: hidden;
    transition: border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
    z-index: var(--z-surface);
    width: 100%;
}

.category:hover {
    border-color: var(--gold-soft);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .30);
}

.categoryHead {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: clamp(16px, 4vw, 20px) clamp(18px, 4vw, 22px);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .3s var(--ease);
    position: relative;
    z-index: 2;
    min-height: 60px;
}

.categoryHead:hover,
.categoryHead:focus-visible {
    background: var(--gold-dim);
    outline: none;
}

.catArrow {
    width: clamp(22px, 6vw, 26px);
    height: clamp(22px, 6vw, 26px);
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--gold-soft);
    background: rgba(0, 0, 0, .18);
    color: var(--gold);
    font-weight: 900;
    font-size: clamp(10px, 3vw, 12px);
    transition: transform .3s var(--ease), background .3s var(--ease);
    flex-shrink: 0;
}

.category[data-open="1"] .catArrow {
    transform: rotate(90deg);
    background: var(--gold-soft);
}

.catText {
    flex: 1;
    min-width: 0;
}

.catText b {
    display: block;
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
    line-height: 1.2;
}

.catSub {
    display: block;
    font-size: clamp(11px, 3vw, 13px);
    color: var(--ink-muted);
    line-height: 1.4;
    opacity: .9;
    word-break: break-word;
}

.catCount {
    min-width: clamp(36px, 10vw, 42px);
    height: clamp(24px, 6vw, 28px);
    padding: 0 clamp(8px, 2vw, 10px);
    border-radius: 999px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 3vw, 13px);
    color: var(--gold);
    font-weight: 900;
    flex-shrink: 0;
}

.categoryBody {
    position: relative;
    z-index: 1;
    padding: 0 clamp(18px, 4vw, 22px);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: opacity .5s var(--ease), transform .5s var(--ease), padding .5s var(--ease);
}

.category[data-open="1"] .categoryBody {
    opacity: 1;
    transform: translateY(0);
    padding: 0 clamp(18px, 4vw, 22px) clamp(20px, 5vw, 24px);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(12px, 3vw, 20px);
    margin-top: 18px;
    animation: gridBreath 10.5s var(--ease-breathe) infinite;
    transform-origin: 50% 40%;
}

@keyframes gridBreath {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -0.35%, 0) scale(1.006); }
}

.tile {
    border: 1px solid var(--panel-edge);
    border-radius: var(--radius2);
    background: linear-gradient(180deg, rgba(10, 14, 22, .62), rgba(10, 14, 22, .30));
    box-shadow: var(--shadow-medium);
    padding: clamp(16px, 4vw, 20px) clamp(14px, 3.5vw, 18px) clamp(16px, 4vw, 18px);
    position: relative;
    overflow: hidden;
    transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
    will-change: transform;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    animation: tileBreathe 7.2s var(--ease-breathe) infinite;
    counter-increment: canon-volume;
    z-index: var(--z-surface);
    width: 100%;
}

.tile::before {
    content: "Vol. " counter(canon-volume);
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    opacity: 0.7;
    color: var(--gold);
    font-weight: 800;
    background: rgba(10, 14, 22, .7);
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid var(--gold-soft);
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@keyframes tileBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.006); }
}

.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(600px 220px at var(--mx, 40%) var(--my, 30%), var(--gold-glow), transparent 55%);
    opacity: .55;
    transition: opacity 260ms var(--ease);
}

.tile:hover,
.tile:focus-within {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lift), 0 0 0 1px var(--gold-soft) inset;
    border-color: var(--gold-soft);
    filter: saturate(1.05) contrast(1.02);
    outline: none;
}

.tile:hover::after {
    opacity: .9;
}

.tileTop {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.icon {
    width: clamp(36px, 10vw, 44px);
    height: clamp(36px, 10vw, 44px);
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold-soft);
    background: rgba(0, 0, 0, .22);
    color: var(--gold);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .05) inset, 0 0 30px var(--gold-soft);
    font-weight: 900;
    font-size: clamp(16px, 5vw, 20px);
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: clamp(24px, 6vw, 28px);
    padding: 0 clamp(8px, 2.5vw, 12px);
    border-radius: 999px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .45);
    color: var(--ink-muted);
    font-size: clamp(10px, 3vw, 12px);
    letter-spacing: .8px;
    text-transform: uppercase;
    font-weight: 900;
    transition: transform 220ms var(--ease), filter 220ms var(--ease);
    flex-shrink: 0;
}

.tile:hover .badge {
    transform: translate3d(0, -1px, 0) scale(1.02);
    filter: brightness(1.1);
}

.badge.core {
    border-color: var(--gold-soft);
    color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold-soft), 0 0 18px var(--gold-glow);
}

.badge.admin {
    border-color: rgba(120, 220, 255, .18);
    color: rgba(200, 240, 255, .78);
    box-shadow: 0 0 0 1px rgba(120, 200, 255, .18), 0 0 18px rgba(120, 200, 255, .06);
}

.tile h3 {
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
    font-size: clamp(15px, 4vw, 17px);
    letter-spacing: .2px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.tile p {
    margin: 0 0 16px;
    position: relative;
    z-index: 1;
    color: var(--ink-muted);
    font-size: clamp(13px, 3.5vw, 14px);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(3 * 1.5 * 14px);
    flex-grow: 1;
    word-break: break-word;
}

.locked-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: var(--gold);
    opacity: 0.8;
}

.metaRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 1;
    margin-top: auto;
    flex-wrap: wrap;
}

.tagPill {
    display: inline-flex;
    align-items: center;
    height: clamp(24px, 6vw, 28px);
    padding: 0 clamp(8px, 2.5vw, 12px);
    border-radius: 999px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .45);
    color: var(--ink-muted);
    font-weight: 800;
    font-size: clamp(10px, 3vw, 12px);
    letter-spacing: .3px;
    text-transform: lowercase;
}

.go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 900;
    font-size: clamp(11px, 3vw, 13px);
    color: var(--ink);
    border: 1px solid var(--gold-soft);
    background: var(--gold-dim);
    height: clamp(32px, 8vw, 36px);
    padding: 0 clamp(10px, 3vw, 14px);
    border-radius: 999px;
    transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
    font-family: inherit;
}

.tile:hover .go {
    transform: translate3d(1px, -1px, 0);
    background: var(--gold-soft);
    border-color: var(--gold);
    box-shadow: var(--shadow-lift), 0 0 40px var(--gold-glow);
    filter: brightness(1.08);
}

.go:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 999px;
}

.go.locked {
    opacity: 0.8;
}

.emptyState {
    border: 1px solid var(--panel-edge);
    border-radius: var(--radius2);
    background: rgba(10, 14, 22, .42);
    padding: clamp(24px, 6vw, 32px) clamp(20px, 5vw, 24px);
    text-align: center;
    width: 100%;
}

.emptyCard {
    max-width: 400px;
    margin: 0 auto;
}

.emptyCard b {
    display: block;
    font-size: clamp(16px, 5vw, 18px);
    margin-bottom: 8px;
    color: var(--gold);
}

.emptyCard p {
    color: var(--ink-muted);
    font-size: clamp(13px, 4vw, 14px);
    line-height: 1.5;
}

.empty-icon {
    font-size: clamp(2.5rem, 8vw, 3rem);
    opacity: 0.7;
    margin-bottom: 1rem;
    display: block;
    color: var(--gold);
}

/* ============================================================================
   PRESENCE BUBBLES
   ============================================================================ */
.presence-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.presence-bubble {
    background: var(--panel-deep);
    border: 1px solid var(--gold);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 20px var(--gold-glow);
    animation: bubble-appear 0.3s var(--ease-spring);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.presence-bubble:hover {
    transform: scale(1.05) translateX(-5px);
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--gold);
}

.presence-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #000;
    box-shadow: 0 0 15px currentColor;
}

.presence-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.presence-location {
    font-size: 0.7rem;
    color: var(--ink-muted);
}

.presence-role {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--panel-deep);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.presence-bubble:hover .presence-role {
    opacity: 1;
}

@keyframes bubble-appear {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================================
   JOURNEY PATH
   ============================================================================ */
.journey-path {
    position: fixed;
    top: 100px;
    left: 20px;
    z-index: 9998;
    background: var(--panel-deep);
    border: 1px solid var(--gold);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px var(--gold-glow);
    animation: journey-appear 0.5s var(--ease-spring);
    pointer-events: none;
    font-weight: 600;
}

.journey-icon {
    color: var(--gold);
    font-size: 1rem;
}

.journey-steps {
    display: flex;
    gap: 5px;
    color: var(--ink-muted);
}

.journey-step {
    display: flex;
    align-items: center;
    gap: 5px;
}

.journey-step.active {
    color: var(--gold);
    font-weight: 800;
}

.journey-step::after {
    content: '→';
    margin-left: 5px;
    color: var(--ink-soft);
}

.journey-step:last-child::after {
    display: none;
}

@keyframes journey-appear {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
    margin-top: 28px;
    padding: clamp(14px, 4vw, 16px) clamp(16px, 4vw, 20px);
    border-radius: 18px;
    border: 1px solid var(--panel-edge);
    background: rgba(10, 14, 22, .42);
    color: var(--ink-muted);
    font-size: clamp(11px, 3vw, 13px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
}

.footer b {
    color: var(--gold);
    font-weight: 800;
}

.footer-law {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.law-glyph {
    color: var(--gold);
    font-size: 1.1rem;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.separator {
    color: var(--ink-soft);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .brand {
        min-width: unset;
        justify-content: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .footer {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wrap { padding: 1rem; }
    .title { font-size: 2rem; }
    .statsRow { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .quantum-reality-layer {
        display: none;
    }
}

/* ============================================================================
   IDENTITY PORTAL - TOP-LEFT HALF CIRCLE (Emerald Green Jurisdiction)
   ============================================================================ */
.consciousness-identity-portal {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.portal-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid <?php echo $DOMAIN_COLOR; ?>;
    border-top-color: transparent;
    border-right-color: transparent;
    animation: portal-rotate 3s linear infinite;
}

@keyframes portal-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.portal-core {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: <?php echo $IS_AUTHED ? $ROLE_COLOR : 'rgba(255,255,255,0.2)'; ?>;
    box-shadow: 0 0 30px <?php echo $IS_AUTHED ? $ROLE_COLOR : $DOMAIN_COLOR; ?>;
    transition: all 0.3s ease;
}

.portal-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: <?php echo $IS_AUTHED ? '#50ffb4' : '#ffffff'; ?>;
    border: 2px solid #000;
    box-shadow: 0 0 15px <?php echo $IS_AUTHED ? '#50ffb4' : '#ffffff'; ?>;
}

.portal-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: <?php echo $DOMAIN_COLOR; ?>;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.7;
}

.consciousness-identity-portal:hover .portal-core {
    transform: scale(1.1);
}