/* WunoOS Docs - static documentation system using WunoOS design tokens */
:root {
  --background: 192 38% 99%;
  --foreground: 180 4% 12%;
  --card: 0 0% 100%;
  --card-foreground: 180 4% 12%;
  --primary: 192 91% 26%;
  --primary-foreground: 0 0% 100%;
  --primary-dark: 192 94% 20%;
  --primary-light: 190 73% 93%;
  --secondary: 180 10% 95%;
  --secondary-foreground: 180 4% 24%;
  --muted: 180 11% 96%;
  --muted-foreground: 180 4% 44%;
  --accent: 180 82% 45%;
  --accent-foreground: 184 100% 14%;
  --border: 180 8% 90%;
  --ring: 192 91% 26%;
  --radius: 12px;
  --gradient-brand: linear-gradient(135deg, hsl(192 91% 26%) 0%, hsl(184 78% 38%) 100%);
  --gradient-hero: radial-gradient(circle at 84% 12%, hsl(190 73% 93%) 0, transparent 30%), linear-gradient(180deg, hsl(192 38% 99%) 0%, hsl(180 16% 97%) 100%);
  --shadow-sm: 0 1px 2px hsl(190 20% 20% / 0.06);
  --shadow-md: 0 10px 30px hsl(190 30% 20% / 0.08);
  --shadow-lg: 0 22px 70px hsl(192 91% 20% / 0.14);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Roboto', 'HarmonyOS Sans SC', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  --sidebar-w: 276px;
  --toc-w: 220px;
}

.dark {
  --background: 190 44% 4%;
  --foreground: 180 12% 92%;
  --card: 190 32% 7%;
  --card-foreground: 180 12% 92%;
  --primary: 190 55% 58%;
  --primary-foreground: 190 44% 4%;
  --primary-dark: 190 61% 68%;
  --primary-light: 190 33% 13%;
  --secondary: 190 20% 12%;
  --secondary-foreground: 180 16% 82%;
  --muted: 190 22% 10%;
  --muted-foreground: 180 8% 60%;
  --accent: 180 65% 48%;
  --accent-foreground: 190 44% 4%;
  --border: 190 18% 17%;
  --ring: 190 55% 58%;
  --gradient-hero: radial-gradient(circle at 84% 12%, hsl(190 42% 18%) 0, transparent 30%), linear-gradient(180deg, hsl(190 44% 4%) 0%, hsl(190 30% 7%) 100%);
  --shadow-sm: 0 1px 2px hsl(190 50% 2% / 0.5);
  --shadow-md: 0 10px 30px hsl(190 50% 2% / 0.48);
  --shadow-lg: 0 22px 70px hsl(190 50% 2% / 0.6);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.72;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 4.4rem); font-weight: 760; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin-top: 2.4rem; margin-bottom: 0.9rem; }
h3 { font-size: 1.08rem; margin-top: 1.5rem; margin-bottom: 0.55rem; }
p { margin-bottom: 1rem; color: hsl(var(--muted-foreground)); }
a { color: hsl(var(--primary-dark)); text-decoration: none; transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease; }
a:hover { color: hsl(var(--primary)); }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.28rem; }
code { font-size: 0.9em; background: hsl(var(--muted)); padding: 0.15em 0.4em; border-radius: 6px; font-family: var(--font-mono); }
pre { background: hsl(var(--muted)); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin: 1rem 0; border: 1px solid hsl(var(--border)); }
pre code { background: none; padding: 0; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.25rem; }
th, td { padding: 0.65rem 0.8rem; border: 1px solid hsl(var(--border)); text-align: left; font-size: 0.9rem; }
th { background: hsl(var(--muted)); font-weight: 700; }
blockquote { border-left: 4px solid hsl(var(--ring)); padding: 0.65rem 1rem; margin: 1rem 0; background: hsl(var(--muted)); border-radius: 0 var(--radius) var(--radius) 0; }
img { max-width: 100%; height: auto; border-radius: var(--radius); }

.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: hsl(var(--card) / 0.9);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid hsl(var(--border));
  height: 60px;
}
.topnav-inner { max-width: 100%; margin: 0 auto; padding: 0 1.4rem; display: flex; align-items: center; height: 100%; gap: 1rem; }
.topnav-logo { font-weight: 760; font-size: 1.02rem; color: hsl(var(--foreground)); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.55rem; flex-shrink: 0; }
.topnav-logo img { width: 26px; height: 26px; object-fit: contain; }
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 0.65rem; }
.topnav-cta, .button-primary {
  background: var(--gradient-brand);
  color: #fff;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  box-shadow: var(--shadow-md);
}
.topnav-cta { padding: 0.45rem 0.92rem; }
.topnav-cta:hover, .button-primary:hover { color: #fff; transform: translateY(-1px); }
.button-primary { padding: 0.8rem 1.15rem; }
.button-secondary {
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border-radius: 999px;
  padding: 0.78rem 1.12rem;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.button-secondary:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); transform: translateY(-1px); }
