/* ============================================================
   AWASE — Base & Accessibility
   reset / typography / focus / a11y / reduced-motion
   ============================================================ */
@layer reset, base, layout, components, pages, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100dvh; line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
  img, picture, svg, video { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: none; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  :target { scroll-margin-top: calc(var(--header-h) + var(--sp-3)); }
}

@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    color: var(--text);
    background: var(--bg);
    text-underline-offset: .18em;
  }
  h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 700; line-height: var(--lh-tight); color: var(--brand); letter-spacing: .01em; }
  h1 { font-size: var(--fs-h1); }
  h2 { font-size: var(--fs-h2); }
  h3 { font-size: var(--fs-h3); }
  p, li { max-width: var(--prose); }
  strong { font-weight: 700; }

  a:not([class]) { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; }
  a:not([class]):hover { text-decoration-thickness: 2.5px; }

  .kicker {
    font-family: var(--font-head); font-weight: 600;
    font-size: var(--fs-kicker); letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-muted);
  }
  .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

  /* focus — always visible, meets 3:1 non-text contrast */
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
  :focus:not(:focus-visible) { outline: none; }

  /* skip link */
  .skip-link {
    position: absolute; left: var(--sp-2); top: -100px;
    background: var(--brand); color: #fff; padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-s); z-index: 1000; transition: top var(--dur-micro) var(--ease);
  }
  .skip-link:focus { top: var(--sp-2); }

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

@layer utilities {
  .stack > * + * { margin-block-start: var(--flow, var(--sp-2)); }
  .center-text { text-align: center; }
  .muted { color: var(--text-muted); }
  .hidden { display: none !important; }
}

/* Minimum touch target 44px for interactive controls (WCAG 2.5.8) */
@layer base {
  a[class], button, .btn, [role="button"], input, select, .chip {
    min-height: 44px;
  }
  .chip, .btn-sm { min-height: 36px; } /* small controls keep 24px+ target via padding */
}

/* Respect reduced motion — disable all non-essential animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
