@font-face {
  font-family: "Archivo";
  src: url("./assets/Archivo-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("./assets/Archivo-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #060608;
  --surface: #18181d;
  --surface-raised: #24242a;
  --text: #edeae3;
  --muted: #96928b;
  --faint: #5c5953;
  --line: #2b2b31;
  --line-strong: #55545a;
  --paper: #f1ebdc;
  --ink: #14120e;
  --sage: #b8c9a8;
  --header-height: 76px;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 12px 16px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 6, 8, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
}

.brand img {
  width: 116px;
  height: 26px;
  object-fit: contain;
  object-position: left center;
}

.brand span,
.page-count,
.eyebrow,
.share-button,
.step-label,
.example-line strong,
.value-line strong,
.primary-action,
.secondary-action {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand span,
.page-count {
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.page-count {
  min-width: 56px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.share-button,
.secondary-action {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.share-button:hover,
.secondary-action:hover {
  border-color: var(--paper);
  background: var(--surface-raised);
}

.reading-progress {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sage);
  transform-origin: left center;
}

.section-index {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 40;
  display: grid;
  gap: 5px;
  transform: translateY(-50%);
}

.section-index a {
  width: 40px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.section-index a:hover {
  color: var(--text);
  border-color: var(--line);
}

.section-index a[aria-current="true"] {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

main {
  padding-top: var(--header-height);
}

.chapter {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  display: grid;
  align-items: center;
  padding: clamp(80px, 8vw, 124px) clamp(72px, 9vw, 144px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  overflow: clip;
}

.chapter-inner {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.cover {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  padding-top: clamp(64px, 6vw, 92px);
  padding-bottom: clamp(64px, 6vw, 92px);
}

.cover-layout {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cover-copy {
  width: 100%;
  max-width: none;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.4;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 24px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

h1 {
  max-width: 1040px;
  font-size: clamp(60px, 7.5vw, 108px);
}

h1.cover-title {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0 0 clamp(34px, 5vw, 58px);
  color: var(--text);
  line-height: 1;
}

.cover-title span {
  display: block;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.cover-batch {
  font-size: clamp(56px, 7.2vw, 106px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
}

.cover-api {
  color: var(--paper);
  font-size: clamp(160px, 26vw, 390px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

h2 {
  max-width: 1020px;
  font-size: clamp(46px, 5.2vw, 74px);
}

.section-heading > p:last-child {
  max-width: 880px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.4;
}

.cover-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding-top: clamp(26px, 3vw, 38px);
  border-top: 1px solid var(--line-strong);
}

.cover-purpose {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.cover-context {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.section-heading {
  margin-bottom: clamp(36px, 5vw, 58px);
}

.example-line {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding: 18px 22px;
  border-left: 3px solid var(--sage);
  background: var(--surface);
}

.example-line strong {
  color: var(--sage);
  letter-spacing: 0.06em;
}

.example-line span {
  color: var(--text);
  font-size: 18px;
  line-height: 1.45;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.workflow-grid article {
  min-width: 0;
  padding: 34px 32px 38px;
}

.workflow-grid article:first-child {
  padding-left: 0;
}

.workflow-grid article:last-child {
  padding-right: 0;
}

.workflow-grid article + article {
  border-left: 1px solid var(--line);
}

.step-label {
  margin-bottom: 22px;
  color: var(--sage);
  letter-spacing: 0.06em;
}

.workflow-grid h3 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.12;
}

.workflow-grid article > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.52;
}

.value-line {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 28px;
  padding: 24px 28px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.value-line strong {
  letter-spacing: 0.06em;
}

.value-line span {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.value-line-split {
  grid-template-columns: 1fr minmax(280px, 0.7fr);
}

.value-line-split > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
}

.value-line-split a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid rgba(20, 18, 14, 0.24);
  padding-left: 26px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-underline-offset: 4px;
}

.pilot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 56px 80px;
}

.pilot h2 {
  max-width: 850px;
}

.pilot-prompt {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.35;
}

.pilot-facts {
  align-self: end;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.pilot-facts article {
  padding: 24px 0;
}

.pilot-facts article + article {
  border-top: 1px solid var(--line);
}

.pilot-facts p:last-child {
  margin-bottom: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.45;
}

.pilot-close {
  grid-column: 1 / -1;
  max-width: 980px;
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.pilot-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.primary-action {
  border: 1px solid var(--paper);
  background: var(--paper);
  color: var(--ink);
  transition: opacity 150ms ease;
}

.primary-action:hover {
  opacity: 0.86;
}

.site-footer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 28px;
  align-items: center;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer img {
  width: 130px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
}

.site-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  text-underline-offset: 4px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.noscript {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
}

@media (max-width: 1120px) {
  .chapter {
    padding-right: 82px;
    padding-left: 58px;
  }

  .workflow-grid article {
    padding-right: 24px;
    padding-left: 24px;
  }

  .workflow-grid article:first-child {
    padding-left: 0;
  }

  .workflow-grid article:last-child {
    padding-right: 0;
  }

  .value-line-split {
    grid-template-columns: 1fr;
  }

  .value-line-split a {
    border-top: 1px solid rgba(20, 18, 14, 0.24);
    border-left: 0;
    padding-top: 18px;
    padding-left: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 68px;
  }

  .site-header {
    padding: 0 22px;
  }

  .brand span,
  .page-count,
  .section-index {
    display: none;
  }

  .brand img {
    width: 106px;
  }

  .chapter {
    min-height: 0;
    display: block;
    padding: 86px 24px;
  }

  .cover {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    display: grid;
    align-items: center;
  }

  .cover-layout {
    min-height: 0;
  }

  .cover-intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .workflow-grid article,
  .workflow-grid article:first-child,
  .workflow-grid article:last-child {
    padding: 30px 0;
  }

  .workflow-grid article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .pilot-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .pilot-close,
  .pilot-actions,
  .site-footer {
    grid-column: auto;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer span {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 0 16px;
  }

  .share-button {
    padding: 0 14px;
  }

  .chapter {
    padding: 74px 18px;
  }

  h1 {
    font-size: clamp(48px, 14vw, 66px);
  }

  h2 {
    font-size: clamp(40px, 11vw, 56px);
  }

  .cover {
    padding-top: 58px;
    padding-bottom: 44px;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .section-heading > p:last-child {
    font-size: 19px;
  }

  h1.cover-title {
    margin-bottom: 32px;
  }

  .cover-batch {
    font-size: clamp(48px, 15vw, 66px);
  }

  .cover-api {
    font-size: clamp(136px, 43vw, 190px);
    letter-spacing: -0.06em;
  }

  .cover-purpose {
    font-size: 27px;
  }

  .cover-context {
    font-size: 17px;
  }

  .example-line,
  .value-line,
  .value-line-split > div {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .example-line {
    padding: 18px;
  }

  .value-line {
    padding: 22px;
  }

  .pilot-actions {
    display: grid;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer a,
  .site-footer span {
    grid-column: auto;
    grid-row: auto;
  }
}

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