:root {
  --space-indigo: #2b2d42;
  --lavender-grey: #8d99ae;
  --platinum: #edf2f4;
  --strawberry-red: #ef233c;
  --flag-red: #d90429;
  --bg: #1f2235;
  --panel: #252a40;
  --text: #edf2f4;
  --muted: #cfd4de;
  --line: #3b4261;
  --accent: #ef233c;
  --header-offset: 84px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top right, #31385b 0%, #1f2235 42%, #171a2d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.65;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--platinum);
  text-decoration-color: var(--lavender-grey);
}

a:hover {
  color: var(--strawberry-red);
}

.skip-link {
  position: absolute;
  left: -10000px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--platinum);
  color: var(--space-indigo);
  padding: 0.6rem;
  border-radius: 0.4rem;
  z-index: 1000;
}

.wrap {
  width: min(1240px, 94vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(31, 34, 53, 0.86);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #2a2f49;
  color: var(--platinum);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.menu-toggle:hover {
  background: #363e61;
}

.app-nav {
  display: block;
}

.app-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.38rem 0.62rem;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.app-nav-list a:hover {
  border-color: var(--line);
  background: rgba(141, 153, 174, 0.12);
}

.app-nav-list a[aria-current="page"] {
  border-color: rgba(239, 35, 60, 0.5);
  background: rgba(239, 35, 60, 0.18);
  color: var(--platinum);
}

.nav-icon {
  width: 1.05rem;
  text-align: center;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.page-content {
  padding: 2rem 0 3rem;
  flex: 1;
}

.hero {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: clamp(1.4rem, 2.2vw, 2.4rem);
  background:
    radial-gradient(circle at 12% 12%, rgba(239, 35, 60, 0.2), transparent 35%),
    radial-gradient(circle at 88% 22%, rgba(141, 153, 174, 0.22), transparent 30%),
    linear-gradient(160deg, rgba(239, 35, 60, 0.12), rgba(141, 153, 174, 0.14));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.hero-kicker {
  display: inline-flex;
  margin: 0 0 0.7rem;
  border: 1px solid rgba(141, 153, 174, 0.45);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  color: var(--platinum);
  background: rgba(43, 45, 66, 0.35);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 0;
  line-height: 1.2;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero-icons {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.28rem;
}

.cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 0.95rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  text-decoration: none;
  background: rgba(43, 45, 66, 0.65);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button.primary {
  background: var(--strawberry-red);
  color: white;
  border-color: var(--flag-red);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  border-color: rgba(141, 153, 174, 0.55);
  background: rgba(53, 58, 86, 0.85);
}

.button.primary:hover {
  background: #f33b53;
  border-color: #f33b53;
}

.cta-icon {
  font-size: 1rem;
  line-height: 1;
}

.hub-cards {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  background: var(--panel);
}

.doc-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 2rem;
}

.doc-sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  background: var(--panel);
}

.sidebar-title {
  margin-top: 0;
  font-size: 1rem;
}

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

.sidebar-list li {
  margin: 0.35rem 0;
}

.sidebar-list li.depth-1 {
  padding-left: 0.7rem;
}

.sidebar-list li.depth-2 {
  padding-left: 1.4rem;
}

.sidebar-list li.depth-3 {
  padding-left: 2.1rem;
}

.sidebar-list a[aria-current="page"] {
  color: var(--strawberry-red);
  font-weight: 700;
}

.doc-content {
  min-width: 0;
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
  line-height: 1.25;
}

.doc-content h1 {
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

.doc-content h2,
.doc-content h3 {
  position: relative;
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.2rem;
  text-wrap: pretty;
}

.doc-content h2::after,
.doc-content h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.05rem;
  width: min(220px, 45%);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(239, 35, 60, 0.75), rgba(141, 153, 174, 0.75));
  opacity: 0.75;
  transition: width 0.25s ease, opacity 0.25s ease;
}

.doc-content h2:hover::after,
.doc-content h3:hover::after {
  width: min(280px, 62%);
  opacity: 1;
}

/* Keep hash-link targets visible below the sticky app header. */
.doc-content :is(h1, h2, h3, h4, h5, h6)[id],
.doc-content [id].header-anchor-target {
  scroll-margin-top: calc(var(--header-offset) + 2px);
}

/* Markdown-it-anchor permalink: hide visible hash and make full heading clickable. */
.doc-content :is(h1, h2, h3, h4, h5, h6)[id] {
  position: relative;
}

.doc-content :is(h1, h2, h3, h4, h5, h6)[id] > a.header-anchor {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  font-size: 0;
  color: transparent;
  z-index: 1;
}

.doc-content :is(h1, h2, h3, h4, h5, h6)[id] > a.header-anchor:focus-visible {
  outline: 2px solid rgba(239, 35, 60, 0.75);
  outline-offset: 4px;
  border-radius: 0.35rem;
}

.doc-content :is(h1, h2, h3, h4, h5, h6)[id]:hover {
  color: #ffffff;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.doc-content pre {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #171a2d !important;
  overflow: auto;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(141, 153, 174, 0.1);
}

.doc-content pre[class*="language-"] {
  margin: 1rem 0;
}

.doc-content code[class*="language-"],
.doc-content pre[class*="language-"] {
  color: #edf2f4;
  text-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
}

.doc-content pre[class*="language-"]::-webkit-scrollbar {
  height: 8px;
}

.doc-content pre[class*="language-"]::-webkit-scrollbar-thumb {
  background: rgba(141, 153, 174, 0.45);
  border-radius: 999px;
}

/* Prism token theme aligned with the site's coastal indigo/red palette */
.doc-content .token.comment,
.doc-content .token.prolog,
.doc-content .token.doctype,
.doc-content .token.cdata {
  color: #8d99ae;
  font-style: italic;
}

.doc-content .token.punctuation {
  color: #cfd4de;
}

.doc-content .token.property,
.doc-content .token.tag,
.doc-content .token.constant,
.doc-content .token.symbol,
.doc-content .token.deleted {
  color: #ef233c;
}

.doc-content .token.boolean,
.doc-content .token.number {
  color: #ff9fa9;
}

.doc-content .token.selector,
.doc-content .token.attr-name,
.doc-content .token.string,
.doc-content .token.char,
.doc-content .token.builtin,
.doc-content .token.inserted {
  color: #91f2c5;
}

.doc-content .token.operator,
.doc-content .token.entity,
.doc-content .token.url,
.doc-content .language-css .token.string,
.doc-content .style .token.string {
  color: #b4c0d3;
}

.doc-content .token.atrule,
.doc-content .token.attr-value,
.doc-content .token.keyword {
  color: #8ab4ff;
}

.doc-content .token.function,
.doc-content .token.class-name {
  color: #ffd166;
}

.doc-content .token.regex,
.doc-content .token.important,
.doc-content .token.variable {
  color: #f78fb3;
}

.doc-content .token.important,
.doc-content .token.bold {
  font-weight: 700;
}

.doc-content .token.italic {
  font-style: italic;
}

.copy-code-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #2a2f49;
  color: var(--platinum);
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.copy-code-btn:hover {
  background: #3a4165;
}

.doc-content :where(input[type="checkbox"]) {
  cursor: pointer;
}

.related-guides {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1rem 0 1.3rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
  background: rgba(23, 26, 45, 0.74);
  box-shadow: inset 0 1px 0 rgba(141, 153, 174, 0.12);
  display: block;
  overflow-x: auto;
}

.doc-content thead {
  background: linear-gradient(180deg, rgba(141, 153, 174, 0.16), rgba(43, 45, 66, 0.2));
}

.doc-content th,
.doc-content td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid rgba(59, 66, 97, 0.8);
  border-right: 1px solid rgba(59, 66, 97, 0.6);
  text-align: left;
  vertical-align: top;
}

.doc-content th:last-child,
.doc-content td:last-child {
  border-right: 0;
}

.doc-content tbody tr:nth-child(even) {
  background: rgba(141, 153, 174, 0.07);
}

.doc-content tbody tr:hover {
  background: rgba(239, 35, 60, 0.08);
}

.doc-content th {
  color: #ffffff;
  font-weight: 650;
}

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

.faq-list {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0 1.2rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(145deg, rgba(37, 42, 64, 0.86), rgba(31, 34, 53, 0.95));
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(141, 153, 174, 0.7);
  transform: translateY(-1px);
}

.faq-question {
  margin: 0;
  font-size: 1.02rem;
  color: #ffffff;
}

.faq-question::before {
  content: "Q";
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: rgba(239, 35, 60, 0.2);
  border: 1px solid rgba(239, 35, 60, 0.5);
  font-size: 0.82rem;
  color: #ffd6dc;
}

.faq-answer {
  margin: 0.65rem 0 0;
  padding-left: 1.85rem;
  color: var(--muted);
}

.faq-answer::before {
  content: "A";
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  margin-left: -1.85rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: rgba(141, 153, 174, 0.2);
  border: 1px solid rgba(141, 153, 174, 0.5);
  font-size: 0.82rem;
  color: #d8dfe9;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 2rem;
  background: rgba(0, 0, 0, 0.16);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-nav-list a {
  text-decoration: none;
}

@media (max-width: 960px) {
  .header-inner {
    align-items: center;
  }

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

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .app-nav {
    width: 100%;
    display: none;
    margin-top: 0.6rem;
  }

  .app-nav.is-open {
    display: block;
  }

  .app-nav-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 0.5rem;
    background: rgba(37, 42, 64, 0.92);
  }

  .app-nav-list a {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding: 1.25rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row .button {
    justify-content: flex-start;
  }

  .hub-cards,
  .doc-grid {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
  }
}

@media (min-width: 1440px) {
  .wrap {
    width: min(1360px, 95vw);
  }

  .doc-grid {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 2.4rem;
  }
}

