:root {
  color-scheme: light;
  --paper: #f4f2ed;
  --surface: #fbfaf7;
  --ink: #17211d;
  --muted: #5e6963;
  --line: #cfd4cf;
  --accent: #1f5d47;
  --accent-soft: #dce8e1;
  --max: 1120px;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.site-header,
main,
footer {
  width: min(100%, calc(var(--max) + 2 * var(--gutter)));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.35rem;
  text-decoration: none;
}

nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
nav a { color: var(--muted); font-size: 0.9rem; text-decoration: none; }
nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }

.intro,
.document-header {
  padding-block: clamp(5rem, 11vw, 9rem);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 500;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3rem, 7.5vw, 6.6rem);
  letter-spacing: -0.035em;
}

.document h1 { font-size: clamp(3rem, 6.5vw, 5.8rem); }

.lede {
  max-width: 760px;
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.55;
}

.app-list,
.principles {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.section-label {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1.6fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.section-label h2 { margin: 0; font-size: 1.5rem; }
.section-label p { max-width: 600px; margin: 0; color: var(--muted); }

.app-row {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) 1.5fr;
  gap: 4rem;
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}

.app-row:last-child { border-bottom: 1px solid var(--line); }
.app-row h3 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); }
.app-row p { max-width: 620px; margin-top: 0; color: var(--muted); font-size: 1.1rem; }
.number { margin-bottom: 1rem !important; color: var(--accent) !important; font-size: 0.78rem !important; font-weight: 600; letter-spacing: 0.12em; }

.text-link { color: var(--accent); font-weight: 600; text-decoration-thickness: 1px; }

.principles { border-bottom: 1px solid var(--line); }
.principles ul { max-width: 760px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.principles li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.principles li:last-child { border-bottom: 1px solid var(--line); }

.document { max-width: calc(920px + 2 * var(--gutter)); }
.document section { display: grid; grid-template-columns: 240px 1fr; gap: 3.5rem; padding-block: 3rem; border-bottom: 1px solid var(--line); }
.document section h2 { margin: 0; font-size: 1.45rem; }
.document section > :not(h2) { grid-column: 2; }
.document section p { margin-top: 0; }
.document section ul { margin-top: 0; padding-left: 1.2rem; }
.document section li + li { margin-top: 0.7rem; }

.scope {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  background: var(--accent-soft);
  border: 1px solid #bed1c5;
  border-radius: 4px;
}
.scope code { color: #143d2f; font-size: 0.88rem; }

.next-link { padding-block: 3rem 5rem; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
footer p { margin: 0; }

@media (max-width: 700px) {
  .site-header { align-items: flex-start; flex-direction: column; padding-block: 1.25rem; }
  nav { gap: 1rem; }
  .intro, .document-header { padding-block: 4.5rem; }
  .section-label, .app-row, .document section { grid-template-columns: 1fr; gap: 1.5rem; }
  .document section > :not(h2) { grid-column: 1; }
  .app-row { padding-block: 2.5rem; }
  footer { flex-direction: column; }
}

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