/* --- Variables & Base --- */
:root {
    --font-serif: 'Crimson Pro', serif;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --bg-color: #faf9f6;
    --line-color: #e5e5e0;
    --text-primary: #1c1917;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    scroll-behavior: smooth;
}

::selection {
    background-color: #1c1917;
    color: white;
}

/* Utility Classes */
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

/* --- Navigation States --- */
/* Active state for nav links */
.nav-active {
    color: #1c1917 !important; /* stone-900 */
    border-bottom: 1px solid #000;
}

.nav-inactive {
    color: #a8a29e !important; /* stone-400 */
}

.nav-inactive:hover {
    color: #78716c !important; /* stone-500 */
}

/* Scrolled Navbar State */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 1px solid #f5f5f4;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* --- Intrinsic Grid --- */
.intrinsic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    grid-auto-rows: minmax(300px, auto);
    grid-auto-flow: dense;
    gap: 1px;
    background-color: var(--line-color);
    border: 1px solid var(--line-color);
}

.grid-item {
    background-color: var(--bg-color);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.grid-item:hover {
    background-color: #f3f2ef;
}

/* --- Code Blocks --- */
pre {
    background-color: #1c1917;
    color: #e7e5e4;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

code {
    font-family: var(--font-mono);
    background-color: #e5e5e0;
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
    color: #1c1917;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* --- Animations --- */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}