/* ==========================================================================
   Base - reset, document defaults, typography primitives, utilities.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--c-ink-800);
  background: var(--c-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

h1,
h2,
h3,
h4,
h5,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--c-ink-900);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--c-primary);
  text-decoration-color: color-mix(in srgb, var(--c-primary) 30%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-1) var(--ease-out),
    text-decoration-color var(--dur-1) var(--ease-out);
}

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

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

button {
  cursor: pointer;
}

svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: color-mix(in srgb, var(--c-primary) 18%, transparent);
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Firefox / WebKit autofill tint removal so the fields match the design. */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--c-ink-900);
  -webkit-box-shadow: 0 0 0 1000px var(--c-white) inset;
  transition: background-color 9999s ease-out;
}

/* --- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-modal);
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-ink-900);
  color: var(--c-white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--r-md);
  text-decoration: none;
  box-shadow: var(--sh-lg);
  transition: top var(--dur-2) var(--ease-out);
}

.skip-link:focus {
  top: var(--sp-3);
  color: var(--c-white);
}

/* --- Scrollbars --------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--c-ink-200) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--c-ink-200);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--r-pill);
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--c-ink-300);
}

/* --- Typographic helpers ------------------------------------------------ */
.eyebrow {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--c-ink-500);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.muted {
  color: var(--c-ink-500);
}

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

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* --- Reduced motion: state changes are instant, never animated ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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