/* ==========================================================================
   Tripo-Pulse reset
   P1.F2.T1 · ©2026 Vexstorm Studios – All Rights Reserved

   One of exactly two layers permitted to use element selectors
   (project_code_standards.md §9.3); the other is base.css. Everything after
   this point styles classes.

   This is a normalising reset, not a wiping one. Headings keep their semantics
   and lists keep their markers unless a component removes them, because an
   over-aggressive reset makes every component re-declare what the browser had
   already got right, and the re-declarations drift.

   No colour, size, or spacing literal appears here — only structural values
   (0, 100%, auto, inherit) and design tokens.
   ========================================================================== */

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

html {
  /* Never below 100% here: a fixed root size breaks the browser's own text-size
     control, which is a WCAG 1.4.4 failure independent of anything else. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* UX-004: nothing may push the page wider than the viewport at 320px. */
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Rhythm is owned by layout primitives and components, not by the user agent's
   default margins, which differ between engines. */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

/* A list whose markers a component removes must also stop being announced as a
   list by some screen readers unless a role is restored; components that strip
   markers therefore set role="list" in the template. */
ul[class],
ol[class] {
  list-style: none;
}

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

svg {
  /* Icons inherit the colour of the text they sit beside, which is what keeps
     every icon on the correct side of a contrast pairing automatically. */
  fill: currentColor;
}

img,
video {
  height: auto;
}

/* Form controls do not inherit typography in any engine. */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

textarea {
  resize: vertical;
}

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

button:disabled {
  cursor: not-allowed;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  /* Chromium refuses to let a fieldset shrink below its content without this,
     which is the single most common cause of horizontal scroll in a form. */
  min-width: 0;
}

legend {
  padding: 0;
}

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

caption,
th,
td {
  text-align: start;
  vertical-align: top;
}

hr {
  border: 0;
  border-top: var(--tp-border-width-hairline) solid var(--tp-color-border-subtle);
  margin: 0;
}

a {
  color: inherit;
}

code,
kbd,
samp,
pre {
  font-family: var(--tp-font-mono);
  font-size: var(--tp-text-sm);
}

pre {
  margin: 0;
  overflow-x: auto;
}

/* The `hidden` attribute must win over any component's display value, otherwise
   JavaScript that hides an element by attribute silently does nothing. This is
   the reason the attribute exists and is not a specificity workaround. */
[hidden] {
  display: none !important;
}

/* Anchor targets must not land under the sticky header. */
:target {
  scroll-margin-top: var(--tp-space-9);
}

/* Smooth scrolling is decoration and is disabled for anyone who asked for less
   motion (ACC-005). The reduced-motion blanket in utilities.css covers
   transitions and animations; scroll behaviour needs its own declaration. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
