/* ==========================================================================
   CENTINELA — BASE
   Reset, base element styles, and cross-cutting utility classes.
   ========================================================================== */

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

/* The [hidden] attribute must always win over a component's own display:flex
   / display:grid rule. Both are specificity (0,1,0); without !important here,
   whichever rule is declared later in the cascade wins regardless of the
   hidden attribute being present — a real, easy-to-hit bug anywhere an
   element toggled via .hidden also carries a flex/grid component class. */
[hidden] {
  display: none !important;
}

* {
  margin: 0;
}

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

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

body {
  font: var(--text-body);
  color: var(--color-text-primary);
  background: var(--color-canvas);
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  text-align: inherit;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font: var(--text-h1);
}
h2 {
  font: var(--text-h2);
}
h3 {
  font: var(--text-h3);
}

/* Focus ring — visible, consistent, never suppressed without a replacement */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--orange-700);
  color: var(--white);
}

/* Scrollbars — subtle, on-brand, not the browser default on WebKit */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--graphite-300);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-canvas);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--graphite-400);
}

/* ------------------------------------------------------------------ *
 * UTILITIES
 * ------------------------------------------------------------------ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  z-index: var(--z-toast);
  background: var(--graphite-950);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--duration-base) var(--ease-standard);
}
.skip-link:focus {
  top: var(--space-4);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.font-mono {
  font-family: var(--font-mono);
}

.text-eyebrow {
  font: var(--text-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.text-micro {
  font: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.container {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-8);
  }
}

.sr-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
