/* ============================================================
   Matrix AI Agents — Global styles
   Palette: homepage navy standard (no pure black anywhere)
   ============================================================ */

:root {
  /* Navy palette (homepage standard) */
  --bg: #061a48;
  --bg-alt: #0b2a66;
  --card: #142d64;
  --card-hover: #204596;
  --text: #ffffff;
  --muted: #d2e2f5;
  --teal: #17b5ab;
  --cyan: #25c6e8;

  /* Light band (only where a section explicitly uses it) */
  --light-bg: #f7fafd;
  --light-card: #eff8fc;
  --light-edge: #dbe6f6;
  --light-heading: #204596;
  --light-body: #142d64;

  --accent-grad: linear-gradient(92deg, var(--teal) 0%, var(--cyan) 100%);
  --radius: 16px;
  --shadow: 0 18px 40px rgba(3, 12, 36, 0.45);
  --maxw: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Layout helpers ---------- */

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

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

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

.section--light {
  background: var(--light-bg);
  color: var(--light-body);
}

.section-head {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.section-head p {
  color: var(--muted);
  font-size: 1.05rem;
}

.section--light .section-head p {
  color: var(--light-body);
  opacity: 0.78;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}

.section--light .eyebrow {
  color: var(--light-heading);
}

.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Dot-grid backdrop (decorative) ---------- */

.dotgrid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(37, 198, 232, 0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

.dotgrid > .container {
  position: relative;
  z-index: 1;
}

/* ---------- Glowing clip-path V divider ---------- */

.v-divider {
  position: relative;
  height: 90px;
  overflow: hidden;
  background: var(--bg);
}

.v-divider__glow {
  position: absolute;
  left: 0;
  right: 0;
  top: -34px;
  height: 180px;
  background: var(--accent-grad);
  clip-path: polygon(0 0, 100% 0, 100% 34px, 50% 100%, 0 34px);
  filter: blur(14px);
  opacity: 0.55;
}

.v-divider__solid {
  position: absolute;
  inset: 0;
  background: var(--bg-alt);
  clip-path: polygon(0 0, 100% 0, 50% 100%, 100% 100%, 100% 100%, 50% 100%, 0 100%, 0 0);
}

.v-divider__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  background: var(--accent-grad);
  clip-path: polygon(0 0, 100% 0, 50% calc(100% - 1px), 0 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 50% calc(100% - 1px), 0 100%);
  opacity: 0.9;
}

/* Flip the V for alternating flow */
.v-divider--flip .v-divider__line {
  clip-path: polygon(0 100%, 50% 1px, 100% 100%, 100% 100%, 0 100%);
  transform: scaleY(-1);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn--primary {
  background: var(--accent-grad);
  color: #041434;
  box-shadow: 0 10px 28px rgba(23, 181, 171, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(37, 198, 232, 0.45);
}

.btn--ghost {
  border: 1px solid rgba(37, 198, 232, 0.45);
  color: var(--text);
  background: rgba(20, 45, 100, 0.45);
}

.btn--ghost:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid rgba(37, 198, 232, 0.12);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  background: var(--card-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(37, 198, 232, 0.12);
  border: 1px solid rgba(37, 198, 232, 0.28);
  margin-bottom: 18px;
}

.card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p {
  color: var(--muted);
  font-size: 0.94rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  align-items: center;
}

/* ---------- Navbar ---------- */

/* Every visual knob below is overridable from the Header & Menu admin
   screen (siteHeader.style). Values are set as CSS custom properties on
   <header class="navbar">, so anything not configured falls back to the
   defaults written here. */
.navbar {
  position: var(--nh-position, sticky);
  top: 0;
  z-index: 50;
  background: var(--nh-bg, #061a48);
  backdrop-filter: var(--nh-blur, none);
  -webkit-backdrop-filter: var(--nh-blur, none);
  border-bottom: var(--nh-border, 1px solid rgba(37, 198, 232, 0.12));
  font-family: var(--nh-font, inherit);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nh-height, 100px);
  padding-inline: var(--nh-pad-x, 0);
  gap: var(--nh-gap, 0);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--logo-gap, 10px);
  font-weight: 800;
  font-size: var(--logo-text-size, 1.08rem);
  letter-spacing: -0.01em;
  color: var(--nh-text, var(--text));
}

.navbar__logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #041434;
  font-weight: 900;
  font-size: 1rem;
}

.navbar__logo-img {
  height: var(--logo-height, 80px);
  width: var(--logo-width, auto);
  max-width: var(--logo-max-width, 400px);
  display: block;
  background: var(--logo-bg, transparent);
  border: var(--logo-border, 0);
  border-radius: var(--logo-radius, 0);
  padding: var(--logo-padding, 0);
  box-shadow: var(--logo-shadow, none);
  object-fit: var(--logo-fit, contain);
  opacity: var(--logo-opacity, 1);
  filter: var(--logo-filter, none);
}

.footer__logo-img {
  height: var(--footer-logo-height, 96px);
  width: auto;
  max-width: var(--footer-logo-max-width, 400px);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--nh-links-gap, 28px);
  list-style: none;
}

.navbar__links a {
  font-size: var(--nh-link-size, 0.92rem);
  font-weight: var(--nh-link-weight, 600);
  color: var(--nh-link, var(--muted));
  transition: color 0.15s ease;
}

.navbar__links a:hover {
  color: var(--nh-link-hover, var(--text));
}

/* Active link: gradient text-clip by default. When the admin picks a solid
   "Active color", --nh-link-active + --nh-link-active-grad are emitted and
   the gradient is swapped out for a flat fill (see shared/header/style.js). */
.navbar__links a.active {
  background: var(--nh-link-active-grad, var(--accent-grad));
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--nh-link-active, transparent);
  -webkit-text-fill-color: var(--nh-link-active, transparent);
}

