:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --ground: #e8ece8;
  --surface: #f9faf7;
  --surface-2: #f0f3ef;
  --ink: #18211c;
  --soft: #5d6861;
  --line: #bcc5be;
  --machine: #142019;
  --machine-ink: #e9eee9;
  --alert: #c44731;
  --ok: #28795b;
  --gate: #7457b9;
  --wait: #9a6b12;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ground);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topline {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  padding: 9px max(20px, calc((100vw - 1240px) / 2));
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--alert);
}

.topline nav,
.actions,
.evidence-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topline nav a,
.actions a,
.evidence-links a {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 8px 11px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.actions .primary {
  border-color: var(--machine);
  background: var(--machine);
  color: var(--machine-ink);
}

main {
  max-width: 1240px;
  margin: 0 auto;
}

section {
  border-bottom: 1px solid var(--line);
  padding: 54px 24px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 56px;
  align-items: end;
  min-height: 430px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.98;
}

.lede {
  max-width: 770px;
  margin: 22px 0;
  color: #354139;
  font-size: 20px;
  line-height: 1.4;
}

.status {
  margin: 0;
  border-top: 1px solid var(--ink);
}

.status div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.status dt {
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status dd {
  margin: 0;
  font-weight: 700;
}

.section-heading {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}

.section-heading h2 {
  max-width: 800px;
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.preview img {
  display: block;
  width: 100%;
  border: 1px solid #66736a;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(24, 33, 28, 0.14);
}

.grammar {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  margin: 0 0 34px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 18px 0;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.grammar i {
  display: block;
  flex: 1 0 20px;
  height: 1px;
  background: var(--gate);
}

.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 36px;
}

.rules article {
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
}

.rules h3,
.arcs h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.rules p,
.arcs p,
.evidence > p {
  margin: 0;
  color: var(--soft);
}

.documents ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: handoff;
}

.documents li {
  counter-increment: handoff;
  display: grid;
  grid-template-columns: 54px minmax(230px, 0.65fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.documents li::before {
  content: "0" counter(handoff);
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
}

.documents li a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.documents li span {
  color: var(--soft);
}

.arcs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.arcs article {
  min-height: 210px;
  border-right: 1px solid var(--line);
  padding: 18px 16px 22px 0;
}

.arcs article + article {
  padding-left: 16px;
}

.arcs article:last-child {
  border-right: 0;
}

.arcs b {
  display: block;
  margin-bottom: 42px;
  color: var(--gate);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 26px;
  border-top: 1px solid var(--machine);
  border-bottom: 1px solid var(--machine);
}

.metrics div {
  min-height: 136px;
  border-right: 1px solid var(--line);
  padding: 18px 16px;
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 36px;
  line-height: 1;
}

.metrics span {
  margin-top: 12px;
  color: var(--soft);
  font-size: 12px;
}

.evidence-links {
  margin-top: 24px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 44px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: 0;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 5px;
  }

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

  .arcs article,
  .arcs article + article {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }

  .arcs b {
    display: inline-block;
    width: 44px;
    margin: 0;
  }

  .arcs h3 {
    display: inline-block;
  }
}

@media (max-width: 640px) {
  .topline {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .topline nav a:first-child {
    display: none;
  }

  section {
    padding: 38px 14px;
  }

  h1 {
    font-size: 48px;
  }

  .lede {
    font-size: 17px;
  }

  .rules,
  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics div {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .documents li {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .documents li span {
    grid-column: 2;
  }

  footer {
    flex-direction: column;
    padding: 24px 14px 36px;
  }
}

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