/* ==========================================================================
   Billogna.lol - Shared Base Styles
   Common theme for www, discord, and modview subdomains
   ========================================================================== */

:root {
    /* Core Palette - Deep Space */
    --bg: #05060c;
    --bg-secondary: #0a0718;
    --card: #0c1020;
    --surface: #1a1a24;
    --elevated: #252538;

    /* Shared panel surface (speech-bubble tone, but more transparent) */
    --panel: rgba(12, 16, 32, 0.78);
    
    /* Accent Colors - Nebula */
    --accent: #6d7dff;
    --accent2: #9a6bff;
    --cyan: #06b6d4;
    --magenta: #ec4899;
    --gold: #FFD700;
    
    /* Text Hierarchy */
    --text: #e7ecff;
    --text-secondary: #a8b2d1;
    --muted: #9aa4c2;
    --text-dim: #64748b;
    
    /* Effects */
    --glow: 0 0 25px rgba(109,125,255,0.6);
    --glow-strong: 0 0 50px rgba(154,107,255,0.4);
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4);
    --glass: rgba(255, 255, 255, 0.02);
    --border: rgba(109,125,255,0.2);
    --border-strong: rgba(109,125,255,0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.8);
    
    /* Danger */
    --danger: #ef4444;
    --danger-hover: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   Background Layers
   ========================================================================== */

.nexus-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#nexus-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(74,158,255,0.45),
        rgba(6,182,212,0.45),
        rgba(139,92,246,0.45)
    );
    background-size: 300% 300%;
    animation: nexusHue 26s linear infinite;
    filter: saturate(170%);
}

@keyframes nexusHue {
    0%   { filter: hue-rotate(0deg) saturate(170%); }
    33%  { filter: hue-rotate(60deg) saturate(170%); }
    66%  { filter: hue-rotate(140deg) saturate(170%); }
    100% { filter: hue-rotate(0deg) saturate(170%); }
}

#nexus-pixels {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    mix-blend-mode: soft-light;
    opacity: 0.85;
    background: transparent;
}

#nexus-haze {
    position: fixed;
    inset: -12%;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(
        circle at 50% 42%,
        rgba(10,6,22,0.0) 0%,
        rgba(4,2,10,0.45) 34%,
        rgba(2,1,6,0.78) 64%,
        rgba(0,0,0,1) 100%
    );
    filter: blur(26px);
    opacity: 1;
}

#nexus-vignette {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.18) 55%,
        rgba(0,0,0,0.35) 78%,
        rgba(0,0,0,0.55) 100%
    );
    mix-blend-mode: multiply;
    opacity: 1;
}

.pixel-glow {
    position: fixed;
    inset: -10%;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 30%, rgba(109,125,255,0.35), transparent 32%),
        radial-gradient(circle at 80% 60%, rgba(154,107,255,0.32), transparent 38%),
        radial-gradient(circle at 50% 80%, rgba(90,220,255,0.18), transparent 40%);
    filter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='discrete' tableValues='0 1'/%3E%3CfeFuncG type='discrete' tableValues='0 1'/%3E%3CfeFuncB type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3C/svg%3E#p");
    opacity: 0.18;
    animation: hue-shift 18s ease-in-out infinite alternate;
}

@keyframes hue-shift {
    0% { filter: hue-rotate(0deg) saturate(1); }
    50% { filter: hue-rotate(12deg) saturate(1.1); }
    100% { filter: hue-rotate(-14deg) saturate(1.05); }
}

/* Floating gradient background animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-gradient {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.gradient-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.gradient-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent2) 0%, transparent 70%);
    bottom: -250px;
    right: -250px;
    animation-delay: 5s;
}

.gradient-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.1); }
    66% { transform: translate(-100px, 100px) scale(0.9); }
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(5,6,12,0.88);
    border-bottom: 1px solid rgba(109,125,255,0.25);
}

/* Subtle premium bottom glow line */
.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(109,125,255,0.55),
        rgba(154,107,255,0.45),
        rgba(6,182,212,0.22),
        transparent
    );
    opacity: 0.45;
    pointer-events: none;
}

.site-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative; /* anchor mobile menu panel */
}

.site-logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--accent);
    text-shadow: 0 0 18px rgba(109,125,255,0.75);
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    transform-origin: left center;
    will-change: transform, text-shadow, filter;
    transition: transform 160ms ease, text-shadow 160ms ease, filter 160ms ease;
}

.site-logo:hover,
.site-logo:focus-visible {
    transform: scale(1.06);
    text-shadow:
        0 0 10px rgba(109,125,255,0.55),
        0 0 18px rgba(154,107,255,0.30);
    filter: saturate(1.15);
    outline: none;
}

.site-links {
    display: flex;
    gap: 16px;
}

.site-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px; /* no pill highlight; just a soft hit area */
    transition: transform 160ms ease, text-shadow 160ms ease, filter 160ms ease;
    border: none;
    color: var(--text);
    font-size: 0.95em;
}

.site-links a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--cyan), var(--accent));
    background-size: 220% 100%;
    box-shadow: 0 0 10px rgba(109,125,255,0.35);
    opacity: 0;
    transform: scaleX(0.25);
    transform-origin: center;
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
}

