:root {
  --bg: #050505;
  --text: #f3f2ec;
  --text-dim: #c9c8c0;
  --muted: #9a9a96;
  --border: rgba(243, 242, 236, 0.14);
  --border-strong: rgba(243, 242, 236, 0.38);
  --measure: 46rem;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.09rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
}

.shell {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-strong);
  border-top: 0;
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

a:hover {
  text-decoration-color: var(--border-strong);
}

a:focus-visible,
.button:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}

.wordmark {
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}

.wordmark-mark {
  font-size: 1.15rem;
}

.wordmark-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
}

.site-header nav ul {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--text);
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-decoration-color: var(--border-strong);
}

.page {
  padding-block: clamp(3.5rem, 10vw, 6.5rem) clamp(4rem, 10vw, 7rem);
  animation: enter 0.55s ease-out both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 1.4rem;
}

h1 {
  font-size: clamp(2.3rem, 6.5vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 1.1rem;
}

.tagline {
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--text-dim);
  margin: 0 0 2.2rem;
  max-width: 38rem;
}

.prose {
  max-width: 38rem;
}

.prose p {
  margin: 0 0 1.2rem;
  color: var(--text-dim);
}

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

.section {
  margin-top: clamp(2.8rem, 8vw, 4.5rem);
}

.section > h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}

.story-intro {
  max-width: 38rem;
}

.story {
  list-style: none;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
}

.step {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(1.8rem, 5vw, 3.2rem);
  align-items: center;
  border-top: 1px solid var(--border);
  padding-block: clamp(2.6rem, 8vh, 4.2rem);
}

.step-number {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.step-glyph {
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(243, 242, 236, 0.015);
}

.step-glyph .glyph {
  display: block;
  width: 100%;
  height: 100%;
}

.glyph [stroke] {
  vector-effect: non-scaling-stroke;
}

.step-text h3 {
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  font-weight: 550;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.step-text > p:last-child {
  margin: 0;
  color: var(--text-dim);
  max-width: 30rem;
}

html.fx .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

html.fx .reveal.is-visible {
  opacity: 1;
  transform: none;
}

html.fx [data-speed] {
  will-change: transform;
}

.statement {
  margin-top: clamp(2.8rem, 8vw, 4.5rem);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-strong);
  padding: clamp(1.3rem, 4vw, 1.9rem) clamp(1.3rem, 4vw, 1.9rem);
}

.statement p {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.22rem);
  line-height: 1.55;
  letter-spacing: -0.005em;
  max-width: 34rem;
}

.cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin: clamp(2.4rem, 7vw, 3.6rem) 0 0;
}

.button {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.65em 1.25em;
  text-decoration: none;
  font-size: 0.98rem;
  transition:
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.button:hover {
  border-color: var(--border-strong);
  background: rgba(243, 242, 236, 0.05);
}

.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-index {
  margin-block: clamp(2.8rem, 8vw, 4rem);
  border-block: 1px solid var(--border);
  padding-block: 1.25rem;
}

.resource-index .kicker {
  margin-bottom: 0.75rem;
}

.resource-index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-index a {
  display: inline-block;
  padding-block: 0.35rem;
  text-decoration-color: var(--border-strong);
}

.topic-count {
  margin-left: 0.4rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.resource-group + .resource-group {
  margin-top: 3.5rem;
}

.resource-group > h2 {
  margin: 0 0 1.2rem;
  font-size: 1.15rem;
  font-weight: 500;
}

[id] {
  scroll-margin-top: 7rem;
}

.back-to-index {
  display: inline-block;
  margin-top: 1rem;
  padding-block: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.resource {
  border-top: 1px solid var(--border);
  padding-block: clamp(1.6rem, 5vw, 2.3rem);
}

.resource:last-of-type {
  border-bottom: 1px solid var(--border);
}

.resource-author {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.resource-title {
  font-size: clamp(1.15rem, 2.8vw, 1.38rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0 0 0.55rem;
}

.resource-title em {
  font-style: italic;
}

.resource-label {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.resource-annotation {
  margin: 0;
  color: var(--text-dim);
  max-width: 36rem;
}

.closing-note {
  margin: clamp(1.8rem, 5vw, 2.5rem) 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  max-width: 34rem;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer .shell {
  padding-block: 1.6rem 2.1rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 34rem;
}

@media (max-width: 40rem) {
  .step {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    align-items: start;
  }
}

@media (max-width: 30rem) {
  .wordmark-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

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

  .page {
    animation: none;
  }

  html.fx .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  [data-speed] {
    transform: none !important;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
