:root {
  --gold: #e5ad2d;
  --gold-strong: #f1c65a;
  --gold-dark: #8d5d12;
  --ink: #0b0d10;
  --ink-2: #11151a;
  --surface: #171c23;
  --surface-2: #202732;
  --surface-3: #263140;
  --cyan: #62d5d0;
  --green: #87d37c;
  --border: #2b3442;
  --text: #eef2f6;
  --muted: #9aa6b5;
  --soft: #c7d0dc;
  --code-bg: #0d1117;
  --scrollbar-track: #0b0d10;
  --scrollbar-thumb: #344052;
  --scrollbar-thumb-hover: #5b687b;
  --radius: 8px;
  --maxw: 1120px;
  --font:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font);
  color: var(--text);
  background:
    linear-gradient(
      180deg,
      rgba(25, 31, 39, 0.84),
      rgba(11, 13, 16, 0.96) 420px
    ),
    var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(229, 173, 45, 0.08),
    transparent 360px
  );
  pointer-events: none;
}

img,
svg {
  display: block;
}

svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

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

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(14px);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand img,
.footer-brand img {
  filter: drop-shadow(0 6px 18px rgba(229, 173, 45, 0.32));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-github {
  display: inline-flex;
  align-items: center;
}

.nav-github svg {
  width: 20px;
  height: 20px;
}

.nav-links a:hover,
.footer-links a:hover,
.text-link:hover {
  color: var(--gold-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #171004;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  box-shadow: 0 12px 28px rgba(141, 93, 18, 0.28);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
  border-color: rgba(98, 213, 208, 0.62);
  background: rgba(98, 213, 208, 0.09);
}

.home-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.hero {
  position: relative;
  flex: 1;
  min-height: min(480px, calc(100vh - 68px));
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(72px, 10vw, 112px) clamp(18px, 5vw, 60px)
    clamp(36px, 5vw, 56px);
}

.hero-content {
  width: min(680px, 100%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 1;
  font-weight: 800;
}

.hero-wordmark {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
}

.letter-i {
  position: relative;
  display: inline-block;
}

.i-stem {
  display: inline-block;
}

.i-dot {
  position: absolute;
  left: 50%;
  top: 0.02em;
  width: 0.32em;
  height: 0.32em;
  transform: translate(-50%, -62%);
  filter: drop-shadow(0 8px 18px rgba(229, 173, 45, 0.42));
}

.hero .eyebrow {
  margin: 18px 0 0;
}

.hero-tagline {
  max-width: none;
  margin: 24px auto 0;
  color: var(--soft);
  font-size: clamp(1.1rem, 2.2vw, 1.38rem);
  line-height: 1.45;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.status-band {
  width: min(var(--maxw), calc(100% - 36px));
  margin: -42px auto 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(23, 28, 35, 0.96),
    rgba(17, 21, 26, 0.96)
  );
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.status-band h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.2;
}

.status-band p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px auto 18px;
  color: var(--muted);
}

.text-link {
  white-space: nowrap;
  color: var(--gold-strong);
  font-weight: 700;
}

.section {
  width: min(var(--maxw), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(72px, 11vw, 118px) 0 0;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.05;
  font-weight: 800;
}

.section-heading p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.section-heading code {
  color: var(--text);
}

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

.feature-card,
.build-card,
.note {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(23, 28, 35, 0.74);
}

.feature-card {
  padding: 24px;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 6px;
  color: #121008;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
}

.feature-card h3,
.build-card h3,
.note h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.feature-card p,
.heritage > p,
.note p {
  margin: 10px 0 0;
  color: var(--muted);
}

.heritage {
  max-width: 820px;
  padding-top: clamp(28px, 5vw, 56px);
  text-align: center;
}

.heritage .section-heading {
  margin-bottom: 18px;
}

.heritage > p {
  margin-right: auto;
  margin-left: auto;
  font-size: 1.08rem;
}

.build-section {
  padding-bottom: 84px;
}

.build-layout {
  display: grid;
  max-width: 920px;
  margin: 0 auto;
  gap: 16px;
}

.build-card {
  overflow: hidden;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.card-heading span {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
}

pre code {
  display: block;
  min-width: 460px;
  padding: 20px 22px;
  color: #d5deea;
  font: 500 0.88rem/1.75 var(--mono);
}

/* Syntax colours, shared by the hand-written snippets on the home page and the
   API reference's generated ones. Three hues and a grey is all the palette
   has, and all a short example needs. */
.tok-comment {
  color: #748094;
  font-style: italic;
}

.tok-string {
  color: var(--green);
}

.tok-number {
  color: var(--gold-strong);
}

.tok-keyword {
  color: var(--cyan);
}

.tok-fn,
.tok-key {
  color: var(--text);
}

.build-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.note {
  overflow: hidden;
  padding: 22px;
}

.note pre {
  margin: 16px -22px -22px;
  border-top: 1px solid var(--border);
}

.note pre code {
  min-width: 360px;
  padding: 18px 22px;
  font-size: 0.8rem;
}

.footer {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(var(--maxw), calc(100% - 36px));
  margin: auto auto 0;
  padding: 32px 0 46px;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-legal {
  margin: 0;
  color: #677386;
  font-size: 0.84rem;
}

/* Documentation page */
.doc-main {
  width: min(var(--maxw), calc(100% - 36px));
  margin: 0 auto;
  /* The footer draws its own rule directly above itself, so the page has to
     leave room for it — without this the pager cards sit on that line. */
  padding: clamp(40px, 7vw, 76px) 0 clamp(48px, 8vw, 88px);
}

.doc-manual {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.doc-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 108px);
  padding-right: 6px;
  overflow-y: auto;
}

/* Custom scrollbars across the whole site, replacing the heavy native ones.
   Firefox uses scrollbar-width/color; WebKit and Chromium use the
   ::-webkit-scrollbar pseudo-elements. Applies to the page and every scroll
   container (sidebars, code blocks, etc.). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  min-height: 36px;
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.doc-sidebar [data-nav] {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
}

.nav-group-title::after {
  content: "\25B6";
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.6rem;
  transition: transform 0.15s ease;
}

.nav-group.open .nav-group-title::after {
  transform: rotate(90deg);
}

.nav-pages {
  margin: 0 0 6px;
  padding: 0 0 0 2px;
  border-left: 1px solid var(--border);
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.nav-group.open .nav-pages {
  max-height: 760px;
}

.nav-pages a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-pages a:hover {
  color: var(--gold-strong);
}

.nav-pages a.active {
  border-left-color: var(--gold);
  color: var(--gold-strong);
  font-weight: 600;
}

.doc-content {
  min-width: 0;
  max-width: 760px;
}

.doc-pager {
  display: flex;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.doc-pager-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(23, 28, 35, 0.74);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.doc-pager-link:hover {
  border-color: rgba(98, 213, 208, 0.5);
  background: rgba(98, 213, 208, 0.07);
}

.doc-pager-next {
  text-align: right;
}

.doc-pager-rel {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-pager-title {
  color: var(--text);
  font-weight: 600;
}

.prose {
  max-width: 720px;
}

.doc-status {
  color: var(--muted);
}

/* Clear the sticky header when an in-page anchor scrolls a heading into view. */
.prose :is(h1, h2, h3, h4) {
  scroll-margin-top: 92px;
}

.prose h1 {
  margin: 56px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-size: 1.85rem;
  line-height: 1.15;
  font-weight: 800;
}

.prose h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h2 {
  margin: 48px 0 0;
  padding-top: 10px;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 800;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose h3 {
  margin: 30px 0 0;
  font-size: 1.14rem;
}

.prose p {
  margin: 14px 0 0;
  color: var(--soft);
}

.prose ul,
.prose ol {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--soft);
}

.prose li {
  margin: 7px 0 0;
}

.prose li::marker {
  color: var(--gold);
}

.prose a {
  color: var(--gold-strong);
  font-weight: 600;
}

.prose a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.prose code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.86em;
}

.prose pre {
  margin: 16px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prose pre code {
  min-width: 0;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  color: #d5deea;
  font-size: 0.84rem;
}

.prose blockquote {
  margin: 18px 0 0;
  padding: 12px 18px;
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  background: rgba(229, 173, 45, 0.06);
  color: var(--soft);
}

.prose blockquote p {
  margin: 0;
}

.doc-table-wrap {
  margin: 16px 0 0;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-2);
}

.prose td {
  color: var(--soft);
}

@media (max-width: 900px) {
  .doc-manual {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .doc-sidebar {
    position: static;
    max-height: none;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .doc-pager {
    flex-direction: column;
  }

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

  .build-notes {
    grid-template-columns: 1fr;
  }

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

  .footer-links {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .nav {
    gap: 12px;
    min-height: 62px;
  }

  .brand span {
    display: none;
  }

  .hero {
    padding: 68px 18px 92px;
  }

  .hero-content {
    padding-top: 0;
  }

  .hero-tagline {
    white-space: normal;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .status-band {
    margin-top: -34px;
    padding: 20px;
  }

  .card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .card-heading span {
    white-space: normal;
  }

  pre code {
    font-size: 0.78rem;
  }
}
