/* ===========================================================
   Capa editorial (inspirada en binarid.com)
   Solo AÑADE sobre el diseño existente: tipografía, aire,
   microinteracciones y filtros de proyectos.
   Nada de transiciones con comodín.
   =========================================================== */

:root {
  --tipo: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --tipo-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --ease: cubic-bezier(.22,.7,.2,1);
}

/* ---------- Tipografía editorial ---------- */
h1, h2, h3 { letter-spacing: -0.035em; }
h2 { line-height: 1.04; }

@media (min-width: 901px) {
  .hero h1 { font-size: clamp(3rem, 5.6vw, 4.4rem); line-height: 0.98; letter-spacing: -0.048em; }
  h2 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); }
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Más aire entre secciones ---------- */
@media (min-width: 901px) {
  section { padding-top: 136px; }
  .cabecera { margin-bottom: 56px; }
  .pf-grupo.segundo { margin-top: 88px; }
}

/* ---------- Microinteracciones ---------- */
.pf > .foto { overflow: hidden; }
.pf .foto img {
  transition: transform .8s var(--ease);
  will-change: transform;
}
.pf:hover .foto img { transform: scale(1.045); }
.pf > .foto { transition: transform .5s var(--ease), box-shadow .5s var(--ease); }

.btn-primary, .btn-secondary {
  transition: transform .4s var(--ease), background-color .3s ease,
              box-shadow .4s var(--ease), border-color .3s ease;
}

.pf-link { position: relative; text-decoration: none; }
.pf-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.pf-link:hover::after { transform: scaleX(1); transform-origin: left; }

.pf-chips span { transition: background-color .3s ease, color .3s ease; }
.pf:hover .pf-chips span { background: rgba(var(--tinte-rgb),0.07); }

/* ---------- Filtros de proyectos ---------- */
.pf-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 40px;
}
.pf-filtro {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texto-2);
  background: transparent;
  border: 1px solid var(--linea);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: color .3s ease, background-color .3s ease, border-color .3s ease;
}
.pf-filtro:hover { color: var(--titulo); border-color: rgba(var(--tinte-rgb),0.22); }
.pf-filtro[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
html.noche .pf-filtro[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); }

.pf-oculto { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .pf .foto img, .pf > .foto, .pf-link::after { transition: none; }
  .pf:hover .foto img { transform: none; }
}

/* ===========================================================
   CAPA 2 — más carácter: escala tipográfica, serif de acento,
   numeración de secciones, reveal por palabras, botones y fotos.
   =========================================================== */

/* ---------- Hero a escala editorial ---------- */
.hero h1 {
  font-size: clamp(2.3rem, 6.6vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 700;
}
@media (min-width: 901px) {
  .hero h1 { font-size: clamp(3.2rem, 5.9vw, 5.4rem); line-height: 0.94; }
}
.hero h1 .fino {
  font-family: var(--tipo-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--texto-2);
}
.hero-sub { max-width: 46ch; }

/* Acento serif también en los titulares de sección */
.cabecera h2 em,
.cabecera h2 .fino {
  font-family: var(--tipo-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* ---------- Hairline + número de sección ---------- */
.banda-blanca > section,
main > div > section { position: relative; }
.cabecera { position: relative; }
.sec-num {
  display: block;
  font-family: var(--tipo-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--texto-3);
  margin-bottom: 14px;
}
@media (min-width: 1100px) {
  .sec-num {
    position: absolute;
    top: 4px;
    left: -64px;
    margin: 0;
  }
}

.sec-linea {
  height: 1px;
  background: var(--linea-2);
  margin-bottom: 44px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
}
.sec-linea.vista { transform: scaleX(1); }

/* ---------- Reveal por palabras ---------- */
.pal { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.pal > i {
  display: inline-block;
  font-style: inherit;
  transform: translateY(105%);
  transition: transform .85s var(--ease);
}
.pal.vista > i { transform: translateY(0); }

/* ---------- Botones con relleno ascendente ---------- */
.btn-primary, .btn-secondary { position: relative; overflow: hidden; z-index: 0; }
.btn-primary::before, .btn-secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--azul);
  transform: translateY(101%);
  transition: transform .55s var(--ease);
}
.btn-secondary::before { background: var(--ink); }
.btn-primary:hover::before, .btn-secondary:hover::before { transform: translateY(0); }
.btn-secondary:hover { color: #fff; border-color: transparent; }
.btn-primary:hover, .btn-secondary:hover { transform: none; }

/* ---------- Fotos de proyecto con overlay y flecha ---------- */
.pf > .foto::after {
  content: "↗";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  pointer-events: none;
}
.pf:hover > .foto::after { opacity: 1; transform: translateY(0); }
.pf-cuerpo h3 { transition: color .3s ease; }
.pf:hover .pf-cuerpo h3 { color: var(--azul); }

@media (prefers-reduced-motion: reduce) {
  .pal > i { transform: none; transition: none; }
  .sec-linea { transform: scaleX(1); transition: none; }
  .btn-primary::before, .btn-secondary::before { transition: none; }
}

/* ---------- Corrección: el hero no puede solaparse con el encabezado ---------- */
@media (min-width: 901px) {
  .hero {
    align-items: flex-start;
    padding-top: calc(var(--alto-header, 74px) + 48px);
  }
  .hero h1 { font-size: clamp(3rem, 4.9vw, 4.5rem); }
}
/* Pantallas bajas: manda el tamaño reducido del diseño original */
@media (max-height: 740px) {
  .hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem) !important; line-height: 1 !important; }
  .hero { padding-top: calc(var(--alto-header, 74px) + 28px); }
}
@media (max-height: 700px) {
  .hero-tags { display: none; }
}
