/* VirtualBoard Design System — "Precision Engineering" aesthetic
   Dark, refined, technical. Bloomberg terminal meets Stripe docs.
   Shared with vb-cli docs for visual consistency. */

/* ============================================
   Fonts
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  --background: oklch(0.12 0.008 260);
  --background-raised: oklch(0.145 0.008 260);
  --foreground: oklch(0.94 0.005 260);
  --foreground-dim: oklch(0.82 0.005 260);
  --primary: oklch(0.68 0.14 230);
  --primary-foreground: oklch(0.12 0.008 260);
  --primary-glow: oklch(0.68 0.14 230 / 0.15);
  --secondary: oklch(0.72 0.12 195);
  --muted: oklch(0.22 0.008 260);
  --muted-foreground: oklch(0.55 0.01 260);
  --border: oklch(0.22 0.008 260);
  --border-subtle: oklch(0.18 0.006 260);
  --card: oklch(0.155 0.008 260);
  --card-hover: oklch(0.175 0.01 260);
  --accent: oklch(0.78 0.16 155);
  --accent-warm: oklch(0.75 0.14 55);
  --danger: oklch(0.65 0.2 25);
  --surface-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ============================================
   Base Reset & Globals
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--muted) var(--background);
}

body {
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on, 'ss02' on;
  position: relative;
}

/* Noise overlay for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--surface-noise);
  background-repeat: repeat;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

code, pre, .font-mono {
  font-family: 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Typography Scale
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3vw + 0.5rem, 3rem); }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem); }
p  { line-height: 1.75; }

/* ============================================
   Page Load Animations
   ============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}

@keyframes terminalBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.animate-fade-up {
  animation: fadeUp 0.6s ease-out both;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out both;
}

/* Stagger children */
.stagger > * { animation: fadeUp 0.5s ease-out both; }
.stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.50s; }

/* ============================================
   Navigation
   ============================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: oklch(0.12 0.008 260 / 0.85);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-link {
  position: relative;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link--active {
  color: var(--foreground);
}

.nav-link--active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* ============================================
   Hero Sections
   ============================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 100%;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, var(--primary-glow), transparent),
    radial-gradient(ellipse 40% 40% at 30% 20%, oklch(0.7 0.12 195 / 0.06), transparent);
  pointer-events: none;
}

/* Geometric accent line */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--border) 20%,
    var(--primary) 50%,
    var(--border) 80%,
    transparent
  );
}

@media (min-width: 768px) {
  .hero { padding: 8rem 0 5rem; }
}

/* ============================================
   Cards
   ============================================ */
.vb-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.vb-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  opacity: 0;
  background: linear-gradient(135deg, var(--primary-glow), transparent 60%);
  transition: opacity 0.3s ease;
}

.vb-card:hover {
  background: var(--card-hover);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px oklch(0 0 0 / 0.3),
    0 0 0 1px var(--border);
}

.vb-card:hover::before {
  opacity: 1;
}

.vb-card > * {
  position: relative;
  z-index: 1;
}

/* Card icon container */
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  background: var(--primary-glow);
  border: 1px solid oklch(0.68 0.14 230 / 0.2);
  transition: transform 0.3s ease, background 0.3s ease;
}

.vb-card:hover .card-icon {
  transform: scale(1.1);
  background: oklch(0.68 0.14 230 / 0.25);
}

/* ============================================
   Code Blocks — Terminal Style
   ============================================ */
.code-terminal {
  background: oklch(0.10 0.005 260);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.code-terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: oklch(0.13 0.006 260);
  border-bottom: 1px solid var(--border-subtle);
}

.code-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-terminal-dot--red    { background: oklch(0.65 0.2 25); }
.code-terminal-dot--yellow { background: oklch(0.75 0.15 85); }
.code-terminal-dot--green  { background: oklch(0.7 0.18 155); }

.code-terminal-body {
  padding: 1rem 1.25rem;
}

.code-terminal-body code,
.code-terminal-body pre {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}

/* Inline code */
.inline-code {
  background: oklch(0.18 0.006 260);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 0.125rem 0.4rem;
  font-size: 0.8125rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--foreground-dim);
}

/* ============================================
   Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}

.badge--primary {
  background: oklch(0.68 0.14 230 / 0.12);
  color: var(--primary);
  border: 1px solid oklch(0.68 0.14 230 / 0.2);
}

.badge--accent {
  background: oklch(0.78 0.16 155 / 0.12);
  color: var(--accent);
  border: 1px solid oklch(0.78 0.16 155 / 0.2);
}

.badge--muted {
  background: oklch(0.22 0.008 260 / 0.5);
  color: var(--muted-foreground);
  border: 1px solid var(--border-subtle);
}

.badge--warm {
  background: oklch(0.75 0.14 55 / 0.12);
  color: var(--accent-warm);
  border: 1px solid oklch(0.75 0.14 55 / 0.2);
}

.badge--secondary {
  background: oklch(0.72 0.12 195 / 0.12);
  color: var(--secondary);
  border: 1px solid oklch(0.72 0.12 195 / 0.2);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 4px 14px oklch(0.68 0.14 230 / 0.3), inset 0 1px 0 oklch(1 0 0 / 0.1);
}

.btn--primary:hover {
  background: oklch(0.72 0.15 230);
  box-shadow: 0 6px 20px oklch(0.68 0.14 230 / 0.4), inset 0 1px 0 oklch(1 0 0 / 0.15);
  transform: translateY(-1px);
}

.btn--ghost {
  background: oklch(0.18 0.006 260);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: oklch(0.22 0.008 260);
  border-color: oklch(0.28 0.01 260);
  transform: translateY(-1px);
}

/* ============================================
   Section Dividers
   ============================================ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--border) 30%,
    var(--border) 70%,
    transparent
  );
  margin: 0 auto;
  max-width: 80%;
}

/* Gradient section backgrounds */
.section-gradient {
  background: linear-gradient(180deg,
    transparent,
    oklch(0.14 0.008 260) 15%,
    oklch(0.14 0.008 260) 85%,
    transparent
  );
}

/* ============================================
   Step Indicators
   ============================================ */
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  border: 1px solid oklch(0.68 0.14 230 / 0.25);
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  text-align: center;
}

.site-footer p {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.8;
}

.site-footer a {
  color: var(--primary);
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--foreground);
}

.footer-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 767px) {
  .hero { padding: 4rem 0 3rem; }
}

/* ============================================
   Focus & Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

/* ============================================
   Workflow Diagram
   ============================================ */
.workflow-node {
  flex: 1;
  text-align: center;
  padding: 1.5rem 1rem;
}

.workflow-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.workflow-icon:hover {
  transform: scale(1.1);
}

.workflow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ============================================
   Note / Callout Boxes
   ============================================ */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.callout--info {
  background: oklch(0.78 0.16 155 / 0.08);
  border: 1px solid oklch(0.78 0.16 155 / 0.2);
  color: var(--muted-foreground);
}

.callout--info strong {
  color: var(--foreground);
}

.callout--warn {
  background: oklch(0.75 0.14 55 / 0.08);
  border: 1px solid oklch(0.75 0.14 55 / 0.2);
  color: var(--muted-foreground);
}

.callout--warn strong {
  color: var(--accent-warm);
}

/* ============================================
   List styling
   ============================================ */
.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

.bullet-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 0.6rem;
}

/* ============================================
   Tabs (for IDE integration section)
   ============================================ */
.tab-group {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
  animation: fadeUp 0.3s ease-out both;
}

.tab-panel.active {
  display: block;
}
