/* ============================================================================
   f(x) → NATURE DS — Base / Reset
   Modern reset + base typography + global primitives.
   Depends on tokens.css.
   ============================================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-6));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-normal);
  font-feature-settings: "ss01", "cv01";
  transition: background-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}

/* --- Headings: heavy grotesque display ------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--foreground);
  text-wrap: balance;
}

p { text-wrap: pretty; }

/* --- Media ----------------------------------------------------------- */
img, svg, video, canvas {
  display: block;
  max-width: 100%;
}
svg { fill: currentColor; }

/* --- Form controls inherit type ------------------------------------- */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: none; }

/* --- Links ----------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

/* --- Code ------------------------------------------------------------ */
code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: "zero", "ss01";
}

/* --- Lists ----------------------------------------------------------- */
ul[role="list"], ol[role="list"] { list-style: none; }

/* --- Selection ------------------------------------------------------- */
::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* --- Accessible focus ring (keyboard only) -------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.fd-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;
}

/* --- Custom scrollbar ------------------------------------------------ */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid var(--background);
  border-radius: var(--radius-full);
}
*::-webkit-scrollbar-thumb:hover { background: var(--foreground-subtle); }
