/* Ported from apps/web/src/styles/globals.css; tokens.css is linked separately. */
@font-face {
  font-family: 'Sora';
  src: url('../fonts/Sora-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
/* Metric-matched fallback, same numbers next/font generates for Sora. */
@font-face {
  font-family: 'Sora Fallback';
  src: local('Arial');
  ascent-override: 83.64%;
  descent-override: 25.01%;
  line-gap-override: 0%;
  size-adjust: 115.97%;
}

:root {
  --font-sora: 'Sora', 'Sora Fallback';
}

:root {
  --font-numeral: var(--font-sora), system-ui, sans-serif;
  --font-body:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --measure: 62ch;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections bring their own top padding, which already clears the
     sticky header; targets without padding add their own scroll-margin-top. */
  scroll-padding-top: 36px;
}

@media (max-width: 759px) {
  html {
    scroll-padding-top: 64px;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.045em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(42px, 5.5vw, 70px);
  font-weight: 700;
}

h2 {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 650;
}

h3 {
  font-size: 19px;
  font-weight: 600;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  width: min(var(--page), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

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

/* Context for screen readers where the visual carries the meaning. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.numeral {
  font-family: var(--font-numeral);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* The website shares Nomatterlab's paper and ink palette; app UI keeps its blue. */
:root {
  --bg: #fdfaf7;
  --text: #172139;
  --text-muted: #646c7c;
  --border: #e6e4e1;
  --surface: #fffdfb;
  --surface-raised: #f1f0ed;
  --editorial-accent: #b84c0a;
  --editorial-button: #d65309;
  --editorial-soft: #faeee3;
  --road-verge: #dce1d4;
  --road-asphalt: #d4d4cf;
  --road-line: #fffdf6;
  --band: #141d33;
  --band-text: #f7f3ed;
  --band-muted: #aab4c6;
  --band-line: #e9e2d5;
  --mark-arc: #2258e6;
  --mark-halo: #8fb5ff;
  --page: 1160px;
}
:root[data-theme='dark'] {
  --bg: #191c21;
  --text: #f1efe9;
  --text-muted: #afb2ba;
  --border: #34383d;
  --surface: #22262b;
  --surface-raised: #292e33;
  --editorial-accent: #f7a168;
  --editorial-button: #c84c08;
  --editorial-soft: #342a23;
  --road-verge: #333d38;
  --road-asphalt: #3e4448;
  --road-line: #92978d;
  --band: #0e1116;
  --band-text: #f1efe9;
  --band-muted: #a2aab8;
  --band-line: #4a5260;
  --mark-arc: #5b8cff;
  --mark-halo: #35508c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #191c21;
    --text: #f1efe9;
    --text-muted: #afb2ba;
    --border: #34383d;
    --surface: #22262b;
    --surface-raised: #292e33;
    --editorial-accent: #f7a168;
    --editorial-button: #c84c08;
    --editorial-soft: #342a23;
    --road-verge: #333d38;
    --road-asphalt: #3e4448;
    --road-line: #92978d;
    --band: #0e1116;
    --band-text: #f1efe9;
    --band-muted: #a2aab8;
    --band-line: #4a5260;
    --mark-arc: #5b8cff;
    --mark-halo: #35508c;
  }
}
::selection {
  background: var(--editorial-soft);
  color: var(--text);
}
