/* ═══ FONDATION SERENITY VAULT PROTOCOL v3 ═══ */
/* Ultra-Premium Design System */

/* ── Base ── */
:root {
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --purple: #8b5cf6;
    --emerald: #10b981;
    --amber: #f59e0b;
    --bg-primary: #000000;
    --bg-secondary: #0a0a0f;
    --bg-card: rgba(17, 24, 39, 0.5);
    --border: rgba(55, 65, 81, 0.5);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Open Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ── Text Gradient ── */
.text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 40%, #93c5fd 70%, #3b82f6 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-emerald {
    background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ── Hero Gradient Background ── */
.hero-gradient {
    background: radial-gradient(ellipse at 30% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
}

/* ── Floating Orbs ── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    animation: float-orb 25s infinite ease-in-out;
    pointer-events: none;
}
.orb-1 { width: 400px; height: 400px; background: #3b82f6; top: 5%; left: 5%; }
.orb-2 { width: 300px; height: 300px; background: #8b5cf6; top: 55%; right: 10%; animation-delay: -8s; }
.orb-3 { width: 350px; height: 350px; background: #06b6d4; bottom: 5%; left: 25%; animation-delay: -16s; }

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -40px) scale(1.15); }
    50% { transform: translate(-30px, 30px) scale(0.85); }
    75% { transform: translate(30px, 15px) scale(1.1); }
}

/* ── Grid Pattern ── */
.grid-pattern {
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
}

/* ── Particles ── */
.particle {
    position: absolute;
    background: rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    animation: particle-float linear infinite;
    pointer-events: none;
}
@keyframes particle-float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* ── Navigation ── */
#navbar {
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#navbar.scrolled {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
    transition: color 0.3s;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
    border-radius: 1px;
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* ── Card Styles ── */
.card-glass {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.card-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s;
}
.card-glass:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
}
.card-glass:hover::before { opacity: 1; }

/* ── Trinity Card ── */
.trinity-card {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid #1f2937;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.trinity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transition: left 0.6s;
}
.trinity-card:hover {
    border-color: #374151;
    background: rgba(17, 24, 39, 0.7);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.trinity-card:hover::before { left: 100%; }

/* ── Pulse Icon ── */
.pulse-icon {
    animation: icon-pulse 3s infinite ease-in-out;
}
@keyframes icon-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
    50% { box-shadow: 0 0 25px 8px rgba(59, 130, 246, 0.12); }
}

/* ── Status Dot ── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}
.status-dot.online { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Terminal ── */
.terminal {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.terminal-header {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #30363d;
}
.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-body {
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    color: #c9d1d9;
}
.terminal-body .prompt { color: #58a6ff; }
.terminal-body .success { color: #3fb950; }
.terminal-body .warning { color: #d29922; }
.terminal-body .error { color: #f85149; }
.terminal-body .info { color: #8b949e; }

/* ── Chatbot ── */
.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
    animation: chatbot-pulse 3s infinite;
}
.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}
@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(59, 130, 246, 0.7), 0 0 60px rgba(59, 130, 246, 0.2); }
}

.chatbot-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 16px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: chatbot-open 0.3s ease-out;
}
.chatbot-window.open { display: flex; }

@keyframes chatbot-open {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
    background: linear-gradient(135deg, #1e3a5f, #1a1a2e);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #30363d;
}
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
}
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    animation: msg-appear 0.3s ease-out;
}
.chat-msg.bot {
    align-self: flex-start;
    background: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}
@keyframes msg-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #30363d;
    background: #161b22;
}
.chatbot-input input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: border-color 0.3s;
}
.chatbot-input input:focus { border-color: var(--accent); }
.chatbot-input button {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}
.chatbot-input button:hover { background: var(--accent-hover); }

/* ── Scroll Reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }

/* ── Architecture Diagram ── */
.arch-node {
    transition: all 0.4s;
    cursor: pointer;
}
.arch-node:hover {
    filter: brightness(1.3);
    transform: scale(1.05);
}
.arch-line {
    stroke-dasharray: 8 4;
    animation: dash 2s linear infinite;
}
@keyframes dash {
    to { stroke-dashoffset: -24; }
}

/* ── Counter ── */
.stat-counter { position: relative; }
.stat-counter::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--accent-glow);
    border-radius: 1px;
}

/* ── Avatar ── */
.avatar-ring {
    position: relative;
}
.avatar-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(var(--accent), var(--purple), var(--emerald), var(--accent));
    animation: ring-spin 6s linear infinite;
    z-index: -1;
}
@keyframes ring-spin {
    to { transform: rotate(360deg); }
}

/* ── Timeline ── */
.timeline-item {
    position: relative;
    padding-left: 32px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 28px;
    bottom: -20px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), transparent);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Section Divider ── */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── Glowing Button ── */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}
.btn-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    filter: blur(8px);
}
.btn-glow:hover::before { opacity: 1; }
.btn-glow:hover { transform: translateY(-2px); }

/* ── Marquee ── */
.marquee {
    overflow: hidden;
    white-space: nowrap;
}
.marquee-content {
    display: inline-flex;
    animation: marquee 30s linear infinite;
    gap: 3rem;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .orb { display: none; }
    .chatbot-window { width: 320px; right: -12px; }
    .text-gradient { font-size: 2.2rem; }
}
@media (max-width: 480px) {
    .chatbot-window { width: 290px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ── Page Transition ── */
.page-enter {
    animation: pageIn 0.5s ease-out;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Typing indicator ── */
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #8b949e;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}
