/* =========================================================
   Porfe Producciones — v2
   Paleta oficial (3.2 Paleta de Colores – Producciones)
   ========================================================= */
:root {
  --azul-noche: #081122;
  --azul-medio: #122859;
  --celeste:    #5679D3;
  --cian:       #009FE3;
  --gris-tenue: #E6ECF8;
  --blanco:     #ffffff;

  /* DM Sans variable: pesos 100–1000, cursiva y tamaño óptico (opsz 9–40) */
  --font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --radius-panel: clamp(36px, 7vw, 96px);
  --radius-pill: 999px;
  --line: 3px solid var(--azul-noche);
  --ring: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--azul-noche);
  color: var(--blanco);
  font-family: var(--font);
  font-weight: 400;
  font-optical-sizing: auto; /* DM Sans variable: ajusta el eje opsz según el tamaño */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Slots de imagen (muestran un reemplazo hasta que cargues el archivo) ---------- */
.slot img { width: 100%; height: 100%; object-fit: contain; }
.slot:not(.is-empty) [class*="fallback"] { display: none; }
.slot.is-empty img { display: none; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px var(--gutter);
}
.logo { height: 32px; display: flex; align-items: center; }
.logo img { width: auto; }
.logo__fallback { font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.nav { display: flex; gap: 28px; font-size: 13px; letter-spacing: .04em; }
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .35s ease;
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Menú hamburguesa flotante ---------- */
.menu-btn {
  position: fixed;
  top: 16px;
  right: var(--gutter);
  z-index: 100;
  width: 60px; height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--azul-medio);
  box-shadow: var(--ring), 0 8px 24px rgba(8, 17, 34, .35);
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 7px;
  transform: scale(0);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .3s ease;
}
.menu-btn span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--blanco);
  transition: transform .35s ease;
}
.menu-btn:hover { background: var(--celeste); }
/* En desktop aparece al bajar; en celular siempre (ver Responsive) */
body.is-scrolled .menu-btn,
body.menu-open .menu-btn { transform: scale(1); }
body.menu-open .menu-btn { background: var(--celeste); }
body.menu-open .menu-btn span:first-child { transform: translateY(4.25px) rotate(45deg); }
body.menu-open .menu-btn span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 17, 34, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s;
}
.menu__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(100%, 480px);
  padding: 110px clamp(28px, 5vw, 64px) 40px;
  background: var(--azul-medio);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .6s cubic-bezier(.7, 0, .2, 1);
  overflow-y: auto;
}
body.menu-open { overflow: hidden; }
body.menu-open .menu { opacity: 1; visibility: visible; }
body.menu-open .menu__panel { transform: translateX(0); }

.menu__label {
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(230, 236, 248, .2);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(230, 236, 248, .6);
}
.menu__nav { display: flex; flex-direction: column; gap: 6px; }
.menu__nav a {
  position: relative;
  font-size: clamp(40px, 10vw, 64px);
  line-height: 1.15;
  letter-spacing: -.03em;
  transition: color .3s ease, padding-left .3s ease;
}
.menu__nav a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--cian);
  transform: scale(0);
  transition: transform .3s ease;
}
.menu__nav a:hover { padding-left: 28px; color: var(--gris-tenue); }
.menu__nav a:hover::before { transform: scale(1); }
.menu__bottom { margin-top: auto; padding-top: 48px; }
.menu__links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; }
.menu__links a:hover { color: var(--cian); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(32px, 8vw, 110px); }

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 12px 12px 12px var(--gutter);
  background: var(--blanco);
  color: var(--azul-noche);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
}
.location-pill__globe {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--azul-noche);
  color: var(--blanco);
  border-radius: 50%;
}
.location-pill__globe svg { width: 28px; height: 28px; }

.marquee {
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px) 0 clamp(16px, 2vw, 28px);
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  animation: marquee 22s linear infinite;
  font-size: clamp(44px, 9vw, 150px);
  line-height: 1.1;
  letter-spacing: -.02em;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Panel claro ---------- */
.panel {
  position: relative;
  background: var(--gris-tenue);
  color: var(--azul-medio);
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
  padding: clamp(36px, 6vw, 80px) var(--gutter) clamp(64px, 10vw, 140px);
}

.about-section { margin-bottom: clamp(48px, 8vw, 110px); }
.about__heading {
  margin: 0 0 clamp(24px, 3vw, 40px);
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--azul-noche);
}
.about {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(32px, 6vw, 110px);
}
.about p {
  margin: 0 0 1.2em;
  font-size: clamp(17px, 1.45vw, 21px);
  font-weight: 400;
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}
.about strong { font-weight: 700; color: var(--azul-noche); }
.about__col--right { display: flex; flex-direction: column; }

.isotipo {
  width: 84px; height: 84px;
  margin-top: 16px;
  align-self: center;
  border-radius: 50%;
  display: grid; place-items: center;
  overflow: hidden;
}
.isotipo { background: var(--azul-medio); }
.isotipo img { width: 50%; height: 50%; transform: translateX(6%); } /* P más chica y centrada dentro del círculo */
.isotipo__fallback { color: var(--blanco); font-weight: 800; font-size: 34px; }

