/* ============================================================
   Papillon IT Solutions — design tokens + global styles
   ============================================================ */

:root {
  /* dark mode (default) — purple-tinted throughout */
  --bg: #0a0715;
  --bg-2: #0e0a1f;
  --bg-3: #150f2a;
  --bg-elev: #1c1540;
  --line: #251e42;
  --line-2: #322858;
  --line-strong: #3e3264;
  --text: #f4f1ff;
  --text-dim: #b0a5d4;
  --text-mute: #706592;
  --primary: #8b5cf6;
  --primary-bright: #a78bfa;
  --neon: #c084fc;
  --neon-2: #e879f9;
  --good: #4ade80;
  --grid-color: rgba(139, 92, 246, 0.07);
  --glow: rgba(139, 92, 246, 0.35);
  --glow-soft: rgba(139, 92, 246, 0.15);
  --card-bg: linear-gradient(180deg, rgba(28, 21, 64, 0.55), rgba(14, 10, 31, 0.55));
  --hero-bg: #0b0720;
  --hero-glow-1: rgba(100, 40, 200, 0.65);
  --hero-glow-2: rgba(140, 60, 240, 0.45);
  --hero-glow-3: rgba(180, 100, 255, 0.30);
  --hero-glow-4: rgba(220, 120, 255, 0.18);
  --hero-grid-line: rgba(139, 92, 246, 0.12);

  --font-display: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  --font-body: "Inter", ui-sans-serif, sans-serif;
  --font-mono: "Inter", ui-sans-serif, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  --c-max: 1280px;
}

[data-theme="light"] {
  --bg: #e9e2f7;
  --bg-2: #ddd2f0;
  --bg-3: #cfc0e8;
  --bg-elev: #f2ecfa;
  --line: #c3b3dd;
  --line-2: #ad9ad0;
  --line-strong: #9484c0;
  --text: #150c28;
  --text-dim: #352a52;
  --text-mute: #5c4f7d;
  --primary: #7c3aed;
  --primary-bright: #6d28d9;
  --neon: #9f3ff0;
  --neon-2: #c026d3;
  --grid-color: rgba(124, 58, 237, 0.10);
  --glow: rgba(124, 58, 237, 0.22);
  --glow-soft: rgba(124, 58, 237, 0.10);
  --card-bg: linear-gradient(180deg, #f2ecfa, #ddd2f0);
  --hero-bg: #1b0f3a;
  --hero-glow-1: rgba(124, 58, 237, 0.65);
  --hero-glow-2: rgba(88, 28, 175, 0.45);
  --hero-glow-3: rgba(168, 85, 247, 0.35);
  --hero-glow-4: rgba(192, 132, 252, 0.20);
  --hero-grid-line: rgba(168, 85, 247, 0.14);
}

/* Keep hero sections on the dark purple palette (matching the primary CTA
   button) even in light mode, so text/tag/line colors stay legible. */
[data-theme="light"] .hero {
  --text: #f4f1ff;
  --text-dim: #c3b6e6;
  --text-mute: #9a8cc2;
  --line: #34285c;
  --line-2: #423470;
  --line-strong: #4f3f82;
  --bg-2: #241a4a;
  --bg-3: #2c2058;
  --primary: #8b5cf6;
  --primary-bright: #a78bfa;
  --neon: #c084fc;
  --neon-2: #e879f9;
  --glow: rgba(139, 92, 246, 0.35);
  --glow-soft: rgba(139, 92, 246, 0.15);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

body {
  background-image:
    radial-gradient(1100px 600px at 80% -10%, var(--glow-soft), transparent 60%),
    radial-gradient(900px 500px at 0% 40%, var(--glow-soft), transparent 60%),
    radial-gradient(1200px 800px at 50% 60%, var(--glow-soft), transparent 70%),
    linear-gradient(to bottom, var(--bg), var(--bg));
  overflow-x: hidden;
}

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

img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

h1 { font-size: clamp(40px, 6vw, 84px); line-height: 1; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3.5vw, 48px); line-height: 1.05; }
h3 { font-size: clamp(20px, 2vw, 28px); line-height: 1.15; }

p { margin: 0; color: var(--text-dim); }

button { font-family: inherit; }

/* ============================================================
   Layout primitives
   ============================================================ */

.container {
  max-width: var(--c-max);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 120px 0;
  position: relative;
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .container { padding: 0 20px; }
}

.eyebrow {
  display: none;
}
.eyebrow::before {
  display: none;
}

.muted { color: var(--text-dim); }
.dim   { color: var(--text-mute); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .3s ease, background .2s ease, border-color .2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--neon));
  color: white;
  box-shadow: 0 8px 32px -8px var(--glow), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 48px -8px var(--glow), 0 0 0 1px var(--primary-bright), inset 0 0 0 1px rgba(255,255,255,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--primary);
  background: var(--glow-soft);
}

