/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Base */
    --bg: #161614;
    --bg-card: #f2ede7;
    --bg-card-alt: #e8e2da;

    /* Typography */
    --ink: #f2ede7;
    --ink-dark: #1a1a18;
    --muted: #6a6258;
    --muted-light: #9a9084;

    /* Accents */
    --accent: #6b7c5e;
    --accent-hover: #5a6b4e;
    --accent-soft: rgba(107, 124, 94, 0.12);

    /* Glass (for below-fold elements) */
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-bg: linear-gradient(180deg, rgba(22, 22, 20, 0.22), rgba(22, 22, 20, 0.42));
    --glass-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "JetBrains Mono", monospace;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* ── BACKGROUND MESH (warm blobs for liquid glass) ── */
.mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    filter: blur(70px) saturate(1.4);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.45;
    width: max(38vmin, 260px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
}

.blob:nth-child(1) {
    left: 12%;
    top: 12%;
    background: radial-gradient(circle, #4a5a3a, transparent 70%);
}
.blob:nth-child(2) {
    left: 82%;
    top: 22%;
    background: radial-gradient(circle, #7a6a4a, transparent 70%);
}
.blob:nth-child(3) {
    left: 22%;
    top: 80%;
    background: radial-gradient(circle, #5a6b4a, transparent 70%);
}
.blob:nth-child(4) {
    left: 78%;
    top: 72%;
    background: radial-gradient(circle, #8a7a5a, transparent 70%);
}

/* ── GRAIN OVERLAY ── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.24;
    background-image: 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.04'/%3E%3C/svg%3E");
}

.page {
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    width: 100%;
}

/* ── FIXED PILL NAV ── */
.pill-nav {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    align-items: center;
    padding: 0.35rem;
    border-radius: 16px;
    background: rgba(22, 22, 20, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    animation: navIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes navIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav-indicator {
    position: absolute;
    top: 0.35rem;
    left: 0;
    height: calc(100% - 0.7rem);
    background: #c3ccba;
    border-radius: 12px;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 0;
    width: 0;
}

.nav-item {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(242, 237, 231, 0.55);
    text-decoration: none;
    padding: 0.45rem 1.1rem;
    border-radius: 12px;
    transition: color 0.25s ease;
    cursor: pointer;
}

.nav-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.nav-item:hover {
    color: rgba(242, 237, 231, 0.85);
}

.nav-item.active {
    color: #1a1c18;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.fixed-logo {
    position: fixed;
    top: 1.8rem;
    left: 2rem;
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: var(--ink);
    text-decoration: none;
    z-index: 500;
}
.fixed-logo em {
    font-style: normal;
    color: var(--accent);
}

@media (max-width: 768px) {
    .pill-nav {
        width: max-content;
        max-width: 90%;
        padding: 0.35rem;
        justify-content: center;
    }
    .nav-item {
        padding: 0.4rem 0.8rem;
    }
    .fixed-logo {
        display: none;
    }
    .hide-on-mobile {
        display: none !important;
    }
}
