/* ==========================================================================
   MarketGrowth.io - Global stylesheet
   Brand: Dark Green #1D3C34 · Teal #40C1AC · Off-white #F5F5F5
   Type:  Funnel Display (headlines) · IBM Plex Sans (body)
   ========================================================================== */

:root {
  /* Brand palette (from MarketGrowth Style Guide v1.0) */
  --mg-dark-green: #1D3C34;
  --mg-green: #40C1AC;
  --mg-red: #FA4616;
  --mg-blue: #99D6EA;
  --mg-orange: #FFAA4D;
  --mg-purple: #753BBD;
  --mg-peach: #FCC89B;
  --mg-white: #F5F5F5;

  --font-head: "Funnel Display", "Arial Black", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;

  --container: 1140px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(10, 25, 21, 0.12);
  --transition: 0.25s ease;
}

/* ---------- Theme tokens ---------- */
/* Dark theme: deep charcoal/slate base with indigo undertones -
   green is reserved for accents so the UI isn't all green. */
[data-theme="dark"] {
  --bg: #101419;
  --bg-alt: #151a21;
  --surface: #1a212b;
  --surface-2: #222b37;
  --border: rgba(245, 245, 245, 0.12);
  --text: #F5F5F5;
  --text-muted: rgba(245, 245, 245, 0.72);
  --heading: #F5F5F5;
  --accent: #40C1AC;
  --accent-contrast: #101419;
  --accent-soft: rgba(64, 193, 172, 0.14);
  --nav-bg: rgba(16, 20, 25, 0.88);
  /* Brand guide: dark gradients keep the signature deep green as a base,
     layered with modular highlight colors (teal, purple, blue). */
  --hero-grad: radial-gradient(1000px 520px at 15% -5%, rgba(29, 60, 52, 0.55), transparent 60%),
               radial-gradient(1200px 600px at 80% -10%, rgba(64, 193, 172, 0.14), transparent 60%),
               radial-gradient(900px 500px at 10% 110%, rgba(117, 59, 189, 0.2), transparent 55%),
               radial-gradient(700px 400px at 50% 40%, rgba(153, 214, 234, 0.06), transparent 60%);
  --logo-filter: none;
  --grid-line: rgba(245, 245, 245, 0.05);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F5F5F5;
  --bg-alt: #ECF1EE;
  --surface: #FFFFFF;
  --surface-2: #F0F5F2;
  --border: rgba(29, 60, 52, 0.14);
  --text: #1D3C34;
  --text-muted: rgba(29, 60, 52, 0.75);
  --heading: #1D3C34;
  --accent: #1D3C34;
  --accent-contrast: #F5F5F5;
  --accent-soft: rgba(64, 193, 172, 0.16);
  --nav-bg: rgba(245, 245, 245, 0.9);
  /* Brand guide: light gradients keep soft green/dark green infusions present */
  --hero-grad: radial-gradient(1000px 520px at 15% -5%, rgba(29, 60, 52, 0.08), transparent 60%),
               radial-gradient(1200px 600px at 80% -10%, rgba(64, 193, 172, 0.22), transparent 60%),
               radial-gradient(900px 500px at 10% 110%, rgba(252, 200, 155, 0.35), transparent 55%);
  /* Renders the white logo in brand dark green on light backgrounds */
  --logo-filter: brightness(0) saturate(100%) invert(18%) sepia(14%) saturate(1200%) hue-rotate(120deg) brightness(95%);
  --grid-line: rgba(29, 60, 52, 0.07);
  color-scheme: light;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: var(--heading);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.85; }

img { max-width: 100%; display: block; border-radius: var(--radius); }

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

section { padding: 88px 0; }

.section-alt { background: var(--bg-alt); }

/* Brand guide "Building Blocks": modular gradient-block divider that opens
   every alternate section. One color per block, consistent sizes. */
