/* ApplyPacket base stylesheet. Loads after tokens.css. System font stack only - no webfont
   request. Calm, plain, high contrast, generous whitespace, one accent color, no gradients,
   no glow, no hero illustration. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-2);
  line-height: 1.55;
  overflow-x: hidden; /* belt-and-suspenders: no primitive here should ever need this */
}
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0 0 var(--sp-4); }
ul, ol { padding-left: var(--sp-5); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* Visible keyboard focus everywhere; mouse/touch users never see it. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

/* Section grammar: one padding rhythm, one named exception. */
.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-6); }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  flex-wrap: wrap;
}
.brand {
  font-size: var(--fs-3);
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--fg); }
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: var(--fs-1);
  padding-block: var(--sp-2);
}
.site-nav a:hover { color: var(--accent); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: var(--fs-1);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.footer-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  padding-block: var(--sp-7);
}
.footer-group h2 {
  font-size: var(--fs-0);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: var(--sp-3);
}
.footer-group ul { list-style: none; margin: 0; padding: 0; }
.footer-group li + li { margin-top: var(--sp-2); }
.footer-group a {
  color: var(--fg);
  text-decoration: none;
  font-size: var(--fs-1);
}
.footer-group a:hover { color: var(--accent); }
.footer-disclosure {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-4);
  font-size: var(--fs-0);
  color: var(--fg-muted);
}

/* ---------- hero ---------- */
.hero {
  padding-block: var(--sp-8);
  text-align: left;
}
.hero h1 {
  font-size: var(--fs-6);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: var(--measure);
}
.hero p {
  font-size: var(--fs-3);
  color: var(--fg-muted);
  max-width: var(--measure);
}
.hero .actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

/* ---------- steps (numbered) ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--sp-5);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--sp-4);
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg);
  font-weight: 700;
}
.steps h3 { font-size: var(--fs-3); margin-bottom: var(--sp-1); }
.steps p { color: var(--fg-muted); margin-bottom: 0; }

/* ---------- grids ---------- */
.grid-2, .grid-3 {
  display: grid;
  gap: var(--sp-5);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- card ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
}
.card h3 { font-size: var(--fs-3); margin-bottom: var(--sp-2); }
.card p { color: var(--fg-muted); margin-bottom: 0; }

/* ---------- faq (native details) ---------- */
.faq { border-top: 1px solid var(--border); }
.faq details {
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-4);
}
.faq summary {
  cursor: pointer;
  font-size: var(--fs-2);
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.faq summary::marker { color: var(--accent); }
.faq details p {
  color: var(--fg-muted);
  margin-top: var(--sp-3);
  margin-bottom: 0;
  max-width: var(--measure);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: var(--sp-5);
  border-radius: var(--radius);
  font-size: var(--fs-1);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn--quiet {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn--quiet:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: var(--sp-5); max-width: var(--measure); }
.field label {
  display: block;
  font-size: var(--fs-1);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: var(--sp-3);
  font-size: var(--fs-2);
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.field .help {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-0);
  color: var(--fg-muted);
}
.field .error {
  display: block;
  margin-top: var(--sp-2);
  font-size: var(--fs-0);
  color: var(--danger);
}

/* ---------- prose and note ---------- */
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--fs-4); margin-top: var(--sp-7); }
.prose h3 { font-size: var(--fs-3); margin-top: var(--sp-6); }
.note {
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  color: var(--fg-muted);
  font-size: var(--fs-1);
  max-width: var(--measure);
}

/* ---------- responsive: 390 / 768 / 1280 css px, no horizontal overflow anywhere ---------- */
@media (max-width: 767px) {
  .footer-groups { grid-template-columns: 1fr; gap: var(--sp-5); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: var(--fs-5); }
  .steps li { grid-template-columns: 2.5rem 1fr; }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
