/* Purpose: Modern reset, @font-face declarations, and base element styles.
   Mobile-first. Uses design-system.css tokens only — no hardcoded values. */

/* ---------------------------------------------------------------------
   SELF-HOSTED FONTS
   Drop the .woff2 files into /assets/fonts/. Until then the stacks in
   design-system.css fall back to system fonts gracefully.
   Clash Display  -> https://www.fontshare.com/fonts/clash-display (free, self-host)
   Hanken Grotesk -> https://fonts.google.com/specimen/Hanken+Grotesk (download, self-host)
   Space Mono     -> https://fonts.google.com/specimen/Space+Mono (download, self-host)
   --------------------------------------------------------------------- */
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../fonts/HankenGrotesk-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Space Mono';
  src: url('../fonts/SpaceMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

/* ---------------------------------------------------------------------
   RESET
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------------
   TYPOGRAPHY BASE
   --------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p  { max-width: 68ch; text-wrap: pretty; }

@media (min-width: 1024px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
}

/* ---------------------------------------------------------------------
   ACCESSIBILITY
   --------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 3px; border-radius: var(--radius-sm); }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  background: var(--color-primary);
  color: var(--color-text-invert);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  transition: top var(--duration-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px);
  white-space: nowrap; border: 0;
}

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

/* Body lock when cart drawer / modal open */
body.is-cart-open, body.is-modal-open { overflow: hidden; }
