:root {
  --bg: #0a0e1a;
  --bg-elev: #121829;
  --bg-elev-2: #161e35;
  --border: #253050;
  --border-glow: #4c3df0;
  --text: #eef1fb;
  --text-dim: #8b95b8;
  --violet: #7c5cff;
  --cyan: #22e0ea;
  --pink: #ff5ec4;
  --gradient: linear-gradient(100deg, var(--violet), var(--cyan));
  --gradient-warm: linear-gradient(100deg, var(--pink), var(--violet));
  --radius: 18px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.015em;
}

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

.eyebrow {
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: lowercase;
  letter-spacing: -0.02em;
}
.nav__brand span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 1.85rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.nav__links a:not(.nav__cta):hover { color: var(--text); }
.nav__cta {
  color: #0a0e1a !important;
  background: var(--gradient);
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.5);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.nav__cta:hover { box-shadow: 0 0 24px 2px rgba(124, 92, 255, 0.45); transform: translateY(-1px); }

/* hero */
.hero {
  position: relative;
  padding: 7rem 1.5rem 6rem;
  overflow: hidden;
  isolation: isolate;
}
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black 40%, transparent 100%);
}
.hero__glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 10s ease-in-out infinite;
}
.hero__glow--a {
  width: 480px; height: 480px;
  top: -180px; left: 50%;
  margin-left: -520px;
  background: var(--violet);
}
.hero__glow--b {
  width: 420px; height: 420px;
  top: -140px; right: -120px;
  background: var(--cyan);
  animation-delay: -4s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(26px) scale(1.05); }
}

.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero__copy { min-width: 0; }

/* terminal mockup */
.hero__visual { min-width: 0; }
.term {
  background: rgba(18, 24, 41, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(124, 92, 255, 0.08);
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.term__dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; }
.term__dot--r { background: #ff5f56; }
.term__dot--y { background: #ffbd2e; }
.term__dot--g { background: #27c93f; }
.term__title {
  margin-left: 0.5rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-family: "Space Grotesk", monospace;
}
.term__body {
  margin: 0;
  padding: 1.25rem 1.1rem 1.4rem;
  min-height: 230px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.term__cmd { color: var(--text); }
.term__ok { color: var(--cyan); }
.term__done {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { order: -1; max-width: 480px; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(124, 92, 255, 0.08);
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 1.75rem;
}
.badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px 2px var(--cyan);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  max-width: 860px;
}
.hero__lead {
  max-width: 600px;
  color: var(--text-dim);
  font-size: 1.12rem;
  margin: 1.5rem 0 2.25rem;
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn--primary {
  background: var(--gradient);
  color: #0a0e1a;
  box-shadow: 0 8px 30px -8px rgba(124, 92, 255, 0.55);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px -6px rgba(124, 92, 255, 0.7); }
.btn--ghost { border-color: var(--border); color: var(--text); background: rgba(255,255,255,0.02); }
.btn--ghost:hover { border-color: var(--violet); transform: translateY(-2px); }

.hero__stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
}
.hero__stats div { display: flex; flex-direction: column; gap: 0.15rem; }
.hero__stats strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__stats span { color: var(--text-dim); font-size: 0.85rem; }

/* sections */
section { padding: 5rem 1.5rem; position: relative; }
.section__head { max-width: var(--maxw); margin: 0 auto 2.75rem; }
.section__head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; }

/* services */
.services__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-glow); transform: translateY(-4px); }
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.12);
  color: var(--cyan);
  margin-bottom: 1.1rem;
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.55rem; font-weight: 600; }
.card p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

/* process */
.process { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.process__list {
  max-width: var(--maxw);
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.process__list li { display: flex; gap: 1rem; }
.process__index {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--gradient);
  color: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  font-family: "Space Grotesk", sans-serif;
}
.process__list h3 { font-size: 1.05rem; margin-bottom: 0.35rem; font-weight: 600; }
.process__list p { color: var(--text-dim); font-size: 0.92rem; margin: 0; }

/* projects */
.projects__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.project {
  display: block;
  position: relative;
  background: linear-gradient(145deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: var(--radius);
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.project:hover { transform: translateY(-4px); }
.project:hover::before { opacity: 1; }
.project--placeholder { opacity: 0.8; }
.project h3 { font-size: 1.2rem; margin-bottom: 0.55rem; font-weight: 600; }
.project p { color: var(--text-dim); font-size: 0.95rem; margin: 0 0 1.1rem; }
.project__link { color: var(--cyan); font-weight: 600; font-size: 0.9rem; }

/* contact */
.contact {
  text-align: center;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(124, 92, 255, 0.18), transparent 70%);
}
.contact__inner { max-width: 560px; margin: 0 auto; }
.contact h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.75rem; }
.contact p { color: var(--text-dim); margin: 0 0 2rem; }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 2rem 1.5rem; }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .nav__links { gap: 1rem; }
  .nav__links a:not(.nav__cta) { display: none; }
  .hero__glow--a, .hero__glow--b { width: 280px; height: 280px; }
}

/* chat widget */
.chat {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.chat__bubble {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px -6px rgba(124, 92, 255, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat__bubble:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -4px rgba(124, 92, 255, 0.75); }
.chat__icon { width: 22px; height: 22px; position: absolute; transition: opacity 0.15s ease, transform 0.15s ease; }
.chat__icon--close { opacity: 0; transform: rotate(-45deg) scale(0.6); }
.chat--open .chat__icon--open { opacity: 0; transform: rotate(45deg) scale(0.6); }
.chat--open .chat__icon--close { opacity: 1; transform: rotate(0) scale(1); }

.chat__panel {
  width: min(340px, calc(100vw - 3rem));
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.92) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.chat--open .chat__panel { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }

.chat__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.chat__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.chat__header strong { display: block; font-size: 0.92rem; }
.chat__header span { color: var(--text-dim); font-size: 0.76rem; }

.chat__body { padding: 1rem 1.1rem 0.25rem; }
.chat__msg--bot {
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 2px;
  padding: 0.75rem 0.9rem;
  font-size: 0.86rem;
  color: var(--text);
  max-width: 92%;
}

.chat__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem 1.1rem;
}
.chat__form input,
.chat__form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  resize: vertical;
}
.chat__form input:focus,
.chat__form textarea:focus {
  outline: none;
  border-color: var(--violet);
}
.chat__form input::placeholder,
.chat__form textarea::placeholder { color: var(--text-dim); }
.chat__send {
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

@media (max-width: 480px) {
  .chat { right: 1rem; bottom: 1rem; }
}
