/* ==========================================================================
   Base: fonts, reset, element defaults
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/sora-latin-variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* Brand wordmark only (closest free match to the logo lettering) */
@font-face {
  font-family: "Audiowide";
  src: url("/assets/fonts/audiowide-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--ink-900);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

/* :where() keeps this at zero specificity, so component classes can set padding */
:where(ul, ol)[role="list"] {
  list-style: none;
  padding: 0;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); line-height: var(--lh-display); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p {
  max-width: var(--measure);
  text-wrap: pretty;
}

a {
  color: var(--brand-blue);
  text-underline-offset: 0.2em;
}

/* ---- Focus ---- */

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

/* ---- Utilities ---- */

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

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: calc(var(--z-header) + 1);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
  translate: 0 -200%;

  &:focus-visible {
    translate: 0 0;
  }
}

/* Locks page scroll while the mobile menu is open (works with or without Lenis) */
.is-scroll-locked {
  overflow: hidden;
}

/* ---- Anchor targets ----
   Jumps to a section (e.g. /trading/#how-an-order-works) stop below the
   fixed header instead of under it. */

section[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-3));
}

/* ---- Motion preferences ---- */

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

/* Scroll reveals (reveal.js) and page-hero entrances: hidden until animated in,
   only when motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .js :is([data-reveal], [data-hero-reveal]) {
    visibility: hidden;
  }
}

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