/* ============================================================================
   BASE  —  reset + global typography. Uses ONLY variables from theme/theme.css.
   Never hardcode colors/fonts here.
   ============================================================================ */

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

* { margin: 0; padding: 0; }

html,
body,
body *,
body *::before,
body *::after {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-user-drag: none !important;
  -webkit-user-modify: read-only !important;
}

a[href],
button,
input,
textarea,
select,
label[for],
summary {
  -webkit-user-modify: unset !important;
}

::selection,
::-moz-selection,
*::selection,
*::-moz-selection {
  background: transparent !important;
  background-color: transparent !important;
  color: inherit !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-lg));
  color-scheme: dark only;
  background-color: var(--color-bg);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text);
  background-color: transparent;
  /* Subpixel rendering on light bg = solid, not thin/pale glyphs. */
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--theme-transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The 3D particle field sits behind page content (not behind body bg). */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  z-index: var(--z-bg);
  pointer-events: none;
  -webkit-user-modify: unset !important;
}

/* Page chrome stacks above the particle field; leave fixed overlays alone. */
.announce-stack,
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.cursor-fx__canvas,
.cursor-fx__icon {
  position: fixed;
  max-width: none;
  max-height: none;
  pointer-events: none;
}
.cursor-fx__canvas { inset: 0; z-index: 99998; }
.cursor-fx__icon { top: 0; left: 0; z-index: 99999; }

img,
picture,
video,
canvas:not(#bg-canvas):not(.cursor-fx__canvas) { max-width: 100%; display: block; user-select: none; -webkit-user-drag: none; }

a {
  color: var(--accent, var(--color-accent));
  text-decoration: none;
  transition: color var(--speed-fast) var(--ease-out),
              opacity var(--speed-fast) var(--ease-out);
}
/* On hover a link takes its component's own color (--accent), never a
   hardcoded blue. Header/footer/announce links set their own hover above this. */
a:hover { color: var(--accent, var(--color-accent)); }

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

ul, ol { list-style: none; }

/* ---- Headings: DISPLAY font, bold + large ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

p { line-height: var(--lh-relaxed); color: var(--color-text-soft); font-weight: var(--weight-regular); }

strong { font-weight: var(--weight-bold); color: var(--color-text); }

/* ---- Reusable type helpers ---- */
.t-hero    { font-size: var(--fs-hero); }
.t-display { font-size: var(--fs-display); }
.t-title   { font-size: var(--fs-title); }
.t-heading { font-size: var(--fs-heading); }
.t-lead    { font-size: var(--fs-lead); font-weight: var(--weight-regular); line-height: var(--lh-snug); color: var(--color-text-soft); }
.t-body    { font-size: var(--fs-body); }
.t-small   { font-size: var(--fs-small); }
.t-tiny    { font-size: var(--fs-tiny); }

.t-muted   { color: var(--color-text-muted); }
.t-soft    { color: var(--color-text-soft); }
.t-accent  { color: var(--color-accent); }

.eyebrow {
  font-size: var(--fs-small);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  /* The text above a title is neutral white-grey on every page (--eyebrow-color),
     never a content color. The card/section keeps its color elsewhere. */
  color: var(--eyebrow-color);
}

.text-center { text-align: center; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--content-gutter);
}
.container-wide { max-width: var(--content-max-wide); }
.container-narrow { max-width: 760px; }
.container-blog {
  width: min(100%, var(--content-max-wide));
  max-width: min(1100px, calc(100vw - 2 * var(--content-gutter)));
}

.section { padding-block: var(--section-padding-y); position: relative; transition: var(--theme-transition); }
/* 1px hairline between consecutive sections (none above the first). */
.section + .section { border-top: 1px solid var(--section-divider); }
/* Sections stay transparent so the fixed #bg-canvas particle field shows through.
   section--alt (plain band) is no longer applied — kept for legacy markup only. */
.section:not(.section--dark) { background-color: transparent; }
.section.section--alt:not(.section--dark) { background-color: transparent; }
.section--dark {
  background-color: var(--color-surface-dark);
  color: var(--color-text-invert);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--color-text-invert); }
.section--dark p { color: var(--color-text-invert-soft); }

.section-head { max-width: 820px; margin-bottom: var(--space-xl); }
.section-head.text-center { margin-inline: auto; }
.section-head .eyebrow { display: block; margin-bottom: var(--space-sm); }
.section-head p { margin-top: var(--space-sm); font-size: var(--fs-lead); }

/* ---- Accessibility ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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