/* ===========================
   RESET & VARIABLES
=========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
    --bg: #0a0a0f;
    --bg-2: #0d0d14;
    --bg-card: #12121a;
    --bg-card-hover: #181822;
    --border: rgba(59, 130, 246, 0.10);
    --border-hover: rgba(59, 130, 246, 0.45);
    --blue: #3b82f6;
    --blue-bright: #60a5fa;
    --blue-dark: #1d4ed8;
    --blue-glow: rgba(59, 130, 246, 0.25);
    --text: #eef2f7;
    --text-muted: #8a9bb5;
    --text-dim: #4a5568;
    --radius: 12px;
    --radius-lg: 18px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===========================
   AMBIENT BACKGROUND
=========================== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59,130,246,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(59,130,246,0.06) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 50% 50%, rgba(10,10,15,1) 40%, transparent 100%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(59,130,246,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 100%);
    animation: grid-drift 20s ease-in-out infinite alternate;
}

@keyframes grid-drift {
    0%   { background-position: 0 0; }
    100% { background-position: 36px 36px; }
}

/* ===========================
   PARTICLES
=========================== */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particles span {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(96, 165, 250, 0.5);
    border-radius: 50%;
    animation: particle-float linear infinite;
}

.particles span:nth-child(1)  { left: 10%; top: 80%; animation-duration: 18s; animation-delay: 0s;   width: 3px; height: 3px; }
.particles span:nth-child(2)  { left: 25%; top: 90%; animation-duration: 22s; animation-delay: -4s; }
.particles span:nth-child(3)  { left: 40%; top: 70%; animation-duration: 16s; animation-delay: -8s;  width: 1px; height: 1px; }
.particles span:nth-child(4)  { left: 55%; top: 95%; animation-duration: 20s; animation-delay: -2s; }
.particles span:nth-child(5)  { left: 70%; top: 85%; animation-duration: 24s; animation-delay: -6s;  width: 3px; height: 3px; }
.particles span:nth-child(6)  { left: 85%; top: 75%; animation-duration: 14s; animation-delay: -10s; }
.particles span:nth-child(7)  { left: 5%;  top: 60%; animation-duration: 26s; animation-delay: -1s;  width: 1px; height: 1px; }
.particles span:nth-child(8)  { left: 90%; top: 50%; animation-duration: 19s; animation-delay: -7s; }
.particles span:nth-child(9)  { left: 35%; top: 88%; animation-duration: 21s; animation-delay: -3s;  width: 2px; height: 2px; }
.particles span:nth-child(10) { left: 65%; top: 92%; animation-duration: 17s; animation-delay: -9s; }
.particles span:nth-child(11) { left: 15%; top: 45%; animation-duration: 23s; animation-delay: -5s;  width: 1px; height: 1px; }
.particles span:nth-child(12) { left: 78%; top: 30%; animation-duration: 15s; animation-delay: -11s; }

@keyframes particle-float {
    0%   { transform: translateY(0) translateX(0);   opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

/* ===========================
   HERO OVERLAY
=========================== */
.hero-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.8) 40%, rgba(10,10,15,0.95) 100%);
    z-index: 0;
    pointer-events: none;
}

/* ===========================
   HEADER
=========================== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font);
}

header h2, header span, header a, header button {
    font-family: var(--font) !important;
}

header.scrolled {
    background: rgba(10, 10, 15, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 12px 40px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.2));
}

.brand-info h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand-info span {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── External Links Nav ────────────────────────────────────────────────────── */
.header-external-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-ext-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.header-ext-btn:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.header-ext-btn i {
    font-size: 0.92rem;
    color: var(--blue-bright);
}

/* ===========================
   MOBILE NAV
=========================== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(59,130,246,0.1);
}

.mobile-nav-overlay {
    display: none;
}

.desktop-only {
    display: block;
}

/* ===========================
   SECTION HEADERS
=========================== */
section {
    position: relative;
    z-index: 1;
}

.section-header-left {
    margin-bottom: 24px;
}

.section-header-left h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
    line-height: 1.15;
}

.section-header-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ===========================
   STATUS PAGE - OVERALL BANNER
=========================== */
.status-hero {
    padding: 100px 0 40px;
    position: relative;
    z-index: 1;
}

.status-overall {
    text-align: center;
    padding: 48px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(12px);
    transition: all 0.4s ease;
}

.status-overall--operational {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.03);
}

.status-overall--degraded {
    border-color: rgba(250, 204, 21, 0.3);
    background: rgba(250, 204, 21, 0.03);
}

.status-overall--down {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.03);
}

.status-overall-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.status-overall--operational .status-overall-icon { color: #22c55e; }
.status-overall--degraded .status-overall-icon { color: #facc15; }
.status-overall--down .status-overall-icon { color: #ef4444; }

.status-overall-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--text);
}

.status-overall-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 16px;
}

.status-overall-updated {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* ===========================
   STATUS PAGE - SERVICE TILES
=========================== */
.status-services {
    padding: 20px 0 60px;
    position: relative;
    z-index: 1;
}

.status-services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.status-tile {
    background: rgba(18, 18, 26, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px rgba(59, 130, 246, 0.05);
}

.status-tile--operational { border-color: rgba(34, 197, 94, 0.25); }
.status-tile--degraded { border-color: rgba(250, 204, 21, 0.25); }
.status-tile--down { border-color: rgba(239, 68, 68, 0.25); }

.status-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--blue-bright);
    flex-shrink: 0;
}

