:root {
  --bg: #0B0F17;
  --bg-1: #111827;
  --bg-2: #1F2937;
  --border: #374151;
  --accent: #8B5CF6;
  --accent-hi: #A78BFA;
  --accent-lo: rgba(139, 92, 246, 0.15);
  --text: #F8FAFC;
  --text-2: #E2E8F0;
  --text-3: #94A3B8;
  --mono: 'JetBrains Mono', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(11, 15, 23, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent-hi);
}

.nav-links {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 100vh;
  background: var(--bg);
  padding: 3rem 2rem;
  gap: 2rem;
  list-style: none;
  border-bottom: 1px solid var(--border);
  z-index: 99;
  overflow-y: auto;
}

.nav-links.active {
  display: flex;
}

.nav-links a {
  font-size: 1.25rem;
  color: var(--text-2);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  display: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-hi);
  background: var(--accent-lo);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 0.5rem 1.25rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.nav-cta:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.hamburger-bar {
  width: 100%;
  height: 2px;
  background-color: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active .hamburger-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  z-index: 2;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
  z-index: 1;
}

.hero-glow {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.07) 0%, transparent 68%);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  width: 100%;
  max-width: 820px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.hero-title .thin {
  display: block;
  font-weight: 300;
  color: var(--text-2);
  font-size: 1.2em;
}

.hero-title .heavy {
  display: block;
  font-weight: 800;
  color: var(--text);
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.btn-primary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 0.875rem 2rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, transform 0.15s;
  display: block;
  width: 100%;
  text-align: center;
}

.btn-primary:hover {
  background: var(--accent-hi);
  transform: translateY(-1px);
}

.btn-ghost {
  font-size: 0.9375rem;
  color: var(--text-2);
  background: transparent;
  padding: 0.875rem 2rem;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
  display: block;
  width: 100%;
  text-align: center;
}

.btn-ghost:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  width: 100%;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-stat .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.hero-stat .num span {
  color: var(--accent-hi);
}

.hero-stat .lbl {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section {
  padding: 4rem 1.5rem;
  width: 100%;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
}

.text-justify {
  text-align: justify;
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 25%, var(--border) 75%, transparent);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px -10px rgba(139, 92, 246, 0.15);
  background: var(--bg-2);
}

.service-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-hi);
  background: rgba(139, 92, 246, 0.1);
  padding: 0.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.service-card:hover .service-icon {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.05);
  border-color: transparent;
}

.service-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.service-name a {
  color: inherit;
  text-decoration: none;
}

.service-name a:hover {
  color: var(--accent-hi);
}

.service-desc {
  font-size: 0.875rem;
  color: var(--text-3);
  line-height: 1.6;
}

.about-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
  margin-top: 1.75rem;
}

.about-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.check-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.about-item p {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.65;
}

.about-item strong {
  color: var(--text);
  font-weight: 600;
}

.code-block {
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.85;
  color: var(--text-2);
  position: relative;
  overflow-x: auto;
}

.code-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi), transparent);
}

.code-line {
  display: block;
  white-space: nowrap;
}

.kw {
  color: var(--accent-hi);
}

.str {
  color: #A5B4FC;
}

.val {
  color: #86EFAC;
}

.cmt {
  color: var(--text-3);
}

.stack-bg {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stack-rows {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 3rem;
}

.stack-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px dashed var(--border);
}

.stack-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stack-cat {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.chip:hover {
  color: var(--accent-hi);
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.testimonials-track-wrapper {
  overflow: hidden;
  margin-top: 3rem;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.testimonials-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marquee 35s linear infinite;
}

.testimonials-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.testimonial-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: min(380px, 85vw);
  flex-shrink: 0;
}

.testimonial-quote {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.75;
  text-align: justify;
}

.contact-bg {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}

.contact-inner {
  width: 100%;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea,
.form-field select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 4px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-3);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--accent);
}

