@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600&display=swap');

/* ===== BASE ===== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background: #000;
  font-family: 'Work Sans', sans-serif;
}

/* ================= FILTERS ================= */

.portfolio-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 56px 0 72px;
}

.filter {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}

.filter:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
}

.filter.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

/* ===== GRID ===== */
.work-grid {
  max-width: 1700px;
  margin: 0 auto;
  padding: 8px 40px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* ===== CARD ===== */
.card {
  height: 520px;
  border-radius: 28px;
  position: relative;
  background: #000;
  perspective: 1200px;
  cursor: pointer;
  transform-style: preserve-3d;
  isolation: isolate;
  overflow: visible; /* FIX sombra cortada */
}

/* sombra premium desacoplada */
.card::after {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 36px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: -1;
}

@media (hover:hover) {
  .card:hover::after {
    opacity: 1;
  }
}

/* ===== FACES ===== */
.face {
  position: absolute;
  inset: 0;
  transition:
    opacity .35s ease,
    transform .6s cubic-bezier(.22,.61,.36,1); /* easing más fino */
  backface-visibility: hidden;
  will-change: transform, opacity;
  overflow: hidden;
  border-radius: 28px;
}

/* ===== FRONT ===== */
.front {
  z-index: 2;
}

.front video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.front-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.35) 45%,
    rgba(0,0,0,.1) 100%
  );
  transition: opacity .25s ease;
}

.front-content {
  position: absolute;
  bottom: 48px;
  left: 48px;
  max-width: 520px;
  color: #fff;
}

/* ===== BACK ===== */
.back {
  z-index: 1;
  opacity: 0;
  transform: rotateY(-12deg) scale(.98);
  pointer-events: none;
  display: grid;
  grid-template-columns: 65% 35%;
  background: #0B0D10;
}

/* ===== FLIP ===== */
.card.is-open .front {
  opacity: 0;
  transform: rotateY(12deg) scale(.96) translateX(-1%);
  pointer-events: none;
}

.card.is-open .front-overlay {
  opacity: 0; /* FIX overlay tardío */
}

.card.is-open .back {
  opacity: 1;
  transform: rotateY(0) scale(1);
  pointer-events: auto;
}

/* ===== BACK CONTENT ===== */
.back-text {
  padding: 48px;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.back-text .content {
  overflow-y: auto;
  margin: 16px 0;
}

.back-text h3 {
  font-size: 38px;
  margin: 0;
}

.back-text p {
  font-size: 13px;
  line-height: 1.7;
  color: #E6E7EB;
}

.back-image {
  background-size: cover;
  background-position: center;
}

.cta {
  margin-top: 48px;
}

.cta a {
  display: block;
  width: 100%;
  text-align: center;
  padding: 20px 0;

  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;

  color: #000;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #eaeaea 100%
  );

  border-radius: 14px;
  position: relative;
  overflow: hidden;

  transition: all .4s cubic-bezier(.22,.61,.36,1);
}
.cta a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.6) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  transition: left .6s ease;
}

.cta a:hover::before {
  left: 150%;
}
.cta a {
  background: #fff;
  font-size: 18px;
  letter-spacing: .06em;
  padding: 22px 0;
}
 

/* GALERÍA UNIFICADA */

#video-gallery {
  display: flex;
  gap: 18px;
  margin-top: 32px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.media-thumb {
  position: relative;
  min-width: 180px;
  height: 100px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .4s ease, box-shadow .4s ease;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
}

.media-thumb.active {
  box-shadow: 0 0 0 2px #fff;
}

.media-type {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 10px;
  letter-spacing: .12em;
  background: rgba(0,0,0,.6);
  padding: 4px 8px;
  border-radius: 999px;
}
.video-slider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  transition: all .25s ease;
}

.video-nav:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-50%) scale(1.08);
}

.video-nav.prev {
  left: -80px;
}

.video-nav.next {
  right: -80px;
}
.video-wrapper iframe {
  transition: opacity .25s ease;
}
.video-indicator {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: .2em;
  color: rgba(255,255,255,.6);
}


/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.25);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.45);
}

