:root {
  --bg: #0a0e14;
  --surface: #111827;
  --accent: #2dd4bf;
  --accent-2: #fb923c;
  --accent-3: #a78bfa;
  --text: #f7f8f8;
  --text-2: #8a8f98;
  --text-muted: #62666d;
  --border-subtle: rgba(255,255,255,0.05);
  --border-teal: rgba(45,212,191,0.1);
  --r-std: 8px;
  --r-panel: 12px;
  --r-btn: 6px;
  --r-pill: 9999px;
  --maxw: 1200px;
  --pad: 100px;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { 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-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  flex-shrink: 0;
}
.nav-name {
  font-family: var(--font-mono), var(--font-body);
  color: var(--text);
  font-weight: 400;
}
.nav-prompt {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 23px;
}
.cursor-blink {
  animation: cursorBlink 1.2s steps(2) infinite;
}
@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
  justify-content: center;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-cta {
  background: var(--accent);
  color: #0a0e14;
  padding: 12px 24px;
  border-radius: var(--r-btn);
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.nav-cta:hover { opacity: 0.9; }
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.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(--bg);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 32px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 16px;
  color: var(--text-2);
  padding: 8px 0;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu .nav-cta {
  align-self: flex-start;
  color: var(--bg) !important;
  font-weight: 600 !important;
  padding: 10px 24px;
  border-radius: 6px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 80px 48px 60px;
}
.hero-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.7;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
/* Staggered fade-in animation for each hero element */
.hero-content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content > *:nth-child(3) { animation-delay: 0.6s; }
.hero-content > *:nth-child(4) { animation-delay: 0.8s; }
.hero-content > *:nth-child(5) { animation-delay: 1.0s; }
@keyframes heroFadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  background: rgba(45, 212, 191, 0.05);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pillDot 2s ease-in-out infinite;
}
@keyframes pillDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(38px, 5.5vw, 68px);
  line-height: 1.02;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 24px;
}
.hero h1 .accent-word {
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.hero h1 .accent-word::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  opacity: 0.3;
  transform: scaleX(0);
  transform-origin: left;
  animation: underlineDraw 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}
@keyframes underlineDraw {
  to { transform: scaleX(1); }
}
.hero h1 .purple-word {
  color: var(--accent-3);
}
.hero-sub {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 300;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: 36px;
}
.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #0a0e14;
}
.btn-primary:hover { opacity: 0.92; box-shadow: 0 4px 20px rgba(45, 212, 191, 0.25); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: rgba(45, 212, 191, 0.4);
}
.btn-ghost:hover { background: rgba(45,212,191,0.06); border-color: var(--accent); }
.btn .arrow {
  transition: transform 0.2s;
}
.btn:hover .arrow { transform: translateX(3px); }
.hero-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.hero-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-meta .meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}
.hero-meta .meta-dot.orange { background: var(--accent-2); }
.hero-meta .meta-dot.purple { background: var(--accent-3); }
.hero-meta .divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 48px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
}
.scroll-indicator .line {
  width: 32px;
  height: 1px;
  background: linear-gradient(to right, var(--text-muted), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-indicator .line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 1px;
  background: var(--accent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { left: -8px; opacity: 0; }
  50% { opacity: 1; }
  100% { left: 32px; opacity: 0; }
}

@media (max-width: 768px) {
  .hero { padding: 80px 24px 60px; }
  .hero-content { max-width: 100%; }
  .scroll-indicator { left: 24px; }
  .hero-meta { flex-wrap: wrap; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content > * { animation: none; opacity: 1; transform: none; 
  .cursor-blink { animation: none; }
}
  .scroll-indicator { animation: none; opacity: 1; }
  .pill::before { animation: none; }
  .hero h1 .accent-word::after { animation: none; transform: scaleX(1); }
}

/* ===== SVG CIRCUIT ANIMATIONS ===== */
.proc-border {
  animation: procPulse 3s ease-in-out infinite alternate;
}
.proc-border.delay-1 { animation-delay: 0.5s; }
.proc-border.delay-2 { animation-delay: 1s; }
@keyframes procPulse {
  from { opacity: 0.3; }
  to { opacity: 0.8; }
}
.trace-flash {
  animation: traceFlash 4s ease-in-out infinite;
}
.trace-flash.d1 { animation-delay: 1s; }
.trace-flash.d2 { animation-delay: 2s; }
.trace-flash.d3 { animation-delay: 3s; }
@keyframes traceFlash {
  0%, 88%, 100% { opacity: 0.3; }
  92%, 96% { opacity: 0.9; }
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--pad) 32px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-bg-surface {
  background: var(--surface);
}
.section-bg-surface .section { background: var(--surface); }
.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-header h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.section-header p {
  color: var(--text-2);
  font-weight: 300;
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== SERVICES CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border-teal);
  border-radius: var(--r-panel);
  padding: 32px;
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover {
  border-color: rgba(45,212,191,0.3);
  transform: translateY(-3px);
}
.card-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45,212,191,0.06);
  border: 1px solid var(--border-teal);
  border-radius: var(--r-std);
  margin-bottom: 24px;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 12px;
  color: var(--text);
}
.card p {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 300;
  margin-bottom: 20px;
}
.card-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}
.card-link:hover { gap: 10px; }

/* ===== PROCESS ===== */
.process-wrap {
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.process-step {
  position: relative;
  padding: 40px 32px;
  overflow: hidden;
}
.process-step::before {
  content: attr(data-num);
  position: absolute;
  top: 10px; right: 20px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 120px;
  color: rgba(45,212,191,0.06);
  line-height: 1;
  pointer-events: none;
}
.process-step h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 10px;
  position: relative;
}
.process-step p {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 300;
  position: relative;
}

/* ===== CTA SECTION ===== */
.cta-section {
  text-align: center;
  padding: var(--pad) 32px;
}
.cta-section h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.cta-section p {
  color: var(--text-2);
  font-size: 18px;
  font-weight: 300;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 32px 32px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 32px;
  color: var(--text);
}
.footer-brand .mono {
  font-family: var(--font-mono);
  color: var(--accent);
  margin-right: 4px;
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }
.footer-right {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-copy {
  max-width: var(--maxw);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root { --pad: 60px; }
  .nav-links { display: none; }
  .hamburger { display: flex; order: 1; }
  .nav-right .nav-cta { order: 2; }
  .nav-right { justify-content: flex-end; gap: 16px; }
  #nav { padding: 14px 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .section { padding: var(--pad) 24px; }
  .hero { padding: 80px 24px 60px; }
  footer { padding: 40px 24px 24px; }
}

@media (max-width: 480px) {
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .process-step { padding: 32px 24px; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-svg animate, .hero-svg animateMotion, .hero-svg animateTransform {
    display: none;
  }
  .proc-border, .trace-flash, .scroll-indicator .mouse::after {
    animation: none !important;
  }
}
