/* ============================================================
   Eden Agriculture — splash / gateway
   Mobile first · BEM · valores relativos
   ============================================================ */

/* ---- Reset mínimo ---- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

[hidden] { display: none !important; }

:root {
  --green: #00ab57;
  --green-deep: #005030;
  --forest: #12300f;
  --forest-cool: #06231c;
  --lime: #f4de36;
  --lime-modern: #f7dd00;
  --cream: #f3f1e7;
  --ease: cubic-bezier(.22, .8, .22, 1);

  /* Sentido de lectura: multiplica los desplazamientos horizontales
     y orienta lo que no tiene equivalente lógico (transform-origin). */
  --dir: 1;
  --origin-inline: left;
  --safe-inline-end: env(safe-area-inset-right);   /* lado donde flota el selector */
}

[dir="rtl"] {
  --dir: -1;
  --origin-inline: right;
  --safe-inline-end: env(safe-area-inset-left);
}

html,
body { height: 100%; }

body {
  /* El árabe cae a IBM Plex Sans Arabic glifo a glifo: Space Grotesk
     sigue resolviendo el latín (los códigos del selector, las marcas). */
  font-family: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  background: var(--forest);
  color: var(--cream);
  overflow: hidden;                 /* splash: sin scroll */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Oculto visualmente pero accesible para lectores / SEO */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Layout: dos mundos
   Mobile → columna (50% / 50%).  Desktop → fila.
   ============================================================ */
.eden {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;                /* fallback */
  min-height: 100svh;
  min-height: 100dvh;
  isolation: isolate;
}

.eden__panel {
  position: relative;
  flex: 1 1 50%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  transition: flex-basis .7s var(--ease), filter .7s var(--ease);
}

/* Acento cromático por marca + luz que sostiene el logotipo en tinta verde */
.eden__panel--agro   { --accent: var(--lime);        --glow: 247, 245, 236; }
.eden__panel--modern { --accent: var(--lime-modern); --glow: 252, 253, 250; }

/* ---- Fondo fotográfico (siempre <img>, nunca background-image) ---- */
.eden__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: scale(1.05);
  will-change: transform;
  animation:
    kenburns 28s ease-in-out infinite alternate,
    fadeIn 1.3s var(--ease) both;
}
.eden__panel--agro   .eden__bg { object-position: center 62%; }
.eden__panel--modern .eden__bg { object-position: center 45%; animation-duration: 34s, 1.3s; animation-direction: alternate-reverse, normal; }

/* ---- Velo de marca: garantiza contraste + tiñe el mundo ---- */
.eden__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: opacity .7s var(--ease);
}
.eden__panel--agro::before {
  background:
    radial-gradient(120% 80% at 50% 42%, transparent 40%, rgba(18, 48, 15, .35) 100%),
    linear-gradient(180deg, rgba(18, 48, 15, .55) 0%, rgba(18, 48, 15, .04) 32%, rgba(0, 80, 48, .28) 66%, rgba(0, 80, 48, .82) 100%);
}
.eden__panel--modern::before {
  background:
    radial-gradient(120% 80% at 50% 42%, transparent 36%, rgba(5, 40, 32, .46) 100%),
    linear-gradient(180deg, rgba(5, 38, 31, .64) 0%, rgba(6, 46, 37, .16) 30%, rgba(6, 52, 42, .42) 64%, rgba(3, 48, 38, .9) 100%);
}

/* ---- Velo suave tras el contenido: da contraste a los logos en blanco ---- */
.eden__halo {
  position: absolute;
  z-index: 2;
  left: var(--hx, 50%);
  top: var(--hy, 50%);
  width: min(82vw, 36rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(var(--hs, .95));
  background: radial-gradient(circle, rgba(16, 28, 8, .6) 0%, rgba(16, 30, 10, .26) 45%, transparent 72%);
  filter: blur(6px);
  opacity: .9;
  pointer-events: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease), left .4s ease-out, top .4s ease-out;
}
.eden__panel--modern .eden__halo {
  background: radial-gradient(circle, rgba(4, 26, 22, .62) 0%, rgba(5, 30, 26, .26) 46%, transparent 72%);
}

/* ---- Contenido ---- */
.eden__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}
/* Enlace principal del bloque (envuelve eyebrow, logo, tagline y CTA) */
.eden__enter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.7rem, 1.8vw, 1.15rem);
  text-decoration: none;
  color: inherit;
  outline: none;
}

