/*
  Sepivex — Base
  Resets and global element defaults built on tokens.css.
*/

/* ---- Self-hosted fonts ----
   Replaces the brand guide's own Google Fonts @import (fine for a
   brand-guide reference page, not appropriate for a production site —
   avoids a third-party runtime request and the associated render delay).
   Inter is loaded as a single variable-weight file (100–900), which is
   the only way to get the brand guide's specified weight 650 without
   approximating it against a fixed static cut. JetBrains Mono ships
   only 400/500, which is all the brand guide specifies for mono use. */

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

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  line-height: var(--text-body-leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

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

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

h1, .text-h1 {
  font-size: var(--text-h1-size);
  font-weight: var(--text-h1-weight);
  letter-spacing: var(--text-h1-tracking);
  line-height: var(--text-h1-leading);
}

h2, .text-h2 {
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  letter-spacing: var(--text-h2-tracking);
  line-height: var(--text-h2-leading);
}

h3, .text-h3 {
  font-size: var(--text-h3-size);
  font-weight: var(--text-h3-weight);
  letter-spacing: var(--text-h3-tracking);
  line-height: var(--text-h3-leading);
}

p, .text-body {
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  letter-spacing: var(--text-body-tracking);
  line-height: var(--text-body-leading);
  color: var(--text-secondary);
  max-width: var(--content-max-width-narrow);
}

.text-small {
  font-size: var(--text-small-size);
  font-weight: var(--text-small-weight);
  letter-spacing: var(--text-small-tracking);
  line-height: var(--text-small-leading);
  color: var(--text-secondary);
}

code, .text-mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono-size);
  line-height: var(--text-mono-leading);
  color: var(--accent-2);
  background: var(--surface-2);
  padding: 6px 10px;
  border-radius: 6px;
}

/* ---- Links ---- */

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

a:hover {
  text-decoration: underline;
}

/* Inline links inside running copy must be distinguishable without relying
   on colour alone (WCAG 1.4.1). Buttons and nav links are excluded. */
main p a:not(.btn),
main li a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Focus states (accessibility foundation) ---- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-control);
}

/* Never remove focus outlines without a visible replacement. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Reduced motion ---- */

@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;
  }
}

/* ---- Selection ---- */

::selection {
  background: var(--accent);
  color: var(--text-primary);
}
