/* base — reset, typography, utilities */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* paper grain */
  background-image:
    radial-gradient(circle at 25% 12%, rgba(85, 56, 255, 0.025), transparent 40%),
    radial-gradient(circle at 78% 88%, rgba(255, 94, 91, 0.025), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' 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.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--lemon); color: var(--ink); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--whisper-soft); background-clip: padding-box; }

/* type primitives */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: 32px; line-height: 1.05; }
h2 { font-size: 22px; line-height: 1.15; }
h3 { font-size: 16px; line-height: 1.2; }

.serif { font-family: var(--font-serif); font-weight: 400; }
.mono  { font-family: var(--font-mono); }
.kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--whisper);
}

/* utilities */
.row     { display: flex; align-items: center; }
.col     { display: flex; flex-direction: column; }
.gap-1   { gap: 4px; }
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }
.gap-6   { gap: 24px; }
.flex-1  { flex: 1; }
.between { justify-content: space-between; }
.center  { justify-content: center; align-items: center; }
.muted   { color: var(--whisper); }

.divider { height: 1px; background: var(--hairline-soft); margin: 12px 0; }
.dot     { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

.shimmer {
  background: linear-gradient(90deg, var(--paper-3) 0%, var(--paper-2) 40%, var(--paper-3) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
