/* ============ ClosedLoop AI ============ */
:root {
  --bg: #060911;
  --bg-alt: #090e1a;
  --surface: #0d1424;
  --surface-2: #111a2e;
  --line: rgba(148, 163, 200, 0.14);
  --text: #e8ecf4;
  --muted: #93a0ba;
  --teal: #5eead4;
  --violet: #818cf8;
  --grad: linear-gradient(100deg, #5eead4 0%, #67b8f0 50%, #818cf8 100%);
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
strong { color: var(--text); font-weight: 600; }
.container { width: min(1140px, 92%); margin: 0 auto; }

/* ---- ambient background ---- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 62vw; height: 62vw; max-width: 900px; max-height: 900px;
  border-radius: 50%; filter: blur(120px); opacity: 0.16;
}
.bg-glow-1 { top: -28vw; right: -18vw; background: #818cf8; }
.bg-glow-2 { top: 46%; left: -30vw; background: #14b8a6; opacity: 0.1; }

/* ---- nav ---- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(6, 9, 17, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.01em; }
.brand-ai {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; margin-left: 2px;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 0.95rem; color: var(--muted); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  color: #06131a; background: var(--grad);
  padding: 9px 18px; border-radius: 999px; font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-links .nav-cta:hover { color: #06131a; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(94, 234, 212, 0.3); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 6px 0; border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---- buttons ---- */
.btn {
  display: inline-block; font-weight: 600; font-size: 1rem;
  padding: 14px 28px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--font-body); transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--grad); color: #06131a;
  box-shadow: 0 4px 28px rgba(94, 234, 212, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(94, 234, 212, 0.4); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: rgba(148, 163, 200, 0.4); background: rgba(148, 163, 200, 0.06); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

/* ---- hero ---- */
.hero { padding: 168px 0 96px; position: relative; }
.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 48px; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.85rem; font-weight: 500; color: var(--teal);
  border: 1px solid rgba(94, 234, 212, 0.25); background: rgba(94, 234, 212, 0.06);
  padding: 7px 15px; border-radius: 999px; margin-bottom: 26px;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); font-weight: 700; margin-bottom: 22px; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 1.16rem; color: var(--muted); max-width: 540px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); }
.hero-meta i { font-style: normal; opacity: 0.5; }

/* ---- orbit visual ---- */
.hero-visual { display: flex; justify-content: center; }
.orbit-wrap { position: relative; width: min(440px, 100%); aspect-ratio: 1; }
.orbit { width: 100%; height: 100%; }
.ring { fill: none; }
.ring-faint { stroke: rgba(148, 163, 200, 0.12); stroke-width: 1.5; }
.ring-dash {
  stroke: url(#ring-g); stroke-width: 2; stroke-dasharray: 6 10; stroke-linecap: round;
  opacity: 0.8; transform-origin: 210px 210px; animation: spin 40s linear infinite;
}
.ring-inner { stroke: rgba(148, 163, 200, 0.1); stroke-width: 1; stroke-dasharray: 2 8; }
.orbiter { transform-origin: 210px 210px; animation: spin 9s linear infinite; }
.orbiter-2 { animation: spin 14s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.orbit-node {
  position: absolute; text-align: center;
  background: rgba(13, 20, 36, 0.85); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 16px; backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%); white-space: nowrap;
}
.orbit-node b { display: block; font-family: var(--font-head); font-size: 0.95rem; }
.orbit-node span { font-size: 0.72rem; color: var(--muted); }
.node-n { top: 7%; left: 50%; }
.node-e { top: 50%; left: 93%; }
.node-s { top: 93%; left: 50%; }
.node-w { top: 50%; left: 7%; }
.orbit-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}
.orbit-core-num {
  font-family: var(--font-head); font-size: 2.1rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-variant-numeric: tabular-nums;
}
.orbit-core-label { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- sections ---- */
.section { padding: 104px 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section-head { max-width: 640px; margin-bottom: 56px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: 16px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---- tiles ---- */
.card-grid { display: grid; gap: 20px; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; position: relative; overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--grad); opacity: 0; transition: opacity 0.25s;
}
.tile:hover { transform: translateY(-4px); border-color: rgba(129, 140, 248, 0.35); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.tile:hover::before { opacity: 1; }
.tile-icon { font-size: 1.5rem; margin-bottom: 16px; color: var(--teal); }
.tile h3 { font-size: 1.14rem; margin-bottom: 10px; }
.tile p { color: var(--muted); font-size: 0.96rem; }

/* ---- loop steps ---- */
.loop-steps {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 14px; align-items: stretch; margin-bottom: 64px;
}
.loop-step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s;
}
.loop-step.active {
  border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.25), 0 12px 40px rgba(94, 234, 212, 0.08);
  transform: translateY(-3px);
}
.loop-step-num {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--violet); margin-bottom: 12px;
}
.loop-step.active .loop-step-num { color: var(--teal); }
.loop-step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.loop-step p { color: var(--muted); font-size: 0.92rem; }
.loop-arrow { align-self: center; color: var(--muted); opacity: 0.6; font-size: 1.2rem; }

