/* ===== Design tokens ===== */
:root {
  --bg: #0a0a0f;
  --bg-soft: #101018;
  --panel: #14141f;
  --panel-border: #24243a;
  --text: #f3f2f8;
  --text-dim: #a6a4bd;
  --text-faint: #6f6d8a;
  --accent: #7c5cff;
  --accent-2: #c9ff4d;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --radius: 18px;
  --radius-sm: 10px;
  --max-w: 1180px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { 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;
  overflow-x: hidden;
}

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

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

p { margin: 0; }

::selection { background: var(--accent); color: #0a0a0f; }

/* ===== Background texture ===== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

/* ===== Nav ===== */
header.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
header.site-nav.scrolled {
  border-bottom-color: var(--panel-border);
  background: rgba(10, 10, 15, 0.85);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot { color: var(--accent-2); }
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--text-dim);
}
.nav-links a { transition: color 0.2s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--panel-border);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-toggle { display: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 600;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(124, 92, 255, 0.6); }
.btn-ghost {
  border-color: var(--panel-border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ===== Section scaffolding ===== */
section { position: relative; z-index: 1; padding: 120px 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--accent-2);
}
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); }
.section-head p { margin-top: 16px; color: var(--text-dim); font-size: 17px; }

/* ===== Hero ===== */
.hero {
  padding: 200px 0 140px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  letter-spacing: -0.02em;
}
.hero h1 .grad {
  background: linear-gradient(97deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 22px;
  font-size: 19px;
  color: var(--text-dim);
  max-width: 520px;
}
.hero-typed {
  font-family: var(--font-mono);
  color: var(--accent-2);
}
.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-meta {
  margin-top: 46px;
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
.hero-meta div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
}
.hero-meta div span {
  font-size: 13px;
  color: var(--text-faint);
}

/* Hero terminal card */
.term {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: #35354a; }
.term-bar .t-label {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.term-body {
  padding: 22px 20px 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-dim);
  min-height: 230px;
}
.term-body .line { margin-bottom: 10px; white-space: pre-wrap; }
.term-body .prompt { color: var(--accent-2); }
.term-body .out { color: var(--text); }
.cursor { display: inline-block; width: 7px; height: 15px; background: var(--accent-2); vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Logo/stat strip ===== */
.strip {
  padding: 46px 0;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}
.strip .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.service-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px 24px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.service-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.service-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  color: var(--accent-2);
}
.service-card h3 { font-size: 18px; margin-bottom: 10px; }
.service-card p { color: var(--text-dim); font-size: 14.5px; }

/* ===== Work ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.work-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.work-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.work-card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  border: 1px solid var(--panel-border);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.work-card h3 { font-size: 21px; margin-bottom: 10px; }
.work-card p { color: var(--text-dim); font-size: 14.5px; }
.work-card .status {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.work-card.feature { grid-column: span 2; }
.work-card::after {
  content: "";
  position: absolute;
  top: -40%; right: -20%;
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.work-card:hover::after { opacity: 1; }

/* ===== Process ===== */
.process-list { display: flex; flex-direction: column; }
.process-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 34px 0;
  border-top: 1px solid var(--panel-border);
}
.process-item:last-child { border-bottom: 1px solid var(--panel-border); }
.process-item .num {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent-2);
}
.process-item h3 { font-size: 21px; margin-bottom: 8px; }
.process-item p { color: var(--text-dim); font-size: 15px; max-width: 560px; }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: start;
}
.about-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 34px;
}
.about-card .avatar {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-bottom: 20px;
}
.about-card h3 { font-size: 20px; }
.about-card p.role { color: var(--text-faint); font-size: 13px; margin-top: 4px; font-family: var(--font-mono); }
.about-copy p { color: var(--text-dim); font-size: 16.5px; margin-bottom: 20px; }
.about-copy p:first-child { color: var(--text); font-size: 19px; }
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.about-tags span {
  font-family: var(--font-mono);
  font-size: 12.5px;
  border: 1px solid var(--panel-border);
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-dim);
}

/* ===== FAQ ===== */
.faq-list { border-top: 1px solid var(--panel-border); }
.faq-item { border-bottom: 1px solid var(--panel-border); }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  padding: 26px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.faq-q .plus { color: var(--accent-2); font-family: var(--font-mono); transition: transform 0.25s ease; flex-shrink: 0; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--text-dim);
  font-size: 15.5px;
}
.faq-item.open .faq-a { max-height: 240px; }
.faq-a-inner { padding-bottom: 26px; max-width: 680px; }

/* ===== Contact / CTA ===== */
.cta-panel {
  background: linear-gradient(135deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 72px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-panel h2 { font-size: clamp(28px, 4.4vw, 46px); max-width: 720px; margin: 0 auto; }
.cta-panel p { color: var(--text-dim); margin-top: 18px; font-size: 17px; }
.cta-actions { margin-top: 34px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cta-panel .glow {
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  top: -200px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* ===== Footer ===== */
footer { padding: 60px 0 40px; border-top: 1px solid var(--panel-border); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-inner .logo { font-size: 16px; }
.footer-links { display: flex; gap: 26px; font-size: 14px; color: var(--text-dim); }
.footer-note { color: var(--text-faint); font-size: 13px; margin-top: 30px; }

/* ===== Reveal-on-scroll ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; }
  .work-card.feature { grid-column: span 1; }
  .about-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .process-item { grid-template-columns: 1fr; gap: 10px; }
  .cta-panel { padding: 52px 28px; }
}
@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  section { padding: 84px 0; }
  .hero { padding: 150px 0 90px; }
}
