/* =============================================================
   PURPURAL — Elevate the Experience
   style.css
   ============================================================= */

/* ---------- VARIABLES ---------- */
:root {
  --purple: #560DF1;
  --purple-light: #6934FE;
  --white: #FFFFFF;
  --gray: #CACAEA;
  --font-title: 'Zalando Sans Expanded', sans-serif;
  --font-body: 'Work Sans', sans-serif;
}

/* ---------- RESET ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--purple);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- LAYOUT ---------- */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

h1 {
  font-size: clamp(32px, 6.5vw, 64px);
  font-family: var(--font-title);
}

/* ---------- HEADER ---------- */
header {
  position: relative;
  z-index: 100;
  padding: 32px 0;
}
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: block;
  height: 26px;
  width: auto;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 32px;
}
.tagline {
  font-size: 14px;
  font-weight: 300;
}
.tagline strong { font-weight: 600; }

.menu-btn {
  width: 34px;
  height: 22px;
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
}
.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ---------- FULLSCREEN MENU ---------- */
.fullscreen-menu {
  position: fixed;
  inset: 0;
  background: var(--purple-light);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: circle(0% at calc(100% - 55px) 55px);
  transition: clip-path 0.65s cubic-bezier(.65, 0, .35, 1);
  pointer-events: none;
}
.fullscreen-menu.active {
  clip-path: circle(150% at calc(100% - 55px) 55px);
  pointer-events: all;
}
.fullscreen-menu-close {
  position: absolute;
  top: 36px;
  right: 48px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fullscreen-menu-close::before,
.fullscreen-menu-close::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}
.fullscreen-menu-close::before { transform: rotate(45deg); }
.fullscreen-menu-close::after  { transform: rotate(-45deg); }

.fullscreen-menu nav {
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
}
.fullscreen-menu nav a {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(38px, 7vw, 72px);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease, color 0.25s ease;
}
.fullscreen-menu.active nav a {
  opacity: 1;
  transform: translateY(0);
}
.fullscreen-menu.active nav a:nth-child(1) { transition-delay: 0.15s; }
.fullscreen-menu.active nav a:nth-child(2) { transition-delay: 0.25s; }
.fullscreen-menu.active nav a:nth-child(3) { transition-delay: 0.35s; }
.fullscreen-menu nav a:hover { color: var(--gray); }

/* ---------- VIDEO MODAL ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 90px 24px 40px;
  z-index: 300;
}
.video-modal.open { display: flex; }

.video-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 0, 71, 0.8);
}
.video-modal-close {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--white);
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 910px;
}
.video-modal-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: #0d0027;
  /* iOS Safari: crea contexto de apilamiento para que overflow:hidden
     funcione sobre el elemento <video> y no se salga del div */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  transform: translateZ(0);
}
.video-modal-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.video-modal-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 2;
}
.video-modal-play:hover {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(255, 255, 255, 0.25);
}
.video-modal-play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 20px solid var(--white);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 6px;
}
.video-modal-play.hidden { display: none; }

.video-modal-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spinner-rotate 0.75s linear infinite;
  display: none;
  pointer-events: none;
  z-index: 3;
}
.video-modal-spinner.visible { display: block; }
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

.video-modal-title {
  margin-top: 24px;
  color: var(--white);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 22px;
}

/* ---------- HERO ---------- */
.hero { padding: 40px 0 90px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 1.03;
  margin-bottom: 20px;
}
.hero h1 .light { color: var(--gray); }
.hero p {
  font-size: 16px;
  font-weight: 300;
  color: var(--gray);
  max-width: 420px;
  line-height: 1.5;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 40px;
  font-size: 22px;
  font-weight: 500;
  transition: transform 0.25s ease, background 0.25s ease;
}
.btn-primary { background: var(--white); color: var(--purple); }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--white);
}
.btn:hover { transform: translateY(-2px); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
img.mask-p {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  object-fit: contain;
}
/* iframe de Vimeo: no soporta object-fit; Vimeo con background=1 ya
   recorta tipo "cover" internamente. pointer-events:none cede el clic
   al botón de play que está encima. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.play-circle {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}
.play-circle:hover { transform: scale(1.06); background: rgba(255, 255, 255, 0.28); }
.play-circle::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 14px solid var(--white);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
  transition: opacity 0.2s ease;
}
/* Ícono de pausa: dos barras verticales */
.play-circle.is-playing::before {
  border-left: 0;
  width: 10px;
  height: 16px;
  border-top: none;
  border-bottom: none;
  margin-left: 0;
  background:
    linear-gradient(var(--white), var(--white)) 0 0 / 3px 16px no-repeat,
    linear-gradient(var(--white), var(--white)) 7px 0 / 3px 16px no-repeat;
}

/* ---------- SECTIONS ---------- */
.section { padding: 90px 0; }
.section-head { margin-bottom: 44px; }
.section-head h2 { font-family: var(--font-title); font-weight: 700; }
.section-head h1 { font-family: var(--font-title); font-weight: 700; }
.section-head h1 .accent { color: var(--gray); }

/* ---------- FILTERS ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.filter-btn {
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  text-transform: uppercase;
}
.filter-btn.active {
  background: var(--white);
  color: var(--purple);
  border-color: var(--white);
}
.filter-btn:hover:not(.active) { border-color: var(--white); }

/* ---------- PORTFOLIO GRID ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(150px, 18vw, 220px);
  gap: 20px;
}
.portfolio-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--gray);
  display: none;
}
.portfolio-item.show { display: block; }
.portfolio-item.pitem-grande .portfolio-label { font-size: 28px; }

.portfolio-thumb {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--gray);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Video preview cargado solo al hacer hover */
.portfolio-hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}
.portfolio-hover-video.visible { opacity: 1; }

