/* =========================================================
   TUVI — Tu video, tu visión
   Concepto: el visor de cámara. Negro puro + espectro de la marca.
   ========================================================= */

@property --iris {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 0%;
}

:root {
  /* Marca (tomada del logo) */
  --magenta: #ff0a5c;
  --violeta: #8a2be2;
  --azul: #0a6cff;
  --celeste: #00b4f5;
  --spectrum: linear-gradient(90deg, var(--magenta), var(--violeta) 38%, var(--azul) 70%, var(--celeste));
  /* Versión aclarada para texto pequeño sobre negro (contraste AA en todo el tramo) */
  --spectrum-text: linear-gradient(90deg, #ff5a8c, #b583ff 40%, #5aa2ff 72%, #45c8ff);

  /* Base */
  --black: #000;
  --ink: #f4f4f6;
  --muted: #9a9aa5;
  --line: #26262c;
  --surface: #0d0d10;
  --wa: #25d366;

  /* Tipo: una sola familia, el ancho cambia la voz */
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.6vw, 3.8rem);
  --step-4: clamp(2.9rem, 1.8rem + 6vw, 7.5rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --radius: 6px;
  --header-h: 68px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
a, button { touch-action: manipulation; -webkit-tap-highlight-color: rgb(0 180 245 / 0.18); }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul[role='list'] { list-style: none; padding: 0; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

:focus-visible { outline: 2px solid var(--celeste); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--magenta); color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--black); padding: 10px 14px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Botones y enlaces ---------- */
.btn {
  --pad-y: 0.85em; --pad-x: 1.35em;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: var(--pad-y) var(--pad-x);
  min-height: 48px;
  border-radius: 999px;
  font: 600 var(--step-0) / 1 var(--font);
  font-variation-settings: 'wdth' 108;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn--brand { background: var(--spectrum); color: #fff; background-size: 140% 100%; background-position: 0 0; transition: background-position 0.4s ease, transform 0.15s ease; }
.btn--brand:hover { background-position: 100% 0; }
.btn--ghost { border-color: rgb(255 255 255 / 0.55); color: var(--ink); background: rgb(0 0 0 / 0.25); }
.btn--ghost:hover { border-color: var(--ink); background: rgb(255 255 255 / 0.08); }
.btn--sm { --pad-y: 0.6em; --pad-x: 1.1em; min-height: 40px; font-size: var(--step--1); }
.btn--lg { font-size: var(--step-1); --pad-x: 1.6em; min-height: 60px; }

.link {
  color: var(--ink); font-weight: 600; text-decoration: none;
  background: var(--spectrum) left bottom / 100% 2px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.25s ease;
}
.link:hover { background-size: 100% 100%; color: #fff; }

/* ---------- Pantalla de carga ---------- */
.loader { display: none; }
.js:not(.intro-seen) .loader {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 300;
  background: var(--black);
  /* Iris: el agujero central crece y revela el sitio, como un obturador abriéndose */
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent var(--iris), #000 calc(var(--iris) + 1px));
  mask: radial-gradient(circle at 50% 50%, transparent var(--iris), #000 calc(var(--iris) + 1px));
}
.loader__inner { display: grid; justify-items: center; gap: 28px; width: min(62vw, 300px); }
.loader__logo { width: 100%; animation: logo-in 0.7s cubic-bezier(.2,.7,.2,1) both; }
.loader__bar { width: 100%; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.loader__bar span {
  display: block; height: 100%; width: 100%; background: var(--spectrum);
  transform-origin: left; transform: scaleX(var(--progress, 0.08));
  transition: transform 0.35s ease;
}
.loader.is-done { animation: iris-open 0.85s cubic-bezier(.7,0,.2,1) forwards; }
.loader.is-done .loader__inner { animation: logo-out 0.35s ease forwards; }
@keyframes logo-in { from { opacity: 0; transform: scale(0.92); } }
@keyframes logo-out { to { opacity: 0; transform: scale(1.06); } }
@keyframes iris-open { to { --iris: 75vmax; visibility: hidden; } }

/* ---------- Encabezado ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { background: rgb(0 0 0 / 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-color: var(--line); }
.brand img { height: 44px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 36px); }
.nav ul { display: flex; gap: clamp(16px, 2.5vw, 32px); }
.nav ul a {
  text-decoration: none; font-weight: 500; font-size: var(--step--1);
  font-variation-settings: 'wdth' 110; color: var(--ink); padding: 8px 0;
  position: relative;
}
.nav ul a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--spectrum); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav ul a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--ink);
  width: 48px; height: 48px; margin-right: -12px; place-items: center; cursor: pointer;
}
.nav-toggle .icon { width: 28px; height: 28px; }
.nav-toggle__close { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 20px;
    padding: 24px var(--gutter) 32px; background: var(--black); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav ul { flex-direction: column; gap: 4px; }
  .nav ul a { display: block; font-size: var(--step-2); font-weight: 700; padding: 10px 0; font-variation-settings: 'wdth' 115; }
  .nav .btn { min-height: 52px; font-size: var(--step-0); }
  .site-header.menu-open { background: var(--black); border-color: var(--line); }
  .site-header.menu-open .nav { opacity: 1; transform: none; visibility: visible; }
  .site-header.menu-open .nav-toggle__open { display: none; }
  .site-header.menu-open .nav-toggle__close { display: block; }
}

/* ---------- Hero: el visor ---------- */
.hero {
  position: relative;
  min-height: max(100svh, 580px);
  display: flex; align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
}
.hero__media, .hero__media picture, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__media img { object-fit: cover; }
.hero__media::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgb(0 0 0 / 0.92) 0%, rgb(0 0 0 / 0.55) 38%, rgb(0 0 0 / 0.15) 65%, rgb(0 0 0 / 0.5) 100%);
}

.viewfinder {
  --inset: clamp(14px, 3vw, 36px);
  position: absolute; inset: calc(var(--header-h) + 4px) var(--inset) var(--inset);
  pointer-events: none; z-index: 1;
  font: 600 var(--step--1) / 1 var(--font);
  font-variation-settings: 'wdth' 112;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: rgb(255 255 255 / 0.9);
}
.vf-corner { position: absolute; width: clamp(22px, 4vw, 44px); aspect-ratio: 1; border: 0 solid rgb(255 255 255 / 0.85); }
.vf-corner--tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.vf-corner--tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.vf-corner--bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.vf-corner--br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.vf-rec { position: absolute; top: clamp(14px, 2vw, 22px); left: clamp(16px, 2.4vw, 30px); display: flex; align-items: center; gap: 0.55em; }
.vf-rec i { width: 0.75em; height: 0.75em; border-radius: 50%; background: #ff2a2a; box-shadow: 0 0 12px #ff2a2a; animation: rec 1.6s steps(1) infinite; }
.vf-tc { margin-left: 0.4em; color: #fff; }
.vf-spec { position: absolute; top: clamp(14px, 2vw, 22px); right: clamp(16px, 2.4vw, 30px); }
@keyframes rec { 50% { opacity: 0.15; } }

.hero__content {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 0 calc(var(--gutter) + clamp(14px, 3vw, 36px)) calc(clamp(14px, 3vw, 36px) + clamp(32px, 6vw, 72px));
}
.hero__title {
  font-size: var(--step-4);
  font-weight: 850;
  font-variation-settings: 'wdth' 125;
  line-height: 0.92;
  letter-spacing: -0.02em;
  max-width: 11ch;
  text-wrap: balance;
}
.hero__lead { margin-top: clamp(16px, 2vw, 24px); max-width: 46ch; font-size: var(--step-1); line-height: 1.45; color: rgb(255 255 255 / 0.88); }
.hero__actions { margin-top: clamp(24px, 3vw, 36px); display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 760px) {
  .hero__actions .btn { flex: 1 1 220px; }
  .hero__content { padding-bottom: 104px; }
  .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Secciones ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 144px) var(--gutter) 0; }
.section__head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 72px); }
.section__title {
  font-size: var(--step-3); font-weight: 800;
  font-variation-settings: 'wdth' 120;
  line-height: 1; letter-spacing: -0.015em;
  text-wrap: balance;
}
.section__intro { margin-top: 18px; color: var(--muted); font-size: var(--step-1); line-height: 1.5; max-width: 52ch; }

/* ---------- Proyectos ---------- */
.project {
  display: grid; gap: 28px;
  padding: clamp(32px, 4vw, 56px) 0;
  border-top: 1px solid var(--line);
}
.project__client { font-size: var(--step-2); font-weight: 750; font-variation-settings: 'wdth' 115; line-height: 1.1; }
.project__kind {
  margin-top: 8px; display: inline-block; font-weight: 600; font-size: var(--step--1);
  background: var(--spectrum-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.project__summary { margin: 14px 0 20px; color: var(--muted); max-width: 46ch; }

.shots { display: grid; gap: 10px; }
.shot a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.shot a:hover img { transform: scale(1.03); }
.shot--portrait a, .shot--tall a { aspect-ratio: 4 / 5; }
.shot--landscape a { aspect-ratio: 3 / 2; }

/* En móvil, cada proyecto es una tira deslizable */
@media (max-width: 959px) {
  .shots {
    grid-auto-flow: column; grid-auto-columns: 78%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shot { scroll-snap-align: start; }
  .shots:has(.shot--landscape) { grid-auto-columns: 86%; }
}
@media (min-width: 960px) {
  .project { grid-template-columns: minmax(260px, 1fr) 2fr; gap: clamp(32px, 4vw, 64px); align-items: start; }
  .shots--c2 { grid-template-columns: repeat(2, 1fr); }
  .shots--c3 { grid-template-columns: repeat(3, 1fr); }
  .shots--c4 { grid-template-columns: repeat(4, 1fr); }
  .shots--first-wide .shot:first-child { grid-column: 1 / -1; }
}

/* ---------- Planes ---------- */
.plan-list { display: grid; gap: 16px; }
.plan {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
}
.plan--featured {
  border: 0;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--spectrum) border-box;
  border: 2px solid transparent;
}
.plan__badge {
  align-self: flex-start; margin-bottom: 16px;
  font-size: var(--step--1); font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: var(--spectrum); color: #fff;
}
.plan__name { font-size: var(--step-1); font-weight: 750; font-variation-settings: 'wdth' 118; line-height: 1.15; }
.plan__pitch { margin-top: 8px; color: var(--muted); }
.plan__price {
  margin: 24px 0; font-size: clamp(2.2rem, 1.1rem + 2.4vw, 3.4rem); font-weight: 850; font-variation-settings: 'wdth' 120;
  line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.plan__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.35em; }
.plan__price span { font-size: var(--step-0); font-weight: 600; color: var(--muted); letter-spacing: 0; font-variation-settings: 'wdth' 100; }
.plan--featured .plan__price data { background: var(--spectrum-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan__features { display: grid; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); margin-bottom: 28px; }
.plan__features li { display: flex; gap: 10px; align-items: flex-start; }
.plan__features .icon { color: var(--celeste); margin-top: 2px; }
.plan__cta { margin-top: auto; }
.plans__flyer { margin-top: 28px; color: var(--muted); }

@media (min-width: 860px) {
  .plan-list { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  .plan--featured { margin-block: -14px; padding-block: calc(clamp(24px, 3vw, 36px) + 14px); }
}

/* ---------- Equipo: collage ---------- */
.collage {
  --row: clamp(84px, 8vw, 118px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: var(--row);
  grid-auto-flow: dense;
  gap: 6px;
}
.collage__item a { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 4px; background: var(--surface); }
.collage__item picture, .collage__item img { width: 100%; height: 100%; }
.collage__item img { object-fit: cover; transition: transform 0.5s cubic-bezier(.2,.7,.2,1), filter 0.3s ease; }
.collage__item a:hover img { transform: scale(1.04); }
/* Las proporciones suman exacto en 2, 4 y 6 columnas para que el collage cierre sin huecos */
.c-tall { grid-row: span 4; }
.c-big  { grid-row: span 4; }
.c-sq   { grid-row: span 3; }
.c-wide { grid-column: span 2; grid-row: span 2; }

@media (min-width: 700px) {
  .collage { grid-template-columns: repeat(4, 1fr); }
  .c-big { grid-column: span 2; grid-row: span 4; }
}
@media (min-width: 1100px) {
  .collage { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Contacto ---------- */
.contact {
  display: grid; gap: clamp(48px, 6vw, 96px);
  padding-bottom: clamp(72px, 10vw, 144px);
}
.contact__main .btn { margin-top: 32px; }
.contact__mail { margin-top: 20px; }
.contact__subtitle { font-size: var(--step-1); font-weight: 700; font-variation-settings: 'wdth' 115; margin-bottom: 12px; }
.socials li + li { border-top: 1px solid var(--line); }
.social {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 18px 4px; text-decoration: none; color: var(--ink);
  transition: padding 0.2s ease, color 0.2s ease;
}
.social .icon { width: 28px; height: 28px; }
.social__label { font-size: var(--step-1); font-weight: 650; font-variation-settings: 'wdth' 112; }
.social__handle { color: var(--muted); font-size: var(--step--1); }
.social:hover { padding-left: 12px; }
.social:hover .icon { color: var(--celeste); }

@media (min-width: 900px) {
  .contact { grid-template-columns: 1.2fr 1fr; align-items: end; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  display: grid; justify-items: center; gap: 10px; text-align: center;
  color: var(--muted); font-size: var(--step--1);
}
.site-footer__mark { width: 52px; margin-bottom: 6px; }
.site-footer strong { color: var(--ink); }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; z-index: 90;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wa); color: #fff;
  box-shadow: 0 8px 24px rgb(37 211 102 / 0.35);
  transition: transform 0.2s ease;
}
.wa-float .icon { width: 32px; height: 32px; }
.wa-float:hover { transform: scale(1.07); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(0 0 0 / 0.95); color: var(--ink);
  overscroll-behavior: contain;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.9); }
.lightbox__img { max-width: min(92vw, 1400px); max-height: 82dvh; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.lightbox__caption { position: absolute; bottom: 20px; left: 72px; right: 72px; text-align: center; color: var(--muted); font-size: var(--step--1); }
.lightbox__btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgb(255 255 255 / 0.25); background: rgb(0 0 0 / 0.5); color: #fff; cursor: pointer;
}
.lightbox__btn:hover { background: rgb(255 255 255 / 0.12); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 16px; top: 50%; translate: 0 -50%; }
@media (max-width: 600px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 12px; translate: none; }
  .lightbox__caption { bottom: 76px; left: 16px; right: 16px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js:not(.intro-seen) .loader.is-done { animation: fade-out 0.3s ease forwards !important; }
  @keyframes fade-out { to { opacity: 0; visibility: hidden; } }
}
