/* ── Reset ────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    cursor: none;
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-2);
    background: var(--bg-page);
    overflow-x: hidden;
}

/* ── Aggressively hide native cursor on desktop ───── */
@media (hover: hover) and (pointer: fine) {
    *, *::before, *::after {
        cursor: none !important;
    }
}

/* ── Firefox perf: promote animated layers ────────── */
@-moz-document url-prefix() {
    .reveal, .fade-enter, .particle, .cursor,
    .hero-cta, .switcher-bg, .bar-fill {
        will-change: transform, opacity;
    }
}

/* ── Custom cursor (inverted sharp pointer) ───────── */

.cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    will-change: transform, opacity;
    mix-blend-mode: difference;
    transition: opacity 0.2s var(--ease);
}

.cursor.visible { opacity: 1; }
.cursor.hidden { opacity: 0 !important; }

.cursor-arrow {
    display: block;
    transform-origin: top left;
    transition: transform 0.2s var(--ease);
}

.cursor-arrow svg {
    display: block;
    width: 20px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.cursor-dot {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    background: var(--text-white);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s var(--ease);
}

.cursor.dot .cursor-arrow { transform: scale(0); }
.cursor.dot .cursor-dot { transform: scale(1); }

/* ── Noise overlay ────────────────────────────────── */

.noise {
    position: fixed;
    inset: 0;
    background: url('../assets/noise.png') repeat;
    opacity: 0.03;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 9998;
}

/* ── Selection ────────────────────────────────────── */

::selection {
    background: rgba(99, 102, 241, 0.20);
    color: var(--text-1);
}

/* ── Scrollbar ────────────────────────────────────── */

::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ── Base elements ────────────────────────────────── */

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

h1, h2, h3, h4 {
    color: var(--text-1);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

code, .mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: none;
}

input, select, textarea {
    cursor: none;
}

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

/* ── Micro label ──────────────────────────────────── */

.micro {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

/* ── Focus ────────────────────────────────────────── */

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ── Disable custom cursor on touch ───────────────── */

@media (hover: none), (pointer: coarse) {
    html, body, a, button, input, select, textarea {
        cursor: auto;
    }
    .cursor {
        display: none !important;
    }
}
