/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0f0f13;
    --surface: #1a1a24;
    --surface-hover: #22222f;
    --border: rgba(255, 255, 255, 0.07);
    --text: #e8e8f0;
    --text-muted: #8888a8;
    --radius: 16px;
    --transition: 0.25s ease;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===== BACKGROUND GLOW ===== */
@keyframes bgShift {
    0%   { opacity: 1; transform: scale(1) translate(0, 0); }
    33%  { opacity: 0.85; transform: scale(1.15) translate(2%, 3%); }
    66%  { opacity: 0.9;  transform: scale(1.08) translate(-3%, -2%); }
    100% { opacity: 1; transform: scale(1) translate(0, 0); }
}

.background-blur {
    position: fixed;
    inset: -25%;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 40% at 20% 10%, rgba(99, 102, 241, 0.18), transparent),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(14, 165, 233, 0.13), transparent),
        radial-gradient(ellipse 40% 30% at 60% 40%, rgba(168, 85, 247, 0.08), transparent);
    pointer-events: none;
    animation: bgShift 12s ease-in-out infinite;
}

/* ===== HEADER ===== */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

header {
    text-align: center;
    margin-bottom: 3.5rem;
    margin-top: 2rem;
    animation: fadeDown 0.7s ease both;
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 0 20px rgba(99, 102, 241, 0.1); }
    50%       { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.12), 0 0 40px rgba(99, 102, 241, 0.2); }
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 1.2rem;
    letter-spacing: 1px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    animation: avatarPulse 3s ease-in-out infinite;
    transition: transform 0.3s ease;
    cursor: default;
    user-select: none;
}

.avatar:hover {
    transform: scale(1.08) rotate(6deg);
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(90deg, #e8e8f0 0%, #6366f1 40%, #0ea5e9 60%, #e8e8f0 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    animation: shimmerText 5s linear infinite;
    position: relative;
    display: inline-block;
}

@keyframes shimmerText {
    from { background-position: 0% center; }
    to   { background-position: 200% center; }
}

/* ===== GLITCH ===== */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; right: 0;
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: inherit;
    background-size: inherit;
}

.glitch::before {
    animation: glitch1 4s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
    transform: translate(-2px, 0);
    opacity: 0;
}

.glitch::after {
    animation: glitch2 4s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    transform: translate(2px, 0);
    opacity: 0;
}

@keyframes glitch1 {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    92%           { opacity: 0.8; transform: translate(-3px, 1px); filter: hue-rotate(90deg); }
    94%           { opacity: 0.6; transform: translate(3px, -1px); }
    96%           { opacity: 0.8; transform: translate(-2px, 2px); }
    98%           { opacity: 0; }
}

@keyframes glitch2 {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    91%           { opacity: 0.7; transform: translate(3px, -1px); filter: hue-rotate(-90deg); }
    93%           { opacity: 0.5; transform: translate(-3px, 1px); }
    95%           { opacity: 0.7; transform: translate(2px, -2px); }
    97%           { opacity: 0; }
}

/* ===== TYPEWRITER ===== */
#typewriter::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
    margin-left: 1px;
    color: #6366f1;
    -webkit-text-fill-color: #6366f1;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.tagline {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1rem;
    letter-spacing: 0.5px;
    animation: fadeDown 0.9s ease 0.3s both;
    min-height: 1.5em;
}

/* ===== CARD GLARE ===== */
.card-glare {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    pointer-events: none;
    z-index: 1;
    transition: background 0.05s;
}

/* ===== MAIN CONTENT ===== */
main {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* ===== CATEGORY SECTION ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeUp 0.6s ease both;
}

section:nth-child(1) { animation-delay: 0.15s; }
section:nth-child(2) { animation-delay: 0.30s; }
section:nth-child(3) { animation-delay: 0.45s; }
section:nth-child(4) { animation-delay: 0.60s; }

.category-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ===== CARD ===== */
.card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition), transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity var(--transition);
    background: linear-gradient(135deg, var(--accent, #6366f1) 0%, transparent 60%);
}

.card:hover {
    background: var(--surface-hover);
    border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px color-mix(in srgb, var(--accent, #6366f1) 20%, transparent);
}

.card:hover::before {
    opacity: 0.10;
}

.card:active {
    transform: translateY(0);
}

/* ===== CARD ICON ===== */
.card-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent, #6366f1);
    transition: background var(--transition), transform var(--transition);
}

.card:hover .card-icon {
    background: rgba(255, 255, 255, 0.09);
    transform: scale(1.1) rotate(-4deg);
}

.card-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.card-logo--invert {
    filter: invert(1) brightness(1.8);
}

.card-logo--bg {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #fff;
    padding: 3px;
    object-fit: contain;
}

/* ===== CARD BODY ===== */
.card-body {
    flex: 1;
    min-width: 0;
}

.card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== CARD ARROW ===== */
.card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform var(--transition), color var(--transition);
}

.card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--accent, #6366f1);
}

/* ===== FOOTER ===== */
footer {
    margin-top: auto;
    padding-top: 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    animation: fadeUp 0.6s ease 0.7s both;
    transition: color 0.3s;
}

footer:hover {
    color: var(--text);
}

/* ===== SERVER STATUS ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.6rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    vertical-align: middle;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.status-badge--up {
    color: #22c55e;
    border-color: rgba(34,197,94,0.22);
    background: rgba(34,197,94,0.10);
}

.status-badge--down {
    color: #ef4444;
    border-color: rgba(239,68,68,0.22);
    background: rgba(239,68,68,0.10);
}

.status-badge--unknown {
    color: #a1a1aa;
    border-color: rgba(161,161,170,0.22);
    background: rgba(161,161,170,0.08);
}

.status-meta {
    color: color-mix(in srgb, var(--text-muted) 82%, transparent);
    margin-left: 0.25rem;
    white-space: nowrap;
}

.status-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

/* ===== SERVER STATUS (right indicator) ===== */
.status-right {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem 0.75rem 3rem;
    }

    .card-body p {
        display: none;
    }

    .status-badge {
        margin-left: 0.45rem;
        font-size: 0.68rem;
        padding: 0.15rem 0.45rem;
    }

    .status-meta {
        display: none;
    }
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
}

/* ===== FLOATING ORBS ===== */
.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(70px);
    opacity: 0;
    animation: orbFloat var(--dur, 18s) ease-in-out infinite var(--delay, 0s);
}

.orb-1 {
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(99,102,241,0.25), transparent 70%);
    top: -80px; left: -80px;
    --dur: 20s; --delay: 0s;
}
.orb-2 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(14,165,233,0.2), transparent 70%);
    bottom: 5%; right: -60px;
    --dur: 17s; --delay: -6s;
}
.orb-3 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(168,85,247,0.18), transparent 70%);
    top: 45%; left: -40px;
    --dur: 23s; --delay: -11s;
}
.orb-4 {
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(236,72,153,0.15), transparent 70%);
    top: 20%; right: -30px;
    --dur: 19s; --delay: -4s;
}

@keyframes orbFloat {
    0%   { opacity: 0;    transform: translate(0, 0)       scale(1); }
    10%  { opacity: 1; }
    50%  { opacity: 1;    transform: translate(20px, 25px) scale(1.08); }
    90%  { opacity: 1; }
    100% { opacity: 0;    transform: translate(0, 0)       scale(1); }
}

/* ===== GRID LINES (subtle) ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* ===== RIPPLE ===== */
.card .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.55s linear;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}
