/* ==========================================================================
   Machinx Limited — Global Stylesheet (UK)
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #06080f;
  --bg-alt: #0a0d16;
  --surface: #11141f;
  --surface-2: #171b28;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text-primary: #f5f6fa;
  --text-secondary: #a9afc2;
  --text-muted: #6c7387;

  /* Brand accents — teal / indigo / fuchsia */
  --accent-cyan: #2dd4bf;
  --accent-blue: #6366f1;
  --accent-violet: #d946ef;
  --accent-ink: #0f766e;
  --accent-gradient: linear-gradient(135deg, #2dd4bf 0%, #6366f1 55%, #d946ef 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(45,212,191,0.16) 0%, rgba(99,102,241,0.16) 55%, rgba(217,70,239,0.16) 100%);

  /* Status */
  --good: #34d399;

  /* Layout */
  --max-width: 1240px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --gap: 24px;

  /* Shadows */
  --shadow-glow: 0 0 0 1px var(--border), 0 20px 60px -20px rgba(99, 102, 241, 0.24);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 32px -16px rgba(0,0,0,0.6);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

h1, h2, h3, h4, .brand, .btn, .nav-links a, .eyebrow {
  font-family: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

/* Background texture: soft grid + glow blobs */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- Eyebrow / section labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  padding: 3px 0 3px 14px;
  border: none;
  border-left: 3px solid var(--accent-blue);
  border-radius: 0;
  background: none;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent-gradient);
  flex-shrink: 0;
}

/* ---------- Typography helpers ---------- */
.section-tag { margin-bottom: 18px; }
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}
.section-sub {
  margin-top: 16px;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 17px;
}
.section-header { margin-bottom: 48px; }
.section-header.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-header.center .section-sub { margin-left: auto; margin-right: auto; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-gradient);
  color: #04070d;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px rgba(99, 102, 241, 0.55); }
.btn-ghost {
  background: rgba(255,255,255,0.03);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-ghost:hover { border-color: var(--accent-cyan); background: rgba(45,212,191,0.08); transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 102;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar-links { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); transition: color 0.2s ease; }
.topbar a:hover { color: var(--accent-cyan); }
.topbar svg { width: 13px; height: 13px; flex-shrink: 0; }
.topbar-tag { letter-spacing: 0.06em; }
@media (max-width: 640px) { .topbar { display: none; } }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 37px; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}
@media (max-width: 640px) { .navbar { top: 0; } }
.navbar.scrolled {
  padding: 12px 0;
  background: rgba(6, 8, 15, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; row-gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { height: 40px; width: auto; }
@media (max-width: 480px) { .brand img { height: 32px; } }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--text-primary); background: rgba(255,255,255,0.07); }
.nav-cta { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03);
  align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { display: none; }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(6,8,15,0.98);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 100px 32px 40px;
  gap: 6px;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu a {
  font-size: 22px;
  font-weight: 600;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.mobile-menu .btn { margin-top: 24px; align-self: flex-start; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 110px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 140px 0 70px; }
}
.hero h1 {
  font-size: clamp(36px, 5.4vw, 62px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 22px 0 22px;
}
.hero p.lead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 540px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 36px; margin-top: 52px; flex-wrap: wrap; }
.hero-stat .num { font-size: 26px; font-weight: 800; }
.hero-stat .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.hero-visual { position: relative; }
.hero-visual-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 20%, rgba(99,102,241,0.14), transparent 55%), var(--surface);
  overflow: hidden;
}
@media (max-width: 900px) { .hero-visual-frame { aspect-ratio: 16/10; } }
.hero-scene { width: 100%; height: 100%; display: block; }

/* Hero scene: a central intelligence hub with orbiting connected nodes */
.hs-orbit-ring { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 7; }

.hs-pulse { fill: none; stroke: var(--accent-blue); stroke-width: 1.6; opacity: 0; transform-origin: 200px 200px; animation: hsPulseOut 3.6s ease-out infinite; }
.hs-pulse.p2 { animation-delay: 1.2s; }
.hs-pulse.p3 { animation-delay: 2.4s; }
@keyframes hsPulseOut {
  0% { opacity: .65; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.7); }
}

