/* ══════════════════════════════════════
   ECOS MEANING — Animated acronym reveal
══════════════════════════════════════ */
.ecos-meaning {
  position: relative;
  background:
    radial-gradient(ellipse at top, #0a1d70 0%, var(--navy) 38%, #050d3a 100%);
  padding: clamp(5rem, 10vh, 7rem) var(--gap) clamp(4rem, 8vh, 6rem);
  overflow: hidden;
  color: var(--white);
  isolation: isolate;
}

/* Decorative ambient echo rings (siempre activos) */
.em-bg{
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  display: grid; place-items: center;
}
.em-bg::before,
.em-bg::after{
  content:'';
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(250,192,24,.18);
  animation: em-ring 6s ease-out infinite;
}
.em-bg::after{ animation-delay: 3s; border-color: rgba(215,35,39,.18); }
@keyframes em-ring{
  0%   { width: 80px;  height: 80px;  opacity: .6; }
  100% { width: 1500px; height: 1500px; opacity: 0; }
}

/* Subtle dotted noise dots (constellation) */
.em-dot{
  position: absolute; z-index: 0;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .35;
  animation: em-twinkle 3.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(250,192,24,.6));
}
.em-dot.d1{ top: 18%; left: 8%; animation-delay: 0s; }
.em-dot.d2{ top: 28%; right: 12%; animation-delay: 1.1s; background: var(--red); filter: drop-shadow(0 0 6px rgba(215,35,39,.6)); }
.em-dot.d3{ bottom: 30%; left: 14%; animation-delay: 2s; }
.em-dot.d4{ bottom: 18%; right: 9%; animation-delay: .6s; background: var(--white); filter: drop-shadow(0 0 6px rgba(255,255,255,.6)); }
.em-dot.d5{ top: 50%; left: 4%; animation-delay: 1.6s; background: var(--red); filter: drop-shadow(0 0 6px rgba(215,35,39,.6)); }
.em-dot.d6{ top: 60%; right: 5%; animation-delay: 2.4s; }
@keyframes em-twinkle{
  0%, 100% { opacity: .15; transform: scale(1); }
  50%      { opacity: .8;  transform: scale(1.6); }
}

