/* ============================================================
   BASE — Cherry Noir
   Element defaults + resets. Assumes tokens are already loaded.
   This is the only file in the closure that emits real rules for
   bare elements; everything else is custom properties.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings default to the editorial display serif */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
}
h1 { font-size: var(--text-4xl); font-weight: var(--weight-regular); line-height: var(--leading-tight); }
h2 { font-size: var(--text-3xl); font-weight: var(--weight-regular); line-height: var(--leading-tight); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p { margin: 0 0 1em; }

/* Links — editorial: no default underline, cherry on hover with a
   thin rising rule. Always defined so user-added links aren't blue. */
a {
  color: var(--text-accent);
  text-decoration: none;
  transition: var(--transition-color);
}
a:hover { color: var(--brand-cherry-hover); }

small { font-size: var(--text-xs); }

strong, b { font-weight: var(--weight-semibold); }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

img, svg, video { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

hr {
  border: none;
  border-top: 1px solid var(--border-hairline);
  margin: var(--space-6) 0;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Editorial helpers ---- */

.eyebrow {
  font-family: var(--eyebrow-family);
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--text-accent);
}

.display {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

/* Thin metallic editorial rule */
.rule-gold {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent, var(--gold-leaf), transparent);
}

/* Warm paper grain — apply to a decorative overlay layer */
.grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
