/* planar Documentation - Dark Mode UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --background: #000000;
  --foreground: #ffffff;
  --muted: #2d2d2d;
  --muted-foreground: #8e8e93;
  --border: #1a1a1a;
  --primary: #3a3a3c;
  --primary-hover: #4a4a4c;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --success: #30d158;
  --warning: #ff9f0a;
  --destructive: #ff453a;
  --card: #0a0a0a;
  --card-hover: #141414;
  --radius: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px;
}

@media (max-width: 768px) {
  .docs-layout {
    flex-direction: column;
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--muted-foreground);
  font-weight: 400;
  margin-left: 8px;
  font-size: 14px;
}

.header-nav {
  display: flex;
  gap: 8px;
}

.header-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.header-nav a:hover {
  color: var(--foreground);
  background: var(--muted);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 64px;
  width: 260px;
  min-width: 260px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 24px;
  border-right: 1px solid var(--border);
  background: var(--background);
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
  margin-bottom: 12px;
  padding-left: 12px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav a {
  display: block;
  padding: 8px 12px;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  color: var(--foreground);
  background: var(--muted);
}

.sidebar-nav a.active {
  color: var(--foreground);
  background: var(--muted);
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  padding: 48px 64px;
}

@media (max-width: 1200px) {
  .main-content {
    padding: 32px 48px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 24px;
    max-width: none;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

h1 {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 24px;
}

h2 {
  font-size: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 18px;
  margin-top: 32px;
}

p {
  margin-bottom: 16px;
  color: var(--muted-foreground);
}

.lead {
  font-size: 18px;
  color: var(--muted-foreground);
  margin-bottom: 32px;
  max-width: 100%;
}

/* Prevent aggressive word wrapping */
p, li, td, .step-content, .card-description, .feature-description {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* Lists */
ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--muted-foreground);
}

li {
  margin-bottom: 8px;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--foreground);
}

pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 24px;
}

pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--primary-hover);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--foreground);
}

.card-description {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 0;
}

.card-icon {
  width: 40px;
  height: 40px;
  background: var(--muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-secondary {
  background: var(--muted);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: var(--primary-hover);
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 18px;
}

.alert-info {
  background: rgba(10, 132, 255, 0.1);
  border: 1px solid rgba(10, 132, 255, 0.2);
  color: var(--accent);
}

.alert-warning {
  background: rgba(255, 159, 10, 0.1);
  border: 1px solid rgba(255, 159, 10, 0.2);
  color: var(--warning);
}

.alert-success {
  background: rgba(48, 209, 88, 0.1);
  border: 1px solid rgba(48, 209, 88, 0.2);
  color: var(--success);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--foreground);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  color: var(--muted-foreground);
  font-size: 14px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 80px 24px;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }
}

.hero .lead {
  font-size: 20px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #5e5ce6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 24px;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-description {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Steps */
.steps {
  counter-reset: step;
  margin: 32px 0;
}

.step {
  position: relative;
  padding-left: 48px;
  padding-bottom: 32px;
  border-left: 2px solid var(--border);
  margin-left: 16px;
}

.step:last-child {
  border-left: none;
  padding-bottom: 0;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -17px;
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content {
  color: var(--muted-foreground);
  font-size: 14px;
}

/* Keyboard shortcuts */
kbd {
  display: inline-block;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 0 var(--border);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  margin-top: 80px;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  font-size: 14px;
  color: var(--muted-foreground);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--foreground);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Search */
.search-container {
  position: relative;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.badge-new {
  background: rgba(48, 209, 88, 0.1);
  color: var(--success);
}

.badge-pro {
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
}

/* TOC */
.toc {
  position: fixed;
  right: 24px;
  top: 100px;
  width: 200px;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .toc {
    display: none;
  }
}

.toc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list a {
  display: block;
  padding: 6px 0;
  color: var(--muted-foreground);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -2px;
  transition: all 0.2s;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--foreground);
  border-left-color: var(--accent);
}

/* Image */
.doc-image {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 24px 0;
}

/* Video placeholder */
.video-placeholder {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  color: var(--muted-foreground);
}


/* === Shared chrome (site-chrome.js) : wordmark planar + lattice spinner + footer contact === */
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo .brand { font-family: var(--font-sans); font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.logo .brand-sub { font-family: var(--font-sans); color: var(--muted-foreground); font-weight: 400; font-size: 0.85rem; margin-left: 4px; }
.header-spinner { width: 40px; height: 28px; color: rgba(255,255,255,0.75); flex-shrink: 0; }
.header-spinner .beam { opacity: 0; transition: opacity 0.15s ease-out; }
.header-spinner .beam.active { opacity: 1; }
.header-spinner .beam.fading { opacity: 0.3; transition: opacity 0.4s ease-out; }
.footer-contact { margin-top: 8px; color: var(--muted-foreground); font-size: 0.9rem; }
.footer-contact a { color: var(--accent); text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
