/* =========================================================================
   VaakLoom Docs — Design System (VaagaTech Unified Theme)
   Matches www.vaagatech.com visual language
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* -- Design Tokens -------------------------------------------------------- */
:root {
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --c-bg: #FFFFFF;
  --c-bg-soft: #F2F4F7;
  --c-bg-mute: #E8ECF1;
  --c-border: rgba(11, 18, 32, 0.08);
  --c-border-dark: rgba(11, 18, 32, 0.15);

  --c-text-1: #0B1220;
  --c-text-2: #4B5568;
  --c-text-3: #64748B;

  --c-brand: #1D4ED8;
  --c-brand-soft: #EFF6FF;
  --c-brand-text: #1E40AF;
  --c-accent: #3B82F6;
  --c-purple: #6366F1;
  --c-green: #10B981;
  --c-amber: #F59E0B;
  --c-rose: #EF4444;

  --nav-h: 60px;
  --sidebar-w: 260px;
  --content-max: 820px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(11, 18, 32, 0.05);
  --shadow-md: 0 4px 14px rgba(11, 18, 32, 0.08);
}

[data-theme="dark"] {
  --c-bg: #10243F;
  --c-bg-soft: #1A3560;
  --c-bg-mute: #23457A;
  --c-border: rgba(255, 255, 255, 0.12);
  --c-border-dark: rgba(255, 255, 255, 0.2);

  --c-text-1: #F2F4F7;
  --c-text-2: #C7D2FE;
  --c-text-3: #94A3B8;

  --c-brand: #3B82F6;
  --c-brand-soft: rgba(59, 130, 246, 0.18);
  --c-brand-text: #93C5FD;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

/* -- Reset & Global -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text-1);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Dark mode text color inside inline SVG logo */
[data-theme="dark"] .logo-text { fill: #F1F5F9; }

/* -- Skip link ------------------------------------------------------------ */
.skip-link {
  position: absolute; top: -100px; left: 1rem;
  padding: 0.5rem 1rem; background: var(--c-brand); color: #fff;
  border-radius: var(--radius); z-index: 999;
}
.skip-link:focus { top: 0.5rem; }

/* =========================================================================
   TOP NAV
   ========================================================================= */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  backdrop-filter: blur(8px);
}
.topnav-inner {
  max-width: 1280px; width: 100%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.topnav-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.15rem; font-weight: 700; color: var(--c-text-1);
  text-decoration: none;
}
.topnav-brand img { height: 32px; width: auto; }
.topnav-brand:hover { text-decoration: none; }

.topnav-right {
  display: flex; align-items: center; gap: 0.5rem;
}
.topnav-link {
  font-size: 0.9rem; font-weight: 500; color: var(--c-text-2);
  padding: 0.4rem 0.65rem; border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.topnav-link:hover { background: var(--c-bg-mute); color: var(--c-text-1); text-decoration: none; }
.topnav-link.active { color: var(--c-brand); font-weight: 600; }

.topnav-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; font-size: 0.88rem; font-weight: 600;
  border-radius: 6px; text-decoration: none;
  transition: all 0.15s;
}
.topnav-btn:hover { text-decoration: none; opacity: 0.9; transform: translateY(-1px); }
.topnav-btn--ghost {
  background: var(--c-bg-mute); color: var(--c-text-1); border: 1px solid var(--c-border);
}
.topnav-btn--primary {
  background: var(--c-brand); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}

.theme-btn {
  background: var(--c-bg-mute);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  width: 34px; height: 34px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s;
}
.theme-btn:hover { color: var(--c-text-1); border-color: var(--c-border-dark); }

/* =========================================================================
   DOCS LAYOUT (Sidebar + Main)
   ========================================================================= */
.docs-layout {
  max-width: 1280px; width: 100%;
  margin: 0 auto;
  display: flex;
  flex: 1;
}
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--c-border);
  padding: 2rem 1.25rem;
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-title {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-text-3); margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}
.sidebar-links { list-style: none; }
.sidebar-links li { margin-bottom: 0.15rem; }
.sidebar-links a {
  display: block;
  font-size: 0.88rem; color: var(--c-text-2);
  padding: 0.35rem 0.5rem; border-radius: 6px;
  transition: all 0.12s; text-decoration: none;
}
.sidebar-links a:hover { background: var(--c-bg-mute); color: var(--c-text-1); text-decoration: none; }
.sidebar-links a.current {
  background: var(--c-brand-soft);
  color: var(--c-brand-text);
  font-weight: 600;
}

