/* ==========================================================================
   Base: reset, typography, layout primitives, accessibility, motion
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--ap-steel-900);
  background: var(--ap-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ap-indigo-500); text-underline-offset: 0.18em; }
a:hover { color: var(--ap-indigo-700); }

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ap-indigo-700);
  margin: 0 0 var(--space-4);
  letter-spacing: 0.005em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.15; }
h4 { font-size: var(--fs-h4); line-height: 1.2; }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }
ul, ol { margin: 0 0 var(--space-4); }
strong { font-weight: 600; }

/* The "PLUS" emphasis: italic 700, orange. Only at heading sizes (≥24px bold). */
.em-plus {
  font-style: italic;
  font-weight: 700;
  color: var(--ap-orange-500);
}
.on-light .em-plus { color: var(--ap-orange-600); }

.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ap-steel-700); }
.muted { color: var(--ap-steel-700); }
.small { font-size: var(--fs-sm); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { position: relative; padding-block: var(--section-y); }
.section--tint { background: var(--ap-steel-100); }
.section--indigo { background: var(--ap-indigo-100); }
.section--dark {
  background: var(--ap-indigo-900);
  color: var(--ap-white-a70);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--ap-white); }
.section--dark .lead, .section--dark .muted { color: var(--ap-white-a70); }
.section--dark a:not(.btn) { color: var(--ap-white); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2--wide-left { grid-template-columns: 1.15fr 0.85fr; }
}
.stack > * + * { margin-top: var(--space-4); }
.center { text-align: center; }
.center p { margin-inline: auto; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--ap-indigo-900);
  color: var(--ap-white);
  font-weight: 600;
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-4); color: var(--ap-white); }

:focus-visible {
  outline: 3px solid var(--ap-orange-500);
  outline-offset: 3px;
  border-radius: 2px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Scroll reveal (JS adds .is-visible) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: 0.08s; }
.js .reveal[data-delay="2"] { transition-delay: 0.16s; }
.js .reveal[data-delay="3"] { transition-delay: 0.24s; }
.js .reveal[data-delay="4"] { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
.nowrap { white-space: nowrap; }