/* ===== MOBILE ===== */
@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: 1fr;
    padding: 20px 12px 60px;
    gap: 16px;
  }

  .face {
    border-radius: 22px;
  }

  .front-content {
    bottom: 28px;
    left: 20px;
    right: 20px;
  }

  .front-content h2 {
    font-size: 26px;
  }

  .front-content p {
    font-size: 14px;
  }

  .back {
    display: block;
  }

  .back-image {
    display: none;
  }

  .back-text {
    padding: 18px;
  }

  .back-text h3 {
    font-size: 22px;
  }

  .back-text p {
    font-size: 13px;
  }
}

/* ===== LOGOS MOBILE ===== */
.project-logo {
  display: none;
}

@media (max-width: 900px) {
  .project-title {
    display: flex;
    align-items: center;
  }

  .project-title .title-text {
    display: none;
  }

  .project-logo {
    display: block;
    height: 85px;
    width: auto;
    object-fit: contain;
  }
}

/* ================= FORCE FULL WIDTH PORTFOLIO ================= */

/* Rompe el contenedor del theme */
.page-template-page-portfolio .wp-site-blocks,
.page-template-page-portfolio .wp-block-group,
.page-template-page-portfolio main,
.page-template-page-portfolio .wp-block-post-content {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Asegura fondo negro full */
.page-template-page-portfolio body,
.page-template-page-portfolio main {
  background: #000;
}

/* Agranda el grid */
.page-template-page-portfolio .work-grid {
  max-width: 1800px; /* antes 1400 */
  padding: 32px 64px;
}

/* Cards más grandes */
.page-template-page-portfolio .card {
  height: 600px;
}

/* Filtros con más aire */
.page-template-page-portfolio .portfolio-filters {
  margin-top: 40px;
  margin-bottom: 40px;
}
/* ===== PORTFOLIO HEADER ===== */

.portfolio-header {
  width: 100%;
  background: #000;
  padding: 120px 64px 64px;
}

.portfolio-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: start;
  gap: 64px;
}

.portfolio-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(64px, 9vw, 140px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0;
}

.portfolio-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  max-width: 520px;
  margin-top: 100px;
}

.portfolio-subtitle strong {
  color: #fff;
  font-weight: 600;
}

/* ===== MOBILE ===== */
@media (max-width: 900px) {

  .portfolio-header {
    padding: 96px 20px 48px;
  }

  .portfolio-header-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .portfolio-title {
    font-size: clamp(48px, 14vw, 72px);
  }

  .portfolio-subtitle {
    font-size: 16px;
  }
}
/* ===== FIX TITULOS FRONT CARDS ===== */

.front-content h2 {
  font-family: 'Work Sans', sans-serif !important;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.2;
  color: #ffffff !important;

  opacity: 1 !important;
  mix-blend-mode: normal !important;
  text-shadow: 0 6px 20px rgba(0,0,0,0.45);
}

/* MOBILE */
@media (max-width: 900px) {
  .front-content h2 {
    font-size: 26px;
  }
}
/* ===== FIX TITULO BACK (DETALLE PROYECTO) ===== */

.back-text h3,
.back-text .project-title,
.back-text .project-title .title-text {
  font-family: 'Work Sans', sans-serif !important;
  font-weight: 700;
  font-size: 41px;
  line-height: 1.15;
  color: #ffffff !important;

  opacity: 1 !important;
  mix-blend-mode: normal !important;
  text-shadow: none;
}
/* ================= HOVER EFFECT CARDS ================= */

/* transición base */
.card {
  transition: transform 0.45s cubic-bezier(.4,0,.2,1),
              box-shadow 0.45s cubic-bezier(.4,0,.2,1);
}


  /* zoom interno del video */
  .card:hover .front video {
    transform: scale(1.08);
  }

  /* refuerzo del overlay */
  .card:hover .front-overlay {
    background: linear-gradient(
      to top,
      rgba(0,0,0,.9) 0%,
      rgba(0,0,0,.45) 45%,
      rgba(0,0,0,.15) 100%
    );
  }

  /* micro animación del texto */
  .card:hover .front-content {
    transform: translateY(-6px);
  }

/* transiciones internas */
.front video {
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
}