.docs-main {
  flex: 1; min-width: 0;
  padding: 3rem 2.5rem 4rem;
  max-width: var(--content-max);
}

.page-label {
  font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-brand); margin-bottom: 0.5rem;
}
.page-title {
  font-size: 2.25rem; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.2;
  margin-bottom: 0.75rem;
}
.page-desc {
  font-size: 1.1rem; color: var(--c-text-2);
  line-height: 1.6; margin-bottom: 2rem;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--c-border);
}

/* =========================================================================
   PROSE / DOCUMENTATION CONTENT
   ========================================================================= */
.prose h2 {
  font-size: 1.45rem; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 {
  font-size: 1.15rem; font-weight: 700;
  margin: 1.75rem 0 0.75rem;
}
.prose p { margin-bottom: 1rem; color: var(--c-text-2); }
.prose ul, .prose ol { margin-bottom: 1rem; padding-left: 1.5rem; color: var(--c-text-2); }
.prose li { margin-bottom: 0.35rem; }
.prose li strong { color: var(--c-text-1); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--c-bg-mute);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  color: var(--c-brand-text);
}
.prose pre {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre code {
  background: none; padding: 0; border-radius: 0;
  color: var(--c-text-1); font-family: var(--font-mono);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.prose th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
  background: var(--c-bg-soft);
  border-bottom: 2px solid var(--c-border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
}
.prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
}
.prose td strong { color: var(--c-text-1); }

/* Badges & Callouts */
.badge {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--c-brand-soft); color: var(--c-brand-text);
  border: 1px solid rgba(79,70,229,0.2);
}
.badge--green { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.badge--amber { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
[data-theme="dark"] .badge--green { background: rgba(16,185,129,0.15); color: #6EE7B7; border-color: rgba(16,185,129,0.3); }
[data-theme="dark"] .badge--amber { background: rgba(245,158,11,0.15); color: #FCD34D; border-color: rgba(245,158,11,0.3); }

.callout {
  background: var(--c-brand-soft);
  border-left: 3px solid var(--c-brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  color: var(--c-text-2);
}
.callout strong { color: var(--c-brand-text); }
.callout--tip {
  background: rgba(16,185,129,0.08);
  border-left-color: var(--c-green);
}
.callout--tip strong { color: var(--c-green); }

/* =========================================================================
   LANDING PAGE (Hero, Metrics, Features, Preview, CTA)
   ========================================================================= */
.landing-hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  max-width: 860px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600;
  padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--c-brand-soft); color: var(--c-brand-text);
  border: 1px solid rgba(79,70,229,0.2);
  margin-bottom: 1.5rem;
}
.landing-hero h1 {
  font-size: 3.25rem; font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.15;
  margin-bottom: 1.25rem;
}
.landing-hero h1 .highlight {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #0EA5E9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-hero .lead {
  font-size: 1.18rem; color: var(--c-text-2);
  max-width: 660px; margin: 0 auto 2.25rem; line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 0.85rem;
  justify-content: center; flex-wrap: wrap;
}
.hero-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.65rem; font-size: 0.96rem; font-weight: 600;
  border-radius: var(--radius); text-decoration: none;
  transition: all 0.15s;
}
.hero-btn:hover { text-decoration: none; transform: translateY(-1px); }
.hero-btn--primary { background: var(--c-brand); color: #fff; box-shadow: 0 3px 12px rgba(79,70,229,0.3); }
.hero-btn--secondary { background: var(--c-bg-soft); color: var(--c-text-1); border: 1px solid var(--c-border); }

/* Interactive Hero Visual / Weave Canvas */
.hero-visual {
  max-width: 960px; margin: 3rem auto 1rem;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.visual-header {
  background: var(--c-bg-mute);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.visual-dots { display: flex; gap: 6px; }
.visual-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-border-dark); }
.visual-title { font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-text-2); font-weight: 600; }
.visual-body {
  padding: 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; text-align: left;
}

/* Metrics strip */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--c-border);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  overflow: hidden;
  max-width: 820px; margin: 3.5rem auto;
}
.metric {
  background: var(--c-bg);
  padding: 1.5rem 1rem; text-align: center;
}
.metric-val {
  font-size: 1.75rem; font-weight: 800;
  color: var(--c-brand); letter-spacing: -0.02em;
}
.metric-label {
  font-size: 0.78rem; color: var(--c-text-3);
  margin-top: 0.25rem; font-weight: 500;
}