.btn .arrow {
  display: inline-block;
  transition: transform .2s ease;
}
.btn:hover .arrow { transform: translateX(4px); }

/* ============================================================
   Cards
   ============================================================ */

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, var(--primary), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -24px var(--glow);
}
.card:hover::before { opacity: 1; }

/* ============================================================
   Nav
   ============================================================ */

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 0 color-mix(in oklab, var(--primary) 18%, transparent), 0 4px 24px -4px rgba(0,0,0,0.12);
}

.nav {
  width: 100%;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 72px;
}


.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 0;
}
.brand .glyph {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--neon-2));
  border-radius: 10px;
  box-shadow: 0 0 24px -4px var(--glow);
  font-family: var(--font-display);
  font-weight: 700;
  color: white;
  font-size: 20px;
}
.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.nav-link:hover { color: var(--text); background: var(--bg-3); }
.nav-link.active {
  color: var(--text);
  background: var(--bg-3);
}
.nav-indicator-dot {
  position: absolute;
  left: 50%; margin-left: -2px;
  bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary-bright);
  box-shadow: 0 0 12px var(--primary-bright);
}

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-call {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.nav-call b { color: var(--text); font-family: var(--font-body); font-size: 14px; }

@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-call { display: none; }
  .nav-cta-desktop { display: none; }
  .nav { padding: 0 20px; min-height: 64px; }
}

@media (max-width: 480px) {
  .brand .brand-title { font-size: 22px !important; }
  .brand > div { width: 56px !important; height: 48px !important; }
}

@media (max-width: 400px) {
  .nav { padding: 0 12px; gap: 12px; }
  .nav-right { gap: 8px; }
  .nav-search-toggle { display: none !important; }
}

/* ============================================================
   Mobile nav — hamburger + slide-down panel
   ============================================================ */

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 920px) {
  .nav-burger { display: flex; }
}

.nav-mobile-backdrop {
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0,0,0,0.4);
  z-index: 45;
}

.nav-mobile-panel {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 46;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.35);
}
.nav-mobile-inner {
  display: flex;
  flex-direction: column;
  padding: 16px 20px 28px;
  gap: 4px;
}
.nav-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  background: none;
  border-left: none; border-right: none; border-top: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.nav-mobile-link.active { color: var(--primary-bright); }
.nav-mobile-group { display: flex; flex-direction: column; }
.nav-mobile-sub {
  display: flex;
  flex-direction: column;
  padding: 4px 0 8px 14px;
}
.nav-mobile-sublink {
  padding: 10px 4px;
  font-size: 14px;
  color: var(--text-mute);
  text-decoration: none;
}
.nav-mobile-sublink.active { color: var(--primary-bright); }
.nav-mobile-call {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.nav-mobile-call a { color: var(--text-dim); text-decoration: none; }
.nav-mobile-call b { color: var(--text); font-family: var(--font-body); font-size: 15px; }

@media (min-width: 921px) {
  .nav-mobile-panel, .nav-mobile-backdrop { display: none; }
}

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

.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
  min-height: 520px;
  background:
    radial-gradient(ellipse 90% 70% at 55% 40%, var(--hero-glow-1), transparent 70%),
    radial-gradient(ellipse 70% 60% at 20% 30%, var(--hero-glow-2), transparent 65%),
    radial-gradient(ellipse 60% 55% at 85% 25%, var(--hero-glow-3), transparent 60%),
    radial-gradient(ellipse 50% 50% at 70% 70%, var(--hero-glow-4), transparent 55%),
    radial-gradient(ellipse 80% 45% at 40% 80%, var(--hero-glow-2), transparent 60%),
    var(--hero-bg);
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 35%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}