.form-field select option {
  background: var(--bg-2);
}

.form-field textarea {
  min-height: 120px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--text);
}

.contact-link svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.footer-logo span {
  color: var(--accent-hi);
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-align: center;
}

.ai-section {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ai-headline {
  font-size: clamp(1.8rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.ai-sub {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.ai-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.ai-block-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent-hi);
  letter-spacing: 0.12em;
  margin-bottom: 0.625rem;
}

.ai-block-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.625rem;
}

.ai-block-desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  display: inline-block;
}

@keyframes blink {
  from, to { opacity: 0 }
  50% { opacity: 1 }
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.work-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-image-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.work-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.work-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.work-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.work-title a {
  color: inherit;
  text-decoration: none;
}

.work-title a:hover {
  color: var(--accent-hi);
}

.work-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  text-align: justify;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.work-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
}

@media (min-width: 480px) {
  .nav-cta {
    display: block;
    margin-right: 1rem;
  }
  .hero-actions {
    flex-direction: row;
    width: auto;
  }
  .btn-primary,
  .btn-ghost {
    display: inline-block;
    width: auto;
  }
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .hero {
    padding: 8rem 3rem 6rem;
  }
  .hero-title {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
  }
  .hero-title .thin {
    font-size: 1em;
  }
  .hero-sub {
    font-size: 1.1rem;
  }
  .hero-stats {
    grid-template-columns: repeat(5, 1fr);
    margin-top: 3.5rem;
  }
  .hero-glow {
    width: 700px;
    height: 700px;
    left: 52%;
  }
  .section {
    padding: 6rem 3rem;
  }
  .section-desc {
    font-size: 1.0625rem;
  }
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 3.5rem;
  }
  .work-image-wrapper {
    height: 260px;
  }
  .work-content {
    padding: 2rem;
  }
  .work-title {
    font-size: 1.35rem;
  }
  .ai-sub {
    font-size: 1.0625rem;
    margin-bottom: 3.5rem;
  }
  .ai-blocks {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding-top: 3rem;
  }
  .stack-row {
    grid-template-columns: 160px 1fr;
    gap: 2rem;
  }
  .testimonials-track-wrapper {
    margin-top: 3.5rem;
  }
  .testimonial-card {
    width: 380px;
  }
  footer {
    flex-direction: row;
    justify-content: space-between;
    padding: 1.75rem 3rem;
    gap: 0;
  }
  .footer-copy {
    text-align: left;
  }
}

@media (max-width: 767px) {
  .hero-stats .hero-stat:last-child {
    grid-column: span 2;
  }
}

@media (min-width: 900px) {
  nav {
    padding: 1.25rem 3rem;
  }
  .nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    gap: 2.5rem;
    height: auto;
  }
  .nav-links a {
    font-size: 0.875rem;
  }
  .nav-cta {
    margin-right: 0;
  }
  .nav-toggle {
    display: none;
  }
  .about-wrap {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }
  .code-block {
    padding: 1.75rem;
  }
  .contact-inner {
    padding: 6rem 3rem;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  .form-field input,
  .form-field textarea,
  .form-field select {
    font-size: 0.9rem;
  }
  .contact-links {
    margin-top: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 3.5rem;
  }
  .service-card {
    padding: 2.25rem 2rem;
  }
}

/* Custom Multi-Page Helpers */
.nav-links a.active {
  color: var(--accent-hi);
  font-weight: 600;
}

.case-study-hero {
  padding-top: 8rem;
  padding-bottom: 4rem;
}

.case-study-hero .hero-inner {
  align-items: center;
}

.case-study-hero .hero-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.case-study-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  width: 100%;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.meta-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
}

.meta-value {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 600;
}

.case-study-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .case-study-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.cs-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.cs-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cs-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.cs-sidebar-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.cta-banner {
  background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1), transparent), var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.cta-banner h2 {
  font-size: 1.75rem;
  font-weight: 800;
}
