/* NACA — glassmorphism theme */

:root {
    --bg-0: #030814;
    --bg-1: #071024;
    --ink: #e6eaf6;
    --ink-soft: #93a3c7;
    --accent: #3b82f6;
    --accent-2: #60a5fa;
    --accent-deep: #1e3a8a;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-0);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated gradient mesh background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59, 130, 246, 0.32), transparent 60%),
        radial-gradient(ellipse 70% 50% at 80% 20%, rgba(37, 99, 235, 0.28), transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 90%, rgba(30, 58, 138, 0.42), transparent 65%),
        linear-gradient(180deg, #03071a 0%, #071024 100%);
    animation: drift 22s ease-in-out infinite alternate;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.035;
    pointer-events: none;
}

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-2%, 2%, 0) scale(1.05); }
    100% { transform: translate3d(2%, -1%, 0) scale(1); }
}

/* Glass primitives */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-strong {
    background: rgba(14, 18, 40, 0.55);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-navbar {
    background: rgba(10, 14, 36, 0.55);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Interactive card */
.glass-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1),
                border-color 0.35s ease,
                background 0.35s ease;
}

.glass-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0) 0%, rgba(59, 130, 246, 0.4) 50%, rgba(96, 165, 250, 0) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Glow accents for module icons */
.icon-glow {
    position: relative;
    width: 48px; height: 48px;
    display: grid; place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.icon-glow svg { width: 24px; height: 24px; }

.icon-glow::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    background: var(--glow, rgba(59, 130, 246, 0.4));
    filter: blur(18px);
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.35s ease;
}
.glass-card:hover .icon-glow::after { opacity: 0.95; }

/* Status pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}
.pill::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.pill-ok      { color: var(--success); }
.pill-warn    { color: var(--warning); }
.pill-err     { color: var(--danger); }
.pill-neutral { color: var(--ink-soft); }

/* Links & buttons */
.nav-link {
    position: relative;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.nav-link-active {
    color: var(--ink);
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(59, 130, 246, 0.5); }
.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* Typography */
.title-gradient {
    background: linear-gradient(135deg, #fff 0%, #93c5fd 45%, #3b82f6 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Code/monospace */
pre, code, .mono {
    font-family: "JetBrains Mono", "Menlo", "Consolas", monospace;
}

textarea.code {
    font-family: "JetBrains Mono", "Menlo", "Consolas", monospace;
    tab-size: 2;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    color: var(--ink);
    resize: vertical;
}
textarea.code:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Subtle fade-in on load */
.fade-in {
    animation: fadeUp 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.fade-in-delay-1 { animation-delay: 0.08s; }
.fade-in-delay-2 { animation-delay: 0.16s; }
.fade-in-delay-3 { animation-delay: 0.24s; }
.fade-in-delay-4 { animation-delay: 0.32s; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); background-clip: padding-box; }
