/* xanadu.wiki - Art-Deco Knowledge Vault */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-dark: #0A0A0A;
    --card-dark: #141414;
    --gold: #D4A840;
    --gold-light: #E8C868;
    --cream: #E8E0D8;
    --botanical: #4A8A50;
    --border-ornament: rgba(212, 168, 64, 0.4);
    --subtle-surface: #1A1A1A;
}

body {
    background: var(--bg-dark);
    color: var(--cream);
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
    overflow-x: hidden;
}

/* Header */
.vault-header {
    text-align: center;
    padding: 4rem 2rem 2rem;
}
.vault-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    color: var(--gold);
    opacity: 0;
    animation: fadeGold 0.6s ease forwards 0.3s;
}
@keyframes fadeGold {
    to { opacity: 1; }
}
.vault-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    color: rgba(212, 168, 64, 0.7);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-top: 0.5rem;
}

/* Bento Grid */
.bento-grid {
    max-width: 1100px;
    margin: 0 auto 3rem;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    position: relative;
}
.bento-mod {
    background: var(--card-dark);
    border: 2px solid var(--border-ornament);
    border-radius: 4px;
    padding: 24px;
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.2s ease;
}
.bento-mod.visible {
    opacity: 1;
    transform: scale(1);
}
.bento-mod:hover {
    border-color: var(--gold);
}
.bento-mod:hover .corner { transform: rotate(90deg); }

.mod-large { grid-column: span 2; grid-row: span 2; }
.mod-medium { grid-column: span 2; }
.mod-small { grid-column: span 1; }

/* Corner Ornaments */
.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--gold);
    border-style: solid;
    transition: transform 0.2s ease;
}
.corner-tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.corner-tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.corner-br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* Module Typography */
.mod-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    color: rgba(212, 168, 64, 0.7);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}
.mod-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
.mod-preview {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    color: var(--cream);
    opacity: 0.7;
}
.mod-content {
    display: none;
}
.mod-body {
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
    color: var(--cream);
    line-height: 1.8;
}

/* Decorative Objects */
.deco-sphere {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gold-light), #8A6820);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
.sphere-1 { width: 60px; height: 60px; top: 15%; right: -10px; }
.sphere-2 { width: 40px; height: 40px; bottom: 25%; left: -5px; }
.deco-prism {
    position: absolute;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gold), #8A6820);
    opacity: 0.1;
    pointer-events: none;
    transform: rotate(45deg);
    top: 50%;
    right: 20px;
    z-index: 0;
}

/* Botanical SVG */
.botanical-svg {
    display: block;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 2rem;
    height: 100px;
    padding: 0 40px;
}
.botanical-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.8s ease;
}
.botanical-path.drawn {
    stroke-dashoffset: 0;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.85);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.overlay.active {
    display: flex;
    opacity: 1;
}
.overlay-card {
    background: var(--card-dark);
    border: 2px solid var(--gold);
    border-radius: 4px;
    max-width: 680px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}
.overlay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--gold);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

/* Footer */
.vault-footer {
    text-align: center;
    padding: 3rem 2rem;
}
.footer-text {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.8rem;
    color: rgba(212, 168, 64, 0.7);
    letter-spacing: 0.08em;
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; padding: 0 20px; }
    .mod-large, .mod-medium { grid-column: span 1; grid-row: span 1; }
    .botanical-svg { padding: 0 20px; }
}
