/* ------------------------------------------------------------------
   THEME & VARS
   ------------------------------------------------------------------ */
:root {
    --bg-color: #F8F6F2;
    --text-main: #121212;
    --text-muted: #666666;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --card-hover: #FFFFFF;
    --accent: #2A45B6;
    --accent-secondary: #CC2936;
    --tag-bg: rgba(0, 0, 0, 0.04);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

    --font-serif: 'DM Serif Display', serif;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Article specific vars mostly used in modules but good to have globally */
    --card-bg: rgba(255, 255, 255, 0.6);
    --border-color: rgba(0, 0, 0, 0.15);
    --line-subtle: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg-color: #0E0E0E;
    --text-main: #EAEAEA;
    --text-muted: #888888;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --card-hover: #1A1A1A;
    --accent: #5C7CFA;
    --accent-secondary: #FF4D5A;
    --tag-bg: rgba(255, 255, 255, 0.08);

    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.2);
    --line-subtle: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.5s var(--ease-out), color 0.5s;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.1;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ------------------------------------------------------------------
   NAVBAR
   ------------------------------------------------------------------ */
nav {
    padding: 2rem 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
}

/* For Article pages, Nav is fixed/sticky */
nav.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 3rem;
    pointer-events: none;
    /* Let clicks pass through */
}

nav.sticky .logo,
nav.sticky .nav-controls {
    pointer-events: auto;
}

nav.sticky .nav-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    opacity: 0.8;
    backdrop-filter: blur(5px);
    z-index: -1;
    mask: linear-gradient(to bottom, black 50%, transparent);
}

.logo {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

#themeBtn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.github-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
    transition: opacity 0.2s;
    background: var(--tag-bg);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
}

.github-btn:hover {
    opacity: 0.8;
    background: var(--border-subtle);
}

#starCount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin-left: 2px;
}