.navbar__toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--nh-text, var(--text));
}

/* ---------- Services dropdown ---------- */

.navbar__dropdown {
  position: relative;
}

.navbar__dropbtn {
  font-size: var(--nh-link-size, 0.92rem);
  font-weight: var(--nh-link-weight, 600);
  color: var(--nh-link, var(--muted));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease;
}

.navbar__dropbtn:hover,
.navbar__dropbtn.active {
  color: var(--nh-link-hover, var(--text));
}

/* A dropdown with a parent link renders as [Link] [caret-button] inside a
   flex wrapper — the link handles click-through navigation, the caret
   button (or the surrounding li on desktop) toggles the panel. */
.navbar__dropwrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.navbar__dropbtn--link {
  text-decoration: none;
}
.navbar__dropcaret {
  display: inline-flex;
  align-items: center;
  padding: 8px 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--nh-link, var(--muted));
  line-height: 1;
}
.navbar__dropcaret:hover { color: var(--nh-link-hover, var(--text)); }

.navbar__caret {
  font-size: 0.7rem;
  color: var(--nh-caret, var(--cyan));
  transition: transform 0.18s ease;
}

.navbar__dropdown.open .navbar__caret {
  transform: rotate(180deg);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(560px, calc(100vw - 32px));
  background: var(--nh-drop-bg, linear-gradient(165deg, #0b2a66 0%, #0a2154 100%));
  border: var(--nh-drop-border, 1px solid rgba(37, 198, 232, 0.25));
  border-radius: 16px;
  box-shadow: var(--nh-drop-shadow, 0 24px 60px rgba(3, 12, 36, 0.6));
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}

/* small upward pointer */
.dropdown-panel::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: #0b2a66;
  border-left: 1px solid rgba(37, 198, 232, 0.25);
  border-top: 1px solid rgba(37, 198, 232, 0.25);
}

.navbar__dropdown.open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Language switcher pill (right side of navbar) */
.navbar__lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-inline-start: 8px;
}
.navbar__lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: var(--nh-lang-border, 1px solid rgba(37, 198, 232, 0.35));
  background: var(--nh-lang-bg, rgba(11, 42, 102, 0.35));
  color: var(--nh-lang-text, var(--nh-link, #eaf3ff));
  font: 600 12px/1 inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.navbar__lang-btn:hover,
.navbar__lang.open .navbar__lang-btn {
  background: var(--nh-lang-bg-hover, rgba(37, 198, 232, 0.15));
  border-color: var(--nh-lang-border, rgba(37, 198, 232, 0.6));
}
.navbar__lang-code {
  text-transform: uppercase;
}
.navbar__lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  /* Logical edge: `right: 0` pinned the closed dropdown off-canvas on RTL pages,
     which widened the document and gave every page a horizontal scrollbar. */
  inset-inline-end: 0;
  min-width: 140px;
  padding: 6px;
  list-style: none;
  background: #0b2a66;
  border: 1px solid rgba(37, 198, 232, 0.25);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(2, 12, 40, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 20;
}
.navbar__lang.open .navbar__lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.navbar__lang-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  text-align: start;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe8ff;
  font: 500 13px/1.4 inherit;
  cursor: pointer;
}
.navbar__lang-item:hover {
  background: rgba(37, 198, 232, 0.12);
}
.navbar__lang-item.active {
  background: rgba(37, 198, 232, 0.2);
  color: #ffffff;
  font-weight: 600;
}

.dropdown-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  list-style: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nh-drop-item, var(--muted));
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.dropdown-item:hover {
  background: var(--nh-drop-item-hover-bg, var(--card-hover));
  color: var(--nh-drop-item-hover, var(--text));
}

