/* ============================================================
   Privacy Scanner Website — Modern minimal reset

   Based on Andy Bell's modern CSS reset principles, adapted
   for this project. Loads AFTER tokens.css so it can reference
   --font-sans, --text, --bg-base, etc.

   Not Normalize.css — we don't need cross-browser quirk
   smoothing for our browser floor (Safari 16.4+ etc.).
   ============================================================ */


/* Box-sizing on every element (incl. pseudo-elements) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin — type rhythm comes from utility classes */
* {
  margin: 0;
}

/* Document root */
html {
  /* Sticky nav offset: anchor links won't hide beneath the 72px nav.
     Mobile nav is 60px; the larger value is safe at both. */
  scroll-padding-top: calc(var(--nav-h) + var(--sp-4));

  /* Honor user's text-size preference; never override here. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Body baseline */
body {
  min-height: 100dvh;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

/* Headings — tighter line-height by default, balance long titles */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
  font-weight: var(--fw-semibold);
}

/* Long-form prose: better wrapping for readability */
p {
  text-wrap: pretty;
}

/* Links — color from token, underline only on hover for nav-style links.
   Section components override per their own styling. */
a {
  color: var(--text);
  text-decoration-color: var(--teal);
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--teal);
}

/* Lists with role="list" preserve semantics but drop default marker.
   Plain <ul>/<ol> retain markers — opt-in removal only. */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* Media defaults — block, never overflow container */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form elements inherit type — Safari otherwise uses platform fonts */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

/* Disable animations / smooth scroll for users who request it.
   Token-level reductions are in tokens.css §6.6; this catches
   any animation/transition not driven by token durations. */
@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;
  }
}

/* Focus ring — keyboard only. Mouse clicks stay clean.
   Applied as box-shadow from --focus-ring (see tokens.css §6.5).
   Section overrides (e.g. buttons) may layer their own treatment. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* CJK overrides — see DESIGN_SPEC.md §6 Implementation Notes #6.
   Body line-height loosens; letter-spacing collapses to 0.
   Headings stay tighter (1.3) even in CJK. */
:lang(ja),
:lang(zh-Hans),
:lang(ko) {
  line-height: var(--lh-body-cjk);
  letter-spacing: 0;
}

:lang(ja) :is(h1, h2, h3, h4),
:lang(zh-Hans) :is(h1, h2, h3, h4),
:lang(ko) :is(h1, h2, h3, h4) {
  line-height: 1.3;
  letter-spacing: 0;
}
