/* AskCert V8 — reset + base typography. */
@layer reset, tokens, base, components, layout, pages, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  img, svg, video, canvas { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  table { border-collapse: collapse; }
  dialog { padding: 0; border: 0; color: inherit; background: transparent; max-width: none; max-height: none; }
  [hidden] { display: none; }
}

@layer base {
  html { scroll-padding-top: calc(var(--ac-header-h) + var(--ac-space-4)); }
  @media (prefers-reduced-motion: no-preference) {
    html:focus-within { scroll-behavior: smooth; }
  }

  body {
    min-height: 100vh;
    background: var(--ac-bg);
    color: var(--ac-text-primary);
    font-family: var(--ac-font-sans);
    font-size: var(--ac-text-base);
    line-height: var(--ac-leading-ui);
    font-feature-settings: "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, h4 { color: var(--ac-text-strong); line-height: var(--ac-leading-tight); font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
  h1 { font-size: var(--ac-text-2xl); }
  h2 { font-size: var(--ac-text-xl); }
  h3 { font-size: var(--ac-text-lg); font-weight: 600; }
  h4 { font-size: var(--ac-text-base); font-weight: 600; }
  @media (min-width: 1024px) { h1 { font-size: var(--ac-text-3xl); } }

  p { text-wrap: pretty; }
  small { font-size: var(--ac-text-sm); }
  strong, b { font-weight: 650; }

  a { color: var(--ac-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
  a:hover { color: var(--ac-accent-hover); }

  code, kbd, samp, pre { font-family: var(--ac-font-mono); font-size: 0.92em; }
  code { background: var(--ac-code-bg); color: var(--ac-code-text); padding: 0.1em 0.35em; border-radius: var(--ac-radius-sm); }
  pre { background: var(--ac-code-bg); color: var(--ac-code-text); padding: var(--ac-space-4); border-radius: var(--ac-radius-md); overflow-x: auto; }
  pre code { background: none; padding: 0; }
  kbd { display: inline-block; min-width: 1.6em; padding: 0.05em 0.4em; border: 1px solid var(--ac-border-strong); border-bottom-width: 2px; border-radius: var(--ac-radius-sm); background: var(--ac-kbd-bg); color: var(--ac-text-secondary); font-size: var(--ac-text-xs); line-height: 1.5; text-align: center; white-space: nowrap; }
  hr { border: 0; border-top: 1px solid var(--ac-border); margin: var(--ac-space-6) 0; }
  ::selection { background: var(--ac-accent-soft); color: var(--ac-text-strong); }

  :focus-visible { outline: 2px solid var(--ac-focus); outline-offset: 2px; }
  :focus:not(:focus-visible) { outline: none; }

  table { width: 100%; font-variant-numeric: tabular-nums; }
  th, td { padding: var(--ac-space-2) var(--ac-space-3); border-bottom: 1px solid var(--ac-border); text-align: start; vertical-align: top; }
  th { color: var(--ac-text-secondary); font-weight: 600; font-size: var(--ac-text-sm); }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
    min-height: var(--ac-control-h);
    width: 100%;
    padding: var(--ac-space-2) var(--ac-space-3);
    background: var(--ac-surface);
    border: 1px solid var(--ac-border-strong);
    border-radius: var(--ac-radius-md);
    color: var(--ac-text-primary);
  }
  input::placeholder, textarea::placeholder { color: var(--ac-text-muted); opacity: 1; }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--ac-accent); width: 1.05rem; height: 1.05rem; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms; animation-iteration-count: 1; transition-duration: 1ms; scroll-behavior: auto; }
  }
}