.front-content {
  transition: transform 0.4s ease;
}


/* ======================================================
   PORTFOLIO – BACK CARD (SCROLL PREMIUM)
   ====================================================== */

.back-text {
  padding: 48px 56px 48px 48px; /* 🔧 más espacio a la derecha */
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ----- TÍTULO ----- */
.back-text h3 {
  font-size: 34px;              /* 🔧 más grande */
  line-height: 1.15;
  margin: 0 0 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ----- TEXTO BASE ----- */
.back-text p {
  font-size: 15px;              /* 🔧 más legible */
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
  margin: 0;
}

/* labels */
.back-text p strong {
  font-weight: 600;
  color: #ffffff;
}

/* separación entre líneas */
.back-text p + p {
  margin-top: 10px;
}

/* ----- CONTENIDO SCROLLEABLE ----- */
.back-text .content {
  margin-top: 4px;
  padding-right: 16px;          /* 🔧 separa texto del scroll */
  overflow-y: auto;
  max-height: 280px;            /* 🔧 controla alto del bloque */
}

/* ======================================================
   SCROLLBAR PREMIUM
   ====================================================== */

.back-text .content::-webkit-scrollbar {
  width: 6px;
}

.back-text .content::-webkit-scrollbar-track {
  background: transparent;
}

.back-text .content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
}

.back-text .content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.45);
}

/* Firefox */
.back-text .content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}

/* ----- FADE SUTIL ARRIBA Y ABAJO ----- */
.back-text .content::before,
.back-text .content::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  height: 24px;
  pointer-events: none;
  z-index: 2;
}

.back-text .content::before {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(11,13,16,1),
    rgba(11,13,16,0)
  );
}

.back-text .content::after {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(11,13,16,1),
    rgba(11,13,16,0)
  );
}

/* ----- CTA ABAJO ----- */
.back-text .cta {
  margin-top: auto;
  padding-top: 28px;
}

/* ----- BOTÓN ----- */
.back-text .cta a {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}

.back-text .cta a:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

/* ======================================================
   FIN – SCROLL LIMPIO Y TEXTO PREMIUM
   ====================================================== */


@keyframes pulseLogo {
  0%   { opacity: 0.5; transform: scale(0.98); }
  50%  { opacity: 1;   transform: scale(1); }
  100% { opacity: 0.5; transform: scale(0.98); }
}
/* ================= SAFE PORTFOLIO LOADER ================= */

#portfolio-loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: all;
}

#portfolio-loader img {
  width: 160px;
  opacity: 0.85;
  animation: loaderPulse 1.4s ease-in-out infinite;
}

/* animación limpia, sin transforms raros */
@keyframes loaderPulse {
  0%   { opacity: 0.4; }
  50%  { opacity: 1; }
  100% { opacity: 0.4; }
}
/* =========================================
   OVERLAY CINEMATIC FIXED
========================================= */
/* ===== VIDEO TITLE EXACT MATCH ===== */

#video-title {
  font-family: 'Work Sans', sans-serif !important;
  font-weight: 700;
  font-size: 41px;
  line-height: 47px;
  letter-spacing: 0;
  color: #ffffff;
  margin: 0 0 18px;
}

#video-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;
  

  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}

#video-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== MAIN LAYOUT ===== */

.video-overlay-inner {
  width: 90%;
  max-width: 1500px;
  height: 85vh;

  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;

  align-items: center;
}

/* ===== VIDEO SIDE ===== */

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 70vh;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== NAV BUTTONS (no más afuera) ===== */

.video-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
}

.video-nav.prev { left: -24px; }
.video-nav.next { right: -24px; }

.video-nav:hover {
  background: rgba(255,255,255,.15);
}

/* ===== META SIDE ===== */

.video-meta {
  max-width: 480px;
  color: #fff;
}

#video-type {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 18px;
  display: inline-block;
}

#video-title {
  font-size: clamp(30px, 2.6vw, 52px);
  line-height: 1.1;
  margin: 0 0 20px;
}

#video-description {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,.85);
}

/* ===== CLOSE ===== */

