/* ==========================================================================
   XBA Automation — Global Stylesheet
   ========================================================================== */

:root {
  /* Brand colors */
  --green-logo: #58bd35;
  --green-active: #6bad4f;
  --green-inactive: #9dc093;
  --teal-accent: #6fd3d7;
  --gray-light: #f1f2f3;
  --gray-lighter: #f8f9f9;
  --text-dark: #48494e;
  --near-black: #202124;

  /* Status accent colors (used sparingly) */
  --red-stop: #d64f5a;
  --orange-divert: #e49e1c;
  --blue-manual: #80c8cc;
  --red-alert: #d63911;

  /* Derived / structural colors */
  --dark-bg: #202124;
  --dark-surface: #292b2f;
  --dark-surface-2: #303338;
  --border-light: #e2e4e5;
  --white: #ffffff;

  /* Gradients */
  --gradient-green: linear-gradient(135deg, var(--green-logo) 0%, var(--green-active) 100%);
  --gradient-dark: linear-gradient(160deg, #23252a 0%, #16171a 100%);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", "SFMono-Regular", Menlo, monospace;

  /* Layout */
  --container-width: 1180px;
  --header-height: 92px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 2px 8px rgba(32, 33, 36, 0.08);
  --shadow-md: 0 8px 30px rgba(32, 33, 36, 0.12);
  --shadow-lg: 0 20px 50px rgba(32, 33, 36, 0.18);
  --transition: 0.25s ease;
}

/* ---------- Reset ---------- */
* , *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.2; color: var(--near-black); }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}
.section--tight { padding: 64px 0; }
.section--dark {
  background: var(--gradient-dark);
  color: var(--gray-light);
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--white); }
.section--muted { background: var(--gray-lighter); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-active);
  font-weight: 700;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--green-logo);
  display: inline-block;
}

