/* Shared design system — nav, footer, buttons, badges, auth guard */

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

:root {
    --bg:           #060810;
    --surface:      #0c0f1a;
    --surface-2:    #121620;
    --surface-3:    #171c2c;
    --border:       #1c2236;
    --border-light: #27304a;
    --text:         #dde6f5;
    --text-muted:   #8797ba;
    --text-dim:     #5d6e8a;
    --cyan:         #00c8ff;
    --purple:       #7c3aed;
    --purple-soft:  #a78bfa;
    --green:        #10b981;
    --amber:        #f59e0b;
    --danger:       #ef4444;
    --radius:       10px;
    --radius-lg:    14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ── Nav ──────────────────────────────────────────── */

.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(6,8,16,0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
    font-size: 0.95rem; font-weight: 700; letter-spacing: -0.3px;
    color: var(--text); text-decoration: none;
    display: flex; align-items: center; gap: 0.65rem;
}

.brand-logo {
    height: 32px; width: 32px; object-fit: contain;
    filter: invert(1) brightness(0.85); flex-shrink: 0;
}

.brand-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--cyan); box-shadow: 0 0 10px var(--cyan); flex-shrink: 0;
}

.nav-links { display: flex; align-items: center; gap: 0.1rem; list-style: none; }

.nav-links a {
    padding: 0.4rem 0.9rem; font-size: 0.855rem;
    color: var(--text-muted); text-decoration: none;
    border-radius: 6px; transition: color 0.15s, background 0.15s;
    position: relative;
}

.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); background: rgba(255,255,255,0.04); }

.nav-links a.active::after {
    content: ''; position: absolute;
    bottom: 4px; left: 0.9rem; right: 0.9rem;
    height: 2px; background: var(--cyan); border-radius: 2px;
}

.btn-nav-signin {
    padding: 0.4rem 1rem; background: transparent;
    color: var(--text-dim); border: 1px solid var(--border-light);
    border-radius: 6px; font-family: inherit; font-size: 0.82rem;
    font-weight: 500; cursor: pointer; text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-nav-signin:hover {
    color: var(--text); background: var(--surface-2);
    border-color: var(--border-light);
}

.nav-auth-group {
    display: flex; gap: 0.5rem; align-items: center;
}

/* ── Buttons ──────────────────────────────────────── */

.btn-primary {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.75rem 1.75rem;
    background: var(--cyan); color: #000;
    border: none; border-radius: var(--radius);
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
    opacity: 0.9; transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0,200,255,0.3);
}

.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.75rem 1.75rem;
    background: transparent; color: var(--text-dim);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

/* ── Article tags ─────────────────────────────────── */

.article-tag, .paper-type {
    display: inline-block;
    font-size: 0.67rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 0.2rem 0.65rem; border-radius: 4px;
    margin-bottom: 0.85rem;
}

.tag-crypto  { background: rgba(0,200,255,0.1);  color: var(--cyan); }
.tag-quantum { background: rgba(124,58,237,0.1); color: var(--purple-soft); }
.tag-lab     { background: rgba(16,185,129,0.1); color: var(--green); }
.tag-pqc     { background: rgba(245,158,11,0.1); color: var(--amber); }

/* ── Status badges ────────────────────────────────── */

.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px;
    font-size: 0.69rem; font-weight: 600;
}

.badge-green  { background: rgba(16,185,129,0.1);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.badge-red    { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-yellow { background: rgba(245,158,11,0.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-blue   { background: rgba(0,200,255,0.08);  color: var(--cyan); border: 1px solid rgba(0,200,255,0.2); }

/* ── Auth guard ───────────────────────────────────── */

#authGuard {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.guard-inner { text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.guard-spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--border-light); border-top-color: var(--cyan);
    border-radius: 50%; animation: spin 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section label ────────────────────────────────── */

.section-label {
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 2.5px;
    color: var(--text-muted);
}

/* ── Footer ───────────────────────────────────────── */

footer { border-top: 1px solid var(--border); }

.footer-wrap {
    max-width: 1100px; margin: 0 auto;
    padding: 1.75rem 2rem; display: flex;
    align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    font-size: 0.78rem; color: var(--text-muted);
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

/* ── Responsive ───────────────────────────────────── */

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