:root {
  color-scheme: dark;
  --bg: #0D0D0D;
  --card: #17191F;
  --card2: #21242B;
  --divider: #2A2D34;
  --ink: #FFFFFF;
  --muted: #9CA3AF;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #6C63FF;
  --accent-l: #8B83FF;
  --lime: #E4FF3A;
  --lime-ink: #1a1e00;
  --teal: #22BFAF;
  --teal-d: #149B8D;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shell: min(1180px, calc(100% - 40px));
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(108, 99, 255, 0.5);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: 16px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

.site-shell {
  width: var(--shell);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 13, 13, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-toggle-input {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current='page'] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.nav-links a:active {
  transform: scale(0.96);
}

.nav-hamburger {
  position: relative;
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle-input {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.nav-hamburger span {
  position: absolute;
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav-hamburger span:nth-child(1) {
  transform: translateY(-7px);
}

.nav-hamburger span:nth-child(3) {
  transform: translateY(7px);
}

.nav-toggle-input:focus-visible ~ .nav-hamburger {
  outline: 3px solid rgba(108, 99, 255, 0.5);
  outline-offset: 3px;
}

.nav-toggle-input:checked ~ .nav-hamburger span:nth-child(1) {
  transform: rotate(45deg);
}

.nav-toggle-input:checked ~ .nav-hamburger span:nth-child(2) {
  opacity: 0;
}

.nav-toggle-input:checked ~ .nav-hamburger span:nth-child(3) {
  transform: rotate(-45deg);
}

.hero {
  padding: 76px 0 40px;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.doc-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.hero-card,
.panel,
.doc-section,
.table-wrap {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  min-width: 0;
  border-radius: var(--radius-xl);
  padding: 34px;
}

.panel {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 24px;
}

.doc-section {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(108, 99, 255, 0.22);
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent-l);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

h1 {
  margin-top: 18px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 14px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.lede,
.doc-section p,
.doc-section li,
.panel p,
table,
.note,
.callout p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.lede {
  max-width: 62ch;
  margin-top: 22px;
  font-size: 1.08rem;
}

.doc-section p + p,
.doc-section p + ul,
.doc-section ul + p {
  margin-top: 14px;
}

.doc-section ul,
.doc-section ol {
  margin-top: 16px;
  padding-left: 18px;
}

.doc-section li {
  margin: 10px 0;
}

.doc-section strong,
.panel strong {
  color: var(--ink);
}

.doc-section a.inline-link {
  color: var(--accent-l);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.callout {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(108, 99, 255, 0.15);
  border-radius: 18px;
  background: rgba(108, 99, 255, 0.07);
}

.callout strong {
  display: block;
  margin-bottom: 6px;
}

.sidebar {
  position: sticky;
  top: 104px;
  display: grid;
  align-self: start;
  gap: 16px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav a {
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--muted);
}

.sidebar nav a:hover,
.sidebar nav a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.site-footer {
  padding: 18px 0 42px;
}

.site-footer .panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-note {
  max-width: 60ch;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.button-secondary:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-card,
  .panel,
  .doc-section {
    animation: rise 520ms ease both;
  }

  .panel:nth-child(2),
  .doc-section:nth-child(2) {
    animation-delay: 60ms;
  }

  .doc-section:nth-child(3) {
    animation-delay: 100ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .site-header {
    background: rgba(13, 13, 13, 0.9);
  }

  .nav-row {
    flex-wrap: wrap;
    min-height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .brand {
    order: 1;
  }

  .nav-hamburger {
    order: 2;
    display: inline-flex;
    margin-left: auto;
  }

  .nav-links {
    order: 3;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
  }

  .nav-toggle-input:checked ~ .nav-links {
    display: flex;
  }

  .nav-links a {
    min-height: 44px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.05);
  }

  .hero {
    padding: 48px 0 32px;
  }
}

@media (max-width: 720px) {
  :root {
    --shell: min(1180px, calc(100% - 20px));
  }

  .sidebar {
    display: none;
  }

  .hero-card,
  .panel,
  .doc-section {
    padding: 22px;
  }

  .site-footer .panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-secondary {
    width: 100%;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 14px;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 4rem);
  }
}

@media (max-width: 480px) {
  :root {
    --shell: min(1180px, calc(100% - 16px));
  }

  .brand {
    gap: 10px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .hero {
    padding-top: 28px;
  }

  .doc-main {
    gap: 14px;
  }

  .hero-card,
  .panel,
  .doc-section {
    padding: 18px;
  }

  .eyebrow {
    font-size: 0.76rem;
  }

  .lede,
  .doc-section p,
  .doc-section li,
  .panel p,
  table,
  .note,
  .callout p {
    font-size: 0.96rem;
  }

  .pill {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  table {
    min-width: 540px;
  }

  th,
  td {
    padding: 12px;
  }
}
