/* ==========================================================================
   East River Capital — light/css/base.css
   Reset · fonts · element defaults · type scale · motion base · a11y
   ========================================================================== */

/* ---- fonts (self-hosted; system fallbacks are mandatory) ---------------- */
@font-face {
  font-family: 'Inter';
  src: url('../../shared/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../../shared/fonts/SourceSerif4-Variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../../shared/fonts/SourceSerif4-VariableItalic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

ul, ol { padding: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---- type --------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-1);
  font-weight: 400; /* serif display is 300–400 only — never bold */
}

h1 {
  font-size: var(--text-h1);
  font-weight: 340;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 380;
  line-height: 1.14;
  letter-spacing: -0.008em;
}

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

p { max-width: 65ch; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(184, 84, 46, 0.4);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

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

strong { color: var(--ink-1); font-weight: 600; }

em { font-family: var(--font-display); }

::selection { background: rgba(184, 84, 46, 0.16); }

/* serif tabular numerals — stats, figures, money */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
}

table { border-collapse: collapse; width: 100%; }

/* ---- a11y --------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.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 {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--ink-1);
  color: var(--bg-page);
  border-radius: var(--radius-s);
  text-decoration: none;
  font-size: var(--text-sm);
}

.skip-link:focus {
  top: var(--space-2);
  color: var(--bg-page);
}

[hidden] { display: none !important; }

/* ---- motion base (motion.js toggles these classes) ---------------------- */
[data-animate].pre-rise {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) ease-out, transform var(--dur) ease-out;
}

[data-animate].is-risen {
  opacity: 1;
  transform: none;
}

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

  [data-animate].pre-rise {
    transition: none;
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