/* ---------- Lista de trabajos ---------- */
.works { position: relative; }
.works__list { list-style: none; margin: 0; padding: 0; border-top: var(--line); }

.work { border-bottom: var(--line); }
.work__link {
  display: block;
  padding: clamp(10px, 1.4vw, 18px) 4px;
}
.work__title {
  display: block;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--azul-medio);
  transition: font-size .5s cubic-bezier(.2, .8, .2, 1);
}
.work__title sup { font-size: .45em; vertical-align: super; line-height: 0; }
.work__sub {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--celeste);
  font-size: clamp(16px, 1.8vw, 26px);
  transition: max-height .5s ease, opacity .4s ease;
}

/* Fila activa (hover en desktop / toque en celular) */
.work.is-active .work__title { font-size: clamp(40px, 7vw, 110px); }
.work.is-active .work__sub { max-height: 2em; opacity: 1; }
.works__list.has-active .work:not(.is-active) .work__title {
  font-size: clamp(18px, 1.8vw, 24px);
}

/* Imagen flotante (solo desktop) */
.work-preview {
  position: absolute;
  top: 0; left: 0;
  width: clamp(200px, 22vw, 340px);
  aspect-ratio: 4 / 5;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 5;
}
.work-preview.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.work-preview__img { width: 100%; height: 100%; object-fit: contain; }
.work-preview__empty,
.work__inline-empty {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 2px dashed var(--celeste);
  border-radius: 10px;
  background: rgba(86, 121, 211, .12);
  color: var(--azul-medio);
  font-size: 13px;
  place-items: center;
  text-align: center;
  padding: 16px;
}
.work-preview.is-empty .work-preview__img { display: none; }
.work-preview.is-empty .work-preview__empty { display: grid; }

/* Fila sin imagen: muestra un texto (ej. "Muy pronto") */
.work-preview__text {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: 18px 30px;
  border-radius: var(--radius-pill);
  background: var(--celeste);
  color: var(--blanco);
  font-size: clamp(18px, 1.8vw, 26px);
  white-space: nowrap;
}
.work-preview.is-text .work-preview__img,
.work-preview.is-text .work-preview__empty { display: none; }
.work-preview.is-text .work-preview__text { display: block; }

/* Imagen dentro de la fila (celular / tablet táctil) */
.work__inline { display: none; margin-top: 14px; width: min(70%, 280px); }
.work__inline.is-empty img { display: none; }
.work__inline.is-empty .work__inline-empty { display: grid; }
.work__inline-text {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--celeste);
  color: var(--blanco);
  font-size: 18px;
}

/* ---------- Footer ---------- */
.footer {
  padding: clamp(72px, 10vw, 140px) var(--gutter) 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.footer__title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.04;
  letter-spacing: -.02em;
}
/* Círculo con la P: mide lo mismo que la altura de las mayúsculas ("V") y apoya en la línea base */
.footer__iso {
  position: relative;
  display: inline-block;
  width: .72em; height: .72em;
  margin-right: .12em;
  vertical-align: baseline;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blanco);
}
.footer__iso img,
.footer__iso-fallback {
  position: absolute;
  inset: 0;
  margin: auto;
}
.footer__iso img { width: 52%; height: 52%; transform: translateX(6%); }
.footer__iso-fallback {
  display: grid; place-items: center;
  color: var(--azul-noche); font-size: .62em; font-weight: 800; line-height: 1;
}

.footer__line {
  position: relative;
  height: 1px;
  margin: clamp(70px, 7vw, 90px) 0 clamp(80px, 8vw, 100px);
}
.footer__line::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .35);
  transform-origin: left;
  transition: transform 1.4s cubic-bezier(.7, 0, .2, 1);
}
.footer__cta {
  position: absolute;
  right: clamp(0px, 12vw, 180px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(110px, 12vw, 170px);
  aspect-ratio: 1;
  display: grid; place-items: center;
  background: var(--celeste);
  border-radius: 50%;
  font-size: 15px;
  transition: background .3s ease, transform .3s ease;
}
.footer__cta:hover { background: var(--cian); transform: translateY(-50%) scale(1.06); }

.footer__pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: var(--radius-pill);
  box-shadow: var(--ring);
  font-size: 14px;
  transition: background .3s ease;
}
.pill svg { width: 18px; height: 18px; flex: none; }
.pill:hover { background: var(--azul-medio); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(56px, 8vw, 110px);
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  color: rgba(230, 236, 248, .6);
}
.footer__left { display: flex; flex-direction: column; gap: 10px; }
.footer__socials { display: flex; gap: 24px; font-size: 14px; color: var(--gris-tenue); }
.footer__socials a:hover { color: var(--blanco); }

/* Crédito Santa Métrica */
.credit { display: flex; align-items: center; gap: 16px; align-self: flex-end; }
.credit__name {
  font-family: "Helvetica Rounded", "Arial Rounded MT Bold", "Nunito", sans-serif;
  font-weight: 800;
  color: var(--blanco);
  letter-spacing: .01em;
}
.credit__icons { display: flex; gap: 12px; }
.credit__icons a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  box-shadow: var(--ring);
  transition: background .3s ease, color .3s ease;
}
.credit__icons a:hover { background: var(--celeste); color: var(--blanco); }
.credit__icons svg { width: 16px; height: 16px; }