.eden__brand {
  position: relative;
  margin: 0;
  line-height: 0;
}
/* Aura de luz bajo el logotipo: el logo va en tinta verde y necesita
   una superficie clara para leerse sobre la fotografía.
   Núcleo opaco (background) + cola larga (box-shadow), ambos difuminados
   por el mismo blur para que la luz se funda con la escena. */
.eden__brand::before {
  content: "";
  position: absolute;
  z-index: -1;                      /* detrás del logo, delante del halo */
  inset: -44% -13% -20%;            /* se ensancha con el logo (%) */
  border-radius: 50%;
  background: rgba(var(--glow), .9);
  box-shadow: 0 0 3.5rem 1.7rem rgba(var(--glow), .26);
  filter: blur(19px);
  transition: transform .6s var(--ease);
}
.eden__logo {
  display: block;
  width: clamp(9rem, 19vw, 14.5rem);
  height: auto;
  filter: drop-shadow(0 2px 5px rgba(18, 48, 15, .2));
}

.eden__tagline {
  font-family: "Fraunces", "Amiri", Georgia, serif;
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  line-height: 1.15;
  max-width: 20ch;
  color: var(--cream);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}

/* TEMPORAL — lemas ocultos a petición de cliente.
   Para recuperarlos, borrar esta única regla (el texto sigue en el HTML,
   traducido y accesible). */
.eden__tagline { display: none; }

.eden__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: .35rem;
  padding-bottom: .35rem;
  font-size: clamp(.74rem, 1.4vw, .88rem);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
  transition: color .45s var(--ease);
}
.eden__cta::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  opacity: .45;
  transform: scaleX(.55);
  transform-origin: var(--origin-inline);
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
/* La punta sigue el sentido de lectura: en RTL apunta a la izquierda */
.eden__arrow {
  transform: scaleX(var(--dir));
  transition: transform .5s var(--ease);
}

/* ---- Marcas del bloque (chips claros, cada una enlazable) ---- */
.eden__brands {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .9rem;
}
.eden__brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  padding: 0 .55rem;
  background: #fff;
  border-radius: .5rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
  text-decoration: none;
  transition: box-shadow .3s var(--ease), background-color .3s var(--ease);
}
/* Disper manda: chip central, mayor que los satélites */
.eden__brand-chip--main {
  height: 2.55rem;
  padding: 0 .75rem;
  border-radius: .6rem;
}
.eden__brand-chip--main .eden__brand-logo { height: 1.65rem; }

.eden__brand-chip:hover { background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.eden__brand-chip:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.eden__brand-logo {
  height: 1.1rem;
  width: auto;
  display: block;
}

/* ============================================================
   Costura de luz (seam)
   ============================================================ */
.eden__seam {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--green) 18%, var(--lime) 50%, var(--green) 82%, transparent);
  opacity: 0;
  animation: seamIn 1.1s var(--ease) .35s forwards;
}
.eden__seam::before {
  content: "";
  position: absolute;
  inset: -3px 0;
  background: inherit;
  filter: blur(7px);
  animation: seamBreathe 4.5s ease-in-out infinite;
}
.eden__seam::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-start: -28%;
  width: 28%;
  height: 12px;
  transform: translateY(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .95), rgba(244, 222, 54, .4) 42%, transparent 72%);
  filter: blur(2px);
  animation: shimmerH 6s var(--ease) infinite;
}

/* ============================================================
   Selector de idioma (ES · EN · FR · AR)
   Flota sobre los dos mundos; fuera de los paneles para no
   disparar su hover.
   ============================================================ */
