:root {
  --bg: #06080d;
  --bg-secondary: #0b0f19;
  --panel: #111827;
  --panel-card: rgba(15, 23, 42, 0.75);
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(56, 189, 248, 0.35);
  --ink: #f8fafc;
  --muted: #94a3b8;
  --paper: #06080d;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.1);
  --violet: #a78bfa;
  --glow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 30px -5px rgba(56, 189, 248, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
  background-color: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background: radial-gradient(circle at 50% -20%, rgba(56, 189, 248, 0.12), transparent 55%),
              radial-gradient(circle at 90% 40%, rgba(167, 139, 250, 0.08), transparent 45%),
              var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

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

button {
  font: inherit;
  cursor: pointer;
}

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

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

h1, h2, h3 {
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 750;
  color: #ffffff;
}

h1 {
  font-size: clamp(3rem, 6.2vw, 4.8rem);
  margin-bottom: 24px;
}

h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.35rem;
}

main, .nav, footer {
  max-width: 1220px;
  margin: auto;
  padding-inline: 36px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.brand:hover {
  text-decoration: none;
}

.mark {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #ffffff;
  font-weight: 900;
  font-size: 15px;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: normal;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

nav {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  font-weight: 500;
}

nav a {
  color: var(--muted);
}

nav a:hover {
  color: #ffffff;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 60px;
  align-items: center;
  padding-block: 80px 90px;
}

.hero > *, .start > *, .limits > *, .example-body > *, .steps > * {
  min-width: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.eyebrow-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.lead {
  font-size: 1.18rem;
  line-height: 1.65;
  max-width: 520px;
  color: #cbd5e1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 650;
  transition: all 0.2s ease;
}

.primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
}

.primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.5);
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

.secondary:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  text-decoration: none;
}

.fine, .caption {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.paper {
  background: linear-gradient(180deg, rgba(20, 29, 47, 0.85) 0%, rgba(11, 16, 26, 0.85) 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--glow);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.paper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent);
}

.paper-head {
  font-size: 0.82rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
}

.paper blockquote {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.55;
  margin: 0 0 14px;
  color: #f1f5f9;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

.paper h2 {
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

.paper p:not(.eyebrow):not(.caption):not(.fine) {
  font-size: 0.95rem;
  color: #cbd5e1;
}

.rule {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
  background: var(--green-bg);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 650;
  margin: 4px 6px 14px 0;
  border-radius: 6px;
}

/* Steps Grid */
.steps {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-block: 48px;
}

.steps article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.steps article:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
}

.steps h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.steps p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.number {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-block;
  margin-bottom: 14px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Sections */
.section {
  padding-block: 84px;
}

.section-title {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-title > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
}

/* Example Box */
.example {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.8) 0%, rgba(10, 15, 26, 0.95) 100%);
  overflow: hidden;
  box-shadow: var(--glow);
}

.example-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 8px;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.example-tabs button {
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}

.example-tabs button:hover {
  color: #ffffff;
}

.example-tabs .selected {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.3);
}

.example-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 45px;
  padding: 36px;
}

.example-body blockquote {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.55;
  margin: 0 0 20px;
  color: #f1f5f9;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

.example-body ol {
  padding-left: 20px;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.example-body li {
  padding-bottom: 10px;
}

.example-body a {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Start / Onboarding */
.start {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
}

.start p {
  color: var(--muted);
}

.copy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 15, 26, 0.8);
  padding: 14px 16px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.copy-box:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.copy-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  color: #38bdf8;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}

.copy-box button, .verify {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.copy-box button:hover, .verify:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent);
}

.status {
  min-height: 24px;
  font-size: 0.84rem;
  color: var(--green);
}

.start-aside {
  padding: 32px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 29, 47, 0.6) 0%, rgba(15, 23, 42, 0.4) 100%);
  border: 1px solid var(--line);
  align-self: start;
}

.start-aside h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.start-aside blockquote {
  margin: 0 0 24px;
  border-left: 2px solid var(--green);
  padding-left: 16px;
  font-style: italic;
  color: #e2e8f0;
}

pre {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  background: #04060a;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: #38bdf8;
  margin-bottom: 16px;
}

pre code {
  color: inherit;
}

.start-aside a {
  font-size: 0.86rem;
  display: inline-block;
  margin-top: 12px;
}

/* Limits */
.limits {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
}

.limits p {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.7;
}

.limits a {
  font-size: 0.9rem;
}

/* Footer */
footer {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-block: 36px;
  font-size: 0.84rem;
  color: var(--muted);
}

footer .brand {
  margin-right: auto;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: #ffffff;
}

.skip {
  position: absolute;
  left: 15px;
  top: -100px;
  background: var(--accent);
  color: #000000;
  padding: 12px 18px;
  font-weight: 700;
  border-radius: 6px;
  z-index: 100;
}

.skip:focus {
  top: 15px;
}

/* Catalog for registry.html */
.catalog {
  max-width: 860px;
}

.catalog-card {
  padding: 36px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 29, 47, 0.75) 0%, rgba(11, 16, 26, 0.9) 100%);
  border-radius: 16px;
  box-shadow: var(--glow);
}

.catalog-card h2 {
  font-size: 2.2rem;
}

.catalog-card .actions {
  margin-bottom: 14px;
}

.catalog-card dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  font-size: 0.9rem;
  margin: 20px 0;
}

.catalog-card dt {
  color: var(--muted);
  font-weight: 600;
}

.catalog-card dd {
  margin: 0;
  color: #cbd5e1;
}

.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--accent);
  overflow-wrap: anywhere;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

details {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--accent);
}

.source {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
}

.error {
  color: #f87171;
}

/* Feature Pillars Grid (for Moat) */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.pillar-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pillar-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.pillar-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.pillar-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  main, .nav, footer {
    padding-inline: 20px;
  }
  .nav {
    padding-block: 16px;
    flex-wrap: wrap;
    gap: 16px;
  }
  nav {
    gap: 16px;
    font-size: 0.85rem;
    flex-wrap: wrap;
    width: 100%;
  }
  nav a:first-child {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-block: 48px;
  }
  .pillar-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .paper {
    padding: 24px;
  }
  .hero h1 {
    font-size: 2.8rem;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .section {
    padding-block: 54px;
  }
  .start, .limits {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .example-body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .example-tabs button {
    padding: 8px 12px;
    font-size: 0.8rem;
    flex: 1;
  }
  .catalog-card {
    padding: 22px;
  }
  .catalog-card dl {
    grid-template-columns: 100px 1fr;
  }
  .start-aside {
    padding: 24px;
  }
  footer {
    gap: 16px;
  }
  footer span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
