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

html,
body {
    margin: 0;
    padding: 0;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

button,
input,
select {
    font: inherit;
}

/* ========== THEME TOKENS ========== */
:root {
    --font-serif: Georgia, "Times New Roman", Times, serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #5c95ff;
    --accent: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur-1: 120ms;
    --dur-2: 240ms;
    --dur-3: 480ms;

    --container: 1120px;
    --measure: 70ch; /* ideal readable width */
}

html.dark {
    --bg: #0b0f15;
    --surface: #0f172a;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1f2937;
    --primary: #5c95ff;
    --accent: #fbbf24;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.50;
}

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 16px;
}

.muted {
    color: var(--muted);
}

/* ========== NAVBAR ========== */
.navbar-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(120%) blur(8px);
    background-color: color-mix(in srgb, var(--surface) 65%, transparent);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.brand-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--primary);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 1px;
}

.nav-link {
    padding: 6px 12px;
    border-radius: 8px;
    border-bottom: 0px solid transparent;
}

.nav-link:hover {
    background: var(--border);
}

.nav-link[aria-current="page"] {
    color: var(--primary);
}

.menu-btn,
.theme-btn {
    height: 36px;
    width: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.theme-btn {
    width: auto;
    padding: 0 12px;
    gap: 8px;
    grid-auto-flow: column;
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }

    .menu-btn {
        display: none;
    }
}

.mobile-menu {
    display: none;
    padding: 12px 16px 16px;
}

.mobile-panel {
    display: grid;
    gap: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.mobile-panel-link {
    color: var(--text);
}

.mobile-panel-link[aria-current="page"] {
    color: var(--primary);
}

/* ========== GRIDS ========== */
.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-2 {
    grid-template-columns: 1fr;
}

.grid.cols-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius:
        var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
    display: block;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 0;
    cursor: pointer;
    transition: filter var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.03);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 40px 16px;
}

.footer-grid {
    display: grid;
    gap: 24px;
}

.footer-grid[aria-current="page"] {
    color: var(--primary);
}

.footer-link {
    color: var(--primary);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Spacing helpers */
.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.mt-8 {
    margin-top: 32px;
}

.mt-10 {
    margin-top: 40px;
}

.post-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-title {
    font-weight: 600;
    letter-spacing: -0.01em;
}