/* Estilos de faxtal.dev — negro, blanco y verde oscuro, con el efecto de líneas del emblema */

:root {
  --negro: #0b0f0e;
  --negro-suave: #121816;
  --blanco: #f4f6f5;
  --gris: #a7b2ad;
  --gris-oscuro: #5d6964;
  --verde: #0f3d2e;
  --verde-medio: #165a43;
  --verde-claro: #2fa774;
  --borde: rgba(244, 246, 245, 0.12);
  --radio: 14px;
  --ancho: 1120px;
  --titulos: "Montserrat", system-ui, sans-serif;
  --texto: "Inter", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--negro);
  color: var(--blanco);
  font-family: var(--texto);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--verde-claro); outline-offset: 3px; border-radius: 6px; }

.contenedor { width: min(var(--ancho), 100% - 32px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--titulos); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }

/* ---------- Navegación ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 14, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--borde);
}

.nav .contenedor { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--titulos); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.02em; }
.marca img { width: 34px; height: 34px; }

.nav ul { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; font-size: 0.92rem; font-weight: 500; color: var(--gris); transition: color 0.2s; }
.nav ul a:hover { color: var(--blanco); }

.menu-boton { display: none; background: none; border: 1px solid var(--borde); color: var(--blanco); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.menu-boton span { display: block; width: 18px; height: 2px; background: currentColor; margin: 4px auto; border-radius: 2px; }

/* ---------- Botones ---------- */

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

.boton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.boton:hover { transform: translateY(-2px); }
.boton-principal { background: var(--verde-claro); color: var(--negro); }
.boton-principal:hover { background: #3cc088; }
.boton-secundario { border-color: var(--borde); color: var(--blanco); }
.boton-secundario:hover { border-color: var(--verde-claro); }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 96px 0 110px; overflow: hidden; }

.hero .contenedor { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }

.saludo { color: var(--verde-claro); font-weight: 600; font-size: 1rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.saludo::before { content: ""; width: 34px; height: 2px; background: currentColor; }

.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--verde-claro); }

.etiqueta { display: inline-block; margin: 18px 0 20px; padding: 6px 12px; background: var(--verde); border: 1px solid var(--verde-medio); border-radius: 8px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.hero p.bajada { color: var(--gris); max-width: 52ch; margin: 0 0 30px; }

.emblema { position: relative; justify-self: center; width: min(400px, 100%); aspect-ratio: 1; }
.emblema::before { content: ""; position: absolute; inset: -18px; border: 1px solid var(--borde); border-radius: 50%; }
.emblema svg { width: 100%; height: 100%; filter: drop-shadow(0 30px 60px rgba(47, 167, 116, 0.18)); }
.emblema .giro { transform-origin: center; animation: girar 60s linear infinite; }

/* Líneas de fondo del hero */
.lineas-fondo { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }
.lineas-fondo path { fill: none; stroke: var(--verde); stroke-width: 2; }

/* Animación de trazo: las líneas se "dibujan" al aparecer */
.trazo path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: dibujar 1.8s ease-out forwards; }
.trazo path:nth-child(2) { animation-delay: 0.15s; }
.trazo path:nth-child(3) { animation-delay: 0.3s; }

@keyframes dibujar { to { stroke-dashoffset: 0; } }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Secciones ---------- */

.seccion { padding: 96px 0; position: relative; }
.seccion-alterna { background: var(--negro-suave); border-block: 1px solid var(--borde); }

.titulo-seccion { text-align: center; margin-bottom: 56px; }
.titulo-seccion h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 800; }
.titulo-seccion p { color: var(--gris); margin: 14px auto 0; max-width: 60ch; }

/* Separador con las tres líneas del emblema */
.separador { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.separador span { width: 28px; height: 3px; background: var(--verde-claro); border-radius: 3px; }
.separador span:nth-child(2) { opacity: 0.6; }
.separador span:nth-child(3) { opacity: 0.3; }

/* ---------- Servicios ---------- */

.grilla-servicios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }

