/* ============================================================
   CGP DATA LAB — styles.css
   Paleta derivada del logo: navy oscuro + verde-teal + cyan
   Tipografía: Space Grotesk (display) + JetBrains Mono (código)
   ============================================================ */

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:      #171D2E;
  --bg-surface:   #1E2640;
  --bg-card:      #242C42;
  --bg-card-hover:#2A3352;
  --border:       rgba(255,255,255,0.07);
  --border-accent:rgba(0,201,167,0.3);

  --teal:         #00C9A7;
  --cyan:         #00E5FF;
  --teal-dim:     rgba(0,201,167,0.12);
  --cyan-dim:     rgba(0,229,255,0.10);
  --green-grad:   linear-gradient(135deg, #00C9A7, #00E5FF);

  --text-primary: #EEF2FF;
  --text-secondary:#9BA8C5;
  --text-dim:     #5E6A88;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-full:  9999px;

  --shadow-card:  0 4px 24px rgba(0,0,0,0.35);
  --shadow-glow:  0 0 40px rgba(0,201,167,0.15);
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

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

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 3px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar--scrolled {
  background: rgba(23, 29, 46, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--teal);
}

.nav-logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo-text .accent { color: var(--teal); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link--active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-base);
  background: var(--green-grad);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  transition: opacity var(--transition), box-shadow var(--transition);
}

.nav-cta:hover {
  opacity: 0.88;
  box-shadow: 0 0 20px rgba(0,201,167,0.4);
}

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

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--open span:nth-child(2) { opacity: 0; }
.nav-toggle--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 24px 40px;
  overflow: hidden;
}

/* Blueprint grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,201,167,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,201,167,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Glow orbs */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-glow--1 {
  width: 500px; height: 500px;
  background: rgba(0,201,167,0.12);
  top: -100px; right: -100px;
}

.hero-glow--2 {
  width: 350px; height: 350px;
  background: rgba(0,229,255,0.08);
  bottom: 0; left: -80px;
}

.hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--border-accent);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

.badge-dot {
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,201,167,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(0,201,167,0); }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero-title-accent {
  background: var(--green-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.75;
}

.hero-desc strong { color: var(--text-primary); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--green-grad);
  color: var(--bg-base);
  box-shadow: 0 4px 20px rgba(0,201,167,0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,201,167,0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
}

/* ── Terminal ── */
.terminal {
  background: #0D1117;
  border: 1px solid rgba(0,201,167,0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  font-family: var(--font-mono);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #161B22;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}

.terminal-dot--red    { background: #FF5F57; }
.terminal-dot--yellow { background: #FFBD2E; }
.terminal-dot--green  { background: #28CA41; }

.terminal-title {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: 8px;
}

.terminal-body {
  padding: 20px;
  min-height: 180px;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.t-prompt {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.95rem;
}

.t-cmd {
  color: var(--cyan);
  font-size: 0.9rem;
}

.t-cursor {
  color: var(--teal);
  animation: blink 1s step-end infinite;
  font-size: 0.9rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.terminal-out-line {
  font-size: 0.82rem;
  color: #3FB950;
  padding: 2px 0;
  opacity: 0;
  animation: fadeInLine 0.3s ease forwards;
}

@keyframes fadeInLine {
  to { opacity: 1; }
}

/* ── Hero stats ── */
.hero-stats {
  position: relative;
  max-width: 1200px;
  margin: 60px auto 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--green-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

/* ============================================================
   SHARED SECTION STYLES
   ============================================================ */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.75;
}

/* ============================================================
   STACK SECTION
   ============================================================ */
.stack-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stack-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green-grad);
  opacity: 0;
  transition: opacity var(--transition);
}

.stack-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.stack-card:hover::before { opacity: 0.04; }

.stack-card--featured {
  grid-column: span 1;
}

/* First 4 featured cards span more in a featured row */
.stack-grid > .stack-card--featured:nth-child(1),
.stack-grid > .stack-card--featured:nth-child(2),
.stack-grid > .stack-card--featured:nth-child(3),
.stack-grid > .stack-card--featured:nth-child(4) {
  grid-column: span 1;
}

.stack-icon-wrap {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.stack-icon-wrap--sm {
  width: 44px; height: 44px;
  margin-bottom: 12px;
}

.stack-icon {
  width: 36px; height: 36px;
  object-fit: contain;
}

.stack-icon--invert { filter: invert(1) brightness(0.9); }

.stack-icon-fa {
  font-size: 1.8rem;
  line-height: 1;
}

.stack-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.stack-role {
  font-size: 0.75rem;
  color: var(--teal);
  font-family: var(--font-mono);
  font-weight: 500;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stack-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.stack-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.stack-bar-fill {
  height: 100%;
  background: var(--green-grad);
  border-radius: 2px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* Bottom row: 4 cards at span 1 each */
.stack-grid > .stack-card:nth-child(5),
.stack-grid > .stack-card:nth-child(6),
.stack-grid > .stack-card:nth-child(7),
.stack-grid > .stack-card:nth-child(8) {
  grid-column: span 1;
}

/* ============================================================
   SERVICES SECTION
   ============================================================ */
.services-section { background: var(--bg-base); }

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

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 0 30px rgba(0,201,167,0.08);
}

.service-card--accent {
  background: linear-gradient(135deg, rgba(0,201,167,0.1), rgba(0,229,255,0.05));
  border-color: rgba(0,201,167,0.25);
}

.service-icon-wrap {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--teal);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.service-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.service-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin-top: auto;
}

.service-tags li {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--border-accent);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.contact-card--wa:hover  { border-color: rgba(37,211,102,0.4); }
.contact-card--mail:hover{ border-color: var(--border-accent); }

.contact-icon-wrap {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.6rem;
}

.contact-card--wa .contact-icon-wrap {
  background: rgba(37,211,102,0.12);
  color: #25D366;
}

.contact-card--mail .contact-icon-wrap {
  background: var(--teal-dim);
  color: var(--teal);
}

.contact-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition);
}

.contact-value:hover { color: var(--teal); }

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: auto;
  transition: gap var(--transition);
}

.contact-btn:hover { gap: 12px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--teal);
}

.footer-name {
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-align: left;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

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

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

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack-grid > .stack-card--featured,
  .stack-grid > .stack-card {
    grid-column: span 1;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: rgba(23,29,46,0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-link, .nav-cta {
    width: 100%;
    border-radius: var(--radius-md);
  }

  .nav-cta { margin-top: 8px; text-align: center; }

  .hero {
    padding: 88px 16px 32px;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-stats {
    gap: 0;
    padding: 16px;
  }

  .stat-item { padding: 8px; }
  .stat-num  { font-size: 1.1rem; }

  .section-container { padding: 72px 16px; }

  .stack-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

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

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .stack-grid { grid-template-columns: 1fr; }

  .hero-stats {
    flex-direction: column;
    gap: 12px;
  }

  .stat-divider { width: 60px; height: 1px; }

  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
