:root {
  color-scheme: dark;
  --bg: #05080d;
  --surface: #09131d;
  --surface-strong: #0d1c29;
  --ink: #f4f8fb;
  --muted: #a9bdc9;
  --cyan: #77e8f3;
  --gold: #e0bd70;
  --rose: #d590aa;
  --line: rgba(119, 232, 243, 0.2);
  --line-soft: rgba(179, 208, 220, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 76% 9%, rgba(71, 155, 177, 0.13), transparent 28rem),
    linear-gradient(180deg, #06101a 0, var(--bg) 38rem);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  min-height: 44px;
  align-items: center;
  background: var(--ink);
  color: #071019;
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 10px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 8, 13, 0.92);
  backdrop-filter: blur(14px);
}

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

.brand img {
  border-radius: 50%;
}

.brand span {
  display: grid;
  line-height: 1.12;
}

.brand strong {
  font-size: 0.9rem;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
}

.site-header nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  overflow: hidden;
}

.site-header nav a,
.language-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav a[aria-current="page"],
.language-link:hover,
.language-link:focus-visible {
  color: var(--cyan);
}

.language-link {
  min-width: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
}

main {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 88px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumbs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
}

.breadcrumbs span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .breadcrumbs {
    overflow: visible;
    flex-wrap: wrap;
    row-gap: 2px;
    white-space: normal;
  }

  .breadcrumbs span:last-child {
    width: 100%;
    overflow: visible;
    color: var(--text);
    line-height: 1.45;
    text-overflow: clip;
  }
}

.article-hero {
  max-width: 820px;
  padding: 50px 0 48px;
}

.section-label {
  margin: 0 0 16px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 750;
}

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

h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.6rem, 6.5vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2 {
  margin: 0 0 20px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead {
  max-width: 65ch;
  margin: 26px 0 0;
  color: #c2d2db;
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 30px;
}

.hero-actions a,
.primary-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.hero-actions .primary-action,
.primary-action {
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--cyan);
  color: #071119;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #a0f5fb;
}

.fact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 26px;
  border-block: 1px solid var(--line-soft);
}

.fact-line span {
  flex: 1 1 220px;
  padding: 17px 22px 17px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.fact-line > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 16px 0 16px 20px;
  color: var(--cyan);
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.fact-line span::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 10px 1px 0;
  border-radius: 50%;
  background: var(--cyan);
  content: "";
}

.prose-section {
  padding: 44px 0;
  border-bottom: 1px solid var(--line-soft);
}

.intent-section p,
.reference-note p {
  max-width: 72ch;
  margin: 0;
  color: #c4d3dc;
  font-size: 1.02rem;
  line-height: 1.78;
}

.proof-contract {
  margin: 18px 0;
  padding: 28px;
  border: 1px solid rgba(119, 232, 243, 0.28);
  border-radius: 10px;
  background: var(--surface);
}

.proof-contract h2 {
  margin-top: 0;
}

.starter-copy {
  margin: 0 0 22px;
}

.starter-copy code {
  display: block;
  padding: 16px;
  border-left: 3px solid var(--gold);
  color: #f5ead0;
  background: #111a23;
  font: 600 0.9rem/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: normal;
}

.proof-contract dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.proof-contract dl > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.proof-contract dt {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 780;
}

.proof-contract dd {
  margin: 0;
  color: #b9ccd7;
  font-size: 0.86rem;
  line-height: 1.65;
}

.proof-contract dd code {
  display: inline-block;
  margin: 0 4px 4px 0;
  color: var(--cyan);
  font: 650 0.72rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.proof-contract dd a {
  color: var(--cyan);
  text-underline-offset: 3px;
}

.proof-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 18px;
  color: #071019;
  background: var(--cyan);
  padding: 0 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 820;
  text-decoration: none;
}

.route-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: route;
}

.route-list li {
  min-height: 190px;
  padding: 24px 28px 20px 0;
  border-top: 1px solid var(--line);
  counter-increment: route;
}