.hs-hub-outline { fill: rgba(255,255,255,0.03); stroke: url(#icon-grad); stroke-width: 1.6; }
.hs-hub-fill { fill: rgba(99,102,241,0.14); stroke: none; }
.hs-hub-core { fill: var(--accent-blue); transform-origin: 200px 200px; animation: hsCoreBeat 2.2s ease-in-out infinite; }
@keyframes hsCoreBeat { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }

.hs-orbit-group { transform-origin: 200px 200px; animation: hsSpin 20s linear infinite; }
.hs-orbit-group.orbit-1 { animation-duration: 19s; }
.hs-orbit-group.orbit-2 { animation-duration: 27s; animation-direction: reverse; }
.hs-orbit-group.orbit-3 { animation-duration: 23s; }
.hs-orbit-group.orbit-4 { animation-duration: 15s; animation-direction: reverse; }
@keyframes hsSpin { to { transform: rotate(360deg); } }

.hs-spoke { stroke: var(--border-strong); stroke-width: 1; }
.hs-node { fill: var(--accent-cyan); }
.hs-orbit-group.orbit-2 .hs-node,
.hs-orbit-group.orbit-3 .hs-node { fill: var(--accent-blue); }
.hs-orbit-group.orbit-4 .hs-node { fill: var(--accent-violet); }

/* ---------- Sections ---------- */
section { position: relative; padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Card grid ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.card:hover::before { transform: scaleX(1); }
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 20px 40px -20px rgba(99,102,241,0.22); }

.icon-tile {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-gradient-soft);
  border: 1px solid var(--border-strong);
  margin-bottom: 22px;
  transform: rotate(45deg);
}
.icon-tile svg { width: 24px; height: 24px; stroke: url(#icon-grad); transform: rotate(-45deg); }

.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.card p { color: var(--text-secondary); font-size: 15px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.05); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.card-link { margin-top: 20px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent-cyan); }
.card-link svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.card:hover .card-link svg { transform: translateX(3px); }

/* Feature row (icon left, text right) */
.feature-row { display: flex; gap: 18px; }
.feature-row .icon-tile { flex-shrink: 0; margin-bottom: 0; }
.feature-row h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.feature-row p { font-size: 14.5px; color: var(--text-secondary); }

/* Two-col content section */
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0,1fr); gap: 36px; } }
.split.reverse .split-visual { order: 2; }

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface), var(--bg-alt));
  padding: 40px;
  position: relative;
  overflow: hidden;
}

/* ---------- Timeline / list ---------- */
.check-list { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--text-secondary); }
.check-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--good); margin-top: 1px; }

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  padding: 56px;
  background: var(--accent-gradient-soft);
  border: 1px solid rgba(217,70,239,0.25);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.cta-band p { color: var(--text-secondary); margin-top: 14px; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-band .hero-actions { justify-content: center; margin-top: 30px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-alt); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.2fr); gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: minmax(0,1fr); } }
.footer-brand p { color: var(--text-secondary); font-size: 14.5px; margin-top: 14px; max-width: 300px; }
.footer-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14.5px; color: var(--text-secondary); transition: color 0.2s ease; }
.footer-col a:hover { color: var(--accent-cyan); }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-secondary); overflow-wrap: anywhere; }
.footer-contact svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--accent-cyan); }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom span { font-size: 13px; color: var(--text-muted); }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
  transition: all 0.2s ease;
}
.footer-social a:hover { color: var(--bg); background: var(--accent-cyan); border-color: var(--accent-cyan); }
.footer-social svg { width: 15px; height: 15px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px) scale(0.97); transition: opacity 0.6s cubic-bezier(.22,1,.36,1), transform 0.6s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: translateY(0) scale(1); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 158px 0 70px; text-align: center; }
.page-hero .eyebrow { margin-bottom: 20px; }
.page-hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.03em; }
.page-hero p { max-width: 640px; margin: 20px auto 0; color: var(--text-secondary); font-size: 17px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--accent-cyan); }
.breadcrumb svg { width: 12px; height: 12px; }

/* ---------- Stats row ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 720px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) { .stats-row-3 { grid-template-columns: minmax(0, 1fr); } }
.stat-box { text-align: center; padding: 28px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow-wrap: anywhere; }
.stat-box .num { font-size: 30px; font-weight: 800; overflow-wrap: anywhere; }
.stat-box .label { font-size: 13px; color: var(--text-muted); margin-top: 6px; overflow-wrap: anywhere; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.hidden-svg-defs { position: absolute; width: 0; height: 0; }

/* ---------- Form (contact page) ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.form-field input, .form-field textarea, .form-field select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.15);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); filter: grayscale(0.3) invert(0.92) contrast(0.9); }
.map-embed iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }

/* ---------- Table (CVMS specs) ---------- */
.spec-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.spec-table tr { border-top: 1px solid var(--border); }
.spec-table tr:first-child { border-top: none; }
.spec-table td { padding: 16px 20px; font-size: 14.5px; }
.spec-table td:first-child { color: var(--text-muted); width: 40%; font-weight: 600; }
.spec-table td:last-child { color: var(--text-secondary); }
.spec-table tr:nth-child(odd) { background: rgba(255,255,255,0.02); }