.video-close {
  position: fixed;
  top: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* =========================================
   FIX OVERLAY MOBILE – SPACING DOTS
   ========================================= */

@media (max-width: 768px) {

  /* Más aire entre video y texto */
  .video-overlay-inner {
    gap: 50px;
  }

  /* Separar los dots del contenido */
  #video-dots {
    margin-top: 80px;
    margin-bottom: -1px;
  }

  /* Un poco más de aire arriba del meta */
  .video-meta {
    margin-top: 50px;
  }

}


/* =========================================
   LAPTOP FIX (important)
========================================= */

@media (max-width: 1300px) {

  .video-overlay-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    height: auto;
  }

  .video-wrapper {
    max-height: none;
  }

  .video-meta {
    max-width: 800px;
  }

  .video-nav.prev { left: 10px; }
  .video-nav.next { right: 10px; }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {

  .video-overlay-inner {
    width: 92%;
    gap: 30px;
  }

  #video-title {
    font-size: 24px;
  }

  #video-description {
    font-size: 14px;
  }
}
.video-wrapper {
  position: relative;
}

.video-dots {
  position: absolute;
  bottom: -36px;          /* separación del video */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.video-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all .25s ease;
}

.video-dot.active {
  background: #fff;
  transform: scale(1.3);
}


/* ===== FORCE INTER FONT (OVERRIDE TOTAL) ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#video-overlay,
#video-overlay * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Helvetica, Arial, sans-serif !important;
}
/* ===== FRONT CARD CTA ===== */

.hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition:
    background .25s ease,
    transform .25s ease,
    opacity .25s ease;
}

.hint-icon {
  font-size: 16px;
  opacity: .9;
}

.hint-text {
  white-space: nowrap;
}

@media (hover:hover) {
  .card:hover .hint {
    background: rgba(255,255,255,0.85);
    color: #000;
    transform: translateY(-2px);
  }
}
@media (hover:hover) {
  .card:hover .front-overlay {
    background: linear-gradient(
      to top,
      rgba(0,0,0,.9) 0%,
      rgba(0,0,0,.5) 50%,
      rgba(0,0,0,.2) 100%
    );
  }
}
/* ===== STAGGER MICRO – FILTER TRANSITION ===== */

.card {
  transition:
    opacity 0.35s cubic-bezier(.4,0,.2,1),
    transform 0.35s cubic-bezier(.4,0,.2,1);
}

.card.is-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
/* =========================================
   RESPONSIVE FINAL - PORTFOLIO
   (Pegar al final del archivo CSS)
   ========================================= */

/* --- TABLET Y LAPTOPS PEQUEÑAS (Max 1200px) --- */
@media (max-width: 1200px) {
  
  /* Ajustar los márgenes forzados del template */
  .page-template-page-portfolio .work-grid {
    padding: 30px 40px;
    max-width: 100%;
  }

  .portfolio-header {
    padding: 100px 40px 40px;
  }

  /* Reducir altura de cards en tablet para que quepan mejor */
  .page-template-page-portfolio .card {
    height: 500px;
  }
}


/* ===============================
   REACH – DESKTOP MEDIO
   =============================== */
@media (max-width: 1500px) {

  .reach-split {
    padding: 0 4vw;
    gap: 48px;
  }

  .reach-left {
    max-width: 480px;
  }

  .reach-left h2 {
    font-size: clamp(42px, 4.8vw, 64px);
  }

  .reach-left p {
    font-size: 17px;
  }

  .reach-cards {
    width: 760px;
    height: 520px;
  }

  .reach-card.large {
    width: 620px;
    height: 380px;
  }

  .reach-card.small {
    width: 480px;
    height: 300px;
    right: -120px;
  }
}

/* ===============================
   REACH – TABLET
   =============================== */
@media (max-width: 1200px) {

  .reach-split {
    grid-template-columns: 1fr;
    height: auto;
    padding: 120px 6vw 140px;
    gap: 64px;
  }

  .reach-left {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
  }

  .reach-left h2 {
    font-size: clamp(44px, 6vw, 64px);
  }

  .reach-left p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
  }

  .reach-cta {
    margin: 0 auto;
  }

  .reach-cards {
    width: 100%;
    max-width: 820px;
    height: auto;
    transform: none;
    margin: 0 auto;
  }

  .reach-card.large {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .reach-card.small {
    display: none;
  }
}

