@font-face {
  font-family: Roboto;
  src: url("fonts/roboto-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --deep: #062a33;
  --current: #0c3d49;
  --shallows: #134b59;
  --cyan: #22d3ee;
  --pearl: #a5f3fc;
  --foam: #e6fbff;
  --mist: #8fb3bb;
  --drift: #5f8f99;
  --night: #071316;
  --ink: #0e7490;
  --page: #04191f;
  --card: #0a2229;
  --card-hover: #0d2d36;
  --line: #16353d;
  --font: Roboto, "Google Sans", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1360px;
  --header-height: 64px;
  --sidebar-width: 270px;
  --toc-width: 230px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--page);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--foam);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--pearl); text-decoration: underline; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::selection {
  background: var(--cyan);
  color: var(--deep);
}

.skip {
  position: absolute;
  left: 16px;
  top: 0;
  transform: translateY(-120%);
  background: var(--cyan);
  color: var(--deep);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 100;
  transition: transform 0.2s ease;
}
.skip:focus { transform: translateY(12px); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background: rgba(4, 25, 31, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--wrap);
  height: 100%;
  margin-inline: auto;
  padding: 0 clamp(16px, 3vw, 32px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--foam);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
}
.menu-toggle:hover {
  background: var(--current);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pearl);
  text-decoration: none;
}
.lockup:hover { text-decoration: none; }
.lockup img {
  width: 22px;
  height: 20px;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--pearl);
}
.brand-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--current);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--shallows);
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin-inline: 16px;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 34px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--foam);
  font: 14px var(--font);
  transition: border-color 0.15s, background-color 0.15s;
}
.search-input:focus {
  border-color: var(--cyan);
  background: var(--night);
}
.search-input::placeholder {
  color: var(--drift);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--drift);
  pointer-events: none;
}

.search-key {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--line);
  color: var(--mist);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.header-links a {
  color: var(--mist);
  font-size: 14px;
  text-decoration: none;
}
.header-links a:hover {
  color: var(--foam);
  text-decoration: none;
}

/* Layout container */
.docs-layout {
  display: flex;
  max-width: var(--wrap);
  width: 100%;
  margin-inline: auto;
  flex: 1;
  padding: 0 clamp(16px, 3vw, 32px);
  gap: 36px;
}

/* Left Sidebar */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 28px 0;
  border-right: 1px solid var(--line);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 20px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--drift);
  margin: 16px 0 6px 12px;
}
.nav-group-title:first-child { margin-top: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--mist);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.nav-link:hover {
  background: var(--card);
  color: var(--foam);
  text-decoration: none;
}
.nav-link.active {
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-weight: 600;
}

.nav-link-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--drift);
  width: 16px;
}
.nav-link.active .nav-link-num {
  color: var(--cyan);
}

/* Main Content */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 32px 0 64px;
  max-width: 52rem;
}

/* Content Elements */
.content-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--foam);
  margin: 0 0 12px;
}

.content-lede {
  color: var(--mist);
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--foam);
  margin: 40px 0 16px;
  padding-top: 16px;
  scroll-margin-top: 80px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--pearl);
  margin: 28px 0 12px;
  scroll-margin-top: 80px;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--foam);
  margin: 20px 0 8px;
}

p, ul, ol {
  margin: 0 0 18px;
  color: var(--foam);
}

ul, ol {
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

/* Code & pre */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--card);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--pearl);
}

pre {
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 20px 0;
  color: var(--foam);
}
pre code {
  background: transparent;
  padding: 0;
  border: 0;
  color: inherit;
  font-size: inherit;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pearl);
  background: var(--deep);
  border: 1px solid var(--shallows);
  border-bottom-width: 2px;
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  text-align: left;
}

th {
  background: var(--current);
  color: var(--pearl);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--foam);
}

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

/* Callout Alerts */
.callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 12px;
  border-left: 4px solid var(--cyan);
  background: var(--card);
  font-size: 15px;
  line-height: 1.5;
}
.callout-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.callout p:last-child {
  margin-bottom: 0;
}

.callout-note {
  border-left-color: var(--cyan);
  background: rgba(34, 211, 238, 0.07);
}
.callout-note .callout-title { color: var(--cyan); }

.callout-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
.callout-warning .callout-title { color: #f59e0b; }

.callout-important {
  border-left-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}
.callout-important .callout-title { color: #c084fc; }

.callout-tip {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.callout-tip .callout-title { color: #34d399; }

/* In-page Right TOC */
.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 32px 0 32px 16px;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--drift);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-link {
  font-size: 13px;
  color: var(--mist);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}
.toc-link:hover {
  color: var(--cyan);
  text-decoration: none;
}
.toc-link.h3 {
  padding-left: 12px;
  font-size: 12.5px;
}

/* Page Navigation Footer */
.page-nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.page-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  text-decoration: none;
  min-width: 180px;
  transition: all 0.15s ease;
}
.page-nav-btn:hover {
  background: var(--card-hover);
  border-color: var(--shallows);
  text-decoration: none;
}
.page-nav-btn.next { text-align: right; margin-left: auto; }

.page-nav-sub {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--drift);
}
.page-nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--pearl);
  margin-top: 4px;
}

/* Search Dropdown / Modal */
.search-results {
  display: none;
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--shallows);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  z-index: 50;
  padding: 8px;
}
.search-results.active { display: block; }

.search-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.1s ease;
}
.search-item:hover,
.search-item.focused {
  background: var(--current);
  text-decoration: none;
}
.search-item-title {
  color: var(--foam);
  font-size: 14px;
  font-weight: 600;
}
.search-item-section {
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.search-item-snippet {
  color: var(--mist);
  font-size: 12.5px;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--mist);
  font-size: 13.5px;
}

/* Mobile responsive */
@media (max-width: 1120px) {
  .docs-toc { display: none; }
  .docs-content { max-width: none; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .header-links { display: none; }
  
  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--page);
    z-index: 30;
    padding: 20px 16px;
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 8px 0 24px rgba(0,0,0,0.5);
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.6);
    z-index: 25;
  }
  .sidebar-backdrop.open { display: block; }

  .page-nav-footer { flex-direction: column; }
  .page-nav-btn { width: 100%; text-align: left; }
  .page-nav-btn.next { text-align: left; margin-left: 0; }
}
