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

:root,
[data-vk-theme="dark"],
:root:not([data-vk-theme="light"]) {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --hunt-primary: #f59e0b;
  --hunt-secondary: #b45309;
  --hunt-ink: #261600;
  --page-bg: #0a0c10;
  --text: #e8e8ec;
  --text-muted: #9aa1ae;
  --surface: #12151c;
  --surface-border: #252a36;
  --surface-divider: #1e232d;
  --code-bg: #0e1016;
  --code-text: #c9ced8;
  --pass: #4ade80;
  --fail: #f87171;

  --vk-color-primary: #f59e0b;
  --vk-color-primary-hover: #fbbf24;
  --vk-color-primary-active: #d97706;
  --vk-color-primary-light: color-mix(in srgb, #f59e0b 35%, transparent);
  --vk-color-primary-subtle: color-mix(in srgb, #f59e0b 12%, var(--surface));
  --vk-color-on-primary: #261600;
  --vk-color-accent: #b45309;
  --vk-gradient-brand-end: var(--hunt-secondary);
  --vk-font-display: var(--font-display);
  --vk-navbar-max-width: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-vk-theme="light"]) {
    --vk-color-primary: #f59e0b;
    --vk-color-primary-hover: #fbbf24;
    --vk-color-primary-active: #d97706;
    --vk-color-on-primary: #261600;
    --vk-color-accent: #b45309;
  }
}

html {
  overflow-x: clip;
  scrollbar-color: #3a4150 var(--page-bg);
}

body {
  margin: 0;
  font-family: var(--vk-font-family, ui-sans-serif, system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--vk-color-text, var(--text));
  background:
    radial-gradient(ellipse 80% 45% at 50% -8%, color-mix(in srgb, var(--hunt-primary) 14%, transparent), transparent 60%),
    var(--page-bg);
}

::selection {
  background: color-mix(in srgb, var(--hunt-primary) 38%, transparent);
  color: #fff;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--hunt-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--hunt-primary);
  color: var(--hunt-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 0.55rem 0.55rem;
  transform: translateY(-120%);
}

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

.page {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.75rem 5rem;
}

/* Family header */

.brand-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand-slot svg {
  width: 2.1rem;
  height: 2.1rem;
  display: block;
  filter: drop-shadow(0 8px 18px color-mix(in srgb, var(--hunt-primary) 30%, transparent));
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.35rem 0.55rem;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link[aria-current="page"] {
  color: var(--hunt-primary);
}

/* Shared type */

.hero h1,
.section h2,
.close h2,
.guide h1,
.guide h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

/* Code */

pre {
  margin: 0;
  font-family: var(--font-mono);
  scrollbar-width: thin;
  scrollbar-color: #3a4150 transparent;
}

.code,
.guide pre {
  padding: 1.15rem 1.25rem;
  background: var(--code-bg);
  border: 1px solid var(--surface-border);
  border-radius: 0.9rem;
  overflow-x: auto;
  color: var(--code-text);
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 2;
}

.guide pre.out {
  background: color-mix(in srgb, var(--code-bg) 70%, var(--page-bg));
  border-style: dashed;
  color: #aeb4c0;
}

.copy-wrap {
  position: relative;
}

.copy-wrap pre[data-copy] {
  padding-right: 4.75rem;
}

.copy-wrap .copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.45rem;
  background: var(--surface);
  color: var(--text-muted);
  font: 600 0.75rem/1.4 var(--vk-font-family, ui-sans-serif, system-ui, sans-serif);
  cursor: pointer;
}

.copy-wrap .copy-btn:hover,
.copy-wrap .copy-btn:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--hunt-primary) 45%, var(--surface-border));
}