.section-header {
  max-width: 680px;
  margin: 0 0 48px;
}
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-header p { color: #6b6c72; font-size: 1.05rem; }
.section--dark .section-header p { color: #b7bcbf; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-green);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(88, 189, 53, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(88, 189, 53, 0.45); }
.btn-outline {
  background: transparent;
  border-color: var(--near-black);
  color: var(--near-black);
}
.btn-outline:hover { border-color: var(--green-logo); color: var(--green-logo); }
.section--dark .btn-outline,
.hero .btn-outline,
.page-hero .btn-outline { border-color: rgba(255,255,255,0.4); color: var(--white); }
.section--dark .btn-outline:hover,
.hero .btn-outline:hover,
.page-hero .btn-outline:hover { border-color: var(--green-logo); color: var(--green-logo); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 48px; width: auto; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--near-black); border-radius: 2px; }

.main-nav ul { display: flex; align-items: center; gap: 8px; }
.main-nav a {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.main-nav a:hover, .main-nav a.active { color: var(--green-active); background: rgba(88, 189, 53, 0.08); }

.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-sm); }
.dropdown a small { font-weight: 400; color: #86888c; font-size: 0.8rem; }
.dropdown a:hover { background: var(--gray-lighter); }

.nav-cta { margin-left: 8px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-dark);
  color: var(--white);
  padding: 120px 0 100px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(88, 189, 53, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 189, 53, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at top right, black 10%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -220px;
  top: -220px;
  background: radial-gradient(circle, rgba(88, 189, 53, 0.35) 0%, rgba(88, 189, 53, 0) 70%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); margin-bottom: 20px; color: var(--white); }
.hero h1 span { color: var(--green-logo); }
.hero p.lead { font-size: 1.15rem; color: #c7cbcd; max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.stat-row {
  display: flex;
  gap: 36px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.stat-row div strong { display: block; font-size: 1.8rem; color: var(--green-logo); font-family: var(--font-mono); }
.stat-row div span { font-size: 0.85rem; color: #b7bcbf; }

/* Hero visual — abstract control-panel mock */
.hero-visual {
  position: relative;
  background: var(--dark-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.hero-visual .panel-dots { display: flex; gap: 6px; margin-bottom: 16px; }
.hero-visual .panel-dots span { width: 10px; height: 10px; border-radius: 50%; background: #4a4d53; }
.hero-visual.has-image { padding: 0; overflow: hidden; align-self: start; margin-top: 40px; }
.hero-visual.has-image img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--dark-surface-2);
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #d7dadb;
}
.panel-row .led { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; box-shadow: 0 0 8px currentColor; }
.led.run { background: var(--green-active); color: var(--green-active); }
.led.stop { background: var(--red-stop); color: var(--red-stop); }
.led.manual { background: var(--blue-manual); color: var(--blue-manual); }
.led.divert { background: var(--orange-divert); color: var(--orange-divert); }

/* ==========================================================================
   Cards / Grids
   ========================================================================== */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(88, 189, 53, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--green-logo);
}
.card .icon svg { width: 24px; height: 24px; }

/* Product cards */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #eef4ea, var(--gray-light));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
  padding: 24px;
}
.product-card__media img { height: 48px; width: auto; max-width: 80%; }
.product-card__body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.product-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(88,189,53,0.12);
  color: var(--green-active);
  margin-bottom: 14px;
  font-weight: 700;
}
.product-card__body p { color: #6b6c72; flex: 1; }
.product-card__body .btn { align-self: flex-start; margin-top: 12px; }

/* Screenshot placeholder */
.screenshot-placeholder {
  border: 2px dashed #c9d6c2;
  border-radius: var(--radius);
  background: var(--gray-lighter);
  color: #8b8d91;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 16 / 9;
  text-align: center;
  padding: 24px;
}
.screenshot-placeholder svg { width: 42px; height: 42px; color: var(--green-active); opacity: 0.8; }
.screenshot-placeholder span { font-family: var(--font-mono); font-size: 0.82rem; }
.screenshot-placeholder.has-image { border: none; padding: 0; background: #1b1c20; overflow: hidden; }
.screenshot-placeholder.has-image img { width: 100%; height: 100%; object-fit: contain; }

/* Zoomable product images + lightbox */
img.is-zoomable { cursor: pointer; transition: filter var(--transition); }
img.is-zoomable:hover { filter: brightness(1.05); }

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(10, 10, 12, 0.92);
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay .lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
body.lightbox-locked { overflow: hidden; }

/* Feature list */
.feature-list { display: grid; gap: 18px; }
.feature-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 4px 0;
}
.feature-list .check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(88,189,53,0.15);
  color: var(--green-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Split content sections */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split.reverse .split__media { order: 2; }

/* Timeline / values */
.value-card { text-align: left; }

/* CTA banner */
.cta-banner {
  background: var(--gradient-green);
  color: var(--white);
  border-radius: var(--radius);
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-banner h2 { color: var(--white); margin-bottom: 6px; }
.cta-banner .btn-outline { border-color: rgba(255,255,255,0.6); color: var(--white); }
.cta-banner .btn-outline:hover { background: var(--white); color: var(--green-logo); border-color: var(--white); }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}
.contact-info-card {
  background: var(--dark-bg);
  color: var(--gray-light);
  border-radius: var(--radius);
  padding: 36px;
}
.contact-info-card h3 { color: var(--white); }
.contact-method { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.contact-method .icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(88,189,53,0.18); color: var(--green-logo);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-method strong { display: block; color: var(--white); font-size: 0.95rem; }
.contact-method span, .contact-method a { color: #b7bcbf; font-size: 0.92rem; }
.contact-method a:hover { color: var(--green-logo); }

.form-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--near-black);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--gray-lighter);
  transition: border-color var(--transition), background var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-active);
  background: var(--white);
}
.form-group textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: 0.82rem; color: #86888c; margin-top: 14px; }
.form-success {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(88,189,53,0.12);
  color: #2f6e1c;
  border: 1px solid rgba(88,189,53,0.35);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 20px;
}
.form-success.visible { display: flex; }
.form-error {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(214,57,17,0.1);
  color: var(--red-alert);
  border: 1px solid rgba(214,57,17,0.35);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 20px;
}
.form-error.visible { display: flex; }
.form-honeypot { display: none !important; }
.field-error { color: var(--red-alert); font-size: 0.8rem; margin-top: 6px; display: none; }
.form-group.invalid input,
.form-group.invalid textarea,
.form-group.invalid select { border-color: var(--red-alert); background: #fdf1f0; }
.form-group.invalid .field-error { display: block; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--dark-bg);
  color: #b7bcbf;
  padding: 72px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand img { height: 40px; width: auto; margin-bottom: 16px; display: block; }
.footer-brand p { color: #93979a; max-width: 280px; }
.footer-col h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #b7bcbf; transition: color var(--transition); }
.footer-col a:hover { color: var(--green-logo); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: #7d8083;
}
.social-row { display: flex; gap: 10px; }
.social-row a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.social-row a:hover { background: var(--green-logo); color: var(--white); }

/* ==========================================================================
   Page hero (interior pages)
   ========================================================================== */
.page-hero {
  background: var(--gradient-dark);
  color: var(--white);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(88, 189, 53, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(88, 189, 53, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at top left, black 10%, transparent 75%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1, .page-hero h2 { color: var(--white); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.82rem; color: var(--green-logo); margin-bottom: 14px; }
.breadcrumb a { color: #b7bcbf; }
.breadcrumb a:hover { color: var(--white); }
.page-hero p.lead { color: #c7cbcd; max-width: 620px; font-size: 1.05rem; }
.product-hero-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(88,189,53,0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-logo);
  margin-bottom: 20px;
}
.product-hero-icon svg { width: 32px; height: 32px; }
.product-hero-logo {
  display: inline-flex;
  align-items: center;
  background: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}
.product-hero-logo img { height: 36px; width: auto; display: block; }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--border-light); }
.spec-table td { padding: 14px 0; font-size: 0.95rem; }
.spec-table td:first-child { color: #86888c; width: 40%; font-weight: 600; }
.spec-table td:last-child { color: var(--near-black); }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Utility */
.text-center { text-align: center; }
.mt-lg { margin-top: 48px; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual.has-image { margin-top: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse .split__media { order: 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .main-nav { position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0; height: calc(100vh - var(--header-height)); background: var(--white); flex-direction: column; padding: 24px; transform: translateX(100%); transition: transform var(--transition); overflow-y: auto; z-index: 999; }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; align-items: stretch; width: 100%; gap: 4px; }
  .main-nav a { display: block; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; display: none; padding-left: 12px; }
  .has-dropdown.open .dropdown { display: block; }
  .nav-toggle { display: flex; }
  .nav-cta { margin-left: 0; margin-top: 12px; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; padding: 40px; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .stat-row { gap: 24px; }
  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }
}