/* ---- terminal ---- */
.terminal {
  background: #070b14; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  max-width: 860px; margin: 0 auto;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px; border-bottom: 1px solid var(--line); background: rgba(148, 163, 200, 0.04);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-dot.r { background: #f87171; } .t-dot.y { background: #fbbf24; } .t-dot.g { background: #34d399; }
.terminal-title { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-left: 10px; }
.terminal-live {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--teal); text-transform: uppercase; letter-spacing: 0.1em;
}
.terminal-body {
  font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.9;
  padding: 20px 22px; min-height: 240px; white-space: pre-wrap; word-break: break-word;
}
.tl-dim { color: #5b6982; }
.tl-teal { color: var(--teal); }
.tl-violet { color: #a5b4fc; }
.tl-warn { color: #fbbf24; }
.tl-ok { color: #34d399; }

/* ---- stats band ---- */
.band { padding: 72px 0; border-bottom: 1px solid var(--line); }
.band-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
.stat-num {
  font-family: var(--font-head); font-size: 3rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--muted); font-size: 0.94rem; max-width: 260px; margin: 6px auto 0; }

/* ---- contact ---- */
.contact-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: start; }
.contact-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: 16px; }
.contact-copy p { color: var(--muted); font-size: 1.06rem; margin-bottom: 28px; }
.contact-points { display: grid; gap: 12px; color: var(--text); font-size: 0.96rem; }
.contact-points div { color: var(--muted); }
.contact-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 8px;
}
.form-field .opt { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.form-field input, .form-field textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; font-family: var(--font-body); font-size: 0.98rem;
  transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
.form-field input:focus, .form-field textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: #4d5a73; }
.form-note { font-size: 0.84rem; color: var(--muted); text-align: center; margin-top: 14px; }

/* ---- footer ---- */
.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--line); background: var(--bg-alt); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: 0.84rem; }

/* ---- reveal animations ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ring-dash, .orbiter, .orbiter-2, .pulse-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- responsive ---- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero { padding-top: 140px; }
  .hero-visual { order: 2; }
  .card-grid.three { grid-template-columns: 1fr 1fr; }
  .loop-steps { grid-template-columns: 1fr 1fr; }
  .loop-arrow { display: none; }
  .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .band-inner { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .card-grid.three, .loop-steps { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .contact-form { padding: 24px 20px; }
  .orbit-node { padding: 7px 12px; }
  .orbit-node b { font-size: 0.85rem; }
  .orbit-node span { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(6, 9, 17, 0.97); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 12px 6%; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 4px; font-size: 1.05rem; }
  .nav-links .nav-cta { text-align: center; margin-top: 8px; }
}
