:root {
  --color-bg: #0f1419;
  --color-surface: #1a2332;
  --color-surface-alt: #1e2838;
  --color-accent: #2dd4bf;
  --color-accent-warm: #fb923c;
  --color-accent-purple: #a78bfa;
  --color-text-primary: #f7f8f8;
  --color-text-secondary: #8a8f98;
  --color-text-muted: #62666d;
  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-teal: rgba(45, 212, 191, 0.15);
  --color-border-teal-hover: rgba(45, 212, 191, 0.35);
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius-std: 8px;
  --radius-panel: 12px;
  --radius-btn: 6px;
  --radius-pill: 9999px;
  --max-width: 1200px;
  --section-pad: 120px;
  --section-pad-mobile: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ===== AMBIENT GRADIENT BLOBS ===== */
body::before {
  content: "";
  position: fixed;
  top: -180px;
  right: -120px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.07) 0%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  bottom: -200px;
  left: -140px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.06) 0%, transparent 70%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

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

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(15, 20, 25, 0.75);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--color-border-subtle);
}
.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-prompt {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 23px;
}
.nav-name {
  font-family: var(--font-mono), var(--font-body);
  color: var(--color-text-primary, var(--text));
  font-weight: 400;
}
.cursor-blink {
  animation: cursorBlink 1.2s steps(2) infinite;
}
@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--color-accent); }
.nav-links a.active { color: var(--color-accent); }
.nav-cta {
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  transition: opacity 0.2s ease;
}
.nav-cta:hover { opacity: 0.9; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-direction: column;
  padding: 20px 40px;
  gap: 20px;
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 6px 0;
}
.mobile-menu a:hover { color: var(--color-accent); }
.mobile-menu a.active { color: var(--color-accent); }
.mobile-menu .nav-cta {
  align-self: flex-start;
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-btn);
  margin-top: 4px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 204px 24px 120px;
  background: var(--color-bg);
  text-align: center;
}
.page-header .section-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}
.page-header h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  margin-bottom: 18px;
}
.page-header .header-sub {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 400;
  color: var(--color-text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Pipeline SVG layer --- */
.pipeline-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

/* --- Node breathing glow (staggered) --- */
@keyframes node-glow {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}
.node-pulse {
  animation: node-glow 3.6s ease-in-out infinite;
}
.node-pulse.n1 { animation-delay: 0s; }
.node-pulse.n2 { animation-delay: 0.45s; }
.node-pulse.n3 { animation-delay: 0.9s; }
.node-pulse.n4 { animation-delay: 1.35s; }
.node-pulse.n5 { animation-delay: 1.8s; }
.node-pulse.n6 { animation-delay: 2.25s; }

/* --- Core panel slow breath --- */
@keyframes core-breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.85; }
}
.core-breathe {
  animation: core-breathe 5s ease-in-out infinite;
}

/* --- Internal sub-component blinks --- */
@keyframes sub-blink {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.7; }
}
.sub-blink {
  animation: sub-blink 2.4s ease-in-out infinite;
}
.sub-blink.s1 { animation-delay: 0.3s; }
.sub-blink.s2 { animation-delay: 0.9s; }
.sub-blink.s3 { animation-delay: 1.5s; }

/* --- Section labels fade in/out subtly --- */
@keyframes label-fade {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.55; }
}
.pipe-label {
  animation: label-fade 6s ease-in-out infinite;
}
.pipe-label.lbl-mid { animation-delay: 2s; }
.pipe-label.lbl-out { animation-delay: 4s; }

/* --- Data pulse dots (SMIL drives motion; CSS adds glow pulse) --- */
@keyframes pulse-bright {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
.data-pulse {
  animation: pulse-bright 1.6s ease-in-out infinite;
}

/* ===== SHARED SECTION ===== */
section {
  padding: var(--section-pad) 24px;
  position: relative;
  z-index: 1;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 14px;
}
h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 40px);
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.section-subtitle {
  color: var(--color-text-secondary);
  font-size: 16px;
  font-weight: 400;
  margin-top: 14px;
  max-width: 540px;
}
.section-centered { text-align: center; }
.section-centered .section-subtitle { margin-left: auto; margin-right: auto; }

