/* ==========================================================================
   ItemSpan — Base
   --------------------------------------------------------------------------
   Reset, document defaults, typography, and the accessibility primitives that
   every page relies on. No component styling lives here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  /* Anchor links glide instead of jumping. Disabled for reduced-motion below. */
  scroll-behavior: smooth;
  /* Stops the sticky header from covering a heading you just jumped to. */
  scroll-padding-top: 110px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Headings and paragraphs get their margins from layout, not from the browser,
   so spacing is always deliberate. */
h1, h2, h3, h4, p, figure, blockquote, ul, ol {
  margin: 0;
}

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

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

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

button, a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
  color: var(--ink);
}

/* `balance` evens out the line lengths of a short heading so you don't get one
   orphaned word on the last line. It is applied to h2/h3 but deliberately NOT
   to h1: the hero headline is meant to fill its measure edge to edge, and
   balancing it pulls the lines in and weakens the impact. */
h2, h3, h4 {
  text-wrap: balance;
}

h1 {
  font-size: var(--text-hero);
  line-height: 1.04;
  font-weight: var(--weight-bold);
  text-wrap: pretty; /* avoids a single-word last line without shortening lines */
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.15;
  font-weight: 700;
}

h3 {
  font-size: var(--text-h3);
  line-height: 1.3;
  font-weight: 680;
}

p {
  color: var(--secondary);
  font-size: var(--text-body);
  line-height: 1.6;
  text-wrap: pretty;
}

strong {
  font-weight: var(--weight-semibold);
}

/* Prices and quantities line up in columns when digits are all one width. */
.tabular {
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

/* A visible, high-contrast focus ring for keyboard users only. :focus-visible
   means mouse users never see it, so there is no reason to remove it. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Lets a keyboard user jump straight past the nav to the page content.
   Hidden off-screen until it receives focus, then slides into view. */
.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--duration-fast) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Available to screen readers, invisible on screen. Use for table captions and
   any label that would be redundant visually but is needed for context. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Motion preferences
   --------------------------------------------------------------------------
   Some people get motion sickness from parallax and scroll animation, and the
   OS lets them say so. Honour it: strip animation down to near-instant, and
   make sure scroll-reveal elements are VISIBLE rather than stuck at opacity 0.
   -------------------------------------------------------------------------- */

@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;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