.theme-btn, .mobile-toggle, .sidebar-close {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: hsl(var(--foreground));
}
.mobile-toggle { display: none; }
.theme-btn .icon-moon { display: none; }
.dark .theme-btn .icon-sun { display: none; }
.dark .theme-btn .icon-moon { display: block; }
.ui-icon, .inline-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ui-icon { width: 1.15rem; height: 1.15rem; }
.inline-icon { width: 1rem; height: 1rem; }

.app-layout { display: flex; max-width: 1520px; margin: 0 auto; min-height: calc(100vh - 60px); }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  overflow-y: auto;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  padding: 1.1rem 0 3rem;
  -webkit-overflow-scrolling: touch;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 4px; }
.sidebar-close { display: none; margin: 0 1rem 1rem auto; }
.sidebar-section { margin-bottom: 0.35rem; }
.sidebar-section-header { display: flex; align-items: center; min-height: 2.25rem; }
.sidebar-category-link, .sidebar-category-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0.55rem 0.5rem 0.55rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  color: hsl(var(--muted-foreground));
}
.sidebar-category-link:hover { color: hsl(var(--foreground)); }
.sidebar-category-toggle, .sidebar-group-toggle { border: 0; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-category-toggle { width: 2.5rem; align-self: stretch; }
.sidebar-category-toggle:hover, .sidebar-group-toggle:hover { color: hsl(var(--foreground)); }
.sidebar-category-toggle .arrow, .sidebar-group-toggle .arrow { width: 0.9rem; height: 0.9rem; transition: transform 0.2s ease; }
.sidebar-section.collapsed .sidebar-category-toggle .arrow, .sidebar-group.collapsed .sidebar-group-toggle .arrow { transform: rotate(-90deg); }
.sidebar-section.collapsed .sidebar-items, .sidebar-group.collapsed .sidebar-group-items { display: none; }
.sidebar-items, .sidebar-group-items { list-style: none; padding: 0; margin: 0; }
.sidebar-items li a, .sidebar-group-items li a {
  display: block;
  border-left: 2px solid transparent;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
  transition: all 0.14s ease;
}
.sidebar-items li a { padding: 0.4rem 1.25rem 0.4rem 2rem; font-size: 0.86rem; }
.sidebar-group-items li a { padding: 0.36rem 1.25rem 0.36rem 2.75rem; font-size: 0.84rem; }
.sidebar-items li a:hover, .sidebar-group-items li a:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.sidebar-items li a.active, .sidebar-group-items li a.active { color: hsl(var(--primary-dark)); background: hsl(var(--primary-light)); border-left-color: hsl(var(--ring)); font-weight: 700; }
.sidebar-group { list-style: none; margin: 0.1rem 0; }
.sidebar-group-toggle { width: 100%; padding: 0.42rem 1.25rem 0.42rem 2rem; font: 700 0.78rem/1.4 var(--font-sans); letter-spacing: 0.01em; text-align: left; }
.sidebar-group-toggle > span:first-child { flex: 1; }

.main-content { flex: 1; min-width: 0; padding: 2.6rem clamp(1.4rem, 4vw, 3.8rem) 5rem; max-width: 980px; }
.page-toc {
  width: var(--toc-w);
  flex-shrink: 0;
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  height: fit-content;
  padding: 1.4rem 0.75rem 2rem 1rem;
  font-size: 0.8rem;
  border-left: 1px solid hsl(var(--border));
  margin: 1rem 0 0;
}
.toc-title { font-size: 0.78rem; font-weight: 760; color: hsl(var(--foreground)); padding: 0 0.75rem 0.65rem; }
.page-toc ul { list-style: none; padding: 0; margin: 0; }
.page-toc li a { display: block; padding: 0.28rem 0.75rem; color: hsl(var(--muted-foreground)); border-left: 2px solid transparent; line-height: 1.45; }
.page-toc li a.toc-level-3 { padding-left: 1.5rem; font-size: 0.76rem; }
.page-toc li a:hover { color: hsl(var(--primary-dark)); border-left-color: hsl(var(--ring)); }

.hero {
  background: var(--gradient-hero);
  border: 1px solid hsl(var(--border));
  border-radius: 24px;
  padding: clamp(2rem, 6vw, 4.5rem);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
}
.docs-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); gap: clamp(1.4rem, 4vw, 3rem); align-items: center; }
.hero .brand { color: hsl(var(--primary-dark)); }
.hero p { font-size: clamp(1rem, 2vw, 1.18rem); max-width: 56ch; margin-top: 1rem; color: hsl(var(--muted-foreground)); }
.hero-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-panel { border: 1px solid hsl(var(--border)); border-radius: 18px; background: hsl(var(--card) / 0.78); box-shadow: var(--shadow-lg); overflow: hidden; }
.panel-row { display: grid; grid-template-columns: 1fr; gap: 0.25rem; padding: 1rem 1.1rem; border-bottom: 1px solid hsl(var(--border)); }
.panel-row:last-child { border-bottom: 0; }
.panel-row span { font-family: var(--font-mono); color: hsl(var(--primary-dark)); font-size: 0.78rem; }
.panel-row strong { color: hsl(var(--foreground)); font-size: 0.98rem; }