.hero-canvas-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Subtle grid background for non-home hero sections */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 80%);
}

/* Remove bottom fade on non-home hero sections so text stays visible */
.hero:has(.hero-grid-bg)::after {
  display: none;
}

/* Ensure hero content sits above grid on non-home pages */
.hero:has(.hero-grid-bg) > .container {
  position: relative;
  z-index: 2;
}
.hero:has(.hero-grid-bg) h1 {
  color: var(--text);
}
.hero:has(.hero-grid-bg) .muted {
  color: var(--text-dim);
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-2);
}
.hero-tag .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 12px var(--good);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 .grad {
  background: linear-gradient(120deg, var(--text) 0%, var(--neon) 40%, var(--primary-bright) 70%, var(--text) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.hero p.lede {
  margin-top: 28px;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-dim);
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 32px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  max-width: 560px;
}
.hero-meta .num {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-meta .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-mute);
  letter-spacing: 0.1em;
  margin-top: 4px;
}


/* ============================================================
   Marquee
   ============================================================ */

.marquee {
  position: relative;
  border-block: 1px solid var(--line);
  padding: 26px 0;
  overflow: hidden;
  background: var(--bg-2);
  background-image: linear-gradient(90deg, transparent, var(--glow-soft), transparent);
}
.marquee-track {
  display: flex;
  gap: 64px;
  animation: marquee 56s linear infinite;
  width: max-content;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.marquee-item .glyph {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--primary-bright);
}
.marquee-item .sep {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-2);
}

/* ============================================================
   Services grid
   ============================================================ */

.svc-grid { display: grid; gap: 16px; }
.svc-grid.l-grid    { grid-template-columns: repeat(3, 1fr); }
.svc-grid.l-stagger { grid-template-columns: repeat(4, 1fr); }
.svc-grid.l-stagger .svc-card:nth-child(4n+2) { transform: translateY(36px); }
.svc-grid.l-stagger .svc-card:nth-child(4n+4) { transform: translateY(36px); }
.svc-grid.l-stagger .svc-card:hover { transform: translateY(0) !important; }
.svc-grid.l-stagger .svc-card:nth-child(4n+2):hover,
.svc-grid.l-stagger .svc-card:nth-child(4n+4):hover { transform: translateY(28px); }

@media (max-width: 1024px) {
  .svc-grid.l-grid, .svc-grid.l-stagger { grid-template-columns: repeat(2, 1fr); }
  .svc-grid.l-stagger .svc-card { transform: none !important; }
}
@media (max-width: 620px) {
  .svc-grid.l-grid, .svc-grid.l-stagger { grid-template-columns: 1fr; }
}

.svc-grid.l-carousel {
  grid-template-columns: none;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  scrollbar-color: var(--primary) var(--bg-2);
}
.svc-grid.l-carousel .svc-card {
  scroll-snap-align: start;
  min-width: 340px;
  flex: 0 0 340px;
}

.svc-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  overflow: hidden;
}

/* ── Image layer ── */
.svc-card-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.svc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, filter .4s ease;
}
.svc-card:hover .svc-card-img img {
  transform: scale(1.05);
}

/* ── Overlay with heading + detail ── */
.svc-card-overlay {
  position: relative;
  z-index: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

.svc-card h3 {
  font-size: 22px;
  color: #fff;
  margin: 0;
  transition: transform .3s ease;
}
.svc-card:hover h3 {
  transform: translateY(-4px);
}

/* ── Detail (description + explore) hidden by default ── */
.svc-card-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s ease, opacity .3s ease, margin-top .3s ease;
  margin-top: 0;
  display: flex;
  flex-direction: column;
}
.svc-card:hover .svc-card-detail {
  max-height: 220px;
  opacity: 1;
  margin-top: 12px;
}

.svc-card p {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  color: rgba(255,255,255,0.8);
}

.svc-card .arrow-block {
  margin-top: 16px;
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: all .25s ease;
  color: rgba(255,255,255,0.7);
}

