/* Shared foundation only: reset, easing curves, motion + a11y defaults.
   Palette and type are deliberately NOT here — they belong to the page that
   owns the look, so this file stays safe to load anywhere. */

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

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

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

:root {
  /* Custom curves — the CSS built-ins are too weak to read as intentional. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --dur-fast: 180ms;
  --dur-panel: 320ms;
}

/* Visible, deliberate focus — never remove the ring, replace it. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

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

/* Reduced motion = fewer and gentler, not zero. Opacity and colour survive
   because they aid comprehension; movement does not. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    /* Not `transition-duration: 0`. Colour, opacity and shadow carry meaning
       — a button that stops acknowledging hover is broken, not calm. What
       goes is movement: restricting the property list means transform, width
       and position snap while the rest still eases. */
    transition-property: opacity, color, background-color, border-color,
                         box-shadow, fill, stroke !important;
    transition-duration: 150ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .motion-only {
    display: none !important;
  }
}
