/* ─────────────────────────────────────────────────────────────────────────
   Mavek reset + a11y baseline.
───────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; height: 100%; }
body { font-family: var(--font-sans); color: var(--color-text); background: var(--color-bg); line-height: 1.5; height: 100%; }
/* Auth pages: override body bg to night so no parchment bleeds */
body:has(.auth-layout) { background: var(--night); }

/* ── Links ─────────────────────────────────────────────────────────────────
   Restore underlines on content links — WCAG 2.4.4 (Link Purpose Visible)
   wants links distinguishable from surrounding text. Non-content links
   inside .btn / .nav / .sidebar / .topbar / .badge are explicitly opted
   out so they don't get unwanted underlines.
*/
a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  transition: color var(--duration-fast) var(--ease-in-out);
}
a:hover    { color: var(--color-link-hover); }
a:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* Opt-out classes — UI affordances that aren't content links. */
a.btn,
a.nav-link,
a.sidebar-nav-link,
a.sidebar-footer-link,
a.tab-btn,
a.topbar-link,
a.card-features-btn,
a.upload-dl-btn,
a.saved-chip-open,
a.saved-chip-dl,
.sidebar-nav a,
.sidebar-footer a,
.topbar a,
.tabs a,
.btn a,
nav a,
.card a.card-link {
  text-decoration: none;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ── Focus (keyboard only) ───────────────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Skip-to-content link ────────────────────────────────────────────────── */
/* Hidden until focused via Tab. Pages that opt in just include
   <a href="#main-content" class="skip-to-content">Skip to content</a>
   as their first body child, and put id="main-content" on the <main>. */
.skip-to-content {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-tooltip);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--duration-fast) var(--ease-out);
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* ── Visually-hidden helper (for screen-reader-only labels) ──────────────── */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
