/* Typography — reads theme font stacks + weight + Fraunces axes from tokens.
 * Swap --ff-theme-display / --ff-theme-body / --wght-display etc. per theme. */

html, body {
  font-family: var(--ff-theme-body);
  font-weight: var(--wght-body);
  letter-spacing: var(--theme-body-tracking);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-theme-display);
  color: var(--ink-high);
  line-height: var(--lh-tight);
  letter-spacing: var(--theme-display-tracking);
  font-variation-settings: "opsz" var(--frau-opsz), "SOFT" var(--frau-soft), "WONK" var(--frau-wonk), "wght" var(--wght-display);
  font-weight: var(--wght-display);
  text-transform: var(--theme-display-case, none);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, var(--fs-6xl));
  font-variation-settings: "opsz" var(--frau-opsz), "SOFT" var(--frau-soft), "WONK" var(--frau-wonk), "wght" var(--wght-display-hero);
  font-weight: var(--wght-display-hero);
}
h2 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, var(--fs-4xl)); }
h3 { font-size: clamp(1.375rem, 1rem + 1.6vw, var(--fs-3xl)); }
h4 { font-size: var(--fs-xl); font-weight: calc(var(--wght-display) + 60); }
h5 { font-size: var(--fs-lg); font-weight: calc(var(--wght-display) + 80); }
h6 {
  font-family: var(--ff-theme-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-low);
}

p {
  color: var(--ink-mid);
  text-wrap: pretty;
  max-width: 68ch;
  font-weight: var(--wght-body);
}
p + p { margin-top: var(--sp-3); }
p.lead {
  font-size: var(--fs-lg);
  color: var(--ink-high);
  line-height: 1.5;
  max-width: 62ch;
  font-weight: calc(var(--wght-body) + 20);
}

strong, b { font-weight: var(--wght-body-strong); color: var(--ink-high); }
em, i { font-style: italic; }

code, kbd, samp {
  font-family: var(--ff-theme-mono);
  font-size: 0.92em;
  padding: 0.15em 0.4em;
  border-radius: var(--theme-radius-inset);
  background: var(--surface-inset);
  color: var(--color-primary);
  text-transform: none;
}

a.link, .prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--color-primary) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out-soft);
}
a.link:hover, .prose a:hover { text-decoration-color: var(--color-primary); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--ff-theme-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: var(--sp-3);
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.mono { font-family: var(--ff-theme-mono); letter-spacing: 0.01em; }

.display-xl {
  font-family: var(--ff-theme-display);
  font-size: clamp(3rem, 2rem + 6vw, 7rem);
  line-height: 0.98;
  font-variation-settings: "opsz" var(--frau-opsz), "SOFT" var(--frau-soft), "WONK" var(--frau-wonk), "wght" var(--wght-display-hero);
  font-weight: var(--wght-display-hero);
  letter-spacing: var(--theme-display-tracking);
  text-transform: var(--theme-display-case, none);
}

.tracked-tight { letter-spacing: -0.02em; }
.tracked-loose { letter-spacing: 0.12em; text-transform: uppercase; }

.text-high    { color: var(--ink-high); }
.text-mid     { color: var(--ink-mid); }
.text-low     { color: var(--ink-low); }
.text-whisper { color: var(--ink-whisper); }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-center  { text-align: center; }

.grad-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* When .grad-text sits inside a .card--emphasis, the card's background is
 * usually a saturated brand color from the same hue family — gradient
 * text vanishes into it. Fall back to a solid dark color sourced from
 * the inverse-text token themes already define for emphasis cards. */
.card--emphasis .grad-text {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: inherit;
}
[data-theme="firefly"]  .card--emphasis .grad-text { color: #1A0628; }
[data-theme="atelier"]  .card--emphasis .grad-text { color: var(--color-primary); }
[data-theme="halcyon"]  .card--emphasis .grad-text { color: var(--color-accent); }
[data-theme="biomorph"] .card--emphasis .grad-text { color: var(--color-primary); }

.prose { max-width: 68ch; color: var(--ink-mid); }
.prose h2, .prose h3 { margin-top: var(--sp-8); margin-bottom: var(--sp-4); color: var(--ink-high); }
.prose p, .prose ul, .prose ol { margin-bottom: var(--sp-4); }
.prose ul li, .prose ol li { margin-left: 1.25em; list-style: disc; }
.prose ol li { list-style: decimal; }