.svc-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 60px -20px var(--glow);
}
.svc-card:hover .arrow-block {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: rotate(-45deg);
}

.svc-icon {
  display: none;
}

/* ============================================================
   CRM Module Cards — hover-reveal grid
   ============================================================ */
.crm-module-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 32px 28px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: default;
  overflow: hidden;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.crm-module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--neon, #a78bfa));
  opacity: 0;
  transition: opacity .3s ease;
}
.crm-module-card:hover::before {
  opacity: 1;
}
.crm-module-card:hover {
  border-color: var(--primary);
  box-shadow: 0 16px 48px -12px var(--glow);
  transform: translateY(-4px);
}
.crm-module-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 42px;
  color: var(--primary);
  opacity: 0.15;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
  transition: opacity .3s ease;
}
.crm-module-card:hover .crm-module-num {
  opacity: 0.35;
}
.crm-module-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
  transition: color .3s ease;
}
.crm-module-card:hover .crm-module-title {
  color: var(--primary-bright);
}
.crm-module-reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .4s ease, opacity .3s ease, margin-top .3s ease;
  margin-top: 0;
}
.crm-module-card:hover .crm-module-reveal {
  max-height: 300px;
  opacity: 1;
  margin-top: 14px;
}
.crm-module-reveal p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 1024px) {
  .crm-module-card { grid-column: span 3 !important; }
}
@media (max-width: 620px) {
  .crm-module-card { grid-column: span 6 !important; }
}

/* ============================================================
   Stats
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(600px 200px at 50% 50%, var(--glow-soft), transparent 70%);
}
.stat {
  padding: 56px 28px;
  border-right: 1px solid var(--line);
  position: relative;
}
.stat:last-child { border-right: none; }
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 600;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--text), var(--primary-bright));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat .lbl {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.stat .sub {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 14px;
}
@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 32px 20px; border-right: none !important; }
  .stat:not(:last-child) { border-bottom: 1px solid var(--line); }
}

/* ============================================================
   AI assistant terminal
   ============================================================ */

.ai-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 980px) { .ai-stack { grid-template-columns: 1fr; } }

.terminal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow: hidden;
  box-shadow: 0 40px 80px -30px var(--glow);
}
.term-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.term-bar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line-strong);
}
.term-bar .dot.r { background: #ef4444aa; }
.term-bar .dot.y { background: #facc15aa; }
.term-bar .dot.g { background: #22c55eaa; }
.term-bar .title {
  margin-left: 12px;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.term-body { padding: 22px 22px 26px; min-height: 320px; }
.term-line { display: flex; gap: 10px; margin-bottom: 10px; align-items: baseline; }
.term-line .gutter { color: var(--text-mute); user-select: none; }
.term-line .you  { color: var(--neon); }
.term-line .bot  { color: var(--primary-bright); }
.term-text { color: var(--text); white-space: pre-wrap; }
.term-text.dim { color: var(--text-dim); }
.term-cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--primary-bright);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
}

/* ============================================================
   Process / Timeline
   ============================================================ */

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.process::before {
  content: "";
  position: absolute;
  top: 36px; left: 0; right: 0;
  height: 1px;
  background: var(--line-2);
  opacity: 0.35;
}
.process-line {
  content: "";
  position: absolute;
  top: 36px; left: 0; right: 0;
  height: 1px;
  transform-origin: 0% 50%;
  background: linear-gradient(90deg, var(--primary), var(--neon), var(--neon-2));
  box-shadow: 0 0 10px var(--glow);
  z-index: 1;
}
.process-step {
  position: relative;
  padding-top: 0;
}
.process-step .node {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--primary);
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
  display: grid; place-items: center;
  transform-origin: 50% 50%;
}
.process-step .node::after {
  content: "";
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--primary);
}
.process-step .step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.process-step h4 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}
.process-step p { font-size: 14px; }

