/* Element layer (#282): resets, typography, links, focus, motion and
 * print. Skin-agnostic — every colour is a token from tokens.css, and
 * scripts/lint.sh refuses literals in this file. Component vocabulary
 * lives in components.css; this file styles bare elements only.
 */

* {
  box-sizing: border-box;
}

/* The hidden attribute must win (#320 founder review): author-level
   display declarations — the element rules below, components.css's
   label and .btn rules — outrank the UA stylesheet's [hidden]
   mapping, so a label or button the server or a script parked with
   hidden showed anyway (the date lists' no-script remove ticks sat
   beside the script's Remove buttons). The guard restores the
   attribute's meaning; a sheet loaded later — the event form's
   noscript disclosure sheet — still overrides it with its own
   !important rules, so the no-JS degradation is untouched. */
[hidden] {
  display: none !important;
}

/* The page colour rides <html> so a sport-pack overlay — fixed, behind
   content at a negative z-index — shows through a transparent <body>;
   a body colour would paint over the overlay. Uniform with or without
   a pack, so the shell never branches on one. */
html {
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background-color: transparent;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 var(--sp-2);
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
  margin: var(--sp-4) 0;
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

a {
  color: var(--accent);
}

/* Keyboard focus: one visible ring on every interactive element. Text
   inputs keep their own focus treatment (border + soft halo) in
   components.css, so the ring scope excludes them rather than
   doubling up. */
:where(a, button, summary, .tab, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Motion sensitivity (#282 supplement): members who ask their device
   for reduced motion get no animation or transition anywhere in the
   shell — the spinner included. */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print (#282 supplement): a printed page is ink on white whatever the
   screen palette; chrome, forms and the pitch overlay stay off paper,
   and cards do not split across pages. */
@media print {
  .site-header,
  .tabbar,
  .pitch,
  .toast-stack,
  form,
  .btn,
  .link-button {
    display: none !important;
  }

  html {
    background: var(--print-bg);
  }

  body {
    color: var(--print-ink);
  }

  a {
    color: var(--print-ink);
    text-decoration: underline;
  }

  .card,
  .wallet-card,
  .event-card {
    box-shadow: none;
    border-color: var(--print-ink);
    break-inside: avoid;
  }
}