.section-alt > .container::before {
  content: "";
  display: block;
  height: 8px;
  width: 184px;
  margin-bottom: 42px;
  border-radius: 4px;
  background:
    linear-gradient(90deg,
      var(--mg-green) 0 40px, transparent 40px 48px,
      var(--mg-orange) 48px 88px, transparent 88px 96px,
      var(--mg-purple) 96px 136px, transparent 136px 144px,
      var(--mg-blue) 144px 184px);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-green);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
[data-theme="light"] .eyebrow { color: var(--mg-dark-green); }

.section-head { max-width: 720px; margin-bottom: 48px; }
/* Brand guide, "Six Type Commandments": stay left-aligned, rag right.
   Multi-line text is never centered, so .center now aligns left too. */
.section-head.center { margin-left: 0; margin-right: 0; text-align: left; }
.section-head p { margin-top: 14px; font-size: 1.05rem; }

/* ---------- Buttons ----------
   CTA style matches marketgrowth.io: solid green rounded rectangle
   with bold white text (not a pill). */
:root { --mg-cta: #2E8540; --mg-cta-hover: #267036; }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem; /* ~15px: 2px smaller, scales the button down */
  padding: 5px 22px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), opacity var(--transition);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--mg-cta); color: #ffffff; }
.btn-primary:hover { background: var(--mg-cta-hover); opacity: 1; }
[data-theme="light"] .btn-primary { background: var(--mg-cta); color: #ffffff; }
[data-theme="light"] .btn-primary:hover { background: var(--mg-cta-hover); }

.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }

.btn-lg { padding: 5px 28px; font-size: 0.98rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.nav-logo img {
  height: 30px;
  width: auto;
  max-width: 200px;
  border-radius: 0;
  filter: var(--logo-filter);
}

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

.nav-links a {
  color: var(--text);
  font-size: 0.98rem;
}
.nav-links a:hover { color: var(--mg-green); opacity: 1; }
[data-theme="light"] .nav-links a:hover { color: var(--mg-dark-green); text-decoration: underline; }

.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-cta .btn { padding: 5px 18px; font-size: 0.8rem; }

/* Agent-Led Growth: right-justified external link beside the theme switcher */
.nav-external { color: var(--text); font-size: 0.98rem; white-space: nowrap; }
.nav-external:hover { color: var(--mg-green); opacity: 1; }
[data-theme="light"] .nav-external:hover { color: var(--mg-dark-green); text-decoration: underline; }
.nav-mobile-only { display: none; } /* shown only in the mobile menu */

/* Dropdown - trigger spans the full header height so the menu opens flush
   from the header's bottom edge, with no hover gap to cross. */
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 72px; /* match header height */
}
.dropdown > a::after { content: " ▾"; font-size: 0.7em; }
.dropdown-menu {
  position: absolute;
  top: 100%;      /* = header bottom edge */
  left: -12px;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  list-style: none;
  /* elegant open: fade + slide down */
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
}
.dropdown-menu a:hover { background: var(--accent-soft); opacity: 1; }

