/* ==========================================================================
   SolveonX — Phase 1 Foundation: Design Tokens & Theme
   Dark SaaS theme. Loaded after styles.css so tokens + foundation overrides win.
   Defaults used (per plan Open Questions):
   - Font: Geist (recommended)
   - Accent: WhatsApp green #25D366 + secondary amber #d4af37 (max 2)
   ========================================================================== */

/* --- Self-hosted Geist --------------------------------------------------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist/Geist-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist/Geist-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* Base — charcoal black site-wide */
  --bg: #0c0c0e;
  --bg-elevated: #111114;
  --surface: #141418;
  --surface-raised: #1a1a20;
  --surface-glass: rgba(20, 20, 24, 0.55);

  /* Text */
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-soft: #71717a;

  /* Borders & shadows */
  --border: #27272a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(37, 211, 102, 0.08);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);

  /* Accent 1 — WhatsApp green */
  --accent: #25d366;
  --accent-hover: #1ebe57;
  --accent-soft: rgba(37, 211, 102, 0.16);
  --accent-muted: #6ee7a0;

  /* Accent 2 — amber (secondary only) */
  --warm: #d4af37;
  --warm-soft: rgba(212, 175, 55, 0.16);

  /* Legacy aliases remapped for dark (keeps existing styles.css working) */
  --blue: #25d366;
  --blue-soft: rgba(37, 211, 102, 0.14);
  --cyan: #128c7e;
  --cyan-soft: rgba(18, 140, 126, 0.16);

  /* Radius & layout */
  --radius: 12px;
  --radius-lg: 20px;
  --max: 76rem;

  /* Typography — Geist + label tracking */
  --font: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-display: clamp(2.25rem, 5vw, 4.25rem);

  --leading-tight: 1.05;
  --leading-snug: 1.25;
  --leading-normal: 1.6;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-label: 0.1em;
  --tracking-caps: 0.14em;

  /* Spacing scale — increased whitespace between sections */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3.5rem;
  --space-9: 4.5rem;
  --space-10: 6rem;
  --section-pad-y: clamp(4.5rem, 10vw, 7.5rem);
  --section-gap: clamp(1.5rem, 3vw, 2.5rem);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #25d366 0%, #128c7e 55%, #0d9488 100%);
  --gradient-surface: linear-gradient(
    145deg,
    rgba(26, 26, 32, 0.92),
    rgba(18, 18, 22, 0.88)
  );
  --gradient-mesh:
    radial-gradient(ellipse 50% 40% at 15% 20%, rgba(37, 211, 102, 0.28), transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 15%, rgba(18, 140, 126, 0.22), transparent 50%),
    radial-gradient(ellipse 40% 45% at 70% 80%, rgba(212, 175, 55, 0.1), transparent 55%),
    radial-gradient(ellipse 55% 40% at 20% 85%, rgba(37, 211, 102, 0.12), transparent 50%);

  /* Grain / glass helpers */
  --grain-opacity: 0.045;
  --glass-blur: 18px;
  --glass-bg: rgba(18, 18, 22, 0.45);
  --glass-border: rgba(255, 255, 255, 0.12);
}

/* --- Base surface — charcoal black everywhere ---------------------------- */
html {
  background: var(--bg);
}

html,
body,
.page-wrap,
main {
  color: var(--text);
  background: var(--bg);
  background-image: none;
}

body {
  font-family: var(--font);
}

/* Kill leftover light section/footer washes from styles.css */
.section,
.section-alt,
.logos-section,
.site-footer,
.final-cta,
.results-section,
.pricing-section {
  background: var(--bg);
  background-image: none;
}

.section-alt,
.logos-section {
  background: var(--bg-elevated);
  border-color: var(--border);
}

.site-footer {
  background: var(--bg);
  border-top-color: var(--border);
}

.page-conversion .site-header {
  background: rgba(12, 12, 14, 0.95);
}

/* Contained bands/cards stay charcoal-elevated, not white */
.cta-band,
.roi-interactive,
.roi-band,
.demo-package-card,
.demo-phases-card {
  background:
    linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(18, 140, 126, 0.06)),
    var(--surface);
  border-color: rgba(37, 211, 102, 0.22);
}

.cta-band::before {
  background: radial-gradient(circle, rgba(37, 211, 102, 0.12), transparent 70%);
}

.project-thumb {
  background:
    linear-gradient(135deg, rgba(37, 211, 102, 0.18), rgba(18, 140, 126, 0.1)),
    var(--surface-raised);
}

.project-thumb-fallback {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    linear-gradient(135deg, rgba(37, 211, 102, 0.16), rgba(18, 140, 126, 0.12));
}

/* Forms / inputs that were hard-coded white */
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select,
.form-group input,
.form-group textarea,
.form-group select,
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-raised);
  color: var(--text);
}

/* Phone mock + chat bubbles (were light pastels) */
.phone-mock {
  background: var(--surface-raised);
}

.chat-bubble.incoming {
  background: var(--surface);
  color: var(--text-muted);
}

/* Diff cards (were #fff5f5 / mint washes) */
.diff-card.bad {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
}

.diff-card.good {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.35);
}