/* ── HEAD ── */
.em-head{
  position: relative; z-index: 2;
  text-align: center;
  max-width: 920px;
  margin: 0 auto 3.6rem;
}
.em-anniversary{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  padding: .85rem 1.4rem .7rem;
  background: linear-gradient(160deg, var(--gold) 0%, var(--gold2) 55%, #FF9D00 100%);
  color: var(--navy);
  border-radius: 22px;
  margin-bottom: 1.6rem;
  box-shadow:
    0 18px 38px rgba(250,192,24,.35),
    inset 0 1px 0 rgba(255,255,255,.45);
  position: relative;
  overflow: hidden;
}
.em-anniversary::after{
  content:'';
  position: absolute; top: 0; left: -60%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: em-shine 3s ease-in-out infinite;
}
@keyframes em-shine{
  0%, 60%   { left: -60%; }
  100% { left: 130%; }
}
.em-ann-num{
  font-family: var(--ft);
  font-size: 1.65rem; font-weight: 800;
  background: var(--navy); color: var(--gold);
  width: 56px; height: 56px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: -.04em;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 6px 14px rgba(5,22,94,.3);
}
.em-ann-txt{
  font-family: var(--ft);
  font-size: .58rem; line-height: 1.25;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
}
.em-eye{
  font-family: var(--ft); font-size: .62rem;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
  display: inline-flex; align-items: center; gap: 12px;
}
.em-eye::before, .em-eye::after{
  content:''; width: 24px; height: 1px;
  background: rgba(250,192,24,.45);
}
.em-title{
  font-family: var(--ft); font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.018em;
  color: var(--white);
}
.em-title em{
  font-style: italic; color: var(--gold);
  font-family: var(--fb); font-weight: 400;
  position: relative;
}
.em-title em::after{
  content:''; position: absolute;
  left: 0; right: 0; bottom: -4px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 1s .6s ease;
}
.em-head.visible .em-title em::after,
.em-title.visible em::after{ transform: scaleX(1); }
.em-sub{
  margin-top: 1.3rem;
  font-style: italic;
  font-size: clamp(.95rem, 1.5vw, 1.15rem);
  color: rgba(255,255,255,.65);
  letter-spacing: .015em;
}
.em-sub strong{
  color: var(--gold); font-style: normal; font-weight: 600;
}

/* ── GRID DE 4 LETRAS ── */
.em-grid{
  position: relative; z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.em-card{
  position: relative;
  padding: 2.3rem 1.4rem 2rem;
  text-align: center;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 24px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform .4s cubic-bezier(.2,.7,.3,1), background .25s, border-color .25s, box-shadow .35s;
  overflow: hidden;
}
.em-card::before{
  content:''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 70%; height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: .45;
  filter: blur(.3px);
  transition: opacity .4s, width .4s;
}
.em-card-e::before{ color: #6E8BFF; }
.em-card-c::before, .em-card-o::before{ color: #FF6B6F; }
.em-card-s::before{ color: var(--gold); }
.em-card:hover{
  transform: translateY(-10px);
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.em-card:hover::before{ opacity: 1; width: 92%; }

/* ── Animación secuencial: cada card pulsa por turnos (E → C → O → S → loop) ── */
@keyframes em-card-cycle{
  0%, 78%, 100%{
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    border-color: rgba(255,255,255,.07);
    background: rgba(255,255,255,.025);
  }
  10%, 22%{
    transform: translateY(-9px);
    box-shadow: 0 22px 52px rgba(0,0,0,.4);
    border-color: rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
  }
}
@keyframes em-edge-cycle{
  0%, 78%, 100%{ opacity: .45; width: 70%; }
  10%, 22%{ opacity: 1; width: 96%; filter: blur(0); }
}
.em-card.visible{
  animation: em-card-cycle 4.8s ease-in-out infinite;
}
.em-card.visible::before{
  animation: em-edge-cycle 4.8s ease-in-out infinite;
}
.em-grid .em-card:nth-child(1).visible,
.em-grid .em-card:nth-child(1).visible::before{ animation-delay: 1.4s; }
.em-grid .em-card:nth-child(2).visible,
.em-grid .em-card:nth-child(2).visible::before{ animation-delay: 2.6s; }
.em-grid .em-card:nth-child(3).visible,
.em-grid .em-card:nth-child(3).visible::before{ animation-delay: 3.8s; }
.em-grid .em-card:nth-child(4).visible,
.em-grid .em-card:nth-child(4).visible::before{ animation-delay: 5.0s; }
/* Hover anula el ciclo y deja la card destacada */
.em-card.visible:hover{ animation: none; }
.em-card.visible:hover::before{ animation: none; opacity: 1; width: 96%; }

/* Letra grande con ondas */
.em-letter{
  position: relative;
  width: 124px; height: 124px;
  margin: 0 auto 1.5rem;
  display: flex; align-items: center; justify-content: center;
}
.em-letter-char{
  position: relative; z-index: 3;
  width: 92px; height: 92px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ft); font-weight: 700;
  font-size: 2.7rem; line-height: 1;
  color: var(--white);
  box-shadow: 0 14px 36px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.18);

  /* entrance prep */
  transform: scale(.35) rotate(-12deg);
  opacity: 0;
  transition: transform 1s cubic-bezier(.34,1.56,.64,1), opacity .55s ease;
}
.em-card.visible .em-letter-char{
  transform: scale(1) rotate(0);
  opacity: 1;
  transition-delay: .18s;
}
.em-card-e .em-letter-char{ background: var(--navy); }
.em-card-c .em-letter-char{ background: var(--red); }
.em-card-o .em-letter-char{ background: var(--red); }
.em-card-s .em-letter-char{ background: var(--gold); color: var(--navy); }

/* La 'O' con la mano del logo (ícono de unión) */
.em-card-o .em-letter-char::after{
  content:'';
  position: absolute; inset: 0;
  margin: auto;
  width: 38px; height: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M11 4l-1 4-2 1 1 3-2 1 1 2 4 1 3-1 1-3-2-1 1-3-2-1-1-3z' opacity='.85'/></svg>");
  background-size: contain; background-repeat: no-repeat; background-position: center;
  opacity: 0;
}

/* Ondas de eco */
.em-echo{
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  pointer-events: none;
}
.em-card-e .em-echo{ color: rgba(120,140,255,.7); }
.em-card-c .em-echo,
.em-card-o .em-echo{ color: rgba(215,35,39,.6); }
.em-card-s .em-echo{ color: rgba(250,192,24,.7); }

.em-card.visible .em-echo:nth-of-type(1){ animation: em-wave 2.6s ease-out  .35s infinite; }
.em-card.visible .em-echo:nth-of-type(2){ animation: em-wave 2.6s ease-out 1.20s infinite; }
.em-card.visible .em-echo:nth-of-type(3){ animation: em-wave 2.6s ease-out 2.05s infinite; }
@keyframes em-wave{
  0%   { transform: scale(.55); opacity: .8; }
  70%  { opacity: .15; }
  100% { transform: scale(2);   opacity: 0;  }
}

/* Palabra y descripción */
.em-word{
  font-family: var(--ft); font-weight: 700;
  font-size: 1.32rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .65rem;
  color: var(--white);
  position: relative;
  display: inline-block;
}
.em-word .em-word-first{
  display: inline-block;
  position: relative;
  padding: 0 .04em;
}
.em-card-e .em-word-first{ color: #5d77ff; }
.em-card-c .em-word-first,
.em-card-o .em-word-first{ color: #ff5a5e; }
.em-card-s .em-word-first{ color: var(--gold); }

.em-desc{
  font-size: .85rem;
  line-height: 1.6;
  color: rgba(255,255,255,.62);
  max-width: 240px;
  margin: 0 auto;
}

/* Stagger delay para las cards (refuerza el efecto eco en cadena) */
.em-grid .em-card:nth-child(1){ transition-delay: 0s; }
.em-grid .em-card:nth-child(2){ transition-delay: .12s; }
.em-grid .em-card:nth-child(3){ transition-delay: .24s; }
.em-grid .em-card:nth-child(4){ transition-delay: .36s; }

/* ── FOOT TAGLINE ── */
.em-foot{
  position: relative; z-index: 2;
  margin-top: 3.5rem;
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  flex-wrap: wrap;
  text-align: center;
}
.em-foot-line{
  display: block;
  height: 1px; width: clamp(40px, 8vw, 110px);
  background: linear-gradient(to right, transparent, rgba(250,192,24,.45), transparent);
}
.em-foot-txt{
  font-family: var(--ft);
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(250,192,24,.78);
}

/* ── RESPONSIVE ── */
@media (max-width: 960px){
  .em-grid{ grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (max-width: 560px){
  .ecos-meaning{ padding: 4rem var(--gap) 3.5rem; }
  .em-grid{ grid-template-columns: 1fr; max-width: 360px; }
  .em-letter{ width: 110px; height: 110px; }
  .em-letter-char{ width: 84px; height: 84px; font-size: 2.4rem; }
  .em-head{ margin-bottom: 2.6rem; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce){
  .em-bg::before, .em-bg::after,
  .em-dot,
  .em-card.visible .em-echo,
  .em-anniversary::after{
    animation: none !important;
  }
  .em-card .em-letter-char{ transform: none; opacity: 1; }
}