.site-links a:hover,
.site-links a:focus-visible,
.site-links a.active,
.site-links a.nav-selected {
    transform: scale(1.08);
    text-shadow:
        0 0 10px rgba(109,125,255,0.55),
        0 0 18px rgba(154,107,255,0.30);
    filter: saturate(1.15);
    outline: none;
}

.site-links a.active,
.site-links a.nav-selected {
    text-shadow:
        0 0 12px rgba(109,125,255,0.65),
        0 0 22px rgba(154,107,255,0.38);
}

.site-links a:hover::after,
.site-links a:focus-visible::after,
.site-links a.active::after,
.site-links a.nav-selected::after {
    opacity: 1;
    transform: scaleX(1);
    animation: navUnderlineScan 1.1s linear infinite;
}

@keyframes navUnderlineScan {
    0% { background-position: 0% 0; }
    100% { background-position: 220% 0; }
}

/* ==========================================================================
   Mobile "portal" menu (shared across all pages)
   ========================================================================== */

.nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(109,125,255,0.5);
    background: rgba(12,16,32,0.65);
    backdrop-filter: blur(10px);
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow);
    border-color: rgba(154,107,255,0.7);
}

.nav-toggle:active { transform: translateY(0); }

.nav-toggle-sub {
    margin-left: 2px;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-weight: 800;
    font-size: 0.78em;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    opacity: 0.9;
}

.nav-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 28px));
    padding: 14px;
    border-radius: 18px;
    background: rgba(12,16,32,0.92);
    border: 1px solid rgba(231,236,255,0.14);
    box-shadow: var(--shadow-lg), 0 0 28px rgba(109,125,255,0.18);
    backdrop-filter: blur(12px);
    transform-origin: top right;
    clip-path: circle(0px at 92% 10%);
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: clip-path 280ms ease, opacity 200ms ease, transform 200ms ease;
    z-index: 200;
}

.nav-panel.open {
    clip-path: circle(520px at 92% 10%);
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nav-panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.nav-panel-title strong {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-panel-title span {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.nav-bubbles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.nav-bubble {
    position: relative;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(109,125,255,0.28);
    background: rgba(109,125,255,0.08);
    color: var(--text);
    will-change: transform, text-shadow, filter;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, text-shadow 160ms ease, filter 160ms ease;
}

.nav-bubble::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 8px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--cyan), var(--accent));
    background-size: 220% 100%;
    box-shadow: 0 0 10px rgba(109,125,255,0.35);
    opacity: 0;
    transform: scaleX(0.25);
    transform-origin: center;
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
}

.nav-bubble:hover,
.nav-bubble.nav-selected {
    transform: scale(1.03);
    border-color: transparent;
    box-shadow: none;
    background: rgba(154,107,255,0.10);
    text-shadow:
        0 0 10px rgba(109,125,255,0.50),
        0 0 18px rgba(154,107,255,0.28);
    filter: saturate(1.15);
}

.nav-bubble:hover::after,
.nav-bubble.nav-selected::after,
.nav-bubble:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
    animation: navUnderlineScan 1.1s linear infinite;
}

.nav-bubble .label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.nav-bubble .hint {
    color: var(--text-secondary);
    font-size: 0.9em;
    white-space: nowrap;
}

/* A11y: visible keyboard focus without changing the aesthetic */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Perf guards: allow JS to pause heavy visual layers */
html.perf-paused #nexus-pixels { opacity: 0 !important; }
html.perf-paused #nexus-gradient,
html.perf-paused .pixel-glow,
html.perf-paused .color-shift {
    animation-play-state: paused !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    #nexus-gradient,
    .pixel-glow,
    .color-shift {
        animation: none !important;
    }
    .site-logo,
    .site-links a {
        transition: none !important;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    padding: 40px 20px 80px;
    text-align: center;
    color: var(--muted);
    position: relative;
    z-index: 3;
}

/* ==========================================================================
   Main Content Container
   ========================================================================== */

.main-content {
    position: relative;
    z-index: 3;
    padding-top: 90px; /* offset fixed header */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 3;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--panel);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: white;
    box-shadow: var(--glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(109,125,255,0.5);
}

.btn-secondary {
    background: var(--glass);
    backdrop-filter: blur(10px);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--glow);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4em;
    font-weight: 900;
    color: white;
    margin: 0;
    background: none;
    -webkit-text-fill-color: white;
}

.modal-close {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Tiles / Link Cards
   ========================================================================== */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.tile {
    position: relative;
    background: rgba(12,16,32,0.9);
    border: 1px solid rgba(109,125,255,0.3);
    border-radius: 16px;
    padding: 18px;
    color: var(--text);
    box-shadow: 0 10px 40px rgba(0,0,0,0.35), 0 0 24px rgba(109,125,255,0.18);
    overflow: hidden;
    transition: transform 180ms ease, border 180ms ease, box-shadow 180ms ease;
    text-align: center;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-shadow: 0 0 10px rgba(109,125,255,0.4);
}

.tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120px circle at var(--px,50%) var(--py,50%), rgba(109,125,255,0.22), transparent 55%);
    opacity: 0;
    transition: opacity 220ms ease;
}

.tile:hover {
    transform: translateY(-6px);
    border-color: rgba(109,125,255,0.4);
    box-shadow: var(--glow-strong);
}

.tile:hover::before {
    opacity: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .site-links { display: none; }
    .nav-toggle { display: inline-flex; }

    .container {
        padding: 0 16px;
    }

    .tile-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