.tarjeta {
  position: relative;
  padding: 30px 26px;
  background: var(--negro);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.tarjeta:hover { border-color: var(--verde-medio); transform: translateY(-4px); }

/* Esquina de líneas en cada tarjeta */
.tarjeta::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 100% 0, transparent 0 9px, rgba(47, 167, 116, 0.18) 9px 11px);
  opacity: 0;
  transition: opacity 0.3s;
}
.tarjeta:hover::after { opacity: 1; }

.icono { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--verde); border: 1px solid var(--verde-medio); margin-bottom: 20px; }
.icono svg { width: 26px; height: 26px; stroke: var(--blanco); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tarjeta h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.tarjeta p { color: var(--gris); margin: 0; font-size: 0.97rem; }

/* ---------- Sobre mí ---------- */

.sobre-mi { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }

.marco-lineas { position: relative; aspect-ratio: 1; max-width: 420px; border-radius: var(--radio); background: var(--verde); overflow: hidden; }
.marco-lineas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.marco-lineas path { fill: none; stroke: rgba(244, 246, 245, 0.85); stroke-width: 9; stroke-linecap: round; }
.marco-lineas .firma { position: absolute; left: 24px; bottom: 20px; font-family: var(--titulos); font-weight: 800; font-size: 1.5rem; }

.sobre-mi h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 800; }
.sobre-mi p { color: var(--gris); }

