/* ============================================================
   main.css — design tokens, typography, layout
   ============================================================ */

:root {
    /* ---- Palette : ink + bone + electric organic accent ---- */
    --ink:        #0A0B0A;
    --ink-2:      #0F1110;
    --ink-3:      #14171550;
    --card:       #11141298;
    --card-solid: #111413;
    --bone:       #EFE9DC;
    --bone-2:     #C5BFB1;
    --mute:       #807C70;
    --line:       #2A2D2A;
    --line-2:     #1E211F;
    --lime:       #C8FF3E;
    --lime-soft:  #D9FF7466;
    --lime-glow:  #D9FF7421;
    --amber:      #FF8A3C;
    --rose:       #FFB6A3;
    --mist:       rgba(239,233,220,0.06);

    /* ---- Type ---- */
    --font-display: "Fraunces", "Times New Roman", Georgia, serif;
    --font-body:    "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* ---- Sizing scale (clamp for fluid type) ---- */
    --fs-xxs:  0.6875rem;  /* 11 */
    --fs-xs:   0.75rem;    /* 12 */
    --fs-sm:   0.875rem;   /* 14 */
    --fs-base: 1rem;       /* 16 */
    --fs-md:   1.125rem;   /* 18 */
    --fs-lg:   1.375rem;   /* 22 */
    --fs-xl:   clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
    --fs-2xl:  clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
    --fs-3xl:  clamp(2.8rem, 2rem + 3.6vw, 5rem);
    --fs-4xl:  clamp(3.5rem, 2.5rem + 5vw, 7rem);
    --fs-5xl:  clamp(4.5rem, 3rem + 7vw, 10rem);
    --fs-hero: clamp(3.6rem, 2.4rem + 7.5vw, 11.5rem);

    /* ---- Spacing ---- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --space-10: 8rem;
    --space-11: 12rem;

    /* ---- Layout ---- */
    --container: min(96vw, 1440px);
    --gutter:    clamp(1rem, 3vw, 2.5rem);
    --radius:    2px;
    --radius-lg: 4px;

    /* ---- Motion ---- */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Base ---- */
html { background: var(--ink); }
body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-base);
    color: var(--bone);
    background: var(--ink);
    background-image:
        radial-gradient(ellipse 80vw 60vh at 10% -10%, rgba(200,255,62,0.04), transparent 60%),
        radial-gradient(ellipse 60vw 50vh at 100% 10%, rgba(255,138,60,0.025), transparent 60%);
    background-attachment: fixed;
}

body.is-locked { overflow: hidden; }

/* ---- Grain overlay ---- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.45;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---- Typography presets ---- */
.display {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 0.92;
    letter-spacing: -0.04em;
    font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.display em {
    font-style: italic;
    font-weight: 300;
    font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.display strong {
    font-weight: 500;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: var(--fs-xxs);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--bone-2);
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
}
.eyebrow::before {
    content: "";
    width: 0.5em; height: 0.5em;
    background: var(--lime);
    display: inline-block;
    transform: rotate(45deg);
}
.eyebrow--mute::before { background: var(--mute); }

.lead {
    font-family: var(--font-body);
    font-size: var(--fs-md);
    font-weight: 300;
    line-height: 1.5;
    color: var(--bone-2);
    max-width: 52ch;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

.numerals {
    font-family: var(--font-mono);
    font-feature-settings: "tnum" on, "lnum" on;
}

/* ---- Layout primitives ---- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    position: relative;
    padding-block: clamp(5rem, 12vw, 11rem);
}

.section--tight   { padding-block: clamp(3rem, 7vw, 6rem); }
.section--loose   { padding-block: clamp(8rem, 16vw, 16rem); }

.section__head {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0, 2fr);
    gap: var(--space-6);
    align-items: end;
    margin-bottom: clamp(3rem, 6vw, 6rem);
    border-top: 1px solid var(--line);
    padding-top: var(--space-5);
}

.section__index {
    font-family: var(--font-mono);
    font-size: var(--fs-xxs);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mute);
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}
.section__index strong { color: var(--bone); font-weight: 500; }

.section__title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: var(--fs-3xl);
    line-height: 0.95;
    letter-spacing: -0.035em;
}
.section__title em { font-style: italic; color: var(--bone-2); }

@media (max-width: 720px) {
    .section__head { grid-template-columns: 1fr; gap: var(--space-4); align-items: start; }
}

/* ---- Utility ---- */
.divider {
    height: 1px;
    background: var(--line);
    width: 100%;
}
.diag {
    background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 8px);
}

/* ---- Skip & focus ---- */
:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 3px;
}

/* ---- Custom cursor (hidden on touch) ---- */
@media (hover: hover) and (pointer: fine) {
    html.has-custom-cursor, html.has-custom-cursor * { cursor: none !important; }
}
.cursor {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    will-change: transform;
}
.cursor__dot {
    position: absolute;
    width: 6px; height: 6px;
    background: var(--bone);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.cursor__ring {
    position: absolute;
    width: 36px; height: 36px;
    border: 1px solid var(--bone);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), background 0.3s ease, border-color 0.3s ease;
}
.cursor[data-state="action"] .cursor__ring,
.cursor[data-state="link"] .cursor__ring {
    width: 56px; height: 56px;
    background: var(--bone);
}
.cursor[data-state="action"] .cursor__dot,
.cursor[data-state="link"] .cursor__dot { opacity: 0; }
@media (max-width: 900px), (pointer: coarse) {
    .cursor { display: none; }
}

/* ---- Scroll progress ---- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 9998;
    background: rgba(239,233,220,0.06);
    pointer-events: none;
}
.scroll-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--lime);
    transform-origin: left center;
}
