/* ==========================================================================
   Reset + element defaults
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* clears the sticky header on anchor jumps */
}

body {
  min-height: 100svh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* --- Headings ------------------------------------------------------------ */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  line-height: var(--lh-heading);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-lg);
}

p {
  text-wrap: pretty;
}

/* --- Links --------------------------------------------------------------- */

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--color-link-hover);
}

/* --- Focus --------------------------------------------------------------- */
/* Never remove these. Keyboard users depend on them. */

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Lists --------------------------------------------------------------- */

ul,
ol {
  padding-inline-start: 1.25em;
}

li + li {
  margin-top: var(--sp-2);
}

/* --- Misc ---------------------------------------------------------------- */

hr {
  border: 0;
  height: 1px;
  background: var(--grad-gold-rule);
  margin-block: var(--sp-6);
}

blockquote {
  margin: 0;
}

::selection {
  background: var(--ja-lavender-pale);
  color: var(--ja-navy-deep);
}

/* --- Utilities ----------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--sp-4);
  transform: translateY(-120%);
  z-index: 100;
  background: var(--ja-navy);
  color: var(--ja-white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--ja-white);
}

/* --- Motion preference ---------------------------------------------------- */

@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;
    scroll-behavior: auto !important;
  }
}

/* --- Print ---------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .wa-fab,
  .lang-toggle {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