@media (max-width: 880px) {
  .process { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .process { grid-template-columns: 1fr; }
  .process::before, .process-line { display: none; }
}

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

.cta-band {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 64px;
  background:
    radial-gradient(circle at 20% 20%, var(--glow), transparent 60%),
    radial-gradient(circle at 80% 80%, var(--glow), transparent 50%),
    radial-gradient(circle at 50% 50%, var(--glow-soft), transparent 60%),
    linear-gradient(135deg, var(--bg-3), var(--bg-2));
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: center;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black, transparent 80%);
          mask-image: radial-gradient(ellipse at 50% 50%, black, transparent 80%);
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(28px, 4vw, 44px); }
@media (max-width: 720px) {
  .cta-band { grid-template-columns: 1fr; padding: 36px; }
}

footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
  background: var(--bg-2);
  background-image: radial-gradient(600px 300px at 20% 80%, var(--glow-soft), transparent 70%);
}
.foot {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr 1.8fr;
  gap: 48px;
  margin-bottom: 56px;
}
@media (max-width: 1100px) {
  .foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .foot { grid-template-columns: 1fr; gap: 36px; }
}
.foot h5 {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: none;
  color: var(--text-mute);
  margin: 0 0 18px;
  font-weight: 700;
}
.foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.foot a { color: var(--text-dim); font-size: 14px; transition: color .2s ease; }
.foot a:hover { color: var(--text); }
.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Page transitions (route changes are handled by Framer Motion's
   PageTransition wrapper — this keyframe remains for any leftover
   non-React entry points) */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respect reduced-motion preference: quiet the decorative loops */
@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .float-orb, .float-dot,
  .boot-glyph,
  .hero-tag .dot {
    animation: none !important;
  }
  .reveal {
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Forms
   ============================================================ */
.field {
  display: block;
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--text-mute);
  margin-bottom: 8px;
  font-weight: 600;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow-soft);
}
.field textarea { min-height: 140px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* utility */
.hgroup { display: grid; gap: 16px; max-width: 720px; margin-bottom: 48px; }
.hgroup h2 { font-weight: 600; }
.row { display: flex; align-items: center; gap: 14px; }
.between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

/* ====== Theme toggle small ====== */
.theme-toggle {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text-dim);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--primary); }

/* ============================================================
   Enhanced hover effects — cards, grids, process nodes
   ============================================================ */

/* Generic card glow outline on hover */
.card:hover {
  border-color: var(--primary);
}

/* Process node: pop-out on hover */
.process-step .node {
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.process-step:hover .node {
  transform: scale(1.5);
  border-color: var(--neon);
  box-shadow: 0 0 20px var(--primary), 0 0 40px var(--glow);
}
.process-step:hover .node::after {
  background: var(--neon);
  box-shadow: 0 0 16px var(--neon);
}
.process-step {
  transition: transform .25s ease;
}
.process-step:hover {
  transform: translateY(-4px);
}

/* Stats: hover glow */
.stat {
  transition: background .3s ease, box-shadow .3s ease;
}
.stat:hover {
  background: var(--bg-2);
  box-shadow: inset 0 0 40px var(--glow-soft), 0 0 30px var(--glow-soft);
}

/* Marquee item: hover highlight */
.marquee-item {
  transition: color .2s ease, transform .2s ease;
  border-radius: var(--r-pill);
  padding: 4px 0;
}
.marquee-item:hover {
  color: var(--text);
  transform: scale(1.08);
}
.marquee-item:hover .glyph {
  color: var(--neon);
  filter: drop-shadow(0 0 6px var(--primary));
}

/* ============================================================
   Floating decorations — gradient orbs, animated dots
   ============================================================ */

.float-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.12;
  animation: floatOrb 12s ease-in-out infinite alternate;
}
.float-orb-1 {
  width: 300px; height: 300px;
  background: var(--primary);
  top: 20%; right: -5%;
  animation-delay: 0s;
}
.float-orb-2 {
  width: 200px; height: 200px;
  background: var(--neon-2);
  bottom: 10%; left: -3%;
  animation-delay: -4s;
}
.float-orb-3 {
  width: 250px; height: 250px;
  background: var(--neon);
  top: 40%; left: 10%;
  animation-delay: -8s;
}
@keyframes floatOrb {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(20px, -30px) scale(1.1); }
  66%  { transform: translate(-15px, 20px) scale(0.95); }
  100% { transform: translate(10px, -10px) scale(1.05); }
}