/* Theme toggle: rounded square matching the Contact us CTA height */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
}
.theme-toggle:hover { border-color: var(--mg-green); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav */
.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
/* Brand guide "Connected Systems" key visual: fine grid lines with
   white/brand data points layered behind the hero content. */
.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 90px;
  background: var(--hero-grad), var(--bg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 78% 24%, rgba(64, 193, 172, 0.9) 3px, transparent 4.5px),
    radial-gradient(circle at 88% 62%, rgba(255, 170, 77, 0.85) 3px, transparent 4.5px),
    radial-gradient(circle at 64% 78%, rgba(153, 214, 234, 0.8) 2.5px, transparent 4px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 120px, 133px 100%;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
  animation: hero-dots-drift 16s ease-in-out infinite;
}
/* Subtle drift of the hero data points; grid layers stay put */
@keyframes hero-dots-drift {
  0%, 100% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  33%      { background-position: 10px 14px, -12px 8px, 8px -12px, 0 0, 0 0; }
  66%      { background-position: -8px 6px, 10px -12px, -10px 8px, 0 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}
.hero .container { position: relative; z-index: 1; }
.hero .lede {
  font-size: 1.2rem;
  max-width: 680px;
  margin: 22px 0 34px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 20px; font-size: 0.9rem; }

/* ---------- Hero split + compute network ---------- */
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-split .lede { margin: 22px 0 0; }
.hero-split .hero-actions { margin-top: 34px; }
.hero-split h1 { font-size: clamp(3rem, 7.5vw, 5.4rem); }
.hero-sub {
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  margin-top: 26px;
}
.hero-sub sup { font-size: 0.6em; }
.hero-sub sup a { color: var(--mg-green); }
[data-theme="light"] .hero-sub sup a { color: var(--mg-dark-green); }

/* Compute network: nodes on the hero grid link up with drawn lines and
   pass data packets, then rest for ~5 seconds before the next burst.
   10s cycle = ~3s drawing + ~2s packets + ~5s pause. */
.orb-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.network {
  width: min(500px, 100%);
  height: auto;
}
.net-grid line { stroke: var(--grid-line); stroke-width: 1; }
.net-subgrid { opacity: 0.5; } /* half-pitch sub-grid, extra faint */

.net-line {
  stroke: rgba(64, 193, 172, 0.55);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: net-draw 10s linear infinite;
  animation-delay: calc(var(--i) * 0.14s);
}
[data-theme="light"] .net-line { stroke: rgba(29, 60, 52, 0.45); }

.net-node {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation: net-node 10s ease-out infinite;
  animation-delay: calc(var(--i) * 0.1s);
}

.net-packet {
  fill: var(--mg-orange);
  opacity: 0;
  offset-rotate: 0deg;
  animation: net-packet 10s linear infinite;
}

@keyframes net-draw {
  0%   { stroke-dashoffset: 1; opacity: 1; }
  10%  { stroke-dashoffset: 0; }
  94%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes net-node {
  0%   { transform: scale(0); opacity: 0; }
  4%   { transform: scale(1.25); opacity: 1; }
  7%   { transform: scale(1); }
  94%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
@keyframes net-packet {
  0%, 24%   { offset-distance: 0%; opacity: 0; }
  27%       { opacity: 1; }
  46%       { offset-distance: 100%; opacity: 1; }
  49%, 100% { offset-distance: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .net-line { animation: none; stroke-dashoffset: 0; }
  .net-node { animation: none; transform: scale(1); }
  .net-packet { display: none; }
}
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; }
  .orb-wrap { display: none; } /* mobile: text copy only, no animated network */
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 56px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  border-top: 3px solid var(--mg-green);
}
/* Brand guide: each block = one unit of value, one distinct color per block */
.stat:nth-child(4n+2) { border-top-color: var(--mg-orange); }
.stat:nth-child(4n+3) { border-top-color: var(--mg-purple); }
.stat:nth-child(4n+4) { border-top-color: var(--mg-blue); }

.grid-4 > .card { border-top: 3px solid var(--mg-green); }
.grid-4 > .card:nth-child(4n+2) { border-top-color: var(--mg-orange); }
.grid-4 > .card:nth-child(4n+3) { border-top-color: var(--mg-purple); }
.grid-4 > .card:nth-child(4n+4) { border-top-color: var(--mg-blue); }
.stat .num {
  font-family: var(--font-head);
  font-size: 2.2rem;
  color: var(--mg-green);
  display: block;
}
[data-theme="light"] .stat .num { color: var(--mg-dark-green); }
.stat .label { font-size: 0.92rem; color: var(--text-muted); }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 10px; }
.card .step-num {
  font-family: var(--font-head);
  font-size: 0.9rem;
  color: var(--mg-green);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 14px;
}
[data-theme="light"] .card .step-num { color: var(--mg-dark-green); }
.card .metric-chip {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-head);
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--mg-green);
  padding: 5px 12px;
  border-radius: 999px;
}
[data-theme="light"] .card .metric-chip { color: var(--mg-dark-green); }

.figure-caption { font-size: 0.85rem; margin-top: 10px; color: var(--text-muted); }

