:root {
  --bg: #0a0b0d;
  --bg-2: #0f1114;
  --fg: #f2f3f5;
  --muted: #9ba1ab;
  --line: #242830;
  --panel: #111419;
  --soft: #1a1f27;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(86, 103, 140, 0.15), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(123, 93, 52, 0.12), transparent 40%),
    var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.4;
  min-height: 100vh;
}

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

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-toggle {
  display: none;
}

.nav-toggle-button {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.nav-toggle:focus-visible + .nav-toggle-button {
  outline: 2px solid #9fc0ff;
  outline-offset: 2px;
}

.nav-toggle-button span {
  width: 16px;
  height: 1.5px;
  background: var(--fg);
  border-radius: 99px;
  transform-origin: center;
  transition: transform 140ms ease, opacity 120ms ease;
}

.nav-toggle:checked + .nav-toggle-button {
  border-color: #4f617f;
  background: rgba(79, 97, 127, 0.12);
}

.nav-toggle:checked + .nav-toggle-button span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.nav-toggle:checked + .nav-toggle-button span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-toggle-button span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.brand img {
  display: block;
  height: 18px;
  width: auto;
}

.links {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.links a:hover,
.links a:focus-visible {
  color: var(--fg);
}

.hero {
  padding: 32px 0 46px;
  max-width: 760px;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

.hero h1 {
  margin: 0 auto;
  max-width: none;
  font-size: clamp(34px, 7vw, 66px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 600;
  white-space: nowrap;
}

.lede {
  margin: 20px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
  width: 100%;
  max-width: 620px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.button:hover,
.button:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: #3b4352;
  color: var(--fg);
}

.button.primary {
  background: var(--fg);
  color: #0b0c0f;
  border-color: var(--fg);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #e7edf7;
  border-color: #e7edf7;
  box-shadow: 0 0 0 1px rgba(231, 237, 247, 0.35);
}

.preview {
  margin-top: 6px;
}

.window {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.window-bar {
  height: 42px;
  background: #0d1014;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.window-bar span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #3a404c;
}

.window-body {
  min-height: 360px;
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
}

.viewer-grid {
  background: var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
}

.tile {
  min-height: 150px;
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.06), transparent 45%),
    linear-gradient(135deg, #111111 0%, #1c1c1c 45%, #0b0b0b 100%);
}

.tile-b {
  background:
    radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.05), transparent 50%),
    linear-gradient(140deg, #151515, #070707);
}

.tile-c {
  background:
    radial-gradient(circle at 35% 65%, rgba(255, 255, 255, 0.06), transparent 45%),
    linear-gradient(120deg, #0d0d0d, #171717);
}

.tile-d {
  background:
    radial-gradient(circle at 65% 70%, rgba(255, 255, 255, 0.05), transparent 50%),
    linear-gradient(160deg, #121212, #090909);
}

.side-notes {
  background: var(--bg-2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.side-notes p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--soft);
  border-radius: 10px;
  background: #12161d;
}

.notes {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  text-align: center;
}

.note h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.note p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: rgba(12, 14, 18, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 2000;
  backdrop-filter: blur(6px);
}

.cookie-banner.is-hidden {
  display: none;
}

.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-content p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-decline {
  color: var(--fg);
}

@media (max-width: 720px) {
  .cookie-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-actions .button {
    flex: 1 1 auto;
  }
}

.footer {
  margin-top: auto;
  padding-top: 28px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

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

.footer a:hover,
.footer a:focus-visible {
  color: var(--fg);
}

.doc {
  max-width: 780px;
  margin: 40px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.doc h1 {
  margin: 0 0 18px;
  color: var(--fg);
  font-size: clamp(28px, 5vw, 40px);
}

.doc-updated {
  margin: -10px 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.doc p {
  margin: 0 0 14px;
}

.download-button-note {
  margin: 10px 0 14px;
  font-size: 14px;
}

.doc ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.doc p a,
.doc li a {
  color: #9fc0ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc p a:hover,
.doc p a:focus-visible,
.doc li a:hover,
.doc li a:focus-visible {
  color: #c7dcff;
}

.doc pre {
  margin: 0 0 14px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1218;
  padding: 12px;
}

.doc pre code {
  display: block;
  white-space: pre;
}

.docs-shell {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-nav-link {
  display: block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}

.docs-nav-link:hover,
.docs-nav-link:focus-visible {
  border-color: var(--line);
  color: var(--fg);
}

.docs-nav-link.is-active {
  border-color: #4f617f;
  color: var(--fg);
  background: rgba(79, 97, 127, 0.08);
}

.docs-nav-sub {
  margin: 2px 0 6px 14px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-sublink {
  display: block;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 13px;
}

.docs-nav-sublink:hover,
.docs-nav-sublink:focus-visible {
  border-color: var(--line);
  color: var(--fg);
}

.docs-nav-sublink.is-active {
  border-color: #4f617f;
  color: var(--fg);
  background: rgba(79, 97, 127, 0.08);
}

.docs-main.doc {
  margin: 0;
  max-width: none;
  min-width: 0;
}

.doc-toc {
  margin: 0 0 20px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.doc-toc-title {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-toc nav ul {
  margin: 0;
  padding-left: 16px;
}

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

.doc-toc a:hover,
.doc-toc a:focus-visible {
  color: var(--fg);
}

.doc-list {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.doc-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 120ms ease, background-color 120ms ease;
}

.doc-card:hover,
.doc-card:focus-visible {
  border-color: #4f617f;
  background: rgba(79, 97, 127, 0.08);
}

.doc-card h2 {
  margin: 0 0 6px;
  color: var(--fg);
  font-size: 18px;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.doc-chip-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.doc-chip {
  flex: 0 0 auto;
}

.mobile-docs-links {
  display: none;
}

@media (max-width: 860px) {
  .nav {
    position: relative;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav-toggle {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .nav-toggle-button {
    display: inline-flex;
  }

  .links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: rgba(17, 20, 25, 0.96);
  }

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

  .links > a {
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
  }

  .links > a:hover,
  .links > a:focus-visible {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.03);
  }

  .mobile-docs-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .hero {
    padding: 24px 0 28px;
  }

  .window-body {
    grid-template-columns: 1fr;
  }

  .side-notes {
    border-top: 1px solid var(--line);
  }

  .notes {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .footer > * {
    white-space: nowrap;
  }

  .hero h1 {
    white-space: normal;
  }

  .doc-list {
    grid-template-columns: 1fr;
  }

  .docs-shell {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .docs-sidebar {
    display: none;
  }
}
