/* ==========================================================================
   The Economy Hub — base
   Font faces, reset, document defaults, typography, layout primitives.
   Loads after tokens.css.
   ========================================================================== */

/* ---- font faces (self-hosted, latin subsets) ---- */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-var-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-var-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- reset ---- */

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

* {
  margin: 0;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

/* ---- document ---- */

html {
  color-scheme: light only;
  background-color: var(--color-paper);
  scroll-padding-top: var(--space-6);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

::selection {
  background-color: var(--color-green);
  color: var(--color-paper);
}

/* ---- typography ---- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
}

p {
  margin-block: var(--space-4);
}

a {
  color: var(--color-green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--color-brass);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: var(--rule-hairline);
  margin-block: var(--space-6);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

sub,
sup {
  line-height: 0;
}

/* Numerals and units in running text: wrap in .num (see SKELETON.md).
   Tables, timelines, and data callouts apply the mono treatment on
   their own; .num is for inline figures inside prose. */
.num {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: -0.01em;
}

/* Mono kicker: shared voice for eyebrows, labels, chips. */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* ---- layout primitives ---- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.prose {
  max-width: var(--measure-prose);
}

.prose > * + * {
  margin-block-start: var(--space-4);
}

/* ---- accessibility utilities ---- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-3);
  z-index: 10;
  transform: translateY(-300%);
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-chip);
  text-decoration: none;
}

.skip-link:focus-visible {
  transform: none;
}

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