/* ===============================
   SERVICES – TABLET
   =============================== */
@media (max-width: 1200px) {

  .services-list {
    max-width: 100%;
  }

  .service-item {
    justify-content: center;
  }

  .service-inner {
    margin: 0 auto;
    text-align: center;
  }

  .service-title {
    justify-content: center;
    transform: none !important;
  }
}

/* ===============================
   PORTFOLIO – SOLO MOBILE
   =============================== */
@media (max-width: 768px) {

  .portfolio-header {
    padding-top: 200px;   /* aire bajo el nav */
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 48px;
  }

  .portfolio-title {
    font-size: 64px;
    line-height: 1;
    text-align: center;
    margin-bottom: 24px;
  }

  .portfolio-subtitle {
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
  }
}
/* ===============================
   PORTFOLIO – MOBILE BALANCED FIX
   =============================== */
@media (max-width: 900px) {

  .card {
    height: auto !important;
  }

  /* FRONT mantiene altura visual */
  .face.front {
    position: relative !important;
    height: 480px;   /* ← altura visual fuerte */
    overflow: hidden;
  }

  .face.front video {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  /* BACK fluido */
  .face.back {
    position: relative !important;
    display: none;
  }

  .card.is-open .face.front {
    display: none;
  }

  .card.is-open .face.back {
    display: block;
  }

  /* Scroll solo en texto del back */
  .back-text .content {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

}
/* ===============================
   MOBILE – MÁS AIRE ENTRE CARDS
   =============================== */
@media (max-width: 900px) {

  .work-grid {
    gap: 28px !important;   /* antes estaba más apretado */
  }

}


/* =========================================
   MOBILE SCROLL SAFETY (HORIZONTAL ONLY)
   ========================================= */
@media (max-width: 900px) {

  html,
  body {
    overflow-x: hidden;
  }

  .work-grid,
  .card {
    max-width: 100%;
  }

  body {
    overscroll-behavior-x: none;
  }

}


/* =====================================
   PORTFOLIO FILTERS – VISUAL BOOST
   SOLO DESKTOP
   ===================================== */
@media (min-width: 901px) {

  .portfolio-filters {
    gap: 18px;                 /* más aire entre pills */
    margin: 72px 0 88px;       /* separa mejor del contenido */
  }

  .portfolio-filters .filter {
    font-size: 18px;           /* antes ~14–15 */
    padding: 14px 30px;        /* pills más grandes */
    border-width: 1.5px;
    letter-spacing: 0.02em;
    opacity: 0.9;
    transition:
      background .25s ease,
      color .25s ease,
      border-color .25s ease,
      transform .2s ease,
      box-shadow .2s ease;
  }

  /* Hover más notorio */
  .portfolio-filters .filter:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    opacity: 1;
  }

  /* Activo más protagonista */
  .portfolio-filters .filter.active {
    font-size: 19px;           /* micro jerarquía */
    padding: 15px 34px;
    font-weight: 600;
    box-shadow:
      0 10px 30px rgba(255,255,255,0.15),
      inset 0 0 0 1px rgba(255,255,255,0.9);
  }
}
/* =====================================
   HEADER NAV – DESKTOP TUNING
   ===================================== */
@media (min-width: 901px) {

  .nav {
    gap: 28px; /* antes ~40 → más compacto */
  }

  .nav a {
    font-size: 14px;          /* antes ~12 */
    letter-spacing: 0.18em;  /* un poco más cerrado */
    font-weight: 500;
  }

  /* underline más visible */
  .nav a::after {
    height: 2px;
    bottom: -5px;
  }
}
/* ===============================
   PORTFOLIO – MOBILE SOFT FIX
   =============================== */
@media (max-width: 768px) {

  /* Menos aire arriba */
  .portfolio-header {
    padding-top: 170px !important;
    padding-bottom: 40px !important;
  }

  .portfolio-title {
    font-size: 69px !important;
    line-height: 1.05 !important;
    margin-bottom: 10px !important;
  }

  .portfolio-subtitle {
    margin-top: 1px !important;
    font-size: 16px !important;
     margin-bottom: -25px !important;
  }

  /* Filtros: que respiren y no se pisen */
  .portfolio-filters {
    gap: 1px !important;
    margin: 32px 16px 32px !important;
    gap: 5px !important;   /* antes estaba más apretado */
  }

  .portfolio-filters .filter {
    font-size: 15px !important;
    padding: 8px 20px !important;
  }

  /* Menos aire antes del grid */
  .work-grid {
    padding-top: 22px !important;
   
    
  }
  
}
/* ===============================
   FIX – MONITORES BAJOS (ALTURA)
   =============================== */
@media (max-height: 1220px) {

  .portfolio-header {
    padding-top: 180px !important;
  }

}
/* =========================================
   PORTFOLIO HEADER – FIX ≤900px (LIMPIO)
   ========================================= */
@media (max-width: 900px) {

  .portfolio-header {
    padding-top: 140px;
    padding-bottom: 40px;
  }

  .portfolio-header .portfolio-title {
    font-size: 120px;
    line-height: 1.05;
    margin-bottom: 20px;
  }

  .portfolio-header .portfolio-subtitle {
    margin-top: 0; /* elimina el gap grande */
    font-size: 16px;
  }

}
/* =========================================
   PORTFOLIO FILTERS – MOBILE SIZE BOOST
   ========================================= */
@media (max-width: 900px) {

  .portfolio-filters {
    gap: 12px;
    margin: 28px 20px 40px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .portfolio-filters .filter {
    font-size: 16px;
    padding: 10px 22px;
    border-width: 1.5px;
  }

  .portfolio-filters .filter.active {
    font-size: 17px;
  }

}
/* =========================================
   PORTFOLIO HEADER – MID SCREENS FIX
   (900px – 1100px)
   ========================================= */
@media (min-width: 900px) and (max-width: 1100px) {

  .portfolio-header-inner {
    grid-template-columns: 1fr 1fr;
    align-items: center; /* centra verticalmente ambos bloques */
    gap: 40px;
  }

  .portfolio-title {
    font-size: clamp(72px, 8vw, 110px);
    line-height: 0.95;
  }

  .portfolio-subtitle {
    margin-top: 0; /* elimina el empuje artificial */
  }

}
/* =====================================================
   PREMIUM LOADER
   ===================================================== */

#portfolio-loader{

    position:fixed;
    inset:0;

    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;

    background:#050505;

    z-index:999999;

    transition:opacity .7s ease;

}

#portfolio-loader.hide{

    opacity:0;
    pointer-events:none;

}

