@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Sora:wght@500;600;700&display=swap');

:root {
  --bg: #05070c;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f7fb;
  --text-muted: #9aa6b8;
  --primary: #ff7a00;
  --primary-hover: #e86800;
  --primary-soft: rgba(255, 122, 0, 0.14);
  --primary-glow: rgba(255, 122, 0, 0.28);
  --radius: 14px;
  --sidebar-width: 280px;
  --header-height: 64px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Figtree', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255, 122, 0, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(255, 122, 0, 0.08), transparent 45%),
    linear-gradient(180deg, #05070c 0%, #070b12 45%, #05070c 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code, pre { font-family: var(--font-mono); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(14px);
}

.brand-wrap, .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}
.brand-name {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: -0.02em;
  color: var(--text-muted);
}
.brand-text::before {
  content: '';
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.header-actions { display: flex; align-items: center; gap: 0.65rem; position: relative; }

.header-scripts {
  position: relative;
}
.header-nav-btn {
  white-space: nowrap;
}
.header-actions > .scripts-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: min(92vw, 720px);
  z-index: 60;
  padding: 0;
}
.scripts-panel[hidden] {
  display: none !important;
}
.scripts-panel-inner {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(8, 11, 18, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 122, 0, 0.08);
  padding: 1rem;
  animation: scripts-panel-in 0.2s ease both;
}
@keyframes scripts-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.scripts-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.85rem;
  padding: 0 0.2rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.scripts-panel-head strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.scripts-panel-head span {
  color: var(--text-muted);
  font-size: 0.82rem;
}
.scripts-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  max-height: min(72vh, 560px);
  overflow: auto;
  padding-right: 0.15rem;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 166, 184, 0.28) transparent;
}
.scripts-panel-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none !important;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.scripts-panel-card:hover {
  border-color: rgba(255, 122, 0, 0.55);
  background: rgba(255, 122, 0, 0.1);
  transform: translateY(-2px);
}
.scripts-panel-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0f18;
  overflow: hidden;
}
.scripts-panel-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scripts-panel-label {
  display: block;
  margin-top: auto;
  padding: 0.55rem 0.7rem 0.6rem;
  border-top: 1px solid var(--border);
  background: rgba(8, 11, 18, 0.92);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.scripts-panel-card[aria-disabled="true"] {
  cursor: default;
}
.scripts-panel-card[aria-disabled="true"]:hover {
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 0 24px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  color: var(--primary);
  border-color: rgba(255, 122, 0, 0.55);
  background: transparent;
}
.btn-ghost:hover {
  color: #fff;
  border-color: var(--primary);
  background: rgba(255, 122, 0, 0.12);
}
.doc-article .btn {
  text-decoration: none;
}
.doc-article .btn-primary,
.doc-article .btn-primary:hover {
  color: #fff;
}
.doc-article .btn-ghost,
.doc-article .btn-ghost:hover {
  color: var(--primary);
}
.doc-article .btn-ghost:hover {
  color: #fff;
}
.header-actions .btn-ghost {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}
.header-actions .btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 122, 0, 0.45);
  background: rgba(255, 122, 0, 0.1);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: auto;
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--border);
  background: rgba(8, 11, 18, 0.55);
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 166, 184, 0.28) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(154, 166, 184, 0.28);
}

.sidebar-section + .sidebar-section { margin-top: 1.35rem; }
.sidebar-label {
  margin: 0 0 0.55rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-link {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.sidebar-link.active {
  color: #fff;
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-group {
  margin: 0.15rem 0 0.35rem;
  border-radius: 12px;
}
.nav-group.open,
.nav-group.has-active {
  background: rgba(255, 255, 255, 0.035);
  padding: 0.2rem;
}
.nav-group-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.15rem;
}
.nav-group-head .sidebar-parent {
  font-weight: 600;
  color: #e8eef8;
}
.nav-caret {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}
.nav-caret:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.nav-group:not(.open) .nav-caret {
  transform: rotate(-90deg);
}
.nav-children {
  display: none;
  padding: 0.15rem 0 0.25rem 0.35rem;
  margin-left: 0.45rem;
  border-left: 1px solid rgba(255, 122, 0, 0.28);
}
.nav-group.open .nav-children {
  display: block;
}
.sidebar-child {
  font-size: 0.86rem;
  padding: 0.48rem 0.65rem;
  color: #8b95a8;
}
.sidebar-child.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 122, 0, 0.16);
  box-shadow: inset 3px 0 0 var(--primary);
}

