/*
 * base.css
 * Reset, document defaults, typography and layout primitives.
 * Mobile first. 360px is the primary target; desktop is the enhancement.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink-body);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

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

h1 {
  font-size: var(--fs-h1);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 500;
  letter-spacing: -0.026em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.014em;
}

p {
  margin: 0 0 var(--sp-4);
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0 0 var(--sp-4);
  padding-left: 1.25rem;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-mid);
}

img,
svg {
  max-width: 100%;
}

svg {
  display: block;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* Focus is designed, never removed. */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ---- Layout primitives ------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

/* Alternating surfaces give the page its rhythm. Roughly 30 percent dark,
   matching the presentation decks. */
.surface-light {
  background: var(--paper-2);
}

.surface-white {
  background: var(--white);
}

.surface-dark {
  background: var(--bg-dark);
  color: var(--ink-body-on-dark);
}

.surface-darkest {
  background: var(--bg-darkest);
  color: var(--ink-body-on-dark);
}

.surface-dark h1,
.surface-dark h2,
.surface-dark h3,
.surface-darkest h1,
.surface-darkest h2,
.surface-darkest h3 {
  color: var(--ink-on-dark);
}

.surface-dark a,
.surface-darkest a {
  color: var(--accent-on-dark);
}

/* ---- Utility ------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-2);
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  background: var(--accent-base);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--t-fast) var(--ease);
}

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

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

.measure {
  max-width: 62ch;
}

.measure-wide {
  max-width: 74ch;
}