/* =========================================================
   Responsive
   ========================================================= */

/* Tablet */
@media (max-width: 1024px) {
  .about { gap: 48px; }
}

/* Dispositivos táctiles: no hay imagen flotante */
@media (hover: none) {
  .work-preview { display: none; }
  .work.is-active .work__inline { display: block; }
}

/* Celular */
@media (max-width: 760px) {
  .site-header { padding-top: 16px; padding-bottom: 16px; min-height: 88px; }
  .nav { display: none; }              /* en celular se navega con el menú flotante */
  .menu-btn { transform: scale(1); width: 56px; height: 56px; }

  .location-pill { font-size: 12px; gap: 14px; padding: 10px 10px 10px var(--gutter); }
  .location-pill__globe { width: 40px; height: 40px; }
  .location-pill__globe svg { width: 24px; height: 24px; }

  .about { grid-template-columns: 1fr; gap: 8px; }
  .about p { text-align: left; }
  .isotipo { width: 60px; height: 60px; margin-top: 8px; }

  .work-preview { display: none; }
  .work.is-active .work__inline { display: block; }
  .work.is-active .work__title { font-size: clamp(36px, 11vw, 56px); }

  /* Título y subtítulo en la misma línea; la imagen va abajo */
  .work__link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    align-items: last baseline;
    column-gap: 10px;
  }
  .work__title { flex: 0 1 auto; }
  .work__sub { flex: none; font-size: 16px; }
  .work__inline { flex-basis: 100%; }

  .footer__cta { right: 0; font-size: 14px; }
  .footer__pills { flex-direction: column; }
  .pill { justify-content: center; padding: 14px 20px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 24px; }
  .credit { align-self: flex-start; }
}

/* Celulares chicos */
@media (max-width: 380px) {
  .nav { gap: 12px; font-size: 11px; }
  .logo__fallback { font-size: 17px; }
  .pill { font-size: 13px; }
}

/* =========================================================
   Animaciones (solo con html.js-anim, que se activa en el <head>)
   ========================================================= */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-inout: cubic-bezier(.76, 0, .24, 1); }

/* ---------- Pantalla de carga: palabras + telón que sube con borde curvo ---------- */
.loader { display: none; }
html.js-anim .loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--azul-noche);
  transition: transform 1s var(--ease-inout);
}
html.js-anim .loader::after {
  content: "";
  position: absolute;
  left: -10%; right: -10%;
  top: 99%;
  height: 16vh;
  background: var(--azul-noche);
  border-radius: 0 0 50% 50%;
  transition: height 1s var(--ease-inout);
}
html.is-loaded .loader { transform: translateY(calc(-100% - 17vh)); }
html.is-loaded .loader::after { height: 0; }
html.js-anim .loader.is-gone { display: none; }
html.js-anim:not(.is-loaded) body { overflow: hidden; }

.loader__word {
  display: flex;
  align-items: center;
  gap: .45em;
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -.02em;
  color: var(--blanco);
  animation: loader-in .8s var(--ease-out) both;
}
.loader__dot {
  width: .22em; height: .22em;
  border-radius: 50%;
  background: var(--cian);
}
@keyframes loader-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Entrada del hero (después del telón) ---------- */
html.js-anim [data-intro] {
  transition: opacity 1s ease var(--d, .2s), transform 1.2s var(--ease-out) var(--d, .2s);
}
html.js-anim [data-intro="down"] { --d: .35s; }
html.js-anim [data-intro="left"] { --d: .5s; }
html.js-anim [data-intro="up"]   { --d: .6s; }
html.js-anim:not(.is-loaded) [data-intro="down"] { opacity: 0; transform: translateY(-30px); }
html.js-anim:not(.is-loaded) [data-intro="left"] { opacity: 0; transform: translateX(-100%); }
html.js-anim:not(.is-loaded) [data-intro="up"]   { opacity: 0; transform: translateY(60%); }

/* ---------- Aparición al hacer scroll ---------- */
html.js-anim [data-reveal] {
  transition:
    opacity .9s ease var(--d, 0s),
    transform 1.1s var(--ease-out) var(--d, 0s),
    scale .8s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0s),
    background .3s ease;
}
html.js-anim [data-reveal]:not(.is-in)        { opacity: 0; transform: translateY(50px); }
html.js-anim [data-reveal="pop"]:not(.is-in)  { opacity: 1; transform: none; scale: 0; }
.footer__cta[data-reveal="pop"]:not(.is-in)   { transform: translateY(-50%) !important; }
html.js-anim [data-reveal="line"]:not(.is-in) { opacity: 1; transform: none; }
html.js-anim [data-reveal="line"]:not(.is-in)::before { transform: scaleX(0); }

/* Botones magnéticos: se mueven con `translate` para no pisar su transform */
.magnetic { transition: translate .5s var(--ease-out), transform .35s var(--ease-out), background .3s ease; }

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  * { transition: none !important; }
}