.loader-logo{

    width:180px;
    margin-bottom:42px;

    opacity:0;

    animation:logoFade 1s ease forwards;

}

@keyframes logoFade{

    from{

        opacity:0;
        transform:translateY(8px);

    }

    to{

        opacity:1;
        transform:translateY(0);

    }

}

.loader-progress{

    position:relative;

    width:220px;
    height:2px;

    overflow:hidden;

    border-radius:999px;

    background:rgba(255,255,255,.08);

}

.loader-progress-bar{

    position:absolute;

    inset:0 auto 0 0;

    width:0%;

    background:#fff;

    overflow:hidden;

    transition:width .18s linear;

}

.loader-progress-bar::after{

    content:"";

    position:absolute;

    top:-5px;
    bottom:-5px;

    width:60px;

    left:-60px;

    background:linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.95),
        transparent
    );

    filter:blur(6px);

    animation:loaderShine 1.1s linear infinite;

}

@keyframes loaderShine{

    to{

        left:280px;

    }

}
@media (max-width:768px){

  .portfolio-header{
      padding-top:140px !important;
  }

}

/* ==========================================
   MOBILE HEADER FINAL
   ========================================== */

@media (max-width:768px){

  .site-header{
    padding:14px 22px 12px !important;
  }

  .header-inner{
    align-items:center;
  }

  .logo img{
    height:34px !important;
  }

  .nav{
    gap:22px !important;
  }

  .nav a{
    font-size:11px !important;
    letter-spacing:.18em;
  }

  .nav a::after{
    bottom:-4px;
  }

}