.lista-checks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.lista-checks li { display: flex; gap: 14px; align-items: flex-start; }
.lista-checks svg { flex: none; width: 24px; height: 24px; margin-top: 2px; stroke: var(--verde-claro); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Proyecto ---------- */

.proyecto { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.proyecto h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }
.proyecto p { color: var(--gris); }
.proyecto ul { padding-left: 20px; color: var(--gris); margin: 18px 0 0; }
.proyecto li { margin-bottom: 8px; }
.proyecto li::marker { color: var(--verde-claro); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips span { font-size: 0.8rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--borde); color: var(--gris); }

/* Maqueta de chat hecha con CSS (sin capturas reales) */
.telefono { justify-self: center; width: min(330px, 100%); border-radius: 34px; padding: 12px; background: #1b2320; border: 1px solid var(--borde); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.pantalla { border-radius: 24px; overflow: hidden; background: #0e1714; }
.cabecera-chat { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--verde); font-size: 0.9rem; font-weight: 600; }
.cabecera-chat img { width: 30px; height: 30px; }
.cabecera-chat small { display: block; font-weight: 400; color: var(--gris); font-size: 0.72rem; }
.mensajes { padding: 16px 12px 18px; display: grid; gap: 10px; font-size: 0.84rem; line-height: 1.45; }
.burbuja { max-width: 82%; padding: 9px 12px; border-radius: 12px; }
.burbuja.cliente { justify-self: end; background: var(--verde-medio); border-bottom-right-radius: 4px; }
.burbuja.bot { background: #1d2724; border-bottom-left-radius: 4px; }
.burbuja .opcion { display: block; margin-top: 8px; padding: 7px; text-align: center; border-top: 1px solid var(--borde); color: var(--verde-claro); font-weight: 600; }

/* ---------- Servicios (tarjetas premium) ---------- */

.servicio {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 26px;
  border-radius: 20px;
  background: linear-gradient(160deg, #141b19 0%, var(--negro) 70%);
  border: 1px solid var(--borde);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.servicio::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at 85% -10%, rgba(47, 167, 116, 0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: -1;
}
.servicio:hover { transform: translateY(-6px); border-color: rgba(47, 167, 116, 0.45); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.servicio:hover::before { opacity: 1; }

/* Brazo del emblema como marca de agua en la esquina */
.servicio-lineas { position: absolute; width: 170px; height: 170px; right: -48px; bottom: -58px; z-index: -1; fill: none; stroke: rgba(244, 246, 245, 0.06); stroke-width: 10; stroke-linecap: round; transform: rotate(-30deg); transition: stroke 0.35s ease, transform 0.6s ease; }
.servicio:hover .servicio-lineas { stroke: rgba(47, 167, 116, 0.22); transform: rotate(-20deg) scale(1.05); }

.servicio-cabecera { display: flex; align-items: center; margin-bottom: 26px; }
.servicio-cabecera .icono { margin: 0; }

.servicio h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.servicio > p { color: var(--gris); margin: 0 0 20px; font-size: 0.97rem; }

.incluye { list-style: none; padding: 18px 0 0; margin: 0 0 24px; border-top: 1px solid var(--borde); display: grid; gap: 10px; font-size: 0.9rem; }
.incluye li { display: flex; align-items: center; gap: 10px; color: var(--blanco); }
.incluye li::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--verde-claro); box-shadow: 0 4px 0 rgba(47, 167, 116, 0.45); flex: none; }

.enlace { margin-top: auto; align-self: flex-start; font-weight: 600; font-size: 0.92rem; text-decoration: none; color: var(--verde-claro); display: inline-flex; gap: 6px; }
.enlace span { transition: transform 0.25s ease; }
.enlace:hover span { transform: translateX(4px); }

/* Tarjeta destacada: verde oscuro con brillo */
.servicio.destacado { background: linear-gradient(160deg, var(--verde-medio) 0%, var(--verde) 55%, #0b2a20 100%); border-color: rgba(47, 167, 116, 0.55); box-shadow: 0 20px 60px rgba(15, 61, 46, 0.55); }
.servicio.destacado .icono { background: rgba(11, 15, 14, 0.35); border-color: rgba(244, 246, 245, 0.2); }
.servicio.destacado > p, .servicio.destacado .servicio.destacado .incluye { border-color: rgba(244, 246, 245, 0.18); }
.servicio.destacado .enlace { color: var(--blanco); }
.servicio.destacado .servicio-lineas { stroke: rgba(244, 246, 245, 0.12); }
.insignia { align-self: flex-start; margin: -10px 0 12px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--blanco); color: var(--verde); }

/* ---------- Cómo trabajo (línea de tiempo) ---------- */

.linea-tiempo { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }

/* Tres líneas paralelas que unen los pasos, como el emblema */
.linea-tiempo::before {
  content: "";
  position: absolute;
  top: 37px;
  left: 12%;
  right: 12%;
  height: 10px;
  background:
    linear-gradient(var(--verde-claro), var(--verde-claro)) top / 100% 2px no-repeat,
    linear-gradient(rgba(47, 167, 116, 0.5), rgba(47, 167, 116, 0.5)) center / 100% 2px no-repeat,
    linear-gradient(rgba(47, 167, 116, 0.22), rgba(47, 167, 116, 0.22)) bottom / 100% 2px no-repeat;
}

.hito { position: relative; text-align: center; padding: 0 6px; }

.nodo {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--negro);
  border: 2px solid var(--verde-claro);
  box-shadow: 0 0 0 8px var(--negro), 0 0 0 9px rgba(47, 167, 116, 0.35), 0 0 0 17px var(--negro), 0 0 0 18px rgba(47, 167, 116, 0.15);
  transition: background 0.35s ease, transform 0.35s ease;
}
.nodo svg { width: 30px; height: 30px; fill: none; stroke: var(--blanco); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hito:hover .nodo { background: var(--verde); transform: scale(1.06); }

.cuando { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--verde-claro); margin: 8px 0 8px; }
.hito h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.hito p { margin: 0 auto; color: var(--gris); font-size: 0.95rem; max-width: 24ch; }

/* ---------- GitHub ---------- */

.nav-github { display: inline-flex !important; align-items: center; gap: 8px; padding: 7px 14px !important; border: 1px solid var(--borde); border-radius: 999px; color: var(--blanco) !important; }
.nav-github:hover { border-color: var(--verde-claro); }
.nav-github svg, .boton-github svg { width: 18px; height: 18px; }
.boton-github { margin-top: 28px; }
.contactos svg.relleno { fill: var(--verde-claro); stroke: none; }

/* ---------- Llamado a la acción ---------- */

.cta { position: relative; overflow: hidden; background: var(--verde); padding: 84px 0; text-align: center; }
.cta h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; max-width: 22ch; margin: 0 auto 14px; }
.cta p { color: rgba(244, 246, 245, 0.8); margin: 0 auto 30px; max-width: 54ch; }
.cta .botones { justify-content: center; }
.cta .boton-principal { background: var(--blanco); }
.cta .boton-secundario { border-color: rgba(244, 246, 245, 0.4); }
.cta .lineas-fondo { opacity: 0.25; }
.cta .lineas-fondo path { stroke: var(--blanco); }
.cta .contenedor { position: relative; }

/* ---------- Pie ---------- */

.pie { padding: 56px 0 32px; border-top: 1px solid var(--borde); }
.pie .contenedor { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.pie p { color: var(--gris); margin: 12px 0 0; max-width: 40ch; }
.contactos { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; justify-self: end; }
.contactos a, .contactos span { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--blanco); }
.contactos a:hover { color: var(--verde-claro); }
.contactos svg { width: 22px; height: 22px; stroke: var(--verde-claro); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--borde); font-size: 0.85rem; color: var(--gris-oscuro); }
.legal a { color: var(--gris); }

/* ---------- Páginas legales ---------- */

.documento { padding: 64px 0 96px; }
.documento .contenedor { max-width: 780px; }
.documento h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 8px; }
.documento h2 { font-size: 1.25rem; margin: 36px 0 10px; }
.documento p, .documento li { color: var(--gris); }
.documento .fecha { color: var(--gris-oscuro); font-size: 0.9rem; }

