/* ZenTools Design System - Unified CSS */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Colors */
  --fg: #eaf1ff;
  --muted: #a9b1c3;
  --brand: #6ee7ff;
  --brand-2: #7c4dff;
  
  /* Background Animation Variables */
  --x1: 65%;
  --y1: 10%;
  --x2: 35%;
  --y2: 90%;
  
  /* Background Gradients */
  --bg1a: rgba(124, 77, 255, .35);
  --bg2a: rgba(110, 231, 255, .28);
  
  /* Common Colors */
  --border: #1d2332;
  --border-light: #151a24;
  --border-dark: #171d2a;
  --panel-bg-start: rgba(13, 17, 27, .86);
  --panel-bg-end: rgba(10, 13, 20, .86);
  --header-bg-start: rgba(10, 12, 18, .70);
  --header-bg-end: rgba(10, 12, 18, .06);
}

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  overflow-x: hidden;
  background: #0a0b10;
  position: relative;
}

/* Background grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .22;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="400" height="400" filter="url(%23g)" opacity="0.06"/></svg>');
  background-size: 400px 400px;
  mix-blend-mode: overlay;
}

/* Animated background */
#bg {
  position: fixed;
  inset: -10vmax;
  z-index: -1;
  pointer-events: none;
  will-change: transform, background;
  filter: saturate(120%);
  background:
    radial-gradient(1000px 700px at var(--x1) var(--y1), var(--bg1a), transparent 55%),
    radial-gradient(820px 520px at var(--x2) var(--y2), var(--bg2a), transparent 55%),
    linear-gradient(180deg, #0a0b10, #0e1320 42%, #0a0d15);
  transform: translateZ(0);
}

/* ===== LAYOUT COMPONENTS ===== */

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(10px);
  background: linear-gradient(to bottom, var(--header-bg-start), var(--header-bg-end));
  border-bottom: 1px solid var(--border-light);
}

/* Container */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
}

/* Header specific wrap */
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

/* Brand/Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand span {
  font-weight: 800;
  letter-spacing: .4px;
}

/* Header Navigation */
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  --pad: 10px 16px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--pad);
  border-radius: 10px;
  border: 1px solid rgba(110, 231, 255, 0.15);
  background: rgba(15, 19, 32, 0.3);
  backdrop-filter: blur(6px);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1px;
  transition: all .15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 255, 0.35);
  background: rgba(15, 19, 32, 0.5);
  box-shadow: 0 4px 16px rgba(110, 231, 255, 0.1);
}

.nav-link.primary {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.12), rgba(124, 77, 255, 0.08));
  border-color: rgba(110, 231, 255, 0.25);
  color: var(--fg);
}

.nav-link.primary:hover {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.2), rgba(124, 77, 255, 0.15));
  border-color: rgba(110, 231, 255, 0.4);
  box-shadow: 0 6px 18px rgba(110, 231, 255, 0.15);
}

.nav-link.ghost {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.08), rgba(124, 77, 255, 0.05));
  border-color: rgba(110, 231, 255, 0.2);
  color: var(--fg);
}

.nav-link.ghost:hover {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.15), rgba(124, 77, 255, 0.1));
  border-color: rgba(110, 231, 255, 0.35);
  box-shadow: 0 4px 16px rgba(110, 231, 255, 0.12);
}

.nav-link strong {
  color: var(--brand);
  font-weight: 500;
}

@media (max-width: 768px) {
  header .wrap {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
  }
  
  .nav {
    margin-left: 0;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
  }
  
  .nav-link {
    padding: 8px 16px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
    max-width: 200px;
  }
}

/* ===== TYPOGRAPHY ===== */

/* Headings */
h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -.5px;
}

h2 {
  font-size: 22px;
  margin: 18px 0 10px;
  color: var(--fg);
}

h3 {
  font-size: 16px;
  margin: 12px 0 8px;
  color: var(--muted);
}

/* Text elements */
p {
  margin: 10px 0;
}

.sub {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  margin: 0 0 24px;
}

/* Links */
a {
  color: #6ea8fe;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin: 8px 0 8px 22px;
}

/* ===== UI COMPONENTS ===== */

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 56px 20px 28px;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Panels */
.panel {
  margin: 12px 20px 26px;
  background: linear-gradient(180deg, var(--panel-bg-start), var(--panel-bg-end));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-dark);
}

.panel .panel-body {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* Buttons */
.btn {
  --pad: 12px 20px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--pad);
  border-radius: 12px;
  border: 1px solid rgba(110, 231, 255, 0.2);
  background: rgba(15, 19, 32, 0.4);
  backdrop-filter: blur(8px);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.2px;
  transition: all .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 255, 0.4);
  background: rgba(15, 19, 32, 0.6);
  box-shadow: 0 4px 16px rgba(110, 231, 255, 0.12);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.15), rgba(124, 77, 255, 0.1));
  border-color: rgba(110, 231, 255, 0.3);
  color: var(--brand);
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.25), rgba(124, 77, 255, 0.18));
  border-color: rgba(110, 231, 255, 0.5);
  box-shadow: 0 6px 20px rgba(110, 231, 255, 0.18);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(169, 177, 195, 0.2);
  color: var(--muted);
}

.btn.ghost:hover {
  border-color: rgba(169, 177, 195, 0.4);
  background: rgba(169, 177, 195, 0.08);
  color: var(--fg);
}

/* Utility Components */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 8px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #223158;
  border-radius: 999px;
  background: #12182a;
  font-size: 12px;
  color: #a9c7ff;
  margin-left: 8px;
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #223158;
  background: #12182a;
  font-weight: 700;
  font-size: 12px;
  color: #a9c7ff;
  letter-spacing: .2px;
}

.note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

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

/* Footer */
footer {
  margin-top: 48px;
  border-top: 1px solid rgba(110,168,254,.18);
  padding: 24px 20px 40px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}



.footer-link {
  color: #a9c7ff;
  text-decoration: none;
  opacity: .9;
}

.footer-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-nav .dot {
  margin: 0 8px;
  color: #223158;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ===== RESPONSIVE UTILITIES ===== */

/* Table of contents */
.toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 720px) {
  .toc {
    grid-template-columns: 1fr;
  }
}

/* Steps grid */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 720px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ===== PAGE-SPECIFIC STYLES ===== */

/* Main content wrapper */
main.wrap {
  padding-top: 34px;
}

/* For documentation pages with larger text */
.panel .panel-body.large {
  padding: 18px 20px;
  font-size: 15px;
}