/* =============================================
   ECO FIBONACCI — estilos y animaciones
   Toda la animación vive aquí. El JavaScript solo
   calcula la geometría de las espirales.
   ============================================= */

:root {
    --fondo: oklch(96% 0.015 95);
    --tarjeta: oklch(99% 0.005 95);
    --tinta: oklch(24% 0.02 150);
    --tinta-suave: oklch(36% 0.02 150);
    --tinta-tenue: oklch(42% 0.02 150);
    --verde: oklch(46% 0.1 150);
    --verde-hoja: oklch(55% 0.09 140);
    --verde-claro: oklch(70% 0.06 130);
    --verde-borde: oklch(45% 0.07 135);
    --verde-cuadro: oklch(60% 0.06 140);
    --placa: oklch(92% 0.01 95);
    --acento: oklch(62% 0.14 55);

    --ciclo: 10.4s;

    /* Tipografía */
    --fuente: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

body {
    background: var(--fondo);
    color: var(--tinta);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.fibo {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(40px, 6vw, 64px);
    padding: clamp(32px, 6vw, 64px) clamp(16px, 5vw, 32px) clamp(48px, 8vw, 80px);
}

/* ---------- Header de navegación ---------- */

.res-header {
  width: 100%;
  max-width: 1360px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-radius: 20px;
  background-image: url("/assets/img/path147.webp");
  background-size: cover;
  background-position: center;
  margin-bottom: 8px;
}

.res-logo {
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px oklch(0% 0 0 / 0.2));
}

.res-header-title {
  font-size: 15px;
  font-weight: 600;
  color: oklch(98% 0 0);
}

.regresar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: oklch(20% 0.03 150);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: oklch(98% 0 0 / 0.9);
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.15);
  transition: background 0.2s ease, transform 0.2s ease;
}

.regresar:hover {
  background: oklch(100% 0 0);
  transform: translateX(-2px);
}

.regresar i {
  font-size: 13px;
}

@media (max-width: 560px) {
  .res-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .res-header-title {
    order: 3;
    width: 100%;
    text-align: center;
  }
}

/* ---------- Encabezado ---------- */

.fibo-intro {
    max-width: 760px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fibo-eyebrow {
    font-size: 13px;
    letter-spacing: 0.16em;
    line-height: 1.65;
    color: var(--acento);
    max-width: 620px;
    font-weight: 700;
}

.fibo-titulo {
    font-size: clamp(30px, 6.5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.fibo-entrada {
    font-size: 17px;
    line-height: 1.65;
    color: var(--tinta-suave);
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- Rejilla y tarjetas ---------- */

.fibo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    max-width: 1360px;
    width: 100%;
}

.tarjeta {
    background: var(--tarjeta);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 1px 2px oklch(0% 0 0 / 0.06), 0 8px 24px oklch(0% 0 0 / 0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.tarjeta:hover {
    box-shadow: 0 2px 4px oklch(0% 0 0 / 0.08), 0 16px 32px oklch(0% 0 0 / 0.08);
    transform: translateY(-2px);
}

.tarjeta h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 10px;
}

.tarjeta h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    border-radius: 2px;
    background: var(--acento);
}

.tarjeta p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--tinta-tenue);
}

/* ---------- Fotografías ---------- */

.foto {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    background: var(--placa);
}

.foto-alta { height: 200px; }


/* =============================================
   ANIMACIONES
   ============================================= */

.lienzo {
    width: 100%;
    max-height: 170px;
    aspect-ratio: 1;
    overflow: visible;
    display: block;
    margin: 0 auto;
}

/* --- Trazo de las espirales --- */

@keyframes trazar {
    0%   { stroke-dashoffset: 100; }
    86%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}

@keyframes trazar-rapido {
    0%   { stroke-dashoffset: 100; }
    75%  { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}

.espiral {
    fill: none;
    stroke: var(--verde);
    stroke-width: 0.9;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: trazar var(--ciclo) linear infinite;
}

.espiral-helecho {
    stroke: oklch(45% 0.1 145);
    animation-name: trazar-rapido;
}

/* --- Brote de hojas, folíolos y cuadrados --- */

@keyframes brotar {
    0%   { opacity: 0; }
    4%   { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes brotar-hoja {
    0%   { opacity: 0; transform: scale(0.4); }
    5%   { opacity: 1; transform: scale(1); }
    100% { opacity: 1; transform: scale(1); }
}

.cuadro {
    fill: none;
    stroke: var(--verde-cuadro);
    stroke-width: 0.15;
    opacity: 0;
    animation: brotar var(--ciclo) linear infinite;
    animation-delay: var(--retardo, 0s);
}

.foliolo {
    fill: var(--verde-hoja);
    opacity: 0;
    animation: brotar var(--ciclo) linear infinite;
    animation-delay: var(--retardo, 0s);
}

.hoja {
    opacity: 0;
    transform-box: view-box;
    transform-origin: var(--ox) var(--oy);
    animation: brotar-hoja var(--ciclo) linear infinite;
    animation-delay: var(--retardo, 0s);
}

.hoja ellipse {
    fill: var(--verde-claro);
    stroke: var(--verde-borde);
    stroke-width: 0.25;
}

.corazon { fill: oklch(40% 0.07 135); }

/* --- Respeto por quien prefiere menos movimiento --- */

@media (prefers-reduced-motion: reduce) {
    .espiral,
    .cuadro,
    .foliolo,
    .hoja {
        animation: none;
        opacity: 1;
        stroke-dashoffset: 0;
        transform: none;
    }
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.foto-link {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  cursor: zoom-in;
  position: relative;
}

.foto-link .foto {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.foto-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: oklch(0% 0 0 / 0);
  transition: background 0.25s ease;
}

.foto-link:hover .foto {
  transform: scale(1.06);
}

.foto-link:hover::after {
  background: oklch(0% 0 0 / 0.08);
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(15% 0.02 150 / 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-overlay.activo {
  display: flex;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px oklch(0% 0 0 / 0.4);
}

.lightbox-cerrar {
  position: absolute;
  top: 24px;
  right: 32px;
  color: oklch(98% 0 0);
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  background: oklch(0% 0 0 / 0.3);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-cerrar:hover {
  background: var(--acento);
  transform: scale(1.08);
}

/* ---------- Footer ---------- */

.final {
  width: 100%;
  margin-top: 24px;
}

.foot {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding: 40px 20px;
  background-color: var(--verde);
  background-image: url("/assets/img/path147.webp");
  background-size: cover;
  background-position: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-footer {
  width: 160px;
  height: 160px;
  object-fit: contain;
  -webkit-mask-image: radial-gradient(circle, black 55%, transparent 85%);
  mask-image: radial-gradient(circle, black 55%, transparent 85%);
}

.foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.foot .list li {
  margin-bottom: 10px;
}

.foot .list li a {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.foot .list li a:hover {
  color: var(--verde-claro);
}

.social-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.social-media li a {
  color: #ffffff;
  font-size: 22px;
  transition: transform 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.social-media li a:hover {
  color: var(--verde);
  background: #ffffff;
  transform: translateY(-2px);
}

.footer-copy {
  text-align: center;
  padding: 14px;
  background-color: var(--tinta);
  color: #ffffff;
  font-size: 13px;
}