.kw { color: var(--hunt-primary); }
.tag { color: #c4b5fd; }
.str { color: #fcd34d; }
.cmt { color: #6b7380; }
.pass { color: var(--pass); }
.fail { color: var(--fail); }
.dim { color: #6b7380; }

/* Landing */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 2rem;
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.3rem, 4.4vw + 0.4rem, 3.9rem);
  font-weight: 800;
  max-width: 14ch;
}

.lede {
  margin: 0 0 2.25rem;
  max-width: 34rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.release-note {
  margin: 1.75rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.release-note a {
  color: var(--text);
}

.release-note a:hover {
  color: var(--hunt-primary);
}

.hero figure {
  margin: 0;
}

.run-card {
  border: 1px solid color-mix(in srgb, var(--hunt-primary) 24%, var(--surface-border));
  border-radius: 1.1rem;
  background: var(--code-bg);
  overflow: hidden;
}

.run-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--surface-divider);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.run-card-head span:last-child {
  color: color-mix(in srgb, var(--text-muted) 70%, transparent);
}

.run-card pre {
  padding: 1.1rem 1.15rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--code-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.run-card pre + .run-card-head {
  border-top: 1px solid var(--surface-divider);
}

.run-card-note {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.run-card-note a {
  color: var(--text);
}

.section {
  padding: 6rem 0 0;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 2vw + 0.9rem, 2.3rem);
  font-weight: 750;
  max-width: 26ch;
}

.section-lede {
  margin: 0 0 2.5rem;
  max-width: 40rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

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

.gets li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--surface-divider);
  color: var(--text-muted);
}

.gets strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.claims {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}

.claims div {
  padding-top: 1.25rem;
  border-top: 2px solid var(--hunt-primary);
}

.claims dt {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.claims dd {
  margin: 0;
  color: var(--text-muted);
}

.siblings {
  display: grid;
  border-top: 1px solid var(--surface-divider);
}

.sibling {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.5rem 0.25rem;
  border-bottom: 1px solid var(--surface-divider);
  text-decoration: none;
  color: inherit;
  transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sibling:hover {
  background: color-mix(in srgb, var(--hunt-primary) 5%, transparent);
}

.sibling-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.sibling-role {
  display: block;
  font-size: 0.85rem;
  font-family: var(--vk-font-family, ui-sans-serif, system-ui, sans-serif);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--hunt-primary);
}

.sibling p {
  margin: 0;
  color: var(--text-muted);
}

.sibling-url {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sibling:hover .sibling-url {
  color: var(--hunt-primary);
}

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

.flow li {
  counter-increment: flow;
  color: var(--text-muted);
}

.flow li::before {
  content: counter(flow);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border: 1px solid color-mix(in srgb, var(--hunt-primary) 50%, var(--surface-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--hunt-primary) 10%, var(--surface));
  color: var(--hunt-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
}

.glossary {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 3rem;
}

.glossary div {
  padding: 1rem 0;
  border-top: 1px solid var(--surface-divider);
}

.glossary dt {
  font-weight: 700;
  color: var(--text);
}

.glossary dd {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.limits {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 46rem;
  color: var(--text-muted);
}

.limits li + li {
  margin-top: 0.6rem;
}

.close {
  margin-top: 6.5rem;
  padding: 3rem 2.5rem;
  border-radius: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--hunt-primary) 32%, var(--surface-border));
  background:
    radial-gradient(ellipse 80% 80% at 0% 0%, color-mix(in srgb, var(--hunt-primary) 14%, transparent), transparent 55%),
    var(--surface);
}

.close h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.close p {
  margin: 0 0 1.75rem;
  max-width: 38rem;
  color: var(--text-muted);
}

/* Family footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--surface-divider);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--hunt-primary);
}

.gitlab-icon {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 0.25rem;
}

/* Getting started and docs */

.guide-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 3.5rem;
  padding-top: 3rem;
}

.side-nav {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

.side-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.side-nav-label {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--text-muted) 70%, var(--hunt-primary));
}

.side-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.15rem 0 0.15rem 0.75rem;
  border-left: 1px solid var(--surface-divider);
}

.side-nav a:hover {
  color: var(--text);
}

.side-nav a.is-current {
  color: var(--hunt-primary);
  border-left-color: var(--hunt-primary);
}

.guide h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.1rem, 3vw, 2.9rem);
  font-weight: 800;
}

.guide h2 {
  margin: 4rem 0 1rem;
  font-size: 1.5rem;
  font-weight: 750;
  scroll-margin-top: 5rem;
}

