/* ==========================================================================
   Draco Staff Development — v8 Base
   Reset, base element styling, and small utility helpers.
   Depends on tokens.css.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* No global smooth-scroll: it animates every programmatic/keyboard scroll and
     visibly drags the position:sticky topbar behind the content. Anchor jumps
     stay instant; the sticky header stays pinned. */
  -webkit-tap-highlight-color: transparent;
}

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

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

/* Fallback sizing for inline SVG icons in any context that doesn't set its own
   (component rules like .btn .icon override this). Prevents oversized icons. */
.icon { width: 1.15em; height: 1.15em; flex: none; }

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

p { line-height: var(--lh-base); }
p, li { text-wrap: pretty; }

a { color: var(--link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--link-hover); }

strong, b { font-weight: var(--fw-semibold); }
small { font-size: var(--fs-sm); }

ul, ol { padding-left: 1.25em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

hr { border: none; border-top: 1px solid var(--border); margin: var(--space-6) 0; }

code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }

::selection { background: var(--brand-sky); color: #fff; }

/* Accessible focus — keyboard only */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* Custom scrollbars (desktop) */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb {
    background: var(--border-strong); border-radius: var(--radius-full);
    border: 2px solid transparent; background-clip: padding-box;
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--n-400); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------- Utilities ------------------------------ */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (max-width: 767px) { .container { padding-inline: var(--space-4); } }

.visually-hidden {
  position: absolute !important;
  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-4); top: -60px;
  background: var(--brand-navy); color: #fff; padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md); z-index: var(--z-toast);
  transition: top var(--transition);
}
.skip-link:focus { top: var(--space-4); color: #fff; }

.text-center { text-align: center; }
.text-muted  { color: var(--text-3); }
.text-accent { color: var(--brand-sky); }
.mono        { font-family: var(--font-mono); }
.nowrap      { white-space: nowrap; }

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-6 { gap: var(--space-6); }
.grow  { flex: 1 1 auto; }
.hidden { display: none !important; }
/* The `hidden` attribute must win even over components that set `display`
   (e.g. .btn, .modal__foot use display:flex, which otherwise overrides it). */
[hidden] { display: none !important; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--link);
}

/* Screen-reader-only live region helper for JS status messages */
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
