/* ==========================================================================
   Compresso — Base layer
   Minimal, opinionated reset + element defaults wired to tokens. Consumers
   linking styles.css get sensible typography, smooth-scroll, focus rings,
   and themed link colors out of the box.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  tab-size: 4;
}

@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 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}

/* Headings default to the display family + tight tracking */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Numeric / technical strings (KB, MB, %, stats) */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

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

/* Forms inherit type */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Links — themed defaults so user-added links are never browser-blue */
a {
  color: var(--color-accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: var(--transition-colors);
}
a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

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

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

/* Thin themed scrollbar (opt-in via .cmp-scroll or applied to body) */
* {
  scrollbar-color: var(--color-border-strong) transparent;
}