/* ---------- Aparición al hacer scroll ---------- */

.aparecer { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.aparecer.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .contenedor, .sobre-mi, .proyecto, .pie .contenedor { grid-template-columns: 1fr; }
  .emblema { width: min(300px, 80%); order: -1; }
  .grilla-servicios { grid-template-columns: repeat(2, 1fr); }
  .linea-tiempo { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .linea-tiempo::before { display: none; }
  .marco-lineas { max-width: 100%; aspect-ratio: 16 / 10; }
  .contactos { justify-self: start; }
}

@media (max-width: 720px) {
  .menu-boton { display: block; }
  .nav ul {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--negro);
    border-bottom: 1px solid var(--borde);
    padding: 8px 16px 16px;
  }
  .nav ul.abierto { display: flex; }
  .nav ul a { display: block; padding: 12px 0; font-size: 1rem; }
  .hero { padding: 48px 0 72px; }
  .seccion { padding: 72px 0; }
  .grilla-servicios { grid-template-columns: 1fr; }
  .linea-tiempo { grid-template-columns: 1fr; row-gap: 36px; padding-left: 8px; }
  .linea-tiempo::before { display: block; top: 42px; bottom: 42px; left: 49px; right: auto; width: 10px; height: auto;
    background:
      linear-gradient(var(--verde-claro), var(--verde-claro)) left / 2px 100% no-repeat,
      linear-gradient(rgba(47, 167, 116, 0.5), rgba(47, 167, 116, 0.5)) center / 2px 100% no-repeat,
      linear-gradient(rgba(47, 167, 116, 0.22), rgba(47, 167, 116, 0.22)) right / 2px 100% no-repeat; }
  .hito { display: grid; grid-template-columns: 84px 1fr; column-gap: 28px; text-align: left; align-items: start; }
  .hito .nodo { grid-row: 1 / span 3; margin: 0; }
  .hito .cuando { margin-top: 6px; }
  .hito p { margin: 0; max-width: none; }
  .nav-github { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .trazo path { stroke-dashoffset: 0; }
  .aparecer { opacity: 1; transform: none; }
}
