/* ============================================
   IPCraft Design System — Light Theme
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-elevated: #f1f3f5;
  --bg-card: rgba(0,0,0,0.02);
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.15);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --accent: #059669;
  --accent-dim: rgba(5,150,105,0.08);
  --accent-glow: rgba(5,150,105,0.2);
  --accent-bright: #047857;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* ============================================
   GRAIN OVERLAY
   ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.02;
  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;
  pointer-events: none;
  z-index: 9999;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.logo span {
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.2px;
}
.nav-links a:hover { color: var(--text-primary); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(0,0,0,0.02);
}
.btn-lg {
  padding: 16px 36px;
  font-size: 15px;
  border-radius: 10px;
}
.btn-block { display: block; width: 100%; text-align: center; }

/* ============================================
   SECTION UTILITIES
   ============================================ */
.section {
  padding: 120px 0;
  position: relative;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.section-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-header .section-desc {
  margin: 0 auto;
}

/* ============================================
   PAGE HEADER (for inner pages)
   ============================================ */
.page-header {
  padding: 100px 0 48px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}
.page-header .page-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* ============================================
   PRICING (shared)
   ============================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  max-width: 1100px;
  margin: 0 auto;
}
.price-card {
  background: var(--bg-primary);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease;
}
.price-card:hover {
  background: var(--bg-secondary);
}
.price-card-featured {
  background: var(--bg-secondary);
  position: relative;
}
.price-card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}
.price-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.price-card .popular-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}
.price-card .price-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -2px;
}
.price .period {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0;
}
.price-card ul {
  list-style: none;
  margin: 24px 0;
  flex: 1;
}
.price-card li {
  font-size: 13px;
  padding: 6px 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.price-card li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============================================
   CTA (shared)
   ============================================ */
.cta {
  padding: 120px 0;
  text-align: center;
  position: relative;
  background: var(--bg-secondary);
}
.cta-content {
  position: relative;
  z-index: 1;
}
.cta .section-title {
  margin-bottom: 16px;
}
.cta .section-desc,
.cta p:not(.section-label) {
  color: var(--text-secondary);
  margin: 0 auto 28px;
  max-width: 560px;
  text-align: center;
  font-size: 17px;
}
.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}
.footer-brand {
  flex: 1;
  min-width: 200px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 8px;
  max-width: 280px;
  line-height: 1.6;
}
.footer-links {
  display: flex;
  gap: 56px;
}
.footer-links h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}
.footer-links a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom {
  width: 100%;
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom p {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ============================================
   BACK LINK
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent-bright); }

/* ============================================
   DARK CODE BLOCKS
   ============================================ */
pre {
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 0 0 16px;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(255,255,255,0.7);
  -webkit-font-smoothing: auto;
}
pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}
/* Syntax highlight colors (dark panel) */
pre .key { color: #89b4fa; }
pre .str { color: #a6e3a1; }
pre .num { color: #fab387; }
pre .bool { color: #cba6f7; }
pre .null { color: #6c7086; }
pre .c, pre .comment { color: rgba(255,255,255,0.35); }
pre .cmd { color: #00d4aa; }
pre .f, pre .flag { color: #60a5fa; }
pre .s, pre .string { color: #a5d6ff; }
pre .v, pre .var { color: #fbbf24; }
pre .k, pre .keyword { color: #c4b5fd; }
pre .o, pre .op { color: rgba(255,255,255,0.4); }

/* Inline code (stays light) */
code {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Base URL box */
.base-url {
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 15px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* ============================================
   COMPARISON TABLE
   ============================================ */
.comparison table {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 14px;
}
.comparison th,
.comparison td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.comparison thead th {
  background: var(--bg-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
}
.comparison tbody th {
  font-weight: 600;
  color: var(--text-primary);
}
.comparison td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}
.check { color: var(--accent); font-weight: 700; }
.no { color: var(--text-tertiary); }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .section { padding: 80px 0; }
  .page-header { padding: 80px 0 32px; }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .nav-links { gap: 16px; }
  .nav-links a:not(.btn) { display: none; }
  .footer-links { gap: 32px; }
  .cta-actions {
    flex-direction: column;
  }
  .cta-actions .btn { width: 100%; max-width: 280px; }
}
