/* namu.quest — Fairycore Knowledge Sanctum */

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

:root {
    --bg-deep: #050a10;
    --bg-primary: #0b1118;
    --bg-module: #0f1a26;
    --accent-gold: #e8a84c;
    --accent-green: #7affc1;
    --text-primary: #dceaf5;
    --text-secondary: #8fa3b8;
    --text-muted: #3a5068;
    --frost-border: rgba(122, 255, 193, 0.12);
    --frost-bg: rgba(15, 26, 38, 0.7);
}

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Thaw Overlay */
#thaw-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#thaw-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.thaw-blob {
    width: 200px;
    height: 200px;
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    background: radial-gradient(ellipse at 30% 30%, var(--accent-green), transparent 60%),
                radial-gradient(ellipse at 70% 70%, var(--accent-gold), transparent 50%),
                var(--bg-module);
    box-shadow: 0 0 60px rgba(122, 255, 193, 0.2), inset 0 0 40px rgba(122, 255, 193, 0.1);
    opacity: 0;
    transform: scale(0.6);
    animation: thawBlobIn 1.2s 0.4s ease-out forwards;
}

@keyframes thawBlobIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.thaw-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 3.2rem);
    color: var(--text-primary);
    margin-top: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s 1s ease-out forwards;
}

.thaw-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeUp 0.8s 1.3s ease-out forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main Content */
#main-content {
    opacity: 0;
    transition: opacity 0.6s ease;
}

#main-content.visible {
    opacity: 1;
}

/* Navigation */
#site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    background: rgba(11, 17, 24, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--frost-border);
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-green);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-green);
}

/* Grid Container */
#grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Modules */
.module {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--frost-bg);
    border: 1px solid var(--frost-border);
    backdrop-filter: blur(8px);
    padding: 1.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.module:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(122, 255, 193, 0.08);
    border-color: rgba(122, 255, 193, 0.25);
}

.module-hero {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.module-sm {
    grid-column: span 1;
    grid-row: span 1;
}

.module-md {
    grid-column: span 2;
    grid-row: span 1;
}

.module-wide {
    grid-column: span 3;
    grid-row: span 1;
}

.module-tall {
    grid-column: span 1;
    grid-row: span 2;
}

/* Module Content */
.module-content {
    position: relative;
    z-index: 2;
}

.module-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.module-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.module-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.module-secondary {
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.module-tag {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-gold);
    border: 1px solid rgba(232, 168, 76, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.module-code {
    display: inline-block;
    margin-top: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-green);
    background: rgba(122, 255, 193, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.module-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.module-stats strong {
    color: var(--accent-green);
    font-weight: 400;
}

/* Blobs */
.blob {
    position: absolute;
    z-index: 1;
    opacity: 0.4;
    filter: blur(2px);
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.module:hover .blob {
    opacity: 0.6;
    transform: scale(1.05);
}

.blob-hero {
    width: 280px;
    height: 260px;
    top: -40px;
    right: -40px;
    border-radius: 60% 40% 55% 45% / 50% 65% 35% 50%;
    background: radial-gradient(ellipse at 40% 30%, var(--accent-green), transparent 55%),
                radial-gradient(ellipse at 70% 60%, var(--accent-gold), transparent 50%),
                var(--bg-deep);
    box-shadow: 0 0 40px rgba(122, 255, 193, 0.15);
}

.blob-sm {
    width: 100px;
    height: 90px;
    top: -20px;
    right: -15px;
}

.blob-md {
    width: 160px;
    height: 140px;
    top: -30px;
    right: -20px;
}

.blob-wide {
    width: 200px;
    height: 160px;
    top: -30px;
    right: 10%;
}

.blob-tall {
    width: 120px;
    height: 180px;
    bottom: -30px;
    left: -20px;
}

.blob-1 {
    border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%;
    background: radial-gradient(ellipse at 50% 50%, var(--accent-green), transparent 60%), var(--bg-deep);
}

.blob-2 {
    border-radius: 40% 60% 65% 35% / 55% 45% 55% 45%;
    background: radial-gradient(ellipse at 30% 40%, var(--accent-gold), transparent 55%), var(--bg-deep);
}

.blob-3 {
    border-radius: 55% 45% 40% 60% / 60% 35% 65% 40%;
    background: radial-gradient(ellipse at 60% 30%, var(--accent-green), transparent 60%), var(--bg-deep);
}

.blob-4 {
    border-radius: 45% 55% 60% 40% / 50% 50% 50% 50%;
    background: radial-gradient(ellipse at 40% 50%, var(--accent-green), transparent 50%),
                radial-gradient(ellipse at 70% 30%, var(--accent-gold), transparent 45%),
                var(--bg-deep);
}

.blob-5 {
    border-radius: 50% 50% 35% 65% / 45% 55% 45% 55%;
    background: radial-gradient(ellipse at 50% 40%, var(--accent-gold), transparent 55%), var(--bg-deep);
}

.blob-6 {
    border-radius: 65% 35% 55% 45% / 50% 60% 40% 50%;
    background: radial-gradient(ellipse at 40% 60%, var(--accent-green), transparent 60%), var(--bg-deep);
}

.blob-7 {
    border-radius: 50% 50% 45% 55% / 65% 35% 65% 35%;
    background: radial-gradient(ellipse at 50% 70%, var(--accent-green), transparent 50%),
                radial-gradient(ellipse at 30% 20%, var(--accent-gold), transparent 45%),
                var(--bg-deep);
}

/* Footer */
#site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--frost-border);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--accent-green);
    font-size: 1rem;
}

.footer-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    #grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .module-wide {
        grid-column: span 2;
    }
    .module-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@media (max-width: 600px) {
    #grid-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .module-hero, .module-md, .module-wide, .module-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    #site-nav {
        padding: 1rem;
    }
    .nav-links {
        gap: 1rem;
    }
}
