/* ==========================================================================
   Apex Automations — Design System
   Display: Space Grotesk / Body: IBM Plex Sans / Utility-Mono: IBM Plex Mono
   ========================================================================== */

:root {
  --bg: #070c0a;
  --bg-panel: #0d1512;
  --bg-panel-alt: #10201a;
  --bg-raised: #132821;
  --hairline: #16362a;
  --hairline-bright: #1f4d3a;

  --accent: #3bffa0;
  --accent-soft: #8affc4;
  --accent-deep: #0fa968;
  --accent-dim: #0c5c3f;

  --text: #eafbf1;
  --text-muted: #93b8a9;
  --text-dim: #547568;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;

  --maxw: 1180px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* faint circuit-grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.12;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--text-muted); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

section { position: relative; z-index: 1; padding: 96px 0; }

/* ---------------------------------- Nav ---------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 12, 10, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding-top: 0;
  padding-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}
.brand img { width: 30px; height: 30px; }
.brand .hq { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.nav-links a {
  position: relative;
  color: var(--text-muted);
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 10px 20px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  color: var(--accent-soft);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-cta:hover {
  border-color: var(--accent);
  background: rgba(59, 255, 160, 0.08);
  color: var(--accent);
}

.nav-toggle { display: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  padding: 14px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #04140c;
  font-weight: 600;
  box-shadow: 0 0 0 rgba(59,255,160,0);
}
.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(59, 255, 160, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--hairline-bright);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); }

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

/* --------------------------------- Hero ---------------------------------- */

.hero {
  padding-top: 84px;
  padding-bottom: 60px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.hero h1 { margin-bottom: 22px; }
.hero .lede {
  font-size: 1.12rem;
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-mark {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.hero-mark-img {
  width: 78%;
  animation: markBreathe 4.2s ease-in-out infinite;
}

@keyframes markBreathe {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(59,255,160,0.35)); }
  50% { filter: drop-shadow(0 0 34px rgba(59,255,160,0.6)); }
}

.pulse-node {
  animation: pulse 2.6s ease-in-out infinite;
}
.pulse-node:nth-child(2) { animation-delay: 0.4s; }
.pulse-node:nth-child(3) { animation-delay: 0.8s; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* -------------------------- Apex Line (signature) ------------------------- */
/* Recurring circuit-trace divider with 3 nodes -- echoes the mark, and marks
   genuine transitions between the site's 3-solution structure. */

.apex-line {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 0 32px;
}
.apex-line .seg {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-bright), transparent);
}
.apex-line .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-dim);
  flex-shrink: 0;
  box-shadow: 0 0 0 rgba(59,255,160,0);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}
.apex-line.lit .dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

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

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

.card {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 34px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--hairline-bright); transform: translateY(-3px); }

.card .node-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  display: block;
}

.card h3 { margin-bottom: 12px; }
.card p { margin-bottom: 0; font-size: 0.94rem; }

.node-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
}

/* ------------------------------ Section head ------------------------------ */

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

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

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 64px 0 36px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--text-muted); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--accent-soft); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 12px;
}

/* -------------------------------- Forms ------------------------------------ */

.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--hairline-bright);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus, .field select:focus,
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -------------------------------- Pricing ----------------------------------- */

.price-card {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border-color: var(--accent-dim);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-panel));
  box-shadow: 0 0 40px rgba(15, 169, 104, 0.12);
}
.price-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.price-amount {
  font-family: var(--font-display);
  font-size: 2.6rem;
  margin: 10px 0 4px;
}
.price-amount span { font-size: 1rem; color: var(--text-muted); font-family: var(--font-mono); }
.price-card ul { list-style: none; padding: 0; margin: 26px 0 30px; flex: 1; }
.price-card li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 9px 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 10px;
}
.price-card li::before { content: "＋"; color: var(--accent); }

/* -------------------------------- Blog -------------------------------------- */

.blog-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}
.blog-thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--bg-raised), var(--bg-panel-alt));
  position: relative;
}
.blog-body { padding: 24px; }
.blog-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
.blog-body h3 { font-size: 1.1rem; margin-bottom: 10px; }
.blog-body p { font-size: 0.9rem; margin-bottom: 0; }

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

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat {
  font-family: var(--font-mono);
}
.stat .n {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent);
  display: block;
}
.stat .l {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cta-band {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 64px 48px;
  text-align: center;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  border: 1px solid var(--hairline-bright);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--text-muted);
}

/* ------------------------------ Reduced motion ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse-node { animation: none; }
  .hero-mark-img { animation: none; filter: drop-shadow(0 0 22px rgba(59,255,160,0.45)); }
  .card:hover { transform: none; }
}

/* ---------------------------------- Mobile ----------------------------------- */

@media (max-width: 920px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-mark { order: -1; max-width: 280px; margin: 0 auto; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  section { padding: 64px 0; }
}