.guide h3 {
  margin: 2.25rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  scroll-margin-top: 5rem;
}

.guide h2 code,
.guide h3 code {
  font-size: 0.92em;
  color: var(--text);
}

.guide p,
.guide li,
.guide dd {
  color: var(--text-muted);
}

.guide p {
  margin: 0 0 1.1rem;
  max-width: 44rem;
}

.guide > p:first-of-type {
  max-width: 40rem;
  font-size: 1.12rem;
}

.guide a {
  color: var(--hunt-primary);
  text-decoration: none;
}

.guide a:hover {
  text-decoration: underline;
}

.guide p code,
.guide li code,
.guide dd code,
.guide dt code,
.guide td code {
  color: var(--text);
}

.guide p code,
.guide li code,
.guide dd code,
.guide dt code,
.guide td code {
  overflow-wrap: anywhere;
}

.guide ul,
.guide ol {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  max-width: 44rem;
}

.guide li + li {
  margin-top: 0.4rem;
}

.guide pre,
.guide .copy-wrap {
  margin: 0 0 1.25rem;
}

.guide .copy-wrap pre {
  margin: 0;
}

.guide dl {
  margin: 0 0 1.5rem;
  max-width: 48rem;
}

.guide dt {
  margin-top: 1rem;
  color: var(--text);
  font-weight: 600;
}

.guide dt:first-child {
  margin-top: 0;
}

.guide dd {
  margin: 0.25rem 0 0;
}

.step {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  margin-top: 2rem !important;
}

.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid color-mix(in srgb, var(--hunt-primary) 50%, var(--surface-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--hunt-primary) 10%, var(--surface));
  color: var(--hunt-primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
}

.step span:last-child {
  color: var(--text);
}

.table-wrap {
  margin: 0 0 1.75rem;
  max-width: 100%;
  overflow-x: auto;
}

.guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.guide th,
.guide td {
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--surface-divider);
  text-align: left;
  vertical-align: top;
}

.guide th {
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
}

.guide td {
  color: var(--text-muted);
}

.guide td:first-child {
  white-space: nowrap;
  color: var(--text);
}

.verified {
  margin-top: 4rem;
  padding: 0.5rem 2rem 1rem;
  border: 1px solid color-mix(in srgb, var(--hunt-primary) 28%, var(--surface-border));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--hunt-primary) 5%, var(--surface));
}

.verified h2 {
  margin-top: 1.5rem;
}

/* Responsive */

@media (max-width: 960px) {
  .claims,
  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page {
    padding: 0 1.25rem 3.5rem;
  }

  .hero,
  .gets,
  .glossary,
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero > *,
  .guide-layout > *,
  .run-card,
  .copy-wrap,
  .guide pre {
    min-width: 0;
    max-width: 100%;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.1rem, 9vw, 2.8rem);
  }

  .section {
    padding-top: 4.5rem;
  }

  .sibling {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .guide pre,
  .run-card pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
  }

  .guide-layout {
    gap: 2rem;
    padding-top: 1.75rem;
  }

  .side-nav {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--surface-divider);
  }

  .side-nav-group {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
  }

  .side-nav-label {
    width: 100%;
    margin: 0;
  }

  .side-nav a {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--surface-border);
    border-radius: 0.6rem;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    font-weight: 600;
  }

  .side-nav a.is-current {
    border-color: color-mix(in srgb, var(--hunt-primary) 45%, var(--surface-border));
  }

  .guide thead {
    display: none;
  }

  .guide table,
  .guide tbody,
  .guide tr,
  .guide td {
    display: block;
  }

  .guide tr {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--surface-divider);
  }

  .guide td {
    padding: 0.1rem 0;
    border: 0;
  }

  .guide td:first-child {
    white-space: normal;
    font-weight: 600;
  }

  .verified {
    padding: 0.25rem 1.15rem 0.75rem;
  }

  .close {
    padding: 2rem 1.35rem;
  }
}

@media (max-width: 768px) {
  .nav-link {
    display: block;
    padding: 0.7rem 0.55rem;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .claims,
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .lede {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sibling { transition: none; }
}
