/* ===========================================================================
   HypeVault Base — reset, body on canvas, type utilities, focus rings.
   Fonts: Inter (sans) + JetBrains Mono — loaded via Google Fonts <link> in
   _head.ejs with the system fallbacks declared in tokens.css.
   =========================================================================== */

/* --- Reset (modern, minimal) ------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--hv-canvas);
  color: var(--hv-ink);
  font-family: var(--hv-font-sans);
  font-size: var(--hv-body-size);
  line-height: var(--hv-body-line);
  letter-spacing: var(--hv-body-track);
  font-weight: var(--hv-weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv01", "cv03", "ss03"; /* Inter niceties; ignored elsewhere */
}

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

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

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

a {
  color: var(--hv-ink);
  text-decoration: none;
  transition: color var(--hv-dur) var(--hv-ease);
}

a:hover {
  color: var(--hv-primary-hover);
}

ul,
ol {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--hv-hairline);
}

::selection {
  background: rgba(94, 105, 209, 0.4);
  color: var(--hv-ink);
}

/* --- Scrollbar (dark, unobtrusive) ------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--hv-surface-4) transparent;
}

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

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

*::-webkit-scrollbar-thumb {
  background: var(--hv-surface-4);
  border-radius: var(--hv-radius-pill);
  border: 2px solid var(--hv-canvas);
}

*::-webkit-scrollbar-thumb:hover {
  background: #2c2e34;
}

/* --- Focus-visible rings (2px primary-focus @ 50%) --------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--hv-focus-ring);
  border-radius: var(--hv-radius-sm);
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  box-shadow: var(--hv-focus-ring);
}

/* --- Type utility classes (the contract) ------------------------------- */
.hv-display-xl {
  font-size: var(--hv-display-xl-size);
  line-height: var(--hv-display-xl-line);
  letter-spacing: var(--hv-display-xl-track);
  font-weight: var(--hv-weight-semibold);
}

.hv-display {
  font-size: var(--hv-display-lg-size);
  line-height: var(--hv-display-lg-line);
  letter-spacing: var(--hv-display-lg-track);
  font-weight: var(--hv-weight-semibold);
}

.hv-display-md {
  font-size: var(--hv-display-md-size);
  line-height: var(--hv-display-md-line);
  letter-spacing: var(--hv-display-md-track);
  font-weight: var(--hv-weight-semibold);
}

.hv-headline {
  font-size: var(--hv-headline-size);
  line-height: var(--hv-headline-line);
  letter-spacing: var(--hv-headline-track);
  font-weight: var(--hv-weight-semibold);
}

.hv-title {
  font-size: var(--hv-title-size);
  line-height: var(--hv-title-line);
  letter-spacing: var(--hv-title-track);
  font-weight: var(--hv-weight-medium);
}

.hv-subhead {
  font-size: var(--hv-subhead-size);
  line-height: var(--hv-subhead-line);
  letter-spacing: var(--hv-subhead-track);
  font-weight: var(--hv-weight-regular);
}

.hv-body-lg {
  font-size: var(--hv-body-lg-size);
  line-height: var(--hv-body-lg-line);
  letter-spacing: var(--hv-body-lg-track);
}

.hv-body {
  font-size: var(--hv-body-size);
  line-height: var(--hv-body-line);
  letter-spacing: var(--hv-body-track);
}

.hv-caption {
  font-size: var(--hv-caption-size);
  line-height: var(--hv-caption-line);
  letter-spacing: var(--hv-caption-track);
  color: var(--hv-ink-subtle);
}

.hv-eyebrow {
  font-size: var(--hv-eyebrow-size);
  line-height: var(--hv-eyebrow-line);
  letter-spacing: var(--hv-eyebrow-track);
  font-weight: var(--hv-weight-medium);
  text-transform: uppercase;
  color: var(--hv-ink-subtle);
}

.hv-mono {
  font-family: var(--hv-font-mono);
  font-size: var(--hv-mono-size);
  line-height: var(--hv-mono-line);
  letter-spacing: var(--hv-mono-track);
  font-weight: var(--hv-weight-regular);
}

/* --- Text-color helpers ------------------------------------------------ */
.hv-ink {
  color: var(--hv-ink);
}
.hv-ink-muted {
  color: var(--hv-ink-muted);
}
.hv-ink-subtle {
  color: var(--hv-ink-subtle);
}
.hv-ink-tertiary {
  color: var(--hv-ink-tertiary);
}
.hv-accent {
  color: var(--hv-primary-hover);
}

/* --- Accessibility helpers --------------------------------------------- */
.hv-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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