@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap");

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design Tokens ── */
:root {
  --bg: #0b0d14;
  --bg2: #10131f;
  --bg3: #161928;
  --surface: #1c2035;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #4f6ef7;
  --accent2: #38c9a0;
  --accent-o: #f7a27c;
  --text: #e8eaf2;
  --muted: #7a8099;
  --white: #ffffff;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --max: 1140px;
  --ease: 0.25s ease;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Prevent overflow from flex/grid children */
* {
  min-width: 0;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

p {
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout ── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
}

section {
  position: relative;
  z-index: 1;
}

.section {
  padding: 100px 0;
}

.section--dark {
  background: var(--bg);
}

.section--alt {
  background: var(--bg3);
}

/* ── Section Labels ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.section-label--center {
  justify-content: center;
}

.section-label--center::before {
  display: none;
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--ease);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 0 32px rgba(79, 110, 247, 0.35);
}

.btn-primary:hover {
  background: #6380f8;
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(79, 110, 247, 0.5);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(11, 13, 20, 0.8);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  min-width: 0;
  flex-shrink: 1;
  max-width: 70%;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-logo span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--ease);
  border: none;
}

.nav-links a:hover {
  color: var(--white);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--white) !important;
  padding: 0.55rem 1.4rem !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  transition: opacity var(--ease), transform var(--ease) !important;
}

.nav-cta:hover {
  opacity: 0.88 !important;
  transform: translateY(-1px) !important;
  color: var(--white) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white);
  font-size: 1.3rem;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px 2rem 70px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(79, 110, 247, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(56, 201, 160, 0.10) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  box-sizing: border-box;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79, 110, 247, 0.12);
  border: 1px solid rgba(79, 110, 247, 0.3);
  color: #8fa8ff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-badge i {
  font-size: 0.65rem;
}

.hero-title {
  margin-bottom: 1.25rem;
}

.hero-title .line {
  display: block;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 2.5rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Hero code card */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.9;
  position: relative;
  overflow: hidden;
}

.hero-code-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.code-filename {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.code-kw  { color: #7c9cf7; }
.code-fn  { color: #38c9a0; }
.code-str { color: #f7a27c; }
.code-cm  { color: #4a5070; }

.hero-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.hero-stat-num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.hero-stat-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ============================================================
   SERVICES
   ============================================================ */
#services {
  background: var(--bg2);
}

.services-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 4rem;
}

.services-header h2 {
  margin-bottom: 0.75rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  width: 100%;
  box-sizing: border-box;
}

.service-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  transition: border-color var(--ease), transform var(--ease);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity var(--ease);
}

.service-card--teal::after {
  background: linear-gradient(90deg, var(--accent2), #5ce0c0);
}

.service-card--orange::after {
  background: linear-gradient(90deg, var(--accent-o), #f9c07e);
}

.service-card--purple::after {
  background: linear-gradient(90deg, #a78bfa, #c4b5fd);
}

.service-card:hover {
  border-color: rgba(79, 110, 247, 0.35);
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.service-card:hover::after {
  opacity: 1;
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(79, 110, 247, 0.12);
  border: 1px solid rgba(79, 110, 247, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.service-icon--teal {
  background: rgba(56, 201, 160, 0.1);
  border-color: rgba(56, 201, 160, 0.2);
  color: var(--accent2);
}

.service-icon--orange {
  background: rgba(247, 162, 124, 0.1);
  border-color: rgba(247, 162, 124, 0.2);
  color: var(--accent-o);
}

.service-icon--purple {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: #a78bfa;
}

.service-card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
}

.service-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  flex: 1;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: gap var(--ease);
  border: none;
}

.service-link:hover {
  gap: 0.7rem;
  color: var(--accent);
}

/* ============================================================
   WHY CARICODE
   ============================================================ */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.why-text h2 {
  margin-bottom: 0.5rem;
}

.why-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2.5rem;
}

.why-item {
  display: flex;
  gap: 1rem;
  min-width: 0;
  word-break: break-word;
}

.why-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(79, 110, 247, 0.1);
  border: 1px solid rgba(79, 110, 247, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.15rem;
}

.why-item h4 {
  margin-bottom: 0.3rem;
}

.why-item p {
  font-size: 0.88rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.why-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.why-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
}

.why-stat-card--accent {
  background: rgba(79, 110, 247, 0.08);
  border-color: rgba(79, 110, 247, 0.25);
}

.why-stat-card--teal {
  background: rgba(56, 201, 160, 0.08);
  border-color: rgba(56, 201, 160, 0.25);
}

.why-stat-num {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
}

.why-stat-num--teal {
  color: var(--accent2);
}

.stat-arrow {
  font-size: 1.2rem;
  color: var(--accent);
}

.why-stat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* ============================================================
   EXPERTISE
   ============================================================ */
.expertise-header {
  max-width: 540px;
  margin-bottom: 3rem;
}

.expertise-header h2 {
  margin-bottom: 0.75rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  font-size: 0.83rem;
  color: var(--text);
  transition: all var(--ease);
  cursor: default;
  box-sizing: border-box;
  max-width: 100%;
}

.tag:hover {
  border-color: rgba(79, 110, 247, 0.4);
  color: var(--white);
  background: rgba(79, 110, 247, 0.08);
}

.tag i {
  font-size: 0.7rem;
  color: var(--accent);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrapper {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.contact-wrapper h2 {
  margin-bottom: 0.75rem;
}

.contact-intro {
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.contact-form {
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(122, 128, 153, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(79, 110, 247, 0.6);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--white);
  transition: all var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.form-submit:hover {
  background: #6380f8;
  transform: translateY(-1px);
}

.contact-meta {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contact-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-meta-item i {
  color: var(--accent);
}

.contact-meta-item a {
  color: var(--muted);
  transition: color var(--ease);
  border: none;
}

.contact-meta-item a:hover {
  color: var(--white);
}

/* ============================================================
   SUCCESS POPUP
   ============================================================ */
.success-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}

.success-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.success-card {
  background: #0f1320;
  padding: 40px;
  border-radius: 14px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

.success-icon {
  color: #22c55e;
  font-size: 26px;
  margin-bottom: 10px;
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 980px)
   ============================================================ */
@media screen and (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-visual {
    display: none;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* ============================================================
   RESPONSIVE — Tablet narrow (≤ 1100px)
   ============================================================ */
@media screen and (max-width: 1100px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — Mobile large (≤ 768px)
   ============================================================ */
@media screen and (max-width: 768px) {
  .section {
    padding: 70px 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem 1.5rem;
    align-items: flex-start;
  }

  .nav-links.open li {
    width: 100%;
  }

  .nav-links.open a {
    display: block;
    padding: 0.6rem 0;
    font-size: 1rem;
  }

  .nav-toggle {
    display: block;
  }
}

@media screen and (max-width: 768px) {
  .why-visual {
    grid-template-columns: 1fr;
  }
}

.why-stat-num {
  word-break: break-word;
}

.why-stat-lbl {
  word-break: break-word;
}

/* ============================================================
   RESPONSIVE — Mobile small (≤ 540px)
   ============================================================ */
@media screen and (max-width: 540px) {
  body {
    font-size: 15px;
  }

  #navbar {
    padding: 0 1.2rem;
  }

  .nav-logo span {
    font-size: 1rem;
  }

  #hero {
    padding: 95px 1.5rem 60px;
  }

  .hero-title {
    font-size: 2.4rem;
    line-height: 1.1;
  }

  .hero-sub {
    font-size: 0.95rem;
    max-width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.8rem;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.9rem;
    justify-content: center;
  }

  .service-card {
    padding: 1.6rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-meta {
    flex-direction: column;
    align-items: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================================
   RESPONSIVE — Very small (≤ 360px)
   ============================================================ */
@media screen and (max-width: 540px) {
  .container {
    padding: 0 1.2rem;
  }
}

  .why-visual {
    grid-template-columns: 1fr;
  }

  .why-stat-num {
    font-size: 1.6rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}