/* Kids Marketplace — base: scoped reset, type roles, layout primitives.
   Responsive behaviour uses container queries on .km so each artboard (1440 / 768 / 375)
   composes from its own width. Breakpoints: ≤1023px tablet, ≤639px phone. */

.km {
  container: km / inline-size;
  background: var(--km-color-paper);
  color: var(--km-color-ink);
  font-family: var(--km-font-body);
  font-size: var(--km-text-body);
  line-height: var(--km-lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  box-sizing: border-box;
  min-height: 100%;
}
.km *, .km *::before, .km *::after { box-sizing: border-box; }
.km :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, legend) { margin: 0; padding: 0; }
.km :where(ul, ol) { list-style: none; }
.km :where(img, svg) { display: block; max-width: 100%; }
.km :where(button, input, select, textarea) { font: inherit; color: inherit; }
.km :where(a) { color: inherit; }
.km :where(fieldset) { border: 0; min-width: 0; }

/* Focus: always visible, never colour-only. */
.km :focus { outline: none; }
.km :focus-visible { outline: 3px solid var(--km-color-focus); outline-offset: 2px; border-radius: var(--km-radius-1); }

@media (prefers-reduced-motion: reduce) {
  .km *, .km *::before, .km *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── Type roles ──────────────────────────────────────── */
.km-display, .km-h1, .km-h2, .km-h3, .km-h4 {
  font-family: var(--km-font-display);
  font-weight: 700;
  letter-spacing: var(--km-track-tight);
  text-wrap: balance;
  color: var(--km-color-ink);
}
.km-display { font-size: var(--km-text-display); line-height: var(--km-lh-display); font-variation-settings: "opsz" 96; font-weight: 750; }
.km-h1 { font-size: var(--km-text-h1); line-height: var(--km-lh-h1); font-variation-settings: "opsz" 72; }
.km-h2 { font-size: var(--km-text-h2); line-height: var(--km-lh-h2); font-variation-settings: "opsz" 48; }
.km-h3 { font-size: var(--km-text-h3); line-height: var(--km-lh-h3); font-weight: 650; font-variation-settings: "opsz" 28; }
.km-h4 { font-size: var(--km-text-h4); line-height: var(--km-lh-h4); font-weight: 650; letter-spacing: -0.01em; font-variation-settings: "opsz" 20; }
.km-lede { font-size: var(--km-text-lede); line-height: var(--km-lh-lede); color: var(--km-color-ink-2); text-wrap: pretty; }
.km-body { font-size: var(--km-text-body); line-height: var(--km-lh-body); color: var(--km-color-ink-2); text-wrap: pretty; }
.km-small { font-size: var(--km-text-small); line-height: var(--km-lh-small); color: var(--km-color-ink-3); }
.km-micro { font-size: var(--km-text-micro); line-height: var(--km-lh-micro); color: var(--km-color-ink-3); }
.km-kicker {
  display: inline-flex; align-items: center; gap: var(--km-space-2);
  font-family: var(--km-font-display); font-size: var(--km-text-micro); line-height: 1;
  font-weight: 700; letter-spacing: var(--km-track-kicker); text-transform: uppercase;
  color: var(--km-color-ink-2);
}
.km-kicker__num { color: var(--km-color-coral-deep); white-space: nowrap; }
.km-em { font-style: italic; }
.km-link { color: var(--km-color-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--km-color-line-strong); }
.km-link:hover { text-decoration-color: var(--km-color-ink); }

/* ── Layout primitives ───────────────────────────────── */
.km-container { width: 100%; max-width: calc(var(--km-container) + 2 * var(--km-gutter)); margin-inline: auto; padding-inline: var(--km-gutter); }
.km-section { padding-block: var(--km-space-9); }
.km-section--tight { padding-block: var(--km-space-8); }
.km-stack { display: flex; flex-direction: column; }
.km-row { display: flex; align-items: center; flex-wrap: wrap; }
.km-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.km-rule { border: 0; border-top: 1px solid var(--km-color-line); margin: 0; }

.km-only-phone { display: none !important; }

/* Tablet ≤1023 */
@container km (max-width: 1023px) {
  .km-container { padding-inline: 40px; }
  .km-section { padding-block: var(--km-space-8); }
  .km-display { font-size: 60px; }
  .km-h1 { font-size: 42px; }
  .km-h2 { font-size: 32px; }
}

/* Phone ≤639 */
@container km (max-width: 639px) {
  .km-container { padding-inline: 20px; }
  .km-section { padding-block: var(--km-space-7); }
  .km-section--tight { padding-block: var(--km-space-6); }
  .km-display { font-size: 44px; line-height: 1.0; }
  .km-h1 { font-size: 34px; line-height: 1.08; }
  .km-h2 { font-size: 28px; line-height: 1.12; }
  .km-h3 { font-size: 21px; }
  .km-h4 { font-size: 18px; }
  .km-lede { font-size: 18px; }
  .km-body { font-size: 16px; }
  .km-hide-phone { display: none !important; }
  .km-only-phone { display: revert !important; }
  .km-only-phone.km-flex { display: flex !important; }
}
