/* ── The Crime Board — Global CSS ── */

:root {
    --bg: #0d0f14;
    --surface: #131620;
    --surface-2: #1a1d2a;
    --surface-3: #21253a;
    --border: #1e2235;
    --border-hover: #2a2f45;
    --text: #e8e6e1;
    --text-secondary: #9b9a97;
    --text-muted: #6b6a68;
    --red: #C23B3B;
    --red-dim: rgba(194,59,59,0.15);
    --red-glow: rgba(194,59,59,0.4);
    --green: #2ea043;
    --green-dim: rgba(46,160,67,0.15);
    --yellow: #d4a017;
    --yellow-dim: rgba(212,160,23,0.12);
    --blue: #388bfd;
    --blue-dim: rgba(56,139,253,0.12);
    --purple: #9b5de5;
    --purple-dim: rgba(155,93,229,0.12);
    --orange: #e07a2f;
    --nav-bg: rgba(13,15,20,0.92);
    --input-bg: rgba(0,0,0,0.3);
    --surface-overlay: rgba(255,255,255,0.04);
    --serif: 'Libre Baskerville', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
    --mono: 'Space Mono', 'Courier New', monospace;
}

[data-theme="light"] {
    --bg: #f5f2ee;
    --surface: #ffffff;
    --surface-2: #f0ede8;
    --surface-3: #e8e4dd;
    --border: #d8d3ca;
    --border-hover: #b8b3aa;
    --text: #1a1814;
    --text-secondary: #4a4744;
    --text-muted: #8a8784;
    --nav-bg: rgba(245,242,238,0.94);
    --input-bg: rgba(0,0,0,0.05);
    --surface-overlay: rgba(0,0,0,0.03);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; scrollbar-gutter: stable; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
}