/* Framed treatment for product screenshots so cropped edges look intentional.
   The inner clip-path trims stray edge pixels baked into the capture files
   (e.g. the dark line along the top of the screenshots). */
.screenshot {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.screenshot img {
  clip-path: inset(4px 2px 2px 2px round 8px);
  border-radius: 8px;
}
/* Same trim when a screenshot is enlarged in the lightbox */
.lightbox-figure img.screenshot-clip {
  clip-path: inset(4px 2px 2px 2px round 10px);
}

/* Checklist */
.checklist { list-style: none; margin: 22px 0; }
.checklist li {
  padding-left: 30px;
  position: relative;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--mg-green);
  font-weight: 700;
}

/* Quote / testimonial */
.quote-card {
  background: var(--surface);
  border-left: 4px solid var(--mg-green);
  border-radius: var(--radius);
  padding: 30px;
}
.quote-card blockquote { font-size: 1.05rem; color: var(--text); font-style: italic; }
.quote-card cite { display: block; margin-top: 16px; font-style: normal; font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Testimonial carousel ---------- */
.carousel { position: relative; overflow: hidden; }
.carousel-track {
  display: flex;
  transition: transform 0.45s ease;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
}
.carousel-slide .quote-card { max-width: 860px; }

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}
.carousel-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.carousel-btn:hover { border-color: var(--mg-green); transform: translateY(-2px); }

.carousel-dots { display: flex; gap: 8px; }
.carousel-dots button {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
  transition: width var(--transition), background var(--transition);
}
.carousel-dots button.active {
  width: 26px;
  background: var(--mg-green);
}
[data-theme="light"] .carousel-dots button.active { background: var(--mg-dark-green); }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
.price-card { position: relative; }
.price-card.featured { border-color: var(--mg-green); box-shadow: var(--shadow); }
.price-card .price {
  font-family: var(--font-head);
  font-size: 2.2rem;
  color: var(--heading);
  margin: 8px 0 18px;
}
.price-card .price small { font-size: 1rem; color: var(--text-muted); }
.price-card ul { list-style: none; margin: 20px 0; }
.price-card ul li {
  padding: 9px 0 9px 26px;
  position: relative;
  font-size: 0.94rem;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
}
.price-card ul li::before { content: "•"; position: absolute; left: 6px; color: var(--mg-green); }
.price-card .btn { width: 100%; text-align: center; margin-top: 10px; }
.plan-badge {
  position: absolute;
  top: -13px;
  right: 22px;
  background: var(--mg-orange);
  color: #1D3C34;
  font-family: var(--font-head);
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 999px;
}

/* ---------- FAQ ---------- */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq summary {
  font-family: var(--font-head);
  font-size: 1.02rem;
  color: var(--heading);
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 52px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--mg-green);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 24px 20px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--mg-dark-green), #123128 60%, #0d1f1a);
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: left; /* brand guide: multi-line text is never centered */
  border: 1px solid rgba(64, 193, 172, 0.25);
}
.cta-band h2, .cta-band p { color: var(--mg-white); }
.cta-band p { opacity: 0.85; max-width: 640px; margin: 16px 0 30px; }
.cta-band .btn-primary { background: var(--mg-cta); color: #ffffff; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 640px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.92rem;
  margin-bottom: 8px;
  color: var(--heading);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--mg-green);
}
.form-note { font-size: 0.85rem; margin-top: 14px; }

/* ---------- Contact modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 12, 15, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal h3 { font-size: 1.5rem; margin-bottom: 6px; }
.modal .modal-sub { margin-bottom: 22px; font-size: 0.98rem; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition);
}
.modal-close:hover { border-color: var(--mg-green); }

.modal .form-note a { text-decoration: underline; }

.modal-success {
  text-align: center;
  padding: 28px 8px;
}
.modal-success .check {
  font-size: 2.4rem;
  color: var(--mg-green);
  display: block;
  margin-bottom: 12px;
}

body.modal-locked { overflow: hidden; }

/* ---------- Image lightbox ---------- */
img.js-zoom { cursor: zoom-in; transition: opacity var(--transition); }
img.js-zoom:hover { opacity: 0.92; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 12, 15, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}
.lightbox-overlay.open { opacity: 1; visibility: visible; }

