/* =============================================
   Noemi Díez — Portfolio
   Paleta: blanco roto · tinta casi negra · acento turquesa · terracota cálido
   Tipografía: DM Serif Display (display) · Inter (cuerpo) · JetBrains Mono (código)
   ============================================= */

:root {
  --tinta:       #0F1117;
  --tinta-suave: #2D3142;
  --gris-medio:  #6B7280;
  --gris-claro:  #F3F4F6;
  --blanco:      #FFFFFF;
  --acento:        #5DC1B9;
  --acento-suave:  #E3F5F2;
  --acento-oscuro: #14524B;
  --acento-claro:  #6FE0D1;
  --terracota:       #E8B4A8;
  --terracota-oscura:#8B4636;
  --amarillo:    #F59E0B;
  --fondo-dark:  #0F1117;
  --borde:       #E5E7EB;

  --mono: 'JetBrains Mono', monospace;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;

  --radio: 10px;
  --sombra: 0 4px 24px rgba(15,17,23,0.08);
  --ancho: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--tinta);
  background: var(--blanco);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

/* ── Navegación ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.1rem 1.5rem;
  transition: background 0.25s, box-shadow 0.25s;
}
.nav-scroll {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--borde);
}
.nav-inner {
  max-width: var(--ancho);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--acento-oscuro);
  letter-spacing: 0px;
  background: var(--acento-suave);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: default;
  display: inline-block;
  transition: opacity 0.15s, transform 0.15s;
}
a.nav-logo {
  cursor: pointer;
}
a.nav-logo:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}
.nav-links {
  display: flex;
  gap: 0.2rem;
}
.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gris-medio);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
  color: var(--tinta);
  background: var(--gris-claro);
  box-shadow: 0 2px 0 var(--terracota);
}

/* ── Hero ── */
.hero-seccion {
  position: relative;
  overflow: hidden;
}
.hero-red,
.hero .header-red {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.15) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.15) 75%, transparent 100%);
}
.hero {
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 7rem 1.5rem 5rem;
}
.hero-contenedor,
.hero-codigo {
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gris-medio);
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}
.dot-vivo {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--acento);
  animation: pulso 2s infinite;
  flex-shrink: 0;
}
@keyframes pulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}
.hero-logo {
  width: 100%;
  max-width: 460px;
  height: auto;
  margin-bottom: 1.2rem;
  display: block;
}
.hero-titulo {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 6vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 0.8rem;
  color: var(--tinta);
}
.hero-titulo em {
  font-style: italic;
  color: var(--acento);
}
.hero-rol {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gris-medio);
  margin-bottom: 1.4rem;
  letter-spacing: 0.3px;
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--acento-suave);
  color: var(--acento-oscuro);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--tinta-suave);
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.75;
}
.hero-acciones {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.btn-primario {
  display: inline-block;
  background: var(--acento);
  color: var(--acento-oscuro);
  padding: 0.72rem 1.6rem;
  border-radius: var(--radio);
  font-size: 0.92rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primario:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secundario {
  display: inline-block;
  background: var(--gris-claro);
  color: var(--tinta);
  padding: 0.72rem 1.6rem;
  border-radius: var(--radio);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-secundario:hover { background: #e5e7eb; }

/* Bloque de código decorativo */
.hero-codigo {
  background: var(--tinta);
  border-radius: 14px;
  padding: 2rem 2.2rem;
  box-shadow: 0 20px 60px rgba(15,17,23,0.18);
  position: relative;
  overflow: hidden;
}
.hero-codigo::before {
  content: '● ● ●';
  display: block;
  color: #444;
  font-size: 0.75rem;
  letter-spacing: 4px;
  margin-bottom: 1.2rem;
}
.hero-codigo pre {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.8;
  white-space: pre-wrap;
}
.hero-codigo code { color: #cdd6f4; }
.c-com  { color: #6272a4; }
.c-kw   { color: #cba6f7; }
.c-str  { color: #a6e3a1; }

/* ── Estado activo de navegación ── */
.nav-activo {
  color: var(--tinta) !important;
  background: var(--gris-claro);
  box-shadow: 0 2px 0 var(--terracota-oscura);
}

/* ── Cabecera de subpágina (ej. Eventos) ── */
.pagina-header {
  position: relative;
  overflow: hidden;
  padding: 9rem 1.5rem 4rem;
}
.header-red {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 20% 0%, rgba(0,0,0,0.9), transparent 75%);
  mask-image: radial-gradient(ellipse 70% 100% at 20% 0%, rgba(0,0,0,0.9), transparent 75%);
}
.pagina-header .contenedor { position: relative; z-index: 1; }
.pagina-header-titulo {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--tinta);
  margin-bottom: 1rem;
  line-height: 1.1;
}
.pagina-header-desc {
  font-size: 1.02rem;
  color: var(--tinta-suave);
  max-width: 560px;
  line-height: 1.75;
}

/* ── Eventos ── */
.eventos-lista {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.evento-post {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  background: var(--blanco);
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  padding: 1.4rem;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s;
}
.evento-post:hover {
  box-shadow: var(--sombra);
  transform: translateY(-2px);
  border-color: var(--acento);
}
/* Alterna la imagen a la derecha en los eventos pares */
.evento-post:nth-child(even) {
  flex-direction: row-reverse;
}
.evento-img {
  flex: 0 0 40%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--acento-suave);
}
.evento-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Fotos verticales: más altura para que no se recorten */
.evento-img--vertical {
  aspect-ratio: 3 / 4;
}
.evento-img--vertical img {
  object-fit: contain;
}
.evento-cuerpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.evento-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.evento-titulo {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--tinta);
  line-height: 1.25;
}
.evento-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--gris-medio);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.evento-desc {
  font-size: 0.93rem;
  color: var(--tinta-suave);
  line-height: 1.65;
}
.evento-enlace {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--acento-oscuro);
  margin-top: 0.2rem;
  transition: opacity 0.15s;
}
.evento-enlace:hover { opacity: 0.7; }

@media (max-width: 640px) {
  .evento-post,
  .evento-post:nth-child(even) {
    flex-direction: column;
    align-items: stretch;
  }
  .evento-img {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  .evento-img--vertical {
    aspect-ratio: 3 / 4;
  }
}

/* ── Secciones genéricas ── */
.seccion { padding: 96px 0; }
.seccion-oscura {
  background: var(--fondo-dark);
  padding: 96px 0;
}
.contenedor {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.contenedor-angosto {
  max-width: 680px;
}
.contenedor-media {
  max-width: var(--ancho);
}
.seccion-cabecera { margin-bottom: 3rem; }
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--acento-oscuro);
  margin-bottom: 0.5rem;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.15;
  color: var(--tinta);
}

/* ── Apartados de la página de proyectos ── */
.apartado {
  margin-bottom: 4.5rem;
}
.apartado:last-child {
  margin-bottom: 0;
}
.apartado-cabecera {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--borde);
}
.apartado-titulo {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--tinta);
}
.apartado-cabecera .eyebrow {
  margin-bottom: 0;
}
.apartado-nota {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--gris-medio);
  margin-top: 1.4rem;
}

