/* ===== Variables ===== */
:root {
  --bg: #07090f;
  --bg-soft: #0d1018;
  --card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e7ecf5;
  --muted: #94a0b8;
  --accent: #38e8c4;
  --accent-2: #6c8cff;
  --accent-3: #b06cff;
  --radius: 16px;
  --max: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .brand-text { font-family: 'Space Grotesk', sans-serif; }

/* ===== Fondo: partículas + grid ===== */
#particles {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(108, 140, 255, 0.18), transparent 60%),
    radial-gradient(700px 500px at 0% 20%, rgba(56, 232, 196, 0.12), transparent 60%),
    var(--bg);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* ===== Navbar ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 9, 15, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark {
  font-family: 'Space Grotesk', monospace;
  color: var(--accent);
  background: rgba(56, 232, 196, 0.1);
  border: 1px solid rgba(56, 232, 196, 0.3);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.brand .accent { color: var(--accent); }

.nav-links { display: flex; gap: 10px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  position: relative;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.nav-links a .tag {
  color: var(--accent-2);
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  border-color: rgba(56, 232, 196, 0.35);
  background: rgba(56, 232, 196, 0.06);
  box-shadow: 0 0 18px rgba(56, 232, 196, 0.18);
}
.nav-links a:hover .tag { opacity: 1; color: var(--accent); }
/* Cursor parpadeante tipo terminal al hacer hover */
.nav-links a::after {
  content: '_';
  color: var(--accent);
  margin-left: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.nav-links a:hover::after { opacity: 1; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ===== Layout helper ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(70px, 12vw, 130px) clamp(20px, 5vw, 40px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px clamp(20px, 5vw, 40px) 80px;
}
.hero-inner { max-width: 820px; text-align: center; }

.hero-title {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 22px;
}
.gradient {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 38px;
}

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  color: #06121b;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 30px rgba(56, 232, 196, 0.25);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(56, 232, 196, 0.4); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--card);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); }

.hero-stats {
  display: flex;
  gap: clamp(24px, 6vw, 60px);
  justify-content: center;
  margin-top: 60px;
  flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.9rem;
  color: var(--text);
}
.hero-stats span { color: var(--muted); font-size: 0.85rem; }

/* ===== Cards / Servicios ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(56, 232, 196, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(56, 232, 196, 0.4); }
.card:hover::before { opacity: 1; }
.card-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  display: inline-flex;
  width: 52px; height: 52px;
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.95rem; }

/* ===== Acerca de ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}
.about-text h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 18px; }
.about-text p { color: var(--muted); margin-bottom: 16px; }
.about-text strong { color: var(--text); }
.about-list { list-style: none; margin-top: 22px; }
.about-list li {
  padding: 10px 0 10px 30px;
  position: relative;
  color: var(--text);
}
.about-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Code window */
.code-window {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}
.code-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.code-bar span { width: 12px; height: 12px; border-radius: 50%; background: #3a3f4b; }
.code-bar span:nth-child(1) { background: #ff5f57; }
.code-bar span:nth-child(2) { background: #febc2e; }
.code-bar span:nth-child(3) { background: #28c840; }
.code-window pre {
  padding: 24px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.92rem;
  line-height: 1.9;
  overflow-x: auto;
}
.c-key { color: var(--accent-3); }
.c-var { color: var(--accent-2); }
.c-prop { color: var(--accent); }
.c-str { color: #ffd479; }
.c-num { color: #ff8b8b; }

/* ===== Contacto ===== */
.contact-lead { color: var(--muted); margin-top: 8px; }
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  max-width: 720px;
  margin: 0 auto;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 28px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s, border-color 0.25s;
}
.contact-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.contact-card .card-icon { margin: 0 auto 16px; }
.contact-card h3 { margin-bottom: 8px; }
.contact-card p { color: var(--accent); font-weight: 500; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

/* ===== Botones scroll ===== */
.scroll-btns {
  position: fixed;
  right: 22px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 40;
}
.scroll-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(13, 16, 24, 0.8);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.scroll-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: rgba(56, 232, 196, 0.12);
}

/* ===== Responsivo ===== */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 64px; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(7, 9, 15, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 0 0 0 16px;
    padding: 10px 0;
    width: 200px;
    transform: translateX(110%);
    transition: transform 0.3s;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { padding: 14px 24px; }
  .nav-links a::after { display: none; }
}