.portfolio-label {
  position: absolute;
  left: 20px;
  bottom: 18px;
  right: 60px;
  z-index: 2;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}
.portfolio-item.size-lg   .portfolio-label { font-size: 28px; }
.portfolio-item.size-half .portfolio-label { font-size: 22px; }
.portfolio-item:nth-child(1) .portfolio-label { font-size: 40px; max-width: 350px; top: 18px; }

.portfolio-play {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 0 50% 50% 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
}
.portfolio-item:nth-child(1) .portfolio-play { top: 16px; }
.portfolio-play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 8px solid var(--white);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

/* Overlay degradado inferior */
.portfolio-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(43, 43, 85, 0.25), rgba(43, 43, 85, 0) 55%);
  transition: opacity .3s ease;
}
.portfolio-item:hover::after { opacity: 0.65; }


/* ---------- VER MÁS ---------- */
.ver-mas-wrap {
  display: flex;
  justify-content: center;
  margin-top: 56px;
}
.ver-mas-btn {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: transform 0.25s ease, background 0.25s ease;
  cursor: pointer;
}
.ver-mas-btn button {
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
}
.ver-mas-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-3px);
}
.ver-mas-label {
  text-align: center;
  font-size: 22px;
  margin-top: 5px;
  color: var(--gray);
}
.ver-mas-wrap.hidden { display: none; }

/* ---------- CLIENTES / SLIDER ---------- */
.clientes-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  gap: 24px;
}
.clientes-top div:nth-child(1) { width: 60%; }
.clientes-stat {
  text-align: right;
  width: 35%;
}
.clientes-stat .num {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(48px, 9vw, 125px);
  line-height: 1;
  width: 100% !important;
}
.clientes-stat .label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--gray);
}

.logo-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.logo-track {
  display: flex;
  align-items: center;
  gap: 80px;
  width: max-content;
  animation: scroll-loop 28s linear infinite;
}
@keyframes scroll-loop {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.logo-item {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 22px;
  color: var(--gray);
  opacity: 0.85;
  white-space: nowrap;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.logo-item:hover { opacity: 1; color: var(--white); }

/* ---------- FOOTER ---------- */
footer {
  padding: 70px 0 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 40px;
}
.footer-cols {
  display: flex;
  gap: 100px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gray);
  margin-bottom: 10px;
}
.footer-col p { font-size: 18px; font-weight: 300; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p { font-size: 18px; color: var(--gray); font-weight: 300; }
.footer-mark { font-family: var(--font-title); font-weight: 800; font-size: 22px; }

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  /* Reset explicit JS grid positions for mobile */
  .portfolio-item {
    grid-column: unset !important;
    grid-row: unset !important;
    aspect-ratio: 4 / 3;
  }
  .tagline { display: none; }
  .clientes-top { flex-direction: column; align-items: flex-start; }
  .clientes-top div:nth-child(1) { width: 100%; }
  .clientes-stat { text-align: left; width: 100%; }
}

@media (max-width: 560px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-item:nth-child(1) .portfolio-label { font-size: 20px; max-width: none; top: auto; }
  .portfolio-item:nth-child(1) .portfolio-play  { top: auto; }
  .footer-cols { gap: 40px; }
  .btn { font-size: 16px; padding: 13px 20px; }
  .hero p { max-width: 100%; }

  /* Modal en vertical (9:16) para móvil */
  .video-modal { padding: 70px 16px 24px; }
  .video-modal-close { top: 16px; right: 16px; font-size: 28px; }
  .video-modal-content { max-width: 420px; }
  .video-modal-player {
    border-radius: 14px;
    aspect-ratio: 9 / 16;
    width: min(100%, calc((100dvh - 160px) * 9 / 16));
    margin: 0 auto;
  }
  .video-modal-play { width: 56px; height: 56px; }
  .video-modal-play::before { border-left-width: 15px; border-top-width: 10px; border-bottom-width: 10px; }
  .video-modal-title { font-size: 18px; margin-top: 16px; }

  /* Filtros como dropdown en móvil */
  .filters {
    position: relative;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    z-index: 5;
  }
  .filter-btn {
    display: none;
    width: 100%;
    text-align: left;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 20px;
  }
  .filter-btn.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: var(--white);
  }
  .filter-btn.active::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 10px;
    flex-shrink: 0;
    transition: transform .2s ease;
  }
  .filters.open {
    background: var(--purple);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    overflow: hidden;
    padding-bottom: 6px;
  }
  .filters.open .filter-btn { display: flex; }
  .filters.open .filter-btn.active {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }
  .filters.open .filter-btn.active::after { transform: rotate(-135deg); }
  .filters.open .filter-btn:not(.active):hover { background: rgba(255, 255, 255, 0.06); }

  .ver-mas-btn { width: 88px; height: 88px; }
  .ver-mas-btn button { font-size: 26px; }
  .ver-mas-label { font-size: 16px; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 24px 0 60px; }
  .hero-visual { max-width: 260px; }
  .clientes-stat .num { font-size: clamp(40px, 15vw, 60px); }
}
