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

* { margin: 0; }

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

body {
  min-height: 100svh;
  background: var(--ink);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

p { text-wrap: pretty; }
p + p { margin-top: 1.15em; }

strong { color: var(--text-2); font-weight: 500; }

a {
  color: var(--steel);
  text-decoration-color: color-mix(in srgb, var(--steel) 35%, transparent);
  text-underline-offset: 0.22em;
  transition: color var(--dur-fast) var(--ease),
              text-decoration-color var(--dur-fast) var(--ease);
}
a:hover { color: var(--steel-bright); text-decoration-color: var(--steel-bright); }

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

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

/* Full-bleed by default, gutters only on the content. Alethia-style. */
.shell {
  width: 100%;
  padding-inline: var(--gutter);
}

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

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

.measure { max-width: var(--measure); }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: var(--z-preloader);
  background: var(--ink-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  padding: 0.75rem 1.15rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Scroll reveals ----------------------------------------------------------
   Hidden state hangs off .js, so content is always visible when JavaScript
   fails or is disabled. This also keeps it crawlable. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