/* ===== SERVICE DETAIL CARDS ===== */
.service-detail {
  background: var(--color-bg);
  position: relative;
  z-index: 1;
}
/* Ambient teal blob behind the first service section */
.service-detail::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(45, 212, 191, 0.06) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.service-detail .section-inner {
  position: relative;
  z-index: 1;
}
.service-detail-stack {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.service-detail-card {
  background: rgba(26, 35, 50, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-panel);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
.service-detail-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--color-border-teal-hover);
  border-color: var(--color-border-teal-hover);
}
.sdc-text .sdc-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.sdc-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-teal-hover);
  border-radius: var(--radius-std);
  flex-shrink: 0;
}
.sdc-icon svg { width: 26px; height: 26px; }
.sdc-head h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  color: var(--color-text-primary);
}
.sdc-desc {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 20px;
}
.sdc-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sdc-bullets li {
  font-size: 15px;
  color: var(--color-text-secondary);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.5;
}
.sdc-bullets li .b-prefix {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1.5;
}
.sdc-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.sdc-visual svg { width: 100%; max-width: 220px; height: auto; }

/* ===== PROCESS DETAIL ===== */
.process-detail {
  background: var(--color-surface-alt);
  position: relative;
  z-index: 1;
}
/* Subtle teal-purple blob behind process section */
.process-detail::before {
  content: "";
  position: absolute;
  top: 30%;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.05) 0%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.process-detail .section-inner {
  position: relative;
  z-index: 1;
}
.process-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
  position: relative;
}
.process-step {
  position: relative;
  padding: 32px 28px;
  background: rgba(26, 35, 50, 0.45);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-panel);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.process-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  border-color: var(--color-border-teal-hover);
}
.process-step .step-num {
  position: absolute;
  top: -24px;
  left: 20px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 88px;
  color: var(--color-accent);
  opacity: 0.15;
  line-height: 1;
  z-index: 0;
  pointer-events: none;
}
.process-step .step-content { position: relative; z-index: 1; padding-top: 28px; }
.process-step h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}
.process-step p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.process-step:nth-child(3) .step-num { color: var(--color-accent-purple); }

/* ===== CTA ===== */
.cta {
  background: var(--color-bg);
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
/* Warm orange-purple ambient blob behind CTA */
.cta::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(251, 146, 60, 0.07) 0%, rgba(167, 139, 250, 0.04) 50%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.cta .section-inner {
  position: relative;
  z-index: 1;
}
.cta h2 { font-size: clamp(34px, 4.5vw, 48px); }
.cta-sub {
  color: var(--color-text-secondary);
  font-size: 17px;
  margin: 16px auto 0;
  max-width: 560px;
  line-height: 1.6;
}
.cta-btn {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  margin-top: 36px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cta-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== FOOTER ===== */
footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-subtle);
  padding: 40px 24px 28px;
  position: relative;
  z-index: 1;
}
.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.footer-left {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 32px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-left .nav-prompt { font-size: 30px; }
.footer-center {
  display: flex;
  gap: 28px;
  justify-content: center;
}
.footer-center a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.footer-center a:hover { color: var(--color-accent); }
.footer-right {
  text-align: right;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.footer-copy {
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-subtle);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; order: 1; }
  .nav-right .nav-cta { order: 2; }
  .nav-right { justify-content: flex-end; gap: 16px; }
  section { padding: var(--section-pad-mobile) 20px; }
  .page-header { padding: 174px 20px 86px; }
  .service-detail-card {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px;
  }
  .sdc-visual { order: -1; }
  .sdc-visual svg { max-width: 140px; }
  .process-detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .process-step { padding: 24px 20px; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .footer-left, .footer-right { justify-content: center; text-align: center; }
  .footer-left { display: inline-flex; }
}

@media (max-width: 480px) {
  .sdc-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .cursor-blink { animation: none; }
  .node-pulse, .core-breathe, .sub-blink, .pipe-label, .data-pulse { animation: none !important; }
  .pipeline-bg animateMotion, .pipeline-bg animate { display: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
}
