/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --blue:          #2d8cf0;
  --blue-dark:     #1a6fcb;
  --blue-light:    #e8f3fe;
  --dark:          #0f1623;
  --dark-2:        #111827;
  --dark-3:        #1a2233;
  --mid:           #333344;
  --muted:         #6b7a99;
  --nav-text:      #c8d8f0;
  --nav-dim:       rgba(255,255,255,0.05);
  --border:        #e4eaf4;
  --bg:            #f8fafc;
  --white:         #ffffff;
  --header-h:      56px;
  --content-w:     1000px;
  --mono: 'JetBrains Mono', 'Fira Mono', monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --shadow: 0 2px 18px rgba(0,0,0,.07);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  font-family: var(--sans);
  color: var(--mid);
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  background: var(--bg);
}

/* ── Header ────────────────────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(15, 22, 35, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}

/* Logo */
.site-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-header-logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.site-header-logo span {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  padding-left: 10px;
  border-left: 3px solid var(--blue);
  white-space: nowrap;
}
.site-header-logo .version {
  font-size: 12px;
  font-weight: 400;
  color: var(--blue);
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Hamburger toggle (hidden on desktop) ──────────────────────────────── */
.nav-toggle-input {
  display: none;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  z-index: 201;
  order: 3;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle-input:checked ~ .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle-input:checked ~ .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-toggle-input:checked ~ .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Site nav ──────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list > li {
  position: relative;
}
.nav-list > li > a {
  display: block;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-list > li > a:hover,
.nav-list > li:hover > a {
  background: rgba(45,140,240,.15);
  color: var(--blue);
}
.nav-list > li > a.active {
  color: var(--blue);
}

/* Dropdown arrow indicator */
.has-dropdown > a::after {
  content: ' \203A';
  font-size: 14px;
  opacity: .55;
  margin-left: 1px;
}

/* Dropdown panel — top:100% with padding bridges the gap so hover stays active */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  padding: 8px 0 6px;
  min-width: 180px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
  z-index: 300;
  list-style: none;
  margin: 0;
}
.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown {
  display: block;
}
.nav-dropdown li a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 400;
  color: var(--nav-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav-dropdown li a:hover {
  background: rgba(45,140,240,.15);
  color: var(--white);
}
.nav-dropdown li a.active {
  color: var(--blue);
  background: rgba(45,140,240,.08);
  font-weight: 500;
}

/* GitHub button in nav */
.btn-gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45,140,240,.12);
  border: 1px solid rgba(45,140,240,.3);
  color: var(--blue) !important;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
}
.btn-gh:hover {
  background: var(--blue) !important;
  color: var(--white) !important;
  border-color: var(--blue);
}
.btn-gh svg {
  fill: currentColor;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
main {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Article ───────────────────────────────────────────────────────────── */
article {
  padding: 0;
}
article section {
  padding: 56px 64px;
  max-width: var(--content-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
article section:last-child {
  border-bottom: none;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #0a1628 50%, #0d1f38 100%) !important;
  padding: 80px 64px !important;
  border-bottom: 1px solid rgba(45,140,240,.2) !important;
  max-width: 100% !important;
  margin: 0 !important;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--blue);
  border-radius: 50%;
  display: inline-block;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin: 0 0 18px;
}
.hero h1 .accent { color: var(--blue); }
.hero-subtitle {
  font-size: 17px;
  font-weight: 400;
  color: #8fa4c8;
  line-height: 1.7;
  max-width: 760px;
  margin: 0 0 28px;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.hero-pill {
  font-size: 13px;
  font-weight: 500;
  color: var(--nav-text);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 5px 12px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--blue);
  color: var(--white) !important;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline {
  background: transparent;
  border-color: rgba(45,140,240,.5);
  color: var(--blue) !important;
}
.btn-outline:hover {
  background: rgba(45,140,240,.12);
  border-color: var(--blue);
}
.hero-install {
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 14px 18px;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
}
.hero-install code {
  font-family: var(--mono);
  font-size: 13px;
  color: #e0f4ff;
  background: transparent;
}

/* ── Section headings ──────────────────────────────────────────────────── */
article section > h2:first-of-type {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 6px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
  display: inline-block;
}
article h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin: 32px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
article h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--mid);
  margin: 20px 0 6px;
}
article p {
  margin: 0 0 14px;
  line-height: 1.7;
  color: var(--mid);
}
article ul, article ol {
  padding-left: 22px;
  color: var(--mid);
  margin-bottom: 14px;
}
article li { margin-bottom: 6px; line-height: 1.65; }

/* ── Code ──────────────────────────────────────────────────────────────── */
article pre {
  background: var(--dark);
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 18px;
}
article pre code {
  font-family: var(--mono);
  font-size: 13px;
  color: #82cfff;
  white-space: pre;
}
article code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--blue-light);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--blue-dark);
}
article pre code {
  background: transparent;
  color: #82cfff;
  padding: 0;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
article th {
  background: var(--dark);
  color: var(--white);
  text-align: left;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
article td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--mid);
  vertical-align: top;
}
article tr:nth-child(even) td { background: var(--bg); }

