/* ============================================
   Contextary — Shared Design System
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --bg-primary: #0A0A0F;
  --bg-secondary: #12121A;
  --bg-card: #1A1A25;
  --bg-card-hover: #22222F;
  --text-primary: #F0F0F5;
  --text-secondary: #8888A0;
  --text-muted: #55556A;
  --accent: #2563EB;
  --accent-light: #3B82F6;
  --accent-glow: rgba(37, 99, 235, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --red: #EF4444;
  --green: #22C55E;
  --amber: #F59E0B;
  --purple: #C084FC;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Noise Texture Overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---- Dot Grid Background ---- */
.dot-grid {
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---- Hero Glow ---- */
.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Glassmorphism Cards ---- */
.glass-card {
  background: rgba(26, 26, 37, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: var(--border-hover);
  background: rgba(34, 34, 47, 0.7);
}

.glass-card-glow:hover {
  box-shadow: 0 0 32px -8px var(--accent-glow);
}

/* ---- Button Glow ---- */
.btn-glow {
  box-shadow: 0 0 20px -4px var(--accent-glow);
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.btn-glow:hover {
  box-shadow: 0 0 32px -2px var(--accent-glow), 0 0 60px -8px rgba(37, 99, 235, 0.15);
}

.btn-glow:active {
  transform: scale(0.98);
}

/* ---- Code / Conversation Window ---- */
.code-window {
  background: #0D0D14;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
}

.code-titlebar {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.code-body {
  padding: 24px;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

/* Syntax colors for any inline code examples */
.syn-keyword { color: #C084FC; }
.syn-fn { color: #60A5FA; }
.syn-string { color: #34D399; }
.syn-comment { color: #55556A; font-style: italic; }
.syn-type { color: #F59E0B; }
.syn-prop { color: #93C5FD; }
.syn-val { color: #F0F0F5; }
.syn-bracket { color: #8888A0; }
.syn-arrow { color: #C084FC; }
.syn-num { color: #FB923C; }

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.35s; }
.reveal-delay-5 { transition-delay: 0.4s; }

/* ---- Nav ---- */
.nav-blur {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

/* ---- Integration Pill ---- */
.integration-pill {
  background: rgba(26, 26, 37, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.integration-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ---- Stat Number Animation ---- */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* ---- Mobile Nav ---- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 49;
  padding: 24px;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.mobile-menu a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ---- Selection ---- */
::selection {
  background: rgba(37, 99, 235, 0.3);
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* ---- Problem Card Red Accent ---- */
.problem-card {
  border-top: 2px solid rgba(239, 68, 68, 0.4);
}

.problem-card:hover {
  border-top-color: rgba(239, 68, 68, 0.7);
}

/* ---- Conversation Mockup ---- */
.convo-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.convo-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.convo-check {
  color: var(--green);
  font-size: 13px;
  line-height: 1.7;
}

.convo-result {
  color: var(--accent-light);
  font-weight: 600;
  font-size: 15px;
}

/* ---- Use Case Card ---- */
.use-case-card {
  border-left: 3px solid var(--accent);
}

.use-case-card:hover {
  border-left-color: var(--accent-light);
}

/* ---- Feature Detail Section ---- */
.feature-section:nth-child(even) {
  background: rgba(13, 13, 20, 0.5);
}

/* ---- Pricing Card ---- */
.pricing-card {
  position: relative;
}

.pricing-card.featured {
  border-color: rgba(37, 99, 235, 0.4);
}

.pricing-card.featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(37, 99, 235, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---- Pricing Table ---- */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.pricing-table th,
.pricing-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.pricing-table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-table td {
  color: var(--text-primary);
}

.pricing-table td.muted {
  color: var(--text-muted);
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-blue {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
}

.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
}

.badge-purple {
  background: rgba(192, 132, 252, 0.12);
  color: var(--purple);
}

/* ---- Example Block (for feature detail pages) ---- */
.example-block {
  background: #0D0D14;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

/* ---- Page hero (inner pages) ---- */
.page-hero {
  padding-top: 128px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .page-hero {
    padding-top: 160px;
    padding-bottom: 112px;
  }
}