/* Soft translucent panels that still read white on dark */
.launch-badge {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Subtle noise/grain overlay on dark backgrounds */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: 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.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* Sticky header adapted to dark tokens */
.site-header {
  background: rgba(10, 10, 12, 0.78);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(1.2);
}

.logo,
.logo:hover {
  color: var(--text);
}

.nav-desktop a,
.nav-mobile a {
  color: var(--text-muted);
}

.nav-desktop a:hover,
.nav-desktop a.active,
.nav-mobile a:hover {
  color: var(--accent);
}

/* --- Hero: slow-drifting mesh gradient (replaces static blobs) ----------- */
.hero {
  background-color: var(--bg);
  background-image: var(--gradient-mesh);
  background-size: 200% 200%;
  background-position: 0% 40%;
  animation: mesh-drift 22s ease-in-out infinite alternate;
}

.hero::after {
  /* Soften the old light-mode dot grid into a faint dark grid */
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 75%);
}

.hero::before {
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

@keyframes mesh-drift {
  0% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 80% 20%;
  }
  100% {
    background-position: 40% 90%;
  }
}

/* Hero stats / trust chips: solid dark surfaces — no glass (glass reserved for command center) */
.trust-strip span {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

.stats div {
  background: var(--surface-raised);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

/* --- Glassmorphism: Lead command center ONLY ----------------------------- */
.dashboard-shell {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}

.dashboard-shell::before {
  background: linear-gradient(
    135deg,
    rgba(37, 211, 102, 0.12),
    rgba(212, 175, 55, 0.05)
  );
}

/* Inner tiles stay translucent dark — not competing glass panels */
.metric-row div,
.pipeline-card,
.automation-list {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  box-shadow: none;
}

/* Label / caps tracking from new tokens */
.mini-label,
.section-label {
  letter-spacing: var(--tracking-caps);
}

.live-pill {
  background: var(--warm-soft);
  color: var(--warm);
}

/* Cookie banner: dark solid surface (not glass card treatment) */
.cookie-banner {
  background: var(--surface-raised);
  border-color: var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Featured package wash → dark-friendly accent tint */
.featured-package {
  border-color: rgba(37, 211, 102, 0.45);
  background:
    linear-gradient(180deg, rgba(37, 211, 102, 0.12), transparent 50%),
    var(--surface);
  outline-color: rgba(37, 211, 102, 0.15);
}

/* Page heroes inherit dark mesh wash */
.page-hero {
  background:
    radial-gradient(circle at 90% 10%, rgba(37, 211, 102, 0.14), transparent 22rem),
    var(--bg);
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .hero {
    animation: none;
    background-position: 50% 40%;
  }

  .dashboard-shell {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Phase 2 — Layout Restructure (visual only, no content change)
   ========================================================================== */

/* Site-wide section spacing from tokens */
.section {
  padding: var(--section-pad-y) 0;
}

.page-hero {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0 clamp(2.5rem, 5vw, 3.5rem);
}

/* Asymmetric hero: copy left, visual bleeding off right */
.hero {
  overflow: hidden;
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.hero-inner {
  align-items: center;
}

.hero-copy {
  text-align: left;
  max-width: 40rem;
  z-index: 1;
}

.hero-actions {
  justify-content: flex-start;
}

.hero-visual {
  position: relative;
  z-index: 0;
  width: 100%;
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
    gap: clamp(1.5rem, 4vw, 3rem);
  }

  .hero-visual {
    justify-self: end;
    width: min(34rem, 48vw);
    margin-right: clamp(-5rem, -9vw, -2.5rem);
    transform: translateX(8%);
  }

  .hero-visual .dashboard-shell {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .hero-visual {
    width: min(38rem, 46vw);
    margin-right: clamp(-8rem, -12vw, -4rem);
    transform: translateX(14%);
  }
}

/* Stats: one large primary + two supporting */
.stats {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
  max-width: 38rem;
  align-items: stretch;
}

.stats .stat-primary {
  padding: 1.25rem 1.1rem;
  background: linear-gradient(160deg, rgba(37, 211, 102, 0.16), var(--surface-raised));
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.stats .stat-primary .stat-value {
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  line-height: 1;
}

.stats .stat-primary .stat-label {
  margin-top: 0.45rem;
  font-size: 0.8rem;
}

.stats .stat-secondary {
  padding: 0.85rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stats .stat-secondary .stat-value {
  font-size: 1.2rem;
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stats .stat-primary {
    grid-column: 1 / -1;
  }
}

/* Diagonal SVG dividers between major sections */
.section-divider {
  display: block;
  line-height: 0;
  margin: -1px 0;
  background: var(--bg);
}

.section-divider svg {
  display: block;
  width: 100%;
  height: clamp(2rem, 4vw, 3.5rem);
}

.section-divider path {
  fill: var(--bg-elevated);
}

.section-divider--flip {
  transform: scaleX(-1);
}

.section-divider--flip path {
  fill: var(--bg);
}

/* Divider after elevated sections that lead into normal bg */
.section-alt + .section-divider path,
.logos-section + .section-divider path {
  fill: var(--bg);
}

.section + .section-divider path,
.hero + .section-divider path {
  fill: var(--bg-elevated);
}

/* -------------------------------------------------------------
 * Comprehensive Dark Mode Overrides for Legacy Light-Mode Selectors
 * ------------------------------------------------------------- */

.site-header,
.page-conversion .site-header {
  background: var(--nav-bg, rgba(12, 12, 14, 0.85));
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
}

.section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.trust-strip span {
  background: var(--glass-bg);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.metric-row div,
.pipeline-card,
.automation-list {
  background: var(--glass-bg);
  border-color: var(--border-subtle);
}

.phone-mock {
  background: var(--bg-card);
}

.chat-bubble.incoming {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.logos-section {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.thumb-auto-stats div {
  background: rgba(18, 18, 22, 0.9);
  color: var(--text-primary);
}

.pricing-disclaimer,
.testimonial-disclaimer {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

