/* ============================================================
   FLAIR-AD · base.css
   Reset · typography · prose · links · a11y utilities
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (min-width: 1100px) {
  html { font-size: 17px; }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'cv11' 1;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: var(--fs-4);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
svg { overflow: visible; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
}
button { cursor: pointer; }

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease);
}
a:hover { color: var(--c-accent-deep); }
a.underline, a.link {
  text-decoration: underline;
  text-decoration-color: var(--c-accent-wash-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a.underline:hover, a.link:hover {
  text-decoration-color: var(--c-accent);
}

*:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

/* ---- Typography ---- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  color: var(--c-ink);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.02;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

h3 {
  font-size: var(--fs-6);
  font-weight: 600;
  line-height: 1.2;
}

h4 { font-size: var(--fs-5); font-weight: 600; }

p, ul, ol { max-width: var(--prose); }

p {
  margin: 0 0 var(--s-4);
  color: var(--c-ink-2);
  font-size: var(--fs-4);
  line-height: 1.6;
}
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; color: var(--c-ink); }
em, i { font-style: italic; }

code, kbd, samp, pre {
  font-family: var(--f-mono);
  font-size: 0.92em;
}
code {
  padding: 1px 6px;
  background: var(--c-paper-3);
  border-radius: var(--r-1);
  font-size: 0.88em;
  color: var(--c-ink);
}

/* Gene symbols, loci, numeric metadata */
.mono, .gene, .locus, .stat-num {
  font-family: var(--f-mono);
  font-style: normal;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.gene, .locus { color: var(--c-accent); font-weight: 500; }

ul, ol { padding-left: var(--s-5); }
li { margin-bottom: var(--s-2); }
li::marker { color: var(--c-ink-3); }

blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--c-accent);
  background: var(--c-accent-wash);
  color: var(--c-ink);
  font-size: var(--fs-5);
  line-height: 1.55;
  border-radius: 0 var(--r-2) var(--r-2) 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--c-rule);
  margin: var(--s-7) 0;
}

::selection { background: var(--c-accent-wash-2); color: var(--c-ink); }

/* ---- Prose container ---- */

.prose {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 0 var(--s-5);
  position: relative;
}

.bleed {
  max-width: var(--bleed);
  margin: 0 auto;
  padding: 0 var(--s-5);
  position: relative;
}

.wide {
  max-width: var(--bleed);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

/* ---- Labels ---- */

.eyebrow, .label {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.eyebrow--ink { color: var(--c-ink-3); }

.muted { color: var(--c-ink-2); }
.faint { color: var(--c-ink-3); }

/* ---- Pills ---- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-family: var(--f-sans);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--c-paper-3);
  color: var(--c-ink-2);
  white-space: nowrap;
}
.pill--accent   { background: var(--c-accent); color: var(--c-paper); }
.pill--magenta  { background: var(--c-accent-wash); color: var(--c-accent-deep); }
.pill--ink      { background: var(--c-ink); color: var(--c-paper); }
.pill--ghost    { background: transparent; color: var(--c-ink-2); box-shadow: inset 0 0 0 1px var(--c-rule-strong); }
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pill--accent .dot { background: var(--c-paper); }

/* ---- Reduced motion ---- */

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

/* ---- Visually-hidden but screen-reader accessible ---- */

.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;
}

/* Skip-link */
.skip-link {
  position: absolute; top: -40px; left: var(--s-3);
  padding: var(--s-2) var(--s-4);
  background: var(--c-ink); color: var(--c-paper);
  border-radius: var(--r-2);
  z-index: 100;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--s-3); color: var(--c-paper); }
