/* AshAra Phase 3 base styles - reset + accessible defaults. Loads after tokens.css. */

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

/* The hidden attribute must ALWAYS win - component display values (e.g. a backdrop's
 * display:grid) must never resurrect a [hidden] element as an invisible click shield. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--line-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: var(--line-snug); font-weight: 600; letter-spacing: var(--tracking-tight); color: var(--color-text); }
h1 { font-size: var(--fs-2xl); line-height: var(--line-tight); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { max-width: 68ch; }

a { color: var(--color-link); text-underline-offset: 0.15em; }
a:hover { text-decoration: underline; }

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

/* Visible focus everywhere - never remove the outline without a replacement. */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--ash-brass); color: #fff; }

/* Screen-reader-only utility + skip link. */
.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;
}
.skip-link {
  position: absolute; left: var(--space-3); top: -3rem; z-index: var(--z-toast);
  background: var(--color-surface); color: var(--color-text);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); transition: top var(--motion-base) var(--ease-standard);
}
.skip-link:focus { top: var(--space-3); }

/* Layout containers. */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

/* Reduced motion: neutralize transitions/animations globally. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