.lightbox-figure {
  position: relative;
  margin: 0;
  max-width: min(1100px, 92vw);
  transform: scale(0.96);
  transition: transform 0.22s ease;
}
.lightbox-overlay.open .lightbox-figure { transform: scale(1); }

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.lightbox-caption {
  color: rgba(245, 245, 245, 0.85);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 14px;
}

/* Close icon pinned to the image's top-right corner */
.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: var(--mg-green);
  color: #101419;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition);
}
.lightbox-close:hover { transform: scale(1.08); }

@media (max-width: 600px) {
  .lightbox-overlay { padding: 16px; }
  .lightbox-close { top: 8px; right: 8px; }
}

@media (max-width: 600px) {
  .modal { padding: 26px 20px; }
}

/* ---------- Legal / prose pages ---------- */
.prose { max-width: 780px; }
.prose h2 { margin: 44px 0 14px; font-size: 1.5rem; }
.prose h3 { margin: 30px 0 10px; }
.prose p, .prose li { margin-bottom: 12px; color: var(--text-muted); }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 16px; }
.prose strong { color: var(--text); }

/* ---------- Comparison table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; min-width: 640px; background: var(--surface); }
table.compare th, table.compare td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  color: var(--text-muted);
}
table.compare th { font-family: var(--font-head); color: var(--heading); background: var(--surface-2); }
table.compare tr.group td {
  font-family: var(--font-head);
  color: var(--mg-green);
  background: var(--surface-2);
}
[data-theme="light"] table.compare tr.group td { color: var(--mg-dark-green); }

/* ---------- Footer ----------
   Dark theme: matches the header's charcoal.
   Light theme: light gray with green tones. */
[data-theme="dark"] {
  --footer-bg: #12161c;
  --footer-text: rgba(245, 245, 245, 0.78);
  --footer-heading: #F5F5F5;
  --footer-border: rgba(245, 245, 245, 0.14);
  --footer-link-hover: #40C1AC;
}
[data-theme="light"] {
  --footer-bg: #E5EDE8;
  --footer-text: rgba(29, 60, 52, 0.8);
  --footer-heading: #1D3C34;
  --footer-border: rgba(29, 60, 52, 0.16);
  --footer-link-hover: #1D3C34;
}

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  border-top: 1px solid var(--footer-border);
  padding: 64px 0 32px;
  margin-top: 0; /* footer sits flush against the last section */
  transition: background var(--transition);
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.site-footer img.footer-logo {
  height: 30px;
  width: auto;
  max-width: 200px;
  border-radius: 0;
  margin-bottom: 16px;
  filter: var(--logo-filter);
}
.site-footer h4 {
  color: var(--footer-heading);
  font-size: 0.95rem;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--footer-text); font-size: 0.92rem; }
.site-footer a:hover { color: var(--footer-link-hover); opacity: 1; text-decoration: underline; }
.site-footer p { color: var(--footer-text); font-size: 0.95rem; }
.footer-bottom {
  border-top: 1px solid var(--footer-border);
  margin-top: 48px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--footer-text);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .pricing-grid { grid-template-columns: 1fr 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}

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

  .nav-burger { display: flex; }
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-open .nav-links { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; font-size: 1.05rem; }
  .dropdown { display: block; height: auto; }
  .dropdown-menu {
    position: static;
    display: block;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 16px;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: none;
  }
  .dropdown > a { padding: 12px 0; }
  .dropdown > a::after { content: ""; }
  .nav-cta .btn { display: none; }
  .nav-external { display: none; }
  .nav-mobile-only { display: block; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .pricing-grid { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 44px 24px; }
  .form-card { padding: 26px; }
  .hero-actions .btn { width: 100%; text-align: center; }
}