.section-divider { margin: 2.7rem 0 1.1rem; }
.section-divider h2 { margin: 0 0 0.4rem; }
.section-divider p { max-width: 62ch; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2.4rem; }
.feature-grid { grid-template-columns: 1.15fr 0.85fr; }
.category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: block;
  min-height: 176px;
  padding: 1.2rem;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}
.card:hover { color: hsl(var(--foreground)); transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: hsl(var(--ring) / 0.4); }
.card-large { grid-row: span 2; background: linear-gradient(160deg, hsl(var(--primary-light)), hsl(var(--card))); }
.card h3 { margin-top: 0.5rem; margin-bottom: 0.65rem; }
.card p { color: hsl(var(--muted-foreground)); font-size: 0.95rem; }
.card-icon { width: fit-content; min-width: 38px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: hsl(var(--primary-light)); color: hsl(var(--primary-dark)); font-family: var(--font-mono); font-weight: 760; font-size: 0.78rem; }
.card-link { margin-top: 0.6rem; display: inline-flex; color: hsl(var(--primary-dark)); font-weight: 760; font-size: 0.9rem; }

.doc-lead { font-size: 1.08rem; max-width: 68ch; }
.callout { border: 1px solid hsl(var(--border)); border-radius: 18px; background: hsl(var(--primary-light)); padding: 1rem 1.1rem; margin: 1.2rem 0; }
.callout p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding-left: 0; display: grid; gap: 0.8rem; }
.steps li { counter-increment: step; border: 1px solid hsl(var(--border)); border-radius: 16px; background: hsl(var(--card)); padding: 0.9rem 1rem 0.9rem 3.2rem; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 1rem; top: 0.95rem; width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 999px; background: hsl(var(--primary-dark)); color: hsl(var(--primary-foreground)); font: 700 0.78rem/1 var(--font-mono); }
.kbd { font-family: var(--font-mono); font-size: 0.82rem; border: 1px solid hsl(var(--border)); border-bottom-width: 2px; border-radius: 6px; padding: 0.08rem 0.35rem; background: hsl(var(--card)); color: hsl(var(--foreground)); }

.footer { border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); margin-left: var(--sidebar-w); }
.footer-desktop { padding: 2.2rem clamp(1.4rem, 4vw, 3.8rem); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; max-width: 980px; }
.footer-section h3 { margin: 0 0 0.75rem; font-size: 0.9rem; }
.footer-stack { display: grid; gap: 0.38rem; }
.footer-stack a { color: hsl(var(--muted-foreground)); font-size: 0.9rem; }
.footer-stack a:hover { color: hsl(var(--primary-dark)); }
.footer-meta { max-width: 980px; margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 0.86rem; }
.footer-meta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: space-between; }
.footer-company { color: hsl(var(--foreground)); font-weight: 760; }
.footer-version { margin-top: 0.5rem; }
.footer-mobile { display: none; }

@media (max-width: 1180px) {
  .page-toc { display: none; }
  .main-content { max-width: none; }
}

@media (max-width: 900px) {
  .mobile-toggle { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; z-index: 300; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 250; background: hsl(190 30% 5% / 0.42); }
  .sidebar-overlay.open { display: block; }
  .app-layout { display: block; }
  .footer { margin-left: 0; }
  .docs-hero { grid-template-columns: 1fr; }
  .feature-grid, .category-grid, .card-grid { grid-template-columns: 1fr; }
  .card-large { grid-row: auto; }
}

@media (max-width: 640px) {
  .topnav-inner { padding: 0 0.85rem; }
  .topnav-cta { display: none; }
  .main-content { padding: 1.4rem 1rem 3.5rem; }
  .hero { padding: 1.4rem; border-radius: 18px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .button-primary, .button-secondary { justify-content: center; }
  .footer-desktop { display: none; }
  .footer-mobile { display: block; padding: 1.4rem 1rem; }
  .footer-mobile-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
  .footer-mobile-links a { color: hsl(var(--muted-foreground)); font-size: 0.88rem; }
  .footer-mobile-meta { color: hsl(var(--muted-foreground)); font-size: 0.84rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