.eden__lang {
  position: absolute;
  z-index: 6;
  top: max(0.9rem, env(safe-area-inset-top));
  inset-inline-end: 0.9rem;
  inset-inline-end: max(0.9rem, var(--safe-inline-end));
  display: flex;
  align-items: center;
  gap: .1rem;
  padding: .22rem;
  border: 1px solid rgba(243, 241, 231, .2);
  border-radius: 999px;
  background: rgba(6, 20, 10, .55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  animation: riseIn .8s var(--ease) 1.05s both;
}

.eden__lang-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  padding: .38rem .6rem;
  background: transparent;
  color: rgba(243, 241, 231, .8);
  font-family: inherit;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.eden__lang-btn:hover { color: var(--cream); background: rgba(243, 241, 231, .12); }
.eden__lang-btn:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
.eden__lang-btn--active {
  color: var(--forest);
  background: var(--cream);
}
.eden__lang-btn--active:hover { color: var(--forest); background: var(--cream); }

/* Cambio de idioma: fundido corto para que el texto no salte */
.eden__tagline,
.eden__cta-text { transition: opacity .18s var(--ease); }
.is-lang-switching .eden__tagline,
.is-lang-switching .eden__cta-text { opacity: 0; }

/* ============================================================
   Animaciones
   ============================================================ */
@keyframes kenburns {
  from { transform: scale(1.04); }
  to   { transform: scale(1.11) translateY(-1.2%); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes seamIn {
  from { opacity: 0; }
  to   { opacity: .92; }
}
@keyframes seamBreathe {
  0%, 100% { opacity: .5; filter: blur(7px) brightness(.9); }
  50%      { opacity: 1;  filter: blur(9px) brightness(1.35); }
}
@keyframes shimmerH {
  0%   { inset-inline-start: -28%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { inset-inline-start: 100%; opacity: 0; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(1.4rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Entrada orquestada del contenido */
.eden__enter > *,
.eden__brands {
  animation: riseIn .8s var(--ease) both;
}
.eden__brand   { animation-delay: .5s; }
.eden__tagline { animation-delay: .62s; }
.eden__cta     { animation-delay: .74s; }
.eden__brands  { animation-delay: .86s; }
/* El mundo Modern entra ligeramente después → lectura izquierda→derecha */
.eden__panel--modern .eden__brand   { animation-delay: .58s; }
.eden__panel--modern .eden__tagline { animation-delay: .70s; }
.eden__panel--modern .eden__cta     { animation-delay: .82s; }
.eden__panel--modern .eden__brands  { animation-delay: .94s; }

/* ============================================================
   Interacción hover / focus (micro-reacciones)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  .eden__panel:hover .eden__bg { animation-play-state: paused; }
}

.eden__panel:is(:hover, :focus-within) .eden__halo { opacity: 1; --hs: 1.06; }
.eden__panel:is(:hover, :focus-within) .eden__brand::before { transform: scale(1.05); }
.eden__panel:is(:hover, :focus-within) .eden__tagline { transform: translateY(-2px); }
.eden__panel:is(:hover, :focus-within) .eden__cta { color: var(--accent); }
.eden__panel:is(:hover, :focus-within) .eden__cta::after { transform: scaleX(1); opacity: 1; }
/* El scaleX ya invierte el eje: el avance sale solo en RTL */
.eden__panel:is(:hover, :focus-within) .eden__arrow { transform: scaleX(var(--dir)) translateX(6px); }

/* Foco de teclado: anillo de alto contraste alrededor del bloque activo */
.eden__panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 5;
  border: 3px solid transparent;
  border-radius: 3px;
  pointer-events: none;
}
.eden__panel:has(.eden__enter:focus-visible)::after {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .45);
}

/* ============================================================
   Desktop: fila + expand-on-hover (los mundos compiten)
   ============================================================ */
@media (min-width: 768px) {
  .eden { flex-direction: row; }

  .eden__content { padding: 2rem; }
  .eden__enter { gap: clamp(.9rem, 1.5vw, 1.4rem); }

  .eden__lang { top: 1.5rem; inset-inline-end: 1.5rem; }
  .eden__lang-btn { padding: .42rem .7rem; font-size: .74rem; }

  /* Seam vertical. En RTL los paneles se invierten con el flujo flex,
     así que la costura se mide desde el inicio de línea, no desde la izquierda. */
  .eden__seam {
    top: 0;
    bottom: 0;
    inset-inline-start: 50%;
    inset-inline-end: auto;
    width: 2px;
    height: auto;
    transform: translateX(calc(-50% * var(--dir)));
    background: linear-gradient(180deg, transparent, var(--green) 18%, var(--lime) 50%, var(--green) 82%, transparent);
    transition: inset-inline-start .7s var(--ease);
  }
  .eden__seam::before { inset: 0 -3px; }
  .eden__seam::after {
    top: -30%;
    inset-inline-start: 50%;
    width: 12px;
    height: 30%;
    transform: translateX(calc(-50% * var(--dir)));
    animation: shimmerV 6.5s var(--ease) infinite;
  }

  /* El panel activo crece; el inactivo se atenúa y desatura */
  .eden:has(.eden__panel--agro:is(:hover, :focus-within)) .eden__panel--agro { flex-basis: 60%; }
  .eden:has(.eden__panel--agro:is(:hover, :focus-within)) .eden__panel--modern { flex-basis: 40%; filter: grayscale(.5) brightness(.62); }
  .eden:has(.eden__panel--agro:is(:hover, :focus-within)) .eden__seam { inset-inline-start: 60%; }

  .eden:has(.eden__panel--modern:is(:hover, :focus-within)) .eden__panel--modern { flex-basis: 60%; }
  .eden:has(.eden__panel--modern:is(:hover, :focus-within)) .eden__panel--agro { flex-basis: 40%; filter: grayscale(.5) brightness(.62); }
  .eden:has(.eden__panel--modern:is(:hover, :focus-within)) .eden__seam { inset-inline-start: 40%; }

  /* Marcas: tamaño x2, ancladas bajo el contenido y ocultas hasta hover/foco */
  .eden__brands {
    position: absolute;
    top: calc(100% + clamp(1rem, 2.5vh, 2rem));
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    gap: .7rem;
    width: max-content;              /* fila natural, sin wrap por el ancho del contenido */
    max-width: 92vw;
    animation: none;                 /* el centrado manda; no entra con riseIn */
    visibility: hidden;
    transition: visibility 0s linear .5s;
  }
  .eden__brand-logo { height: 2.6rem; }
  .eden__brand-chip {
    height: 4.8rem;
    padding: 0 1.3rem;
    border-radius: .7rem;
    opacity: 0;
    transform: translateY(16px) scale(.96);
    transition: opacity .45s var(--ease), transform .45s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease);
  }
  .eden__brand-chip--main {
    height: 6rem;
    padding: 0 1.7rem;
    border-radius: .85rem;
  }
  .eden__brand-chip--main .eden__brand-logo { height: 3.7rem; }

  .eden__panel:is(:hover, :focus-within) .eden__brands { visibility: visible; transition-delay: 0s; }
  .eden__panel:is(:hover, :focus-within) .eden__brand-chip { opacity: 1; transform: translateY(0) scale(1); }
  /* Despliegue desde el centro: primero Disper, después los satélites */
  .eden__panel:is(:hover, :focus-within) .eden__brand-chip:nth-child(2) { transition-delay: .05s; }
  .eden__panel:is(:hover, :focus-within) .eden__brand-chip:nth-child(1),
  .eden__panel:is(:hover, :focus-within) .eden__brand-chip:nth-child(3) { transition-delay: .14s; }
}

@keyframes shimmerV {
  0%   { top: -30%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ============================================================
   Pantallas muy bajas (móvil apaisado): compactar
   ============================================================ */
@media (max-height: 480px) {
  .eden__logo { width: clamp(7rem, 15vw, 10rem); }
  .eden__tagline { display: none; }
  .eden__brands { display: none; }
  .eden__enter { gap: .5rem; }
  .eden__content { padding: 1rem; }
  .eden__lang { top: .5rem; inset-inline-end: .5rem; }
  .eden__lang-btn { padding: .3rem .5rem; font-size: .66rem; }
}

/* ============================================================
   Árabe — ajustes propios de la escritura
   La familia se resuelve por fallback de glifo (Amiri para el lema,
   IBM Plex Sans Arabic para la utilidad); aquí solo se corrige lo
   que la escritura árabe no admite.
   ============================================================ */
:root[lang="ar"] .eden__tagline {
  font-style: normal;                       /* la cursiva latina no existe en árabe */
  font-size: clamp(1.35rem, 3vw, 2rem);     /* Amiri tiene el ojo menor que Fraunces */
  line-height: 1.45;                        /* aire para diacríticos y descendentes */
  max-width: 26ch;
}

:root[lang="ar"] .eden__cta {
  letter-spacing: 0;                        /* separar rompería la unión de las letras */
  text-transform: none;                     /* el árabe no tiene caja alta */
  font-size: clamp(.82rem, 1.5vw, .95rem);
  font-weight: 500;
}

/* ============================================================
   Movimiento reducido
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .eden__bg { animation: none; transform: scale(1.02); opacity: 1; }
  .eden__seam { animation: none; opacity: .9; }
  .eden__seam::before,
  .eden__seam::after { animation: none; }
  .eden__seam::after { display: none; }
  .eden__enter > * { animation: none; opacity: 1; transform: none; }
  .eden__brands { animation: none; opacity: 1; }   /* sin tocar transform (centrado en desktop) */
  .eden__lang { animation: none; opacity: 1; transform: none; }
  .eden__brand::before { transition: none; }
  .eden__tagline,
  .eden__cta-text { transition: none; }
  .eden__panel,
  .eden__panel *,
  .eden__halo { transition-duration: .01ms !important; }
}
