/* ============================================================
   e. agencia · estilos
   Colores (cambiá acá y se actualiza toda la página):
   ============================================================ */
:root {
  --rojo:    #e30613;   /* rojo marca (logo, "elevamos tu marca") */
  --rosa:    #f4a9d9;   /* rosa chicle: bloque manifiesto */
  --rosa-2:  #f9c9e6;   /* rosa claro: inicio de la barra de navegación */
  --coral:   #f0663a;   /* naranja coral: final de la barra de navegación */
  --lima:    #c9e63a;   /* verde lima: bloque servicios */
  --crema:   #fff6e6;   /* crema: cómo trabajamos y galería */
  --fucsia:  #e23ac8;   /* fucsia: bloque contacto */
  --oliva:   #3e5a2b;   /* verde oliva oscuro: títulos sobre rosa */
  --oliva-2: #6f7f3a;   /* oliva medio: hero */
  --tinta:   oklch(22% 0.02 340);   /* casi negro, tirando a magenta */
  --hueso:   oklch(99% 0.01 80);    /* casi blanco, tirando a crema */

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */
  --gutter: clamp(20px, 5vw, 72px);
  --nav-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--crema);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
section[id] { scroll-margin-top: var(--nav-h); }  /* que la nav fija no tape el inicio de la sección */
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
em { font-style: italic; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--tinta); color: var(--hueso); padding: 8px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 700;
}
.skip:focus { top: 12px; }

/* ---------- logo como máscara: se pinta con background-color ---------- */
.logo {
  display: inline-block;
  aspect-ratio: 939 / 602;
  -webkit-mask: url("assets/logo.png") no-repeat center / contain;
          mask: url("assets/logo.png") no-repeat center / contain;
}
.logo--mark {
  aspect-ratio: 524 / 602;
  -webkit-mask-image: url("assets/logo-e.png");
          mask-image: url("assets/logo-e.png");
}
.logo--red   { background: var(--rojo); }
.logo--white { background: var(--hueso); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  background: linear-gradient(90deg, var(--rosa-2) 0%, var(--rosa) 35%, var(--coral) 100%);
  transition: height .4s var(--ease);
}
.nav.is-compact { height: 60px; }
.nav__brand { display: block; line-height: 0; position: relative; z-index: 2; }
.nav__brand .logo { width: 64px; }
.nav__links { display: flex; gap: 8px; }