.status-tile-info {
    flex: 1;
    min-width: 0;
}

.status-tile-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-tile-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-tile-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.status-tile-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.status-tile-indicator--operational {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.06);
}

.status-tile-indicator--degraded {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.3);
    background: rgba(250, 204, 21, 0.06);
}

.status-tile-indicator--down {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
}

.status-tile-indicator--checking {
    color: var(--text-muted);
}

.status-tile-ping {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--blue-bright);
    font-family: 'JetBrains Mono', monospace;
}

/* ===========================
   STATUS PAGE - TABS
=========================== */
.status-tabs {
    display: flex;
    gap: 4px;
    margin: 24px auto 16px;
    background: rgba(18, 18, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.status-tab {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-tab:hover {
    color: var(--text);
    background: rgba(59, 130, 246, 0.06);
}

.status-tab.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-tab-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.status-tab-content--hidden {
    display: none !important;
}

/* ===========================
   STATUS PAGE - UPTIME CHART
=========================== */
.status-uptime-section {
    padding: 0 0 60px;
    position: relative;
    z-index: 1;
}

.uptime-chart-container {
    background: rgba(18, 18, 26, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
}

#uptimeCanvas {
    width: 100%;
    display: block;
}

/* ===========================
   STATUS PAGE - INCIDENTS
=========================== */
.status-incidents-section {
    padding: 0 0 80px;
    position: relative;
    z-index: 1;
}

.incidents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.incident-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius);
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 500;
}

.incident-empty i {
    font-size: 1.2rem;
}

.incident-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(18, 18, 26, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}

.incident-item:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

.incident-item--down .incident-icon { color: #ef4444; }
.incident-item--degraded .incident-icon { color: #facc15; }

.incident-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.incident-body {
    flex: 1;
    min-width: 0;
}

.incident-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.incident-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.incident-separator {
    color: var(--text-dim);
}

.incident-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.incident-badge--resolved {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.incident-badge--ongoing {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ===========================
   FOOTER
=========================== */
footer {
    position: relative;
    z-index: 1;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 60px 0 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
    line-height: 1.6;
}

.footer-socials {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.social-icon:hover {
    color: var(--blue-bright);
    border-color: rgba(59,130,246,0.4);
    background: rgba(59,130,246,0.08);
}

.footer-column h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-column h3 span {
    color: var(--blue-bright);
    margin-right: 6px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links li a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-links li a:hover {
    color: var(--text);
}

.contact-box {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(59,130,246,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dmca-badge img {
    border-radius: 6px;
    opacity: 0.8;
}

.dmca-text {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 10px;
}

.footer-logo-img {
    width: 50px !important;
    height: 50px !important;
}

.footer-brand-info h2 {
    font-size: 1.1rem;
}

.footer-brand-info span {
    font-size: 0.8rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.footer-bottom p span {
    color: var(--blue-bright);
}

/* ===========================
   MOBILE RESPONSIVE
=========================== */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    /* Header */
    header { padding: 12px 16px; }
    header.scrolled { padding: 10px 16px; }
    .header-left { gap: 8px; }
    .header-logo img { width: 36px; height: 36px; }
    .brand-info h2 { font-size: 1rem; }
    .brand-info span { font-size: 0.7rem; }
    .header-external-links, .desktop-only { display: none !important; }
    .mobile-menu-toggle { display: flex; }

    /* Mobile nav overlay */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 400px;
        background: rgba(18,18,26,0.98);
        border-radius: 18px;
        box-shadow: 0 12px 48px rgba(0,0,0,0.5);
        z-index: 1002;
        transition: opacity 0.25s ease, transform 0.25s ease;
        opacity: 0;
        pointer-events: none;
        padding: 0;
        border: 1px solid var(--border);
        backdrop-filter: blur(20px);
    }

    .mobile-nav-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav-content {
        width: 100%;
        padding: 24px 0 40px 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        max-height: 80vh;
        overflow: visible;
        box-sizing: border-box;
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 24px;
        margin: 0 14px;
        border-radius: 12px;
        color: var(--text-muted);
        font-size: 0.95rem;
        font-weight: 500;
        font-family: var(--font);
        text-decoration: none;
        border: 1px solid transparent;
        transition: all 0.2s ease;
    }

    .mobile-nav-item:hover {
        background: rgba(59,130,246,0.08);
        border-color: rgba(59,130,246,0.25);
        color: var(--text);
    }

    .mobile-nav-item i {
        width: 20px;
        text-align: center;
        color: var(--blue-bright);
        font-size: 0.9rem;
    }

    /* Status page */
    .status-hero { padding: 80px 0 24px; }
    .status-overall { padding: 32px 20px; }
    .status-overall-icon { font-size: 2.2rem; }
    .status-overall-title { font-size: 1.4rem; }
    .status-services-grid { grid-template-columns: 1fr; }
    .status-tile { padding: 16px 18px; }
    .status-tile-name { font-size: 0.82rem; }

    /* Incidents */
    .incident-item { flex-wrap: wrap; padding: 16px 18px; gap: 12px; }
    .incident-badge { margin-left: auto; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    /* Prevent horizontal overflow */
    html, body { overflow-x: hidden; }
}

@media (max-width: 480px) {
    .status-tile { min-width: 130px; }
    .header-ext-btn { padding: 7px 12px; font-size: 0.78rem; }
}
