/* =========================================================================
   Base — fonts, reset, element defaults.
   Two families, both served from here (no third party sees a visitor):
   Bricolage Grotesque speaks (headings, interface), Literata tells (prose).
   ========================================================================= */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* Page-to-page navigation cross-fades where the browser knows how. */
@view-transition { navigation: auto; }

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

* { margin: 0; }

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

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

/* ---- Headings ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 90%;
  line-height: var(--leading-tight);
  letter-spacing: -0.012em;
  color: inherit;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: 1.1; }
h4 { font-size: var(--step-1); line-height: 1.15; letter-spacing: -0.012em; }

p { text-wrap: pretty; }

/* ---- Links ------------------------------------------------------------- */
a { color: inherit; text-decoration: none; }

/* In running text a link is black type on a line of sun; the line rises into
   a highlighter stroke when pointed at. */
.prose a,
a.link,
.form-hint a,
.note a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--link-line, var(--sun)), var(--link-line, var(--sun)));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.16em;
  padding-bottom: 0.04em;
  transition: background-size var(--dur) var(--ease), color var(--dur) var(--ease);
}
.prose a:hover,
a.link:hover,
.form-hint a:hover,
.note a:hover { background-size: 100% 100%; color: var(--link-hover-ink, #141414); }

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

ul, ol { padding: 0; list-style: none; }

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

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

hr { border: 0; border-top: 1px solid var(--line); }

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 100;
  padding: 0.7em 1.1em;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

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

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