/* ── Grid de proyectos ── */
.proyectos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.proyecto {
  background: var(--blanco);
  border: 1.5px solid var(--borde);
  border-radius: 14px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: box-shadow 0.2s, transform 0.15s;
}
.proyecto:hover {
  box-shadow: var(--sombra);
  transform: translateY(-3px);
}
.proyecto-destacado {
  border: 1.5px solid var(--tinta);
  background: var(--blanco);
  box-shadow: 6px 6px 0 var(--terracota);
  transition: box-shadow 0.15s, transform 0.15s;
}
.proyecto-destacado:hover {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--terracota);
}
.proyecto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.proyecto-icono { font-size: 1.8rem; }
.proyecto-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-turquesa{ background: var(--acento-suave); color: var(--acento-oscuro); }
.badge-amarillo{ background: #fef3c7; color: #92400e; }
.badge-gris    { background: var(--gris-claro); color: var(--gris-medio); }
.badge-verde   { background: #d1fae5; color: #065f46; }
.badge-azul    { background: #dbeafe; color: #1e40af; }

.proyecto-titulo {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--tinta);
  line-height: 1.2;
}
.proyecto-fecha {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--gris-medio);
  margin-top: -0.3rem;
}
.proyecto-desc {
  font-size: 0.92rem;
  color: var(--tinta-suave);
  line-height: 1.65;
  flex: 1;
}
.proyecto-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--acento-suave);
  color: var(--acento-oscuro);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}
