/* ═══════════════════════════════════════════════════════════════════════════
   00 - RESET
   Loaded first. Declares the cascade layer order for the whole site, so the
   remaining nine files can be authored at a flat specificity.
   ═══════════════════════════════════════════════════════════════════════════ */

@layer reset, tokens, base, layout, components, sections, pages, utilities, motion;

@layer reset {

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

  /* Margins are always a token, never a browser default (§15.2). */
  html, body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul, pre {
    margin: 0;
  }

  ul[role='list'],
  ol[role='list'] {
    list-style: none;
    padding: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* The header is 68px when shrunk; anchors should clear it. */
    scroll-padding-top: 96px;
    -moz-text-size-adjust: 100%;
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
  }

  body {
    min-height: 100svh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
  }

  /* Images and media behave like blocks with a sane ceiling. */
  img, picture, video, canvas, svg, iframe {
    display: block;
    max-width: 100%;
  }

  img, video { height: auto; }

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

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

  /* Word-breaking that does not shred Devanagari conjuncts. */
  p, li, h1, h2, h3, h4, blockquote, figcaption, dd {
    overflow-wrap: break-word;
  }

  a { color: inherit; }

  table {
    border-collapse: collapse;
    border-spacing: 0;
  }

  fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
  }

  legend { padding: 0; }

  /* Remove the native chrome we restyle everywhere (§9.2). */
  select {
    appearance: none;
    -webkit-appearance: none;
  }

  textarea { resize: vertical; }

  summary { cursor: pointer; }
  summary::-webkit-details-marker { display: none; }

  ::-moz-focus-inner {
    border: 0;
    padding: 0;
  }

  /* No default focus ring anywhere - 02-base.css defines the real one. */
  :focus { outline: none; }

  [hidden] { display: none !important; }

  /* Cross-browser hyphenation off by default; opted into per component. */
  :where(p, li) { hyphens: manual; }
}
