:root {
  color-scheme: light;
  --ink: #121a2b;
  --authority: #2347a6;
  --signal: #f06449;
  --mist: #e8edf8;
  --paper: #f9fafd;
  --rule: #b8c2d8;
  --white: #ffffff;
  --page: min(1180px, calc(100vw - 48px));
  --line-x: 30px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(35, 71, 166, 0.035) 1px, transparent 1px) 0 0 / 80px 80px,
    var(--paper);
  font-family: "Atkinson Hyperlegible Next", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

a {
  color: var(--authority);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

a:focus-visible,
button:focus-visible {
  outline: 4px solid var(--signal);
  outline-offset: 4px;
}

code {
  font-family: "Atkinson Hyperlegible Mono", ui-monospace, monospace !important;
  font-size: 0.92em;
  font-weight: 700;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.masthead {
  width: var(--page);
  min-height: 116px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  border-bottom: 1px solid var(--rule);
}

.identity {
  display: grid;
  grid-template-columns: 56px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  color: var(--ink);
  text-decoration: none;
}

.identity-mark {
  width: 56px;
  height: 56px;
  grid-row: 1 / 3;
  color: var(--ink);
}

.mark-root {
  fill: var(--signal);
}

.mark-tree {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.identity-name {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.identity-long {
  margin-top: 5px;
  color: #46526b;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 28px;
}

nav a {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

nav a:hover {
  color: var(--authority);
}

nav a[aria-current="page"] {
  color: var(--authority);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

main {
  position: relative;
  width: var(--page);
  margin: 0 auto;
  padding-left: 74px;
}

.root-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--line-x);
  width: 2px;
  background: var(--authority);
  transform-origin: top;
  animation: draw-root 800ms cubic-bezier(.2,.75,.2,1) both;
}

.root-line::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 7px var(--paper);
}

.branch {
  position: relative;
}

.branch::before {
  content: "";
  position: absolute;
  top: 58px;
  left: -44px;
  width: 44px;
  height: 2px;
  background: var(--authority);
}

.hero {
  min-height: 650px;
  padding: 126px 0 112px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  align-items: start;
  gap: clamp(48px, 7vw, 100px);
}

.page-hero {
  min-height: 500px;
  padding: 116px 0 92px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.page-hero h1 {
  max-width: 980px;
  margin-bottom: 30px;
  font-size: clamp(3.6rem, 8vw, 7rem);
}

.eyebrow,
.record-label,
.section-number {
  margin: 0;
  color: var(--authority);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 850px;
  margin: 12px 0 28px;
  font-size: clamp(3.5rem, 8vw, 7.2rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.065em;
}

.lede {
  max-width: 760px;
  margin: 0;
  color: #35415a;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 2px solid var(--authority);
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: var(--authority);
  color: var(--white);
}

.button-secondary {
  background: transparent;
  color: var(--authority);
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.boundary {
  margin-top: 34px;
  border-top: 8px solid var(--signal);
  background: var(--mist);
  padding: 26px;
}

.boundary dl {
  margin: 16px 0 0;
}

.boundary dl div {
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.boundary dt {
  margin-bottom: 5px;
  font-weight: 800;
}

.boundary dd {
  margin: 0;
  color: #44516a;
  font-size: 0.91rem;
}

.boundary > p:not(.record-label) {
  margin: 18px 0 0;
  color: #3d4961;
}

.boundary > p + p {
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
}

.section-heading {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: baseline;
  margin-bottom: 44px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.section-intro {
  max-width: 800px;
  margin: 0;
  color: #35415a;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
}

.authority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.authority-grid article {
  min-height: 250px;
  padding: 34px;
  background: var(--white);
}

.authority-grid article:last-child {
  background: var(--mist);
}

.authority-grid h3 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.authority-grid p {
  margin: 0;
  color: #3d4961;
}

.text-link {
  display: inline-block;
  margin-top: 24px;
  font-weight: 800;
}

.analogy-note,
.comparison-callout,
.membership-note {
  max-width: 920px;
  margin: 38px 0 0;
  padding: 24px 28px;
  border-left: 8px solid var(--signal);
  background: var(--mist);
  color: #35415a;
}

.comparison-callout p:last-child {
  margin: 12px 0 0;
}

.prose-measure {
  max-width: 820px;
  color: #35415a;
  font-size: 1.14rem;
}

.prose-measure p:first-child {
  margin-top: 0;
}

.role-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--rule);
  background: var(--white);
}

.role-comparison article {
  padding: 34px;
}

.role-comparison h3 {
  margin: 12px 0 22px;
  font-size: 1.7rem;
}

.role-comparison ul {
  margin: 0;
  padding-left: 1.2em;
}

.role-comparison li + li {
  margin-top: 12px;
}

.decision-flow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 58px;
  padding: 20px 12px;
  background: var(--authority);
  color: var(--white);
  font-family: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.decision-flow span:first-child::after {
  content: " →";
  color: var(--signal);
}

.decision-flow span:last-child::before {
  content: "← ";
  color: var(--signal);
}

.root-process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 52px;
  border-top: 2px solid var(--authority);
}

.root-process > div {
  position: relative;
  min-height: 190px;
  padding: 28px 24px;
  border-right: 1px solid var(--rule);
}

.root-process > div::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 25px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--authority);
}

.root-process .process-result {
  background: var(--authority);
  color: var(--white);
}

.root-process .process-result::before {
  background: var(--signal);
}

.process-index,
.root-process strong,
.root-process span:last-child {
  display: block;
}

.process-index {
  margin-bottom: 26px;
  font-family: "Atkinson Hyperlegible Mono", ui-monospace, monospace !important;
  font-size: 0.75rem;
}

.root-process strong {
  font-size: 1.05rem;
}

.root-process span:last-child {
  margin-top: 7px;
  color: #56627a;
  font-size: 0.82rem;
}

.root-process .process-result span:last-child {
  color: #dce4f5;
}

.control-ledger {
  border-top: 2px solid var(--authority);
}

.control-ledger > div {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1.4fr);
  gap: 38px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--rule);
}

.control-ledger p {
  margin: 0;
  color: #4b5870;
}

.nic-preview {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}

.nic-preview:hover {
  background: var(--mist);
}

.nic-preview strong,
.nic-preview small {
  display: block;
}

.nic-preview strong {
  font-size: 1.7rem;
}

.nic-preview small {
  margin-top: 6px;
  color: #56627a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.namespace-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.namespace-pair code {
  padding: 10px 14px;
  background: var(--mist);
  color: var(--authority);
  font-size: 1.4rem;
}

.nic-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  border-top: 2px solid var(--authority);
  border-bottom: 1px solid var(--rule);
}