/* ── Feature grid ──────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow .15s, border-color .15s;
}
.feature-card:hover {
  box-shadow: 0 4px 20px rgba(45,140,240,.08);
  border-color: rgba(45,140,240,.3);
}
.feature-icon { font-size: 24px; margin-bottom: 10px; }
.feature-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin: 0 0 8px;
  border: none;
  padding: 0;
}
.feature-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Layer cards ───────────────────────────────────────────────────────── */
.layer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.layer-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.layer-card.layer-media { border-top: 3px solid #10b981; }
.layer-card.layer-web   { border-top: 3px solid var(--blue); }
.layer-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}
.layer-card.layer-media .layer-title { color: #10b981; }
.layer-card.layer-web   .layer-title { color: var(--blue); }
.layer-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin: 0 0 10px;
  border: none;
  padding: 0;
}
.layer-card ul { margin: 0; padding-left: 18px; }
.layer-card li { font-size: 13px; color: var(--muted); margin-bottom: 5px; }

/* ── Callout ───────────────────────────────────────────────────────────── */
.callout {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  margin: 0 0 18px;
}
.callout p { margin: 0; font-size: 14px; color: var(--blue-dark); }
.callout code { background: rgba(45,140,240,.15); color: var(--blue-dark); }
.callout.warning { background: #fffbeb; border-left-color: #f59e0b; }
.callout.warning p { color: #92400e; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.badge-row img { height: 20px; }

/* ── Section subtitle ──────────────────────────────────────────────────── */
.section-lead {
  font-size: 15px;
  color: var(--muted);
  margin: -4px 0 24px;
  line-height: 1.65;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
footer {
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark-3) 100%);
  padding: 32px 40px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}
footer p { margin: 4px 0; font-size: 14px; color: var(--muted) !important; }
footer a { color: #8fa4c8 !important; text-decoration: none; }
footer a:hover { color: var(--white) !important; text-decoration: underline; }
footer .footer-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
footer .footer-badges img { height: 20px; }

/* ── Mobile — tablet ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --content-w: 100%; }
  article section { padding: 40px 32px; }
  .hero { padding: 60px 32px !important; }
  .nav-list > li > a { padding: 6px 8px; font-size: 12px; }
}

/* ── Mobile — phone ────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  header { padding: 0 16px; gap: 0; }
  .site-header-logo span { font-size: 15px; }

  /* Show hamburger, hide nav by default */
  .nav-hamburger { display: flex; }
  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--dark-2);
    border-bottom: 1px solid rgba(255,255,255,.08);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 8px 0 16px;
    z-index: 199;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
  }
  .nav-toggle-input:checked ~ .site-nav { display: block; }

  .nav-list { flex-direction: column; align-items: stretch; padding: 0 8px; }
  .nav-list > li { border-bottom: 1px solid rgba(255,255,255,.05); }
  .nav-list > li > a { padding: 11px 12px; font-size: 14px; border-radius: 4px; }
  .has-dropdown > a::after { float: right; }

  /* Dropdowns display below parent on mobile */
  .nav-dropdown {
    position: static;
    display: none;
    background: rgba(0,0,0,.2);
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 6px 12px;
    min-width: unset;
  }
  .nav-list > li.open .nav-dropdown { display: block; }
  .nav-dropdown li a { padding: 8px 12px; font-size: 13px; }

  article section { padding: 32px 20px; }
  .hero { padding: 40px 20px !important; }
  .layer-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}
