/* Shared design system — used by every page so the look stays one coherent thing
   instead of copy-pasted <style> blocks drifting apart page by page. */

:root {
    --bg: #0a0a0a;
    --bg-elevated: #131311;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f1efe8;
    --text-dim: #969083;
    --text-faint: #57534a;
    --accent: #4c5cf0;
    --accent-soft: rgba(76, 92, 240, 0.14);
    --accent-strong: #6c78ff;
    --good: #6ee7a8;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

:root[data-theme="light"] {
    --bg: #f5f4ef;
    --bg-elevated: #ffffff;
    --surface: rgba(15, 13, 10, 0.04);
    --surface-hover: rgba(15, 13, 10, 0.07);
    --border: rgba(15, 13, 10, 0.1);
    --border-strong: rgba(15, 13, 10, 0.22);
    --text: #171510;
    --text-dim: #57534a;
    --text-faint: #938d80;
    --accent: #4c5cf0;
    --accent-soft: rgba(76, 92, 240, 0.1);
    --accent-strong: #4048d6;
    --good: #12885f;
}

* { box-sizing: border-box; }

body.site {
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    position: relative;
    scroll-behavior: smooth;
}

::selection { background: var(--accent); color: #fff; }

/* Fine grain over the flat black — the one thing almost no AI-templated
   dark portfolio bothers with, and the cheapest way to make it feel made by hand. */
.grain {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.site-glow {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(circle at 50% 0%, var(--accent-soft) 0%, transparent 55%);
}

h1, h2, h3, .font-display { font-family: var(--font-display); }

a { color: inherit; }

/* --- Badges / tags --- */
.badge {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* --- Meta chips (platform / status / role) --- */
.meta-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}
.meta-chip .meta-label { color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.meta-chip .meta-value { color: var(--text); font-weight: 600; margin-top: 3px; font-size: 14px; }

/* --- Cards --- */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: border-color 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.3s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-5px); }

/* --- Icon / app-mark badge with monogram fallback --- */
.icon-badge {
    width: 42px; height: 42px; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.icon-badge img { width: 100%; height: 100%; object-fit: cover; }
.icon-badge .monogram { font-family: var(--font-display); font-weight: 700; color: var(--text-dim); font-size: 15px; }

/* --- Buttons / link pills --- */
.btn-link {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 13px 22px; border-radius: 11px;
    border: 1px solid var(--border-strong);
    color: var(--text); text-decoration: none;
    font-size: 14px; font-weight: 600;
    transition: all 0.25s ease;
    background: var(--surface);
}
.btn-link:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.btn-link.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-link.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; background: var(--good); }

/* --- Reveal-on-load --- */
.reveal { opacity: 0; animation: fadeInUp 0.85s cubic-bezier(0.2, 0.75, 0.2, 1) forwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

/* --- Floating light/dark toggle — same position on every page --- */
#theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-2px); }
#theme-toggle svg { width: 20px; height: 20px; }

@media (max-width: 640px) {
    #theme-toggle { bottom: 16px; right: 16px; width: 44px; height: 44px; }
}