/* Fractal noise background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.page { position: relative; z-index: 1; }

/* ── Navigation ── */
.site-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 0 24px; height: 52px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
}
.nav-logo img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
    font-family: var(--mono); font-size: 11px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); text-decoration: none;
    padding: 6px 10px; border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--red); }
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    margin-left: 4px;
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); }
.theme-toggle svg { pointer-events: none; }
/* Show sun icon in dark mode, moon icon in light mode */
.theme-icon-moon { display: none; }
.theme-icon-sun  { display: block; }
[data-theme="light"] .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun  { display: none; }
/* Logo swap: dark mode shows white logo, light mode shows dark logo */
.logo-light { display: none; }
.logo-dark  { display: inline-block; }
[data-theme="light"] .logo-light { display: inline-block; }
[data-theme="light"] .logo-dark  { display: none; }

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
}
.site-footer-links {
    display: flex; align-items: center; justify-content: center;
    gap: 20px; margin-bottom: 12px; flex-wrap: wrap;
}
.site-footer-links a {
    font-family: var(--mono); font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); text-decoration: none;
    transition: color 0.15s;
}
.site-footer-links a:hover { color: var(--red); }
.site-footer-socials {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin-bottom: 12px;
}
.site-footer-socials a { color: var(--text-muted); transition: color 0.15s; }
.site-footer-socials a:hover { color: var(--red); }
.site-footer-copy {
    font-family: var(--mono); font-size: 10px; color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ── Shared layout ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── Right-side button group (theme + hamburger) ── */
.nav-right-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ── Hamburger button (mobile only) ── */
.nav-hamburger {
    display: none;
    background: none; border: 1px solid var(--border); border-radius: 6px;
    width: 32px; height: 32px; cursor: pointer; color: var(--text-muted);
    align-items: center; justify-content: center; flex-shrink: 0;
    padding: 0;
}
.nav-hamburger:hover { color: var(--text); border-color: var(--border-hover); }
.nav-hamburger svg { pointer-events: none; }

/* ── Nav Sign-In / Profile pill ── */
.nav-signin-btn {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.nav-signin-btn:hover { background: #d94f4f; }
.nav-pill-wrap { position: relative; }
.nav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 5px;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: border-color 0.15s;
    background: var(--surface);
}
.nav-pill:hover { border-color: var(--text-muted); }
.nav-pill-av {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    flex-shrink: 0;
}
.nav-pill-av-init {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--text);
}
.nav-pill-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-pill-chevron { color: var(--text-muted); transition: transform 0.15s; }
.nav-pill-wrap.open .nav-pill-chevron { transform: rotate(180deg); }
.nav-pill-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 150px;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.nav-pill-wrap.open .nav-pill-dropdown { display: block; }
.nav-pill-dd-item {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s;
}
.nav-pill-dd-item:hover { background: var(--surface-overlay); color: var(--text); }
.nav-pill-dd-logout { color: #f87171; }
.nav-pill-dd-logout:hover { background: rgba(194,59,59,0.1); color: #f87171; }

/* ── Login Modal ── */
.login-modal {
    display: none; position: fixed; inset: 0;
    z-index: 9999; align-items: center; justify-content: center;
}
.login-modal.active { display: flex; }
.login-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}
.login-modal-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%; max-width: 380px;
    z-index: 1;
    animation: loginModalIn 0.2s ease;
}
@keyframes loginModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.login-modal-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none;
    color: var(--text-muted); font-size: 22px;
    cursor: pointer; line-height: 1; padding: 4px;
}
.login-modal-close:hover { color: var(--text); }
.login-modal-logo { display: flex; justify-content: center; margin-bottom: 8px; }
.login-modal-logo img { height: 40px; width: auto; }
.login-modal-subtitle {
    text-align: center; color: var(--text-muted);
    font-size: 13px; margin-bottom: 24px;
}
.login-modal-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px;
    background: #fff; color: #1f2937; border: none;
    border-radius: 10px; font-size: 14px; font-weight: 500;
    cursor: pointer; text-decoration: none; transition: background 0.15s;
}
.login-modal-google:hover { background: #f3f4f6; }
.login-modal-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0; color: var(--text-muted); font-size: 12px;
}
.login-modal-divider::before, .login-modal-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-modal-email { display: flex; flex-direction: column; gap: 10px; }
.login-modal-input {
    padding: 10px 14px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 14px;
}
.login-modal-input:focus { outline: none; border-color: var(--red); }
.login-modal-submit {
    padding: 10px; background: var(--red); color: #fff; border: none;
    border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.login-modal-submit:hover { background: #d94f4f; }
.login-modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.login-modal-sent { text-align: center; color: #4ade80; font-size: 14px; padding: 16px 0; }
.login-modal-error { text-align: center; color: var(--red); font-size: 13px; margin-top: 8px; }
.login-modal-footer { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 20px; }
.login-modal-footer a { color: var(--text-muted); text-decoration: underline; }

/* ── Mobile-only nav items (hidden on desktop) ── */
.nav-mobile-only, .nav-mobile-divider { display: none; }

/* ── Responsive nav ── */
@media (max-width: 700px) {
    .nav-inner { padding: 0 16px; }
    .nav-hamburger { display: flex; }
    .nav-pill-wrap { display: none; }
    .nav-signin-btn { display: none; }
    .theme-toggle { width: 32px; height: 32px; margin-left: 0; }
    .nav-links {
        display: none; flex-direction: column; align-items: stretch;
        position: fixed; top: 52px; left: 0; right: 0;
        background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 8px 16px; gap: 0; z-index: 200;
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 10px 8px; font-size: 12px; letter-spacing: 0.5px; border-radius: 4px; }
    .nav-mobile-only { display: block; }
    .nav-mobile-divider { display: block; height: 1px; background: var(--border); margin: 6px 0; }
    .nav-mobile-logout { color: #f87171; }
    .nav-mobile-signin {
        background: none; border: none; cursor: pointer;
        color: var(--red); font-family: var(--sans); font-weight: 600;
        text-align: left;
    }
    .container { padding: 0 14px; }
    .header-quicklinks { padding: 12px 14px; gap: 6px; }
    .hql { font-size: 10px; padding: 4px 10px; flex-shrink: 0; }
}

/* ── Header Quicklinks Bar ── */
.header-quicklinks {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 24px;
}
.hql-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 2px;
    flex-shrink: 0;
}
.hql {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.hql:hover {
    border-color: var(--red);
    color: var(--text);
    background: var(--red-dim);
}
.hql-icon {
    font-size: 12px;
    line-height: 1;
}
