/* ============================================================
   BASE — Reset, Variables, Typography, Noise, Print
   ============================================================ */

/* space mono */
@font-face {
    font-family: 'Space Mono';
    src: url('/assets/fonts/spacemono-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Mono';
    src: url('/assets/fonts/spacemono-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}

:root {
    --bg: #f0ebe5;
    --bg-card: #faf7f2;
    --border: #1a1a1a;
    --text: #1a1a1a;
    --text-muted: #3a3530;
    --accent: #c0392b;
    --font-mono: 'Space Mono', monospace;
    --reveal-base: rgba(26, 26, 26, 0.14);
    --reveal-sweep-width: 200vmax;
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- NOISE OVERLAY ---- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
}

/* ---- SELECTION / SCROLLBAR ---- */
::selection {
    background: var(--accent);
    color: #fff;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text); border-radius: 0; }

/* ---- PROGRESS BAR ---- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease-out;
}

/* ---- BACK TO TOP ---- */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    font-size: 1.2rem;
    color: var(--text);
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 0.3rem 0.6rem;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}
.back-to-top:hover {
    background: var(--border);
    color: #fff;
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* ---- PRINT ---- */
@media print {
    .nav, .progress-bar, .hero-actions, .action-row, .back-to-top {
        display: none;
    }
    .section {
        padding: 0.5rem 0;
    }
    .hero {
        min-height: auto;
        padding: 1rem 0;
        border-bottom: 1px solid #000;
    }
    body {
        background: #fff;
        color: #000;
    }
    .hero-title .highlight {
        color: #000;
        text-decoration: underline;
    }
}