.proyecto-footer { margin-top: 0.4rem; }
.proyecto-enlace {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--acento-oscuro);
  transition: opacity 0.15s;
}
.proyecto-enlace:hover { opacity: 0.7; }
.proyecto-enlace-inactivo {
  font-size: 0.82rem;
  color: var(--gris-medio);
  font-family: var(--mono);
}

/* ── Stack ── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.stack-titulo {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--acento-claro);
  margin-bottom: 1rem;
}
.stack-lista li {
  font-size: 0.93rem;
  color: #a0aec0;
  padding: 0.35rem 0;
  border-bottom: 1px solid #1a2233;
}
.stack-lista li:last-child { border-bottom: none; }

/* ── Contacto ── */
.contacto-intro {
  font-size: 1.05rem;
  color: var(--tinta-suave);
  margin-bottom: 2.5rem;
  line-height: 1.75;
}
.contacto-opciones {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contacto-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.1rem 1.4rem;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contacto-item:hover {
  border-color: var(--acento);
  box-shadow: 0 0 0 3px var(--acento-suave);
}
.contacto-icono { font-size: 1.4rem; flex-shrink: 0; }
.contacto-item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tinta);
}
.contacto-item span {
  font-size: 0.85rem;
  color: var(--gris-medio);
  font-family: var(--mono);
}

/* ── WhatsApp flotante ── */
.whatsapp-flotante {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,0.4);
  z-index: 200;
  transition: transform 0.2s, box-shadow 0.2s;
}
.whatsapp-flotante:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(37,211,102,0.5);
}
.whatsapp-flotante svg {
  width: 29px;
  height: 29px;
  fill: white;
}
@media (max-width: 520px) {
  .whatsapp-flotante {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
  .whatsapp-flotante svg { width: 26px; height: 26px; }
}

/* ── Pie ── */
.pie {
  border-top: 1px solid var(--borde);
  padding: 1.8rem 0;
}
.pie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 6rem;
  }
  .hero-codigo { display: none; }
  .hero-logo { max-width: 340px; }
  .proyectos-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 520px) {
  .stack-grid { grid-template-columns: 1fr; }
  .pie-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
  .nav-links a { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
}

/* ── Red de conexiones animada (hero + cabeceras) ── */
.red-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.red-svg .malla {
  stroke: var(--acento);
  stroke-width: 1;
  opacity: 0.18;
  fill: none;
}
.red-svg .nodo {
  fill: var(--acento);
  opacity: 0.25;
  filter: url(#red-glow);
  animation: nd-pulso 3.6s ease-in-out infinite;
}
.red-svg .veta {
  stroke: var(--terracota);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 5 170;
  opacity: 0.85;
  fill: none;
  filter: url(#red-glow);
  animation: nd-viaja var(--dur, 4.5s) linear infinite;
}
.red-svg .nodo-hub {
  fill: none;
  stroke: var(--acento);
  stroke-width: 1;
  opacity: 0.5;
  filter: url(#red-glow);
  animation: nd-anillo 3.4s ease-out infinite;
}
.red-svg .nodo.d0 { animation-delay: 0s; }
.red-svg .nodo.d1 { animation-delay: .5s; }
.red-svg .nodo.d2 { animation-delay: 1s; }
.red-svg .nodo.d3 { animation-delay: 1.5s; }
.red-svg .nodo.d4 { animation-delay: 2s; }
.red-svg .nodo.d5 { animation-delay: 2.5s; }
.red-svg .veta.d0 { animation-delay: 0s; }
.red-svg .veta.d2 { animation-delay: .8s; }
.red-svg .veta.d4 { animation-delay: 1.6s; }

@keyframes nd-pulso {
  0%, 100% { opacity: .18; }
  50% { opacity: .85; }
}
@keyframes nd-viaja {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -600; }
}
@keyframes nd-anillo {
  0%   { r: 6; opacity: .55; }
  100% { r: 15; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .red-svg .nodo,
  .red-svg .veta,
  .red-svg .nodo-hub {
    animation: none;
  }
}