/* Floating dot particles */
.float-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.float-dot {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary-bright);
  opacity: 0.25;
  animation: floatDot 8s ease-in-out infinite;
}
.float-dot:nth-child(2) { animation-delay: -1.5s; opacity: 0.15; width: 3px; height: 3px; }
.float-dot:nth-child(3) { animation-delay: -3s; opacity: 0.2; width: 5px; height: 5px; }
.float-dot:nth-child(4) { animation-delay: -4.5s; opacity: 0.12; }
.float-dot:nth-child(5) { animation-delay: -6s; opacity: 0.18; width: 3px; height: 3px; }
.float-dot:nth-child(6) { animation-delay: -7s; opacity: 0.22; width: 6px; height: 6px; }

@keyframes floatDot {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.15; }
  25%  { transform: translateY(-40px) translateX(10px); opacity: 0.35; }
  50%  { transform: translateY(-20px) translateX(-15px); opacity: 0.2; }
  75%  { transform: translateY(-50px) translateX(5px); opacity: 0.3; }
}

/* Animated grid lines decoration */
.deco-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.04;
}
.deco-grid::before,
.deco-grid::after {
  content: "";
  position: absolute;
  background: var(--primary);
}
.deco-grid::before {
  width: 1px; height: 100%;
  left: 15%;
  animation: gridLineV 4s ease-in-out infinite;
}
.deco-grid::after {
  width: 100%; height: 1px;
  top: 30%;
  animation: gridLineH 5s ease-in-out infinite;
}
@keyframes gridLineV {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}
@keyframes gridLineH {
  0%, 100% { opacity: 0.3; transform: scaleX(0.6); }
  50% { opacity: 1; transform: scaleX(1); }
}

/* Value prop card hover glow */
.value-card {
  transition: box-shadow .3s ease, background .3s ease;
}
.value-card:hover {
  box-shadow: 0 20px 50px -12px var(--glow), inset 0 0 0 1px var(--primary);
  background: var(--bg-3) !important;
}
.value-card:hover .value-icon {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--glow);
}
.value-icon {
  transition: transform .3s ease, box-shadow .3s ease;
}

/* Blog card hover */
.blog-card {
  transition: transform .25s ease, box-shadow .3s ease, border-color .3s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 16px 48px -12px var(--glow);
}

/* Chip hover */
.chip {
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.svc-card:hover .chip {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* CTA band hover shimmer */
.cta-band {
  transition: box-shadow .4s ease;
}
.cta-band:hover {
  box-shadow: 0 0 60px -10px var(--glow), inset 0 0 30px var(--glow-soft);
}

/* Blog detail responsive */
@media (max-width: 768px) {
  .blog-related-grid { grid-template-columns: 1fr !important; }
  .blog-featured { grid-template-columns: 1fr !important; }
  .blog-post-grid { grid-template-columns: 1fr !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .blog-related-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .blog-post-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================================================
   Generic mobile-friendly grid fallback
   Catches inline-styled `display:grid` layouts throughout pages.jsx
   that don't already have a dedicated responsive class, and
   collapses them to fewer columns on smaller screens.
   ============================================================ */
@media (max-width: 900px) {
  [style*="grid-template-columns: repeat(3, 1fr);"],
  [style*="grid-template-columns: repeat(4, 1fr);"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  [style*="grid-template-columns: repeat(2, 1fr);"],
  [style*="grid-template-columns: repeat(3, 1fr);"],
  [style*="grid-template-columns: repeat(4, 1fr);"],
  [style*="grid-template-columns: 1fr 1fr;"],
  [style*="grid-template-columns: 1.2fr 1fr;"],
  [style*="grid-template-columns: 1.2fr 0.8fr;"],
  [style*="grid-template-columns: auto 1fr;"] {
    grid-template-columns: 1fr !important;
  }
  /* undo borders/padding meant for a side-by-side split that no longer applies once stacked */
  [style*="grid-template-columns: 1fr 1fr; gap: 0"] > div[style*="border-right"] {
    border-right: none !important;
    border-bottom: 1px solid var(--line);
  }
}

/* selection */
::selection { background: var(--primary); color: white; }
