@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400&family=Inter:wght@200;300;500;600&display=swap');
@import './variables.css';
@import './componentes.css';

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-secundaria);
  font-weight: 300;
  color: var(--gris-texto);
  background: var(--blanco);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* ---- Tipografía ---- */

h1, h2, h3, h4 {
  font-family: var(--font-principal);
  line-height: 1.15;
  color: var(--verde-oscuro);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

h4 {
  font-size: 0.9rem;
  font-weight: 400;
}

p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gris-texto);
}

/* Eyebrow label — Inter SemiBold + tracking amplio */
.label {
  font-family: var(--font-secundaria);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--verde);
  display: block;
  margin-bottom: 0.8rem;
}

.subtitulo {
  font-family: var(--font-principal);
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--gris-medio);
  letter-spacing: 0.04em;
  margin-top: 0.6rem;
}

/* ---- Layout ---- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--espacio-md);
}

.seccion {
  padding-block: var(--espacio-lg);
}

.seccion--oscura {
  background: var(--verde-oscuro);
  color: var(--blanco);
}

.seccion--oscura h2,
.seccion--oscura h3 {
  color: var(--blanco);
}

.seccion--oscura .label {
  color: rgba(255,255,255,0.45);
}

.seccion--gris {
  background: var(--gris-claro);
}

/* ---- Separador ondulado ---- */

.separador {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.separador svg {
  display: block;
  width: 100%;
}

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

.btn {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  border-radius: var(--radio-md);
  font-family: var(--font-principal);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    background var(--trans),
    color var(--trans),
    border-color var(--trans),
    box-shadow var(--trans),
    transform var(--trans-fast);
  will-change: transform;
}

.btn:active {
  transform: scale(0.97);
}

.btn-verde {
  background: var(--verde);
  color: var(--blanco);
}

.btn-verde:hover {
  background: var(--verde-medio);
  box-shadow: 0 4px 16px rgba(77,118,15,0.35);
}

.btn-outline {
  border: 1.5px solid var(--verde);
  color: var(--verde);
}

.btn-outline:hover {
  background: var(--verde);
  color: var(--blanco);
}

.btn-outline--blanco {
  border: 1.5px solid rgba(255,255,255,0.55);
  color: var(--blanco);
}

.btn-outline--blanco:hover {
  border-color: var(--blanco);
  background: rgba(255,255,255,0.12);
}

.btn-marron {
  background: var(--marron);
  color: var(--blanco);
}

.btn-marron:hover {
  background: var(--ocre);
}

/* ---- Focus visible ---- */

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

/* ---- Skeleton loader ---- */

.skeleton {
  background: linear-gradient(90deg, #e6e6e2 25%, #edecea 50%, #e6e6e2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radio-md);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Reveal inicial (Motion lo anima) ---- */

.js-reveal {
  opacity: 0;
  transform: translateY(24px);
}

/* ---- Utilidades ---- */

.text-center { text-align: center; }
.text-verde  { color: var(--verde); }
.mt-xs { margin-top: var(--espacio-xs); }
.mt-sm { margin-top: var(--espacio-sm); }
.mt-md { margin-top: var(--espacio-md); }
.mt-lg { margin-top: var(--espacio-lg); }

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

.footer {
  position: relative;
  overflow: hidden;
  background: var(--verde-oscuro);
  padding-block: var(--espacio-lg);
}

/* Trama al azar de fondo, la misma de los títulos de las páginas internas
   (crearTrama() en components.js), más tenue: va detrás de texto chico. */
.footer > .trama-sitio { opacity: 0.3; z-index: 0; }
.footer > .container { position: relative; z-index: 1; }

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--espacio-md);
  padding-bottom: var(--espacio-md);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer__logo {
  height: 44px;
  width: auto;
  margin-bottom: var(--espacio-sm);
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.footer__marca p {
  font-family: var(--font-principal);
  font-weight: 200;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.42);
  line-height: 1.6;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer__col-titulo {
  font-family: var(--font-secundaria);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.2rem;
}

.footer__col a {
  font-family: var(--font-principal);
  font-weight: 200;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.03em;
  transition: color var(--trans);
}

.footer__col a:hover {
  color: var(--blanco);
}

.footer__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--espacio-md);
  font-family: var(--font-principal);
  font-weight: 200;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.28);
}

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

@media (max-width: 900px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding-inline: var(--espacio-sm);
  }
  .seccion {
    padding-block: var(--espacio-md);
  }
  .footer {
    padding-block: var(--espacio-md);
  }
  .footer__legal {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer__marca {
    grid-column: 1 / -1;
    margin-bottom: var(--espacio-sm);
  }
  .footer__legal {
    flex-direction: column;
    gap: .35rem;
    text-align: center;
    font-size: .63rem;
  }
}

/* ---- Redes sociales (header y footer) ---- */
.redes { display: flex; align-items: center; gap: 0.6rem; }
.redes a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid currentColor; opacity: .85;
  transition: opacity var(--trans), background var(--trans), color var(--trans);
}
.redes a:hover { opacity: 1; }
.redes svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.footer__redes-titulo {
  display: block; margin: 1rem 0 .5rem;
  font-family: var(--font-secundaria); font-weight: 600; font-size: .62rem;
  letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.35);
}
.footer .redes a { color: rgba(255,255,255,.7); }
.footer .redes a:hover { color: var(--blanco); background: rgba(255,255,255,.1); }
