/* =========================================================
   CodeVault — Modern Dark Tech Theme
   ========================================================= */

:root {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a2e;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --accent-1: #8b5cf6;
  --accent-2: #6366f1;
  --accent-3: #06b6d4;
  --gradient: linear-gradient(135deg, #8b5cf6, #6366f1, #06b6d4);
  --gradient-text: linear-gradient(135deg, #a78bfa, #818cf8, #22d3ee);

  --whatsapp: #25d366;
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ====== Gradient text ====== */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent-2);
  background: rgba(99, 102, 241, 0.1);
}

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ====== Navbar ====== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: all var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.3rem;
}

.logo-icon {
  font-family: var(--font-mono);
  color: var(--accent-2);
  font-size: 1.1rem;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.btn-nav { display: none; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ====== Hero ====== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(6, 182, 212, 0.1), transparent);
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-2);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 550px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-2), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ====== Sections ====== */
section { padding: 6rem 0; }

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-2);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ====== Services ====== */
.services { background: var(--bg-2); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-4px);
}

.service-card:hover::before { opacity: 1; }

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  color: var(--accent-2);
}

.service-icon svg { width: 24px; height: 24px; }

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.service-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

/* ====== About ====== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-content .section-title { text-align: left; }
.about-content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

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

.about-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.feature-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  color: var(--accent-2);
}

.feature-icon svg { width: 20px; height: 20px; }

.about-feature strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
}

.about-feature span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Code window */
.code-window {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc28; }
.dot.green { background: #28c840; }

.code-title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.code-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-muted);
}

.code-body .kw { color: #c084fc; }
.code-body .var { color: #e4e4e7; }
.code-body .key { color: #67e8f9; }
.code-body .str { color: #86efac; }
.code-body .fn { color: #fbbf24; }

/* ====== Process ====== */
.process { background: var(--bg-2); }

.process-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 250px;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.step p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-connector {
  display: flex;
  align-items: center;
  padding-top: 1.8rem;
}

.step-connector span {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
  opacity: 0.3;
}

/* ====== Contact ====== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info .section-title { text-align: left; }
.contact-info p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

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

.contact-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.contact-method:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateX(4px);
}

.contact-method-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.contact-method-icon svg { width: 22px; height: 22px; }

.contact-method-icon.whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: var(--whatsapp);
}

.contact-method-icon.email {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-2);
}

.contact-method strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.contact-method span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Form */
.contact-form-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

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

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-group select option {
  background: var(--bg-2);
  color: var(--text);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
}

.form-success.show { display: block; }

.form-success svg {
  width: 48px;
  height: 48px;
  color: var(--accent-3);
  margin: 0 auto 1rem;
}

.form-success h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.form-success p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ====== Footer ====== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}

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

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 280px;
}

.footer-links h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 1rem;
}

.footer-links li { margin-bottom: 0.6rem; }

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ====== WhatsApp FAB ====== */
.whatsapp-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--whatsapp);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all var(--transition);
}

.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.fab-tooltip {
  position: absolute;
  right: 68px;
  background: var(--bg-3);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.whatsapp-fab:hover .fab-tooltip { opacity: 1; }

/* ====== Scroll reveal ====== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .btn-nav { display: none; }

  .menu-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 999;
  }

  .nav-links.open a {
    font-size: 1.5rem;
    color: var(--text);
  }

  .hero { min-height: auto; padding: 7rem 0 4rem; }
  .hero-title { font-size: 2.2rem; }
  .hero-stats { gap: 2rem; }
  .stat-number { font-size: 1.4rem; }
  .hero-scroll { display: none; }

  section { padding: 4rem 0; }
  .section-title { font-size: 1.8rem; }

  .services-grid { grid-template-columns: 1fr; }

  .process-steps {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .step-connector {
    transform: rotate(90deg);
    padding-top: 0;
  }

  .step-connector span { width: 30px; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

  .contact-form-wrapper { padding: 1.5rem; }

  .whatsapp-fab { bottom: 1.5rem; right: 1.5rem; width: 50px; height: 50px; }
  .whatsapp-fab svg { width: 24px; height: 24px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { flex-direction: column; gap: 1rem; }
}

/* ====== Reduced motion ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