/* ---------- Navbar CTA button (kind: 'cta' item) ----------
   Extends .btn--primary but every channel is a var so the admin's Header
   & Menu → Colors screen can drive text, background +ampersand their hover states
   independently from the rest of the site's accent palette. */
.navbar__cta.btn--primary {
  padding: 10px 22px;
  background: var(--nh-cta-bg, var(--accent-grad));
  color: var(--nh-cta-text, #041434);
  border: var(--nh-cta-border, 0);
  border-radius: var(--nh-cta-radius, 999px);
}

.navbar__cta.btn--primary:hover {
  background: var(--nh-cta-bg-hover, var(--accent-grad));
  color: var(--nh-cta-text-hover, #041434);
}

/* ---------- Menu not configured (header rows missing in the CMS) ---------- */

.navbar__empty {
  font-size: 0.85rem;
  color: var(--nav-link, #d2e2f5);
  opacity: 0.75;
  white-space: nowrap;
}

/* ---------- Service detail hero ---------- */

.service-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  align-items: start;
}

.service-hero__icon {
  width: 120px;
  height: 120px;
  border-radius: 26px;
  object-fit: cover;
  border: 1px solid rgba(37, 198, 232, 0.3);
  box-shadow: 0 18px 40px rgba(3, 12, 36, 0.5);
}

/* ---------- Footer ---------- */

.footer {
  background: var(--bg-alt);
  border-top: 1px solid rgba(37, 198, 232, 0.12);
  padding: 64px 0 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer ul a:hover {
  color: var(--cyan);
}

.footer__about {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 320px;
  margin-top: 14px;
}

.footer__bottom {
  border-top: 1px solid rgba(210, 226, 245, 0.12);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  margin: 0 auto;
  max-width: var(--maxw);
  border-radius: 24px;
  padding: 64px 48px;
  text-align: center;
  background: linear-gradient(120deg, #0b2a66 0%, #142d64 55%, #204596 100%);
  border: 1px solid rgba(37, 198, 232, 0.25);
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(37, 198, 232, 0.2) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}

.cta-band > * {
  position: relative;
}

.cta-band h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.cta-band p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 28px;
}

/* ---------- Hero (shared shell) ---------- */

.hero {
  position: relative;
  padding: 110px 0 90px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 10%, rgba(32, 69, 150, 0.55), transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 90%, rgba(23, 181, 171, 0.14), transparent 70%),
    var(--bg);
  overflow: hidden;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero p.lead {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 620px;
  margin-bottom: 34px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Misc ---------- */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 18px;
}

.pill-list li {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid rgba(37, 198, 232, 0.3);
  background: rgba(20, 45, 100, 0.5);
  border-radius: 999px;
  padding: 7px 14px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 64px;
}

.stat {
  text-align: center;
  padding: 22px 12px;
  border-radius: var(--radius);
  background: rgba(20, 45, 100, 0.55);
  border: 1px solid rgba(37, 198, 232, 0.16);
}

.stat b {
  display: block;
  font-size: 1.9rem;
  font-weight: 900;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .grid-4,
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 72px 0;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .stat-strip {
    grid-template-columns: 1fr;
  }
  .navbar__links {
    display: none;
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid rgba(37, 198, 232, 0.15);
    padding: 12px 24px 20px;
  }
  .navbar__links.open {
    display: flex;
  }
  .navbar__links li {
    padding: 10px 0;
  }
  .navbar__toggle {
    display: block;
  }
  /* Dropdown becomes an inline expandable section */
  .dropdown-panel {
    position: static;
    transform: none;
    width: 100%;
    opacity: 1;
    visibility: visible;
    display: none;
    box-shadow: none;
    margin-top: 8px;
  }
  .dropdown-panel::before {
    display: none;
  }
  .navbar__dropdown.open .dropdown-panel {
    display: block;
    transform: none;
  }
  .dropdown-panel__grid {
    grid-template-columns: 1fr;
  }
  .service-hero {
    grid-template-columns: 1fr;
  }
  .service-hero__icon {
    width: 88px;
    height: 88px;
    border-radius: 20px;
  }
  .navbar__inner {
    height: 80px;
  }
  .navbar__logo-img {
    height: 56px;
    max-width: 260px;
  }
  .footer__logo-img {
    height: 72px;
    max-width: 300px;
  }
}
