/* ============================================================
   IGNOTUSLABS — theme.css
   Design tokens: color, type, space, motion, base reset.
   Everything calm, monochrome, restrained.
   ============================================================ */

:root {
  /* ---- Color ---------------------------------------------------- */
  --color-bg: #050505;
  --color-bg-raised: #0a0a0a;
  --color-primary: #f5f5f3;
  --color-secondary: #8a8a8a;
  --color-tertiary: #777777;
  --color-divider: rgba(255, 255, 255, 0.08);
  --color-divider-strong: rgba(255, 255, 255, 0.14);
  --color-overlay: rgba(5, 5, 5, 0.72);

  /* Rare accent — used only for the most critical state cues */
  --color-accent: #c8c4b8;

  /* ---- Typography ----------------------------------------------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  --font-serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono",
    Menlo, Consolas, monospace;

  /* Type scale — modular, calm ratios */
  --fs-mono: 0.6875rem;   /* 11px */
  --fs-caption: 0.75rem;  /* 12px */
  --fs-small: 0.8125rem;  /* 13px */
  --fs-body: 0.9375rem;   /* 15px */
  --fs-lead: 1.1875rem;   /* 19px */
  --fs-h4: 1.375rem;      /* 22px */
  --fs-h3: 1.75rem;       /* 28px */
  --fs-h2: 2.75rem;       /* 44px */
  --fs-h1: 4.5rem;        /* 72px */
  --fs-display: 7rem;     /* 112px */

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.12em;
  --tracking-widest: 0.28em;

  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-loose: 1.8;

  /* ---- Space (8pt base) ---------------------------------------- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --space-8: 8rem;
  --space-9: 12rem;

  /* ---- Layout --------------------------------------------------- */
  --container-max: 1320px;
  --container-prose: 720px;
  --container-wide: 1080px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --nav-height: 4.5rem;

  /* ---- Motion --------------------------------------------------- */
  --ease-quiet: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-precise: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasis: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 220ms;
  --dur-base: 440ms;
  --dur-slow: 800ms;
  --dur-glacial: 1600ms;

  /* ---- Layer ---------------------------------------------------- */
  --z-field: 0;
  --z-content: 10;
  --z-glyph: 20;
  --z-nav: 100;
  --z-cursor: 9999;
}

/* ============================================================
   Reset — minimal, opinionated
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Hide the native cursor only when the custom cursor is confirmed
   ready (html.js-cursor, set by interaction.js). Progressive
   enhancement: a JS failure never leaves the page cursor-less. */
html.js-cursor body {
  cursor: none;
}

/* Headings inherit calm weights */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

p {
  line-height: var(--leading-normal);
}

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

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

html.js-cursor button {
  cursor: none;
}

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

ul, ol {
  list-style: none;
}

::selection {
  background: rgba(245, 245, 243, 0.16);
  color: var(--color-primary);
}

/* Focus visibility for keyboard navigation */
:focus-visible {
  outline: 1px solid var(--color-secondary);
  outline-offset: 4px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