.route-list li + li {
  padding-left: 28px;
  border-left: 1px solid var(--line-soft);
}

.route-list li::before {
  display: block;
  margin-bottom: 34px;
  color: var(--gold);
  font: 700 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  content: "0" counter(route);
}

.route-list strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
}

.route-list p,
.signal-list,
.qa-list dd,
.related a span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.route-list p {
  margin: 0;
}

.split-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.split-sections .prose-section {
  min-width: 0;
}

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

.signal-list li {
  position: relative;
  padding: 13px 0 13px 24px;
  border-top: 1px solid var(--line-soft);
}

.signal-list li::before {
  position: absolute;
  top: 21px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  content: "";
}

.boundary .signal-list li::before {
  background: var(--rose);
}

.qa-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 0;
}

.qa-list div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.qa-list dt {
  margin-bottom: 9px;
  font-weight: 760;
}

.qa-list dd {
  margin: 0;
}

.related {
  padding: 52px 0 0;
}

.related > div {
  border-top: 1px solid var(--line-soft);
}

.related a {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}

.related a:hover strong,
.related a:focus-visible strong {
  color: var(--cyan);
}

.library-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 62px;
  min-height: 570px;
  padding: 56px 0;
}

.library-hero h1 {
  max-width: 11ch;
}

.library-hero .primary-action {
  margin-top: 30px;
}

.library-hero img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.guide-directory {
  padding: 60px 0 26px;
}

.guide-directory > div {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.guide-directory a {
  display: grid;
  grid-template-columns: 44px minmax(190px, 0.8fr) minmax(0, 1.2fr) 24px;
  align-items: start;
  gap: 20px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}

.guide-directory a > span {
  color: var(--gold);
  font: 700 0.72rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.guide-directory a strong {
  line-height: 1.4;
}

.guide-directory a p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.guide-directory a b {
  color: var(--muted);
  font-size: 0.8rem;
}

.guide-directory a:hover strong,
.guide-directory a:focus-visible strong,
.guide-directory a:hover b,
.guide-directory a:focus-visible b {
  color: var(--cyan);
}

.reference-note {
  max-width: 760px;
  margin-top: 54px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.reference-note p + p {
  margin-top: 18px;
}

.reference-note a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--cyan);
}

footer {
  display: flex;
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 42px;
  border-top: 1px solid var(--line-soft);
  justify-content: space-between;
  gap: 22px;
  color: var(--muted);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

footer a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding-inline: 6px;
  text-decoration: none;
}

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

@media (max-width: 820px) {
  .site-header {
    gap: 14px;
  }

  .site-header nav {
    display: none;
  }

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

  .library-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .library-hero img {
    max-width: 620px;
  }

  .route-list,
  .split-sections,
  .qa-list {
    grid-template-columns: 1fr;
  }

  .route-list li {
    min-height: 0;
  }

  .route-list li + li {
    padding-left: 0;
    border-left: 0;
  }

  .guide-directory a {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
  }

  .guide-directory a p {
    grid-column: 2 / -1;
  }
}

@media (max-width: 540px) {
  main,
  footer {
    width: min(100% - 28px, 1080px);
  }

  main {
    padding-top: 20px;
  }

  .article-hero {
    padding: 34px 0 38px;
  }

  h1 {
    font-size: clamp(2.35rem, 13.5vw, 3.7rem);
  }

  .library-hero {
    gap: 38px;
    padding: 42px 0;
  }

  .library-hero img {
    aspect-ratio: 1.9;
    object-fit: cover;
  }

  .fact-line span {
    flex-basis: 100%;
    padding: 12px 0;
  }

  .fact-line > a {
    width: 100%;
    padding: 14px 0;
  }

  .prose-section {
    padding: 36px 0;
  }

  .proof-contract {
    padding: 22px 18px;
  }

  .proof-contract dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .related a {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  footer {
    display: grid;
  }

  footer nav {
    justify-content: flex-start;
  }
}

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