/* ==========================================================================
   Lantern — Base / reset / primitives
   ========================================================================== */

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

* {
  margin: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

a {
  color: var(--teal-700);
  text-decoration: none;
  text-underline-offset: 0.16em;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--teal-500);
  text-decoration: underline;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

strong { font-weight: var(--weight-semibold); }

ul, ol { padding-left: 1.25rem; }
li { margin-block: 0.35rem; }

blockquote {
  border-left: 3px solid var(--amber-400);
  padding-left: var(--space-md);
  color: var(--ink-soft);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin-block: var(--space-2xl);
}

/* ---- Focus visibility (keyboard) --------------------------------------- */
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Remove the ring for mouse users but keep it for keyboard. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Accessibility helpers --------------------------------------------- */
.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: var(--z-overlay);
  background: var(--teal-800);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-md);
  color: #fff;
  text-decoration: none;
}

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

.container-narrow {
  max-width: var(--container-narrow);
}

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

.section--tint { background: var(--surface-2); }
.section--ink {
  background: var(--teal-900);
  color: #eaf1f2;
}
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }

.stack > * + * { margin-top: var(--flow, 1.25rem); }

.center { text-align: center; }
.measure { max-width: 42ch; }
.measure-wide { max-width: 58ch; }
.mx-auto { margin-inline: auto; }
