/* ==========================================================================
   proto/shared/reset.css — Foundation Agent
   Modern minimal reset, shared by all directions. Load FIRST, before
   tokens.css and the direction's own styles.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth; /* disabled under reduced motion below */
}

body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Media defaults: block-level, never overflow their container. */
img,
svg,
video,
canvas,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

/* THE form-control gotcha fix: form controls do not inherit typography
   by default. Without this, buttons/inputs silently render in the UA font
   and break the direction's type system. */
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

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

/* Typography sanity */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
}

a {
  color: inherit; /* directions set link colors deliberately */
}

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

table {
  border-collapse: collapse;
}

/* Focus visibility: default visible focus for keyboard users. Directions
   may restyle (color/offset) but must never remove visible focus.
   Uses currentColor so it works on any direction's palette. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

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

/* Reduced motion: force near-zero durations on EVERYTHING, kill smooth
   scroll. Belt-and-suspenders with tokens.css zeroing the duration tokens.
   0.01ms (not 0) so animationend/transitionend events still fire and
   JS waiting on them doesn't hang. */
@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;
  }
}