/* hamburguesa: solo en celular */
.nav__toggle {
  display: none;
  position: relative; z-index: 2;
  width: 44px; height: 44px; padding: 0;
  border: 1.5px solid var(--hueso); border-radius: 50%; background: transparent;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--hueso); border-radius: 2px;
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child  { top: 24px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child  { top: 20px; transform: rotate(-45deg); }

.pill {
  display: inline-block;
  padding: 9px 16px;
  border: 1.5px solid var(--hueso);
  border-radius: 999px;
  color: var(--hueso);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.pill:hover { transform: translateY(-1px); background: color-mix(in oklch, var(--hueso) 25%, transparent); }
.pill.is-active { background: var(--hueso); color: var(--coral); }

/* ============================================================
   HERO · degradado en movimiento + grano
   ============================================================ */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  overflow: hidden;
  background: var(--oliva-2);
  color: var(--hueso);
  isolation: isolate;
}
/* ---------- fondo del hero ----------
   El degradé líquido lo dibuja hero-bg.js en el canvas (.hero__gl).
   Las capas .hero__layer son el respaldo CSS si no hay WebGL. */
.hero__gl { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; display: block; }
.hero:not(.has-gl) .hero__gl { display: none; }
.hero.has-gl .hero__layer { display: none; }

.hero__layer { position: absolute; inset: -18%; z-index: -3; }
.hero__layer::before { content: ""; position: absolute; inset: 0; animation: breathe 11s ease-in-out infinite alternate; }
.hero__layer--base::before {
  background:
    radial-gradient(60% 80% at 100% 20%, #6d6558 0%, rgb(109 101 88 / 0) 70%),
    linear-gradient(100deg, #b98aa8 0%, #89a03c 45%, #4a6a2c 75%, #5e6a4a 100%);
}
.hero__layer--front::before {
  background:
    radial-gradient(55% 75% at 12% 18%, #eba4cd 0%, rgb(235 164 205 / 0) 70%),
    radial-gradient(38% 70% at 42% 28%, #d3e44c 0%, #bccc48 45%, rgb(188 204 72 / 0) 78%),
    radial-gradient(45% 55% at 30% 100%, #c566a9 0%, rgb(197 102 169 / 0) 70%);
  animation-duration: 14s; animation-delay: -5s;
}
@keyframes breathe {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6%, 5%) scale(1.14); }
}

.grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

.hero__inner {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(56px, 9vw, 110px);
}
.hero__logo { line-height: 0; }
.hero__logo .logo {
  width: clamp(220px, 34vw, 480px);
  opacity: 0; transform: translateY(18px);
  animation: rise 1.1s var(--ease) .15s forwards;
}
.hero__tag {
  text-align: right;
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
  font-weight: 500; line-height: 1.1; letter-spacing: -0.01em;
  text-shadow: 0 1px 24px rgb(0 0 0 / .12);
  opacity: 0; transform: translateY(18px);
  animation: rise 1.1s var(--ease) .45s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

.hero__scroll {
  position: absolute; left: var(--gutter); bottom: 22px;
  width: 22px; height: 38px; border: 1.5px solid rgb(255 255 255 / .7); border-radius: 999px;
  opacity: 0; animation: rise 1s var(--ease) 1.2s forwards;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 7px; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--hueso); border-radius: 2px;
  animation: nudge 1.6s var(--ease) infinite;
}
@keyframes nudge { 0%,100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(12px); opacity: .2; } }

/* ============================================================
   MANIFIESTO (rosa)
   ============================================================ */
.manifiesto {
  position: relative;
  background: var(--rosa);
  color: var(--oliva);
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(80px, 12vw, 150px);
}
.claim {
  position: absolute; top: clamp(28px, 4vw, 48px); right: var(--gutter);
  display: flex; align-items: flex-start; gap: 2px;
  color: var(--rojo);
  font-size: clamp(1.05rem, 1.7vw, 1.45rem); font-weight: 500; line-height: 0.95; letter-spacing: -0.01em;
}
.claim .logo--mark { width: 1.05em; height: 1.2em; background: var(--rojo); margin-top: -0.08em; }

.manifiesto__title {
  font-size: clamp(1.75rem, 4.6vw, 3.9rem);
  font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; text-transform: uppercase;
  max-width: 18ch;
}
.manifiesto__body {
  margin-top: clamp(28px, 4vw, 52px);
  font-size: clamp(1.45rem, 4vw, 3.4rem);
  font-weight: 350; line-height: 1.02; letter-spacing: -0.015em; text-transform: uppercase;
  font-stretch: 104%;
}
.manifiesto__body em { font-weight: 400; }

/* ============================================================
   CÓMO TRABAJAMOS (crema + foto)
   ============================================================ */
.como {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--crema); color: var(--tinta);
  min-height: 82vh;
}
.como__text { padding: clamp(64px, 9vw, 120px) var(--gutter); align-self: center; }
.como__title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 400; line-height: 1; letter-spacing: -0.02em; text-transform: uppercase;
}
.como__body { margin-top: clamp(24px, 3vw, 40px); max-width: 44ch; display: grid; gap: 1em; }
.como__body p { font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.35; }
.como__photo { position: relative; min-height: 420px; }
.como__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   SERVICIOS (lima)
   ============================================================ */
.servicios {
  background: var(--lima); color: var(--hueso);
  padding: clamp(120px, 20vw, 260px) var(--gutter) clamp(48px, 6vw, 72px);
}
.servicios__title {
  font-size: clamp(4rem, 15vw, 13rem);
  font-weight: 900; line-height: 0.85; letter-spacing: -0.045em;
  font-stretch: 100%;
  margin-left: -0.05em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px 6px; margin-top: 28px; }
.chips li {
  background: var(--rosa); color: var(--hueso);
  padding: 6px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.chips li:hover { transform: translateY(-2px) rotate(-1.5deg); background: var(--fucsia); }
.chips.in li { animation: chip .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes chip { from { opacity: 0; transform: translateY(10px); } }

/* ============================================================
   GALERÍA (crema) · grilla asimétrica
   ============================================================ */
.galeria {
  background: var(--crema);
  padding: clamp(48px, 7vw, 96px) var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(120px, 12vw, 180px);
  gap: clamp(12px, 2vw, 24px);
}
.galeria__item { position: relative; overflow: hidden; border-radius: 4px; background: oklch(94% 0.02 80); }
.galeria__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.galeria__item:hover img { transform: scale(1.04); }
.galeria__item figcaption {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--hueso); color: var(--tinta);
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.galeria__item--a { grid-column: 1 / 6;  grid-row: 1 / 4; }
.galeria__item--b { grid-column: 6 / 10; grid-row: 1 / 3; }
.galeria__item--c { grid-column: 10 / 13; grid-row: 1 / 3; }
.galeria__item--d { grid-column: 6 / 13; grid-row: 3 / 5; }

/* ============================================================
   CONTACTO (fucsia + foto)
   ============================================================ */
.contacto {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--fucsia); color: var(--tinta);
  min-height: 78vh;
}
.contacto__text {
  padding: clamp(56px, 8vw, 100px) var(--gutter);
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.contacto__title {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 400; line-height: 1; letter-spacing: -0.02em; text-transform: uppercase;
}
.contacto__links { display: grid; gap: 14px; }
.contacto__links a {
  display: inline-flex; align-items: center; gap: 14px;
  text-decoration: none;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem); font-weight: 500; letter-spacing: -0.01em;
}
.contacto__links svg {
  width: 44px; height: 44px; padding: 10px;
  border: 1.5px solid currentColor; border-radius: 50%;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.contacto__links a:hover svg { background: var(--tinta); color: var(--fucsia); transform: rotate(-8deg); }

.contacto__photo {
  position: relative; overflow: hidden; min-height: 460px;
  background: linear-gradient(160deg, #b7cf5a 0%, #4e6a2e 45%, #a63c8f 100%);
}
.contacto__photo img {
  position: absolute; left: 50%; top: 50%;
  width: min(72%, 460px); aspect-ratio: 4 / 5; object-fit: cover;
  transform: translate(-50%, -50%);
  border-radius: 6px; box-shadow: 0 30px 80px rgb(0 0 0 / .25);
}
.splash {
  position: absolute; left: -8%; bottom: -6%; width: 46%; z-index: 1;
  color: var(--lima);
  filter: drop-shadow(0 20px 30px rgb(0 0 0 / .2));
  animation: bob 7s ease-in-out infinite;
}
.splash svg { width: 100%; height: auto; fill: currentColor; }
@keyframes bob { 0%,100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-10px); } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px var(--gutter);
  background: var(--tinta); color: var(--hueso);
  font-size: 0.8rem;
}
.logo--footer { width: 26px; height: 30px; background: var(--rojo); }

/* ============================================================
   REVEAL al scrollear
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .1s; }
.reveal:nth-child(3) { transition-delay: .2s; }

/* ============================================================
   RESPONSIVE · tablet
   ============================================================ */
@media (max-width: 1024px) {
  .como, .contacto { grid-template-columns: 1fr; }
  .como__photo { min-height: 56vw; order: -1; }
  .contacto__photo { min-height: 78vw; }
  .contacto__text { gap: 36px; }
  .galeria { grid-auto-rows: clamp(100px, 14vw, 160px); }
}

/* ============================================================
   RESPONSIVE · celular
   ============================================================ */
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .nav__brand .logo { width: 52px; }
  .nav__toggle { display: block; }

  /* menú desplegable a pantalla completa */
  .nav__links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px;
    padding: var(--nav-h) var(--gutter) 40px;
    background: linear-gradient(160deg, var(--rosa-2) 0%, var(--rosa) 40%, var(--coral) 100%);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s .35s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav.is-open .nav__links .pill {
    font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; text-transform: none;
    padding: 12px 22px;
    opacity: 0; transform: translateY(12px);
    animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms);
  }

  .hero__inner { grid-template-columns: 1fr; gap: 24px; }
  .hero__logo .logo { width: min(62vw, 300px); }
  .hero__tag { text-align: left; }
  .hero__scroll { display: none; }

  .claim { position: static; margin-bottom: 40px; }
  .manifiesto { padding-top: 56px; }
  .manifiesto__body br { display: none; }  /* en celu el texto fluye solo */

  .servicios { padding-top: 96px; }
  .servicios__title { font-size: clamp(3.4rem, 19vw, 6rem); }

  .galeria { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 28vw; }
  .galeria__item--a { grid-column: 1 / 7; grid-row: 1 / 3; }
  .galeria__item--b { grid-column: 1 / 4; grid-row: 3 / 5; }
  .galeria__item--c { grid-column: 4 / 7; grid-row: 3 / 5; }
  .galeria__item--d { grid-column: 1 / 7; grid-row: 5 / 7; }

  .contacto__photo img { width: 68%; }
  .footer { flex-direction: column; text-align: center; }
}

/* ============================================================
   Accesibilidad · sin animaciones si el sistema lo pide
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__layer::before, .splash, .hero__scroll span { animation: none; }
  .hero__logo .logo, .hero__tag, .hero__scroll { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chips.in li { animation: none; }
}