.nic-card-heading {
  padding: 34px 28px 34px 8px;
  border-right: 1px solid var(--rule);
}

.nic-card-heading h3 {
  margin: 10px 0 26px;
  font-size: 2rem;
}

.nic-card-heading a {
  font-weight: 800;
}

.nic-namespaces > div {
  padding: 28px 34px;
}

.nic-namespaces > div + div {
  border-top: 1px solid var(--rule);
}

.nic-namespaces code {
  color: var(--ink);
  font-size: 1.6rem;
}

.nic-namespaces p {
  margin: 8px 0 0;
  color: #3d4961;
}

.registry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 72px;
}

.registry-actions {
  border-top: 2px solid var(--authority);
}

.registry-actions a {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.registry-actions a:hover {
  color: var(--authority);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 30px;
}

.ledger {
  border-top: 2px solid var(--authority);
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 1fr) 110px;
  gap: 28px;
  align-items: center;
  min-height: 112px;
  padding: 20px 12px;
  border-bottom: 1px solid var(--rule);
}

.ledger-row > div span,
.ledger-row > div code {
  display: block;
}

.ledger-row > div code {
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.ledger-row p {
  margin: 0;
  color: #4b5870;
}

.ledger-row > a,
.ledger-state {
  justify-self: end;
  font-size: 0.85rem;
  font-weight: 800;
}

.ledger-state {
  color: #5b6780;
}

footer {
  width: var(--page);
  margin: 0 auto;
  padding: 46px 0 64px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  border-top: 8px solid var(--ink);
  color: #4b5870;
  font-size: 0.82rem;
}

footer p {
  margin: 0;
}

@keyframes draw-root {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@media (max-width: 820px) {
  :root {
    --page: min(100% - 28px, 680px);
    --line-x: 10px;
  }

  .masthead {
    min-height: 0;
    padding: 22px 0;
    align-items: flex-start;
  }

  .identity {
    grid-template-columns: 44px auto;
    column-gap: 10px;
  }

  .identity-mark {
    width: 44px;
    height: 44px;
  }

  .identity-name {
    font-size: 1.35rem;
  }

  .identity-long {
    display: none;
  }

  nav {
    max-width: 220px;
    gap: 8px 16px;
  }

  nav a {
    padding: 5px 0;
  }

  main {
    padding-left: 40px;
  }

  .branch::before {
    left: -30px;
    width: 30px;
  }

  .hero {
    min-height: 0;
    padding: 88px 0 82px;
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .page-hero {
    min-height: 420px;
    padding: 84px 0 72px;
  }

  h1 {
    font-size: clamp(3.4rem, 14vw, 5.4rem);
  }

  .boundary {
    margin-top: 0;
  }

  .authority-grid,
  .registry-layout,
  .role-comparison {
    grid-template-columns: 1fr;
  }

  .decision-flow {
    min-height: 88px;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
  }

  .decision-flow span:first-child::after {
    content: " ↓";
  }

  .decision-flow span:last-child::before {
    content: "↑ ";
  }

  .root-process {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .root-process > div:nth-child(2) {
    border-right: 0;
  }

  .ledger-row {
    grid-template-columns: 1fr auto;
    gap: 10px 20px;
  }

  .ledger-row p {
    grid-column: 1;
  }

  .ledger-row > a,
  .ledger-state {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

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

@media (max-width: 560px) {
  .masthead {
    display: block;
  }

  nav {
    max-width: none;
    margin-top: 20px;
    justify-content: flex-start;
  }

  main {
    padding-left: 34px;
  }

  h1 {
    font-size: clamp(3.1rem, 17vw, 4.5rem);
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .nic-card,
  .control-ledger > div {
    grid-template-columns: 1fr;
  }

  .nic-card,
  .control-ledger > div {
    gap: 14px;
  }

  .nic-card-heading {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .nic-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .section {
    padding: 72px 0;
  }

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

  .authority-grid article {
    min-height: 0;
    padding: 26px;
  }

  .root-process {
    grid-template-columns: 1fr;
  }

  .root-process > div,
  .root-process > div:nth-child(2) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .ledger-row {
    display: block;
    padding: 22px 4px;
  }

  .ledger-row p {
    margin-top: 12px;
  }

  .ledger-row > a,
  .ledger-state {
    display: inline-block;
    margin-top: 14px;
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 20px;
  }
}

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

  .root-line {
    animation: none;
  }
}
