/* ============================================================
   VenHub Developer Portal — Global Styles
   ============================================================ */

/* Smooth cross-fade between pages instead of a hard reload flash.
   Ignored gracefully by browsers that don't support it yet. */
@view-transition {
  navigation: auto;
}

:root {
  --color-primary: #4F46E5;
  --color-primary-dark: #3730A3;
  --color-primary-light: #818CF8;
  --color-accent: #06B6D4;
  --color-accent-dark: #0891B2;
  --color-bg: #FFFFFF;
  --color-bg-subtle: #F8FAFC;
  --color-bg-muted: #F1F5F9;
  --color-surface: #FFFFFF;
  --color-border: #E2E8F0;
  --color-border-subtle: #F1F5F9;
  --color-text: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-code-bg: #1E293B;
  --color-code-text: #E2E8F0;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);

  --nav-height: 64px;
}

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

html { scroll-behavior: auto; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ============================================================
   Top Navigation
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  view-transition-name: site-nav;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.nav-logo-suffix {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-secondary);
  letter-spacing: 0.2px;
  padding-left: 10px;
  border-left: 1px solid var(--color-border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  list-style: none;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.08);
}

.version-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.version-badge-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.btn-outline:hover {
  background: rgba(79, 70, 229, 0.06);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
  padding: 80px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--color-text);
  max-width: 800px;
  margin: 0 auto 20px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

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

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ============================================================
   Getting Started Steps
   ============================================================ */

.section {
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-title {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--color-text);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 17px;
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

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

/* ============================================================
   API Products Grid
   ============================================================ */

.bg-subtle { background: var(--color-bg-subtle); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.product-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.product-icon.inventory { background: rgba(79, 70, 229, 0.1); }
.product-icon.orders { background: rgba(6, 182, 212, 0.1); }
.product-icon.auth { background: rgba(16, 185, 129, 0.1); }
.product-icon.webhooks { background: rgba(245, 158, 11, 0.1); }

.product-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.product-card p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.endpoint-count {
  display: inline-block;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  margin-top: 12px;
}

/* ============================================================
   Code Preview Section
   ============================================================ */

.code-preview-section {
  background: var(--color-code-bg);
  padding: 80px 24px;
  color: var(--color-code-text);
}

.code-preview-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.code-preview-copy .section-title { color: white; }

.code-preview-copy p {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin-bottom: 28px;
}

.code-block {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.code-block-dots {
  display: flex;
  gap: 6px;
}

.code-block-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-block-dots span:nth-child(1) { background: #FF5F57; }
.code-block-dots span:nth-child(2) { background: #FFBD2E; }
.code-block-dots span:nth-child(3) { background: #28CA41; }

.code-block-label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.4);
}

.code-block pre {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--color-code-text);
  margin: 0;
}

.code-keyword { color: #C084FC; }
.code-string { color: #86EFAC; }
.code-comment { color: #6B7280; font-style: italic; }
.code-key { color: #93C5FD; }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.5);
  view-transition-name: site-footer;
  padding: 64px 24px 32px;
}

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

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand-name {
  font-weight: 700;
  font-size: 18px;
  color: white;
  letter-spacing: -0.3px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  margin-top: 16px;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }

.footer-col li + li { margin-top: 10px; }

.footer-col a {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom-links {
  display: flex;
  gap: 24px;
}

.footer-bottom-links a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
}

.footer-bottom-links a:hover { color: white; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .code-preview-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .nav-links { display: none; }

  .hero { padding: 56px 20px 72px; }

  .hero-stats {
    gap: 24px;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