/* Feature cards */
.features-section {
  max-width: 1000px; margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.section-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--c-brand); text-align: center;
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 2.15rem; font-weight: 800; text-align: center;
  margin-bottom: 0.5rem; letter-spacing: -0.025em;
}
.section-desc {
  font-size: 1.05rem; color: var(--c-text-2); text-align: center;
  max-width: 620px; margin: 0 auto 2.5rem;
}
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.feature-card {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s, border-color 0.15s;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-brand);
}
.feature-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--c-brand-soft);
  color: var(--c-brand-text);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 0.5rem;
}
.feature-card p {
  font-size: 0.88rem; color: var(--c-text-2); line-height: 1.6;
}

/* CTA banner */
.cta-banner {
  max-width: 960px; margin: 2rem auto 4rem;
  padding: 3.5rem 2rem; text-align: center;
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 50%, #7C3AED 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(79,70,229,0.35);
}
.cta-banner h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; color: #fff; }
.cta-banner p { font-size: 1.05rem; opacity: 0.95; margin-bottom: 1.75rem; color: rgba(255,255,255,0.95); max-width: 580px; margin-left: auto; margin-right: auto; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.75rem; font-size: 0.98rem; font-weight: 700;
  background: #fff; color: var(--c-brand); border-radius: 6px;
  text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.cta-btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* =========================================================================
   INTERACTIVE SIMULATOR / DEMO SANDBOX
   ========================================================================= */
.simulator-container {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.simulator-toolbar {
  display: flex; gap: 0.75rem; align-items: center;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.scenario-select {
  padding: 0.55rem 0.9rem; font-size: 0.9rem; font-weight: 600;
  background: var(--c-bg); color: var(--c-text-1);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  outline: none; cursor: pointer;
}
.scenario-btn {
  padding: 0.55rem 1.25rem; font-size: 0.9rem; font-weight: 700;
  background: var(--c-brand); color: #fff; border: none;
  border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: all 0.15s;
}
.scenario-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.dag-graph {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; overflow-x: auto;
  padding: 1.25rem; background: var(--c-bg);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.dag-node {
  padding: 0.6rem 0.9rem; font-size: 0.82rem; font-weight: 600;
  border-radius: 6px; border: 1px solid var(--c-border);
  background: var(--c-bg-soft); color: var(--c-text-1);
  text-align: center; min-width: 110px;
  transition: all 0.2s;
}
.dag-node.active {
  border-color: var(--c-brand);
  background: var(--c-brand-soft);
  color: var(--c-brand-text);
  box-shadow: 0 0 0 2px rgba(79,70,229,0.2);
}
.dag-node.done {
  border-color: var(--c-green);
  background: rgba(16,185,129,0.1);
  color: var(--c-green);
}
.dag-arrow { color: var(--c-text-3); font-weight: 700; }

.trace-console {
  background: #0B1120; color: #E2E8F0;
  border-radius: var(--radius); padding: 1rem 1.25rem;
  font-family: var(--font-mono); font-size: 0.82rem;
  max-height: 240px; overflow-y: auto; line-height: 1.6;
}
.trace-line { margin-bottom: 0.25rem; }
.trace-time { color: #64748B; margin-right: 0.5rem; }
.trace-kind { color: #38BDF8; font-weight: 600; margin-right: 0.5rem; }
.trace-ok { color: #34D399; }
.trace-info { color: #A5B4FC; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.88rem; color: var(--c-text-3);
  background: var(--c-bg);
  margin-top: auto;
}
.site-footer a { color: var(--c-text-2); font-weight: 500; }
.site-footer a:hover { color: var(--c-brand); }
.footer-links {
  display: flex; justify-content: center; gap: 1.5rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 960px) {
  .docs-sidebar { display: none; }
  .docs-main { padding: 2rem 1.5rem; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .landing-hero h1 { font-size: 2.35rem; }
  .visual-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .topnav-link { display: none; }
  .landing-hero { padding: 3rem 1rem 2rem; }
  .metrics { grid-template-columns: 1fr; }
}