.content { min-width: 0; padding: 2rem 1.5rem 4rem; }

.doc-article {
  max-width: 780px;
  margin: 0 auto;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc-kicker {
  margin: 0 0 0.65rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-article h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.doc-article h2 {
  margin: 2.2rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.doc-article h3 {
  margin: 1.5rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.doc-article p, .doc-article li { color: #c7d0de; }
.doc-article a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-article ul, .doc-article ol { padding-left: 1.2rem; }
.doc-article li + li { margin-top: 0.35rem; }
.doc-article pre {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0f18;
  color: #ffe1c2;
}
.doc-article :not(pre) > code {
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 122, 0, 0.12);
  color: #ffc078;
  font-size: 0.88em;
}

.callout {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.callout strong { display: block; margin-bottom: 0.25rem; color: var(--text); }
.callout.info {
  border-color: rgba(255, 122, 0, 0.35);
  background: rgba(255, 122, 0, 0.08);
}
.callout.warn {
  border-color: rgba(240, 180, 41, 0.35);
  background: rgba(240, 180, 41, 0.08);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.steps li {
  position: relative;
  padding: 1rem 1rem 1rem 3.2rem;
  margin: 0 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.9rem;
  top: 1rem;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.6rem; }
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid var(--primary);
  border-radius: 4px;
}

.hero {
  max-width: 920px;
  margin: 0 auto 0.5rem;
  padding: 1rem 0 0.5rem;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.hero-brand img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(255, 122, 0, 0.18));
}
.hero-brand-copy {
  display: flex;
  flex-direction: column;
}
.hero-brand-copy strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-brand-copy span {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.hero p {
  margin: 0 0 1.5rem;
  max-width: 38rem;
  color: var(--text-muted);
  font-size: 1.08rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 2.5rem;
}
.feature {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}
.feature h3 { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }

.script-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.script-card,
.doc-article a.script-card {
  display: block;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.script-card:hover,
.doc-article a.script-card:hover {
  border-color: rgba(255, 122, 0, 0.45);
  background: rgba(255, 122, 0, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}
.script-card h3,
.script-card p {
  text-decoration: none;
}
.script-card h3 { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1.02rem; color: var(--text); }
.script-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.pager a {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  min-width: min(100%, 220px);
  text-decoration: none;
}
.pager a:hover { border-color: rgba(255, 122, 0, 0.4); }
.pager span { color: var(--text-muted); font-size: 0.78rem; }
.pager strong { font-size: 0.95rem; color: var(--text); }
.pager .next { margin-left: auto; text-align: right; }

.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.overlay { display: none; }

@media (max-width: 920px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: var(--header-height) auto 0 0;
    width: min(86vw, 320px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    background: #0a0f18;
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.open {
    display: block;
    position: fixed;
    inset: var(--header-height) 0 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 45;
  }
  .brand-name { font-size: 0.78rem; }
  .brand-text { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager .next { margin-left: 0; text-align: left; }
  .header-actions { gap: 0.4rem; }
  .header-actions .btn {
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
  }
  .scripts-panel {
    position: fixed;
    top: calc(var(--header-height) + 0.5rem);
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
  .scripts-panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .header-actions .btn-primary {
    display: none;
  }
  .scripts-panel-grid {
    grid-template-columns: 1fr;
    max-height: min(70vh, 480px);
  }
}
