/* Estudio RGB — dirección "pinned poster": algo queda fijo mientras la obra cambia */

:root {
  /* Color: un fondo, una tinta, un acento */
  --bg: #f4f0ee;
  --surface: #e6e0dc;
  --ink: #10292c;
  --muted: #45585b;
  --accent: #5d6b47;
  --rec: #c8241c;
  --accent-ink: #ffffff;
  --field: #0f3a3f;
  --paper: #f4f0ee;
  --wa: #1f9e55;

  /* Tipo: Epilogue, cinco tamaños */
  --font: "Epilogue", system-ui, sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
  --step-display: clamp(3rem, 1rem + 8.4vw, 9.5rem);

  /* Espacio */
  --m: clamp(16px, 2.2vw, 32px);
  --gap: clamp(96px, 12vw, 200px);

  /* Movimiento */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.h-head {
  font-size: var(--step-head);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  font: 500 var(--step-body)/1 var(--font);
  color: var(--accent-ink); background: var(--accent);
  border: 2px solid var(--accent); border-radius: 0;
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: var(--step-small); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-block { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .btn-ghost:hover { background: var(--ink); color: var(--paper); }
}

/* ---------- Navegación ---------- */
.nav {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  padding: 20px var(--m);
}
.wordmark img { width: clamp(132px, 12vw, 190px); }
.nav-links { display: flex; gap: clamp(16px, 2.4vw, 36px); margin-left: auto; font-size: var(--step-small); font-weight: 500; }
.nav-links a { text-decoration: none; transition: opacity 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { opacity: 0.6; } }

/* ---------- Inicio: la frase partida por el cuadro ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--m);
  padding: clamp(8px, 2vw, 24px) var(--m) 0;
}
.hero-title { grid-column: 1 / -1; grid-row: 1 / 4; display: grid; grid-template-rows: subgrid; margin: 0; font-weight: 900; }
.hero-a, .hero-b {
  display: block;
  font-size: var(--step-display); font-weight: 900;
  letter-spacing: -0.045em; line-height: 0.88;
  white-space: nowrap;
}
.hero-a { grid-row: 1; }
.hero-b { grid-row: 3; justify-self: end; margin-top: 0.08em; }
.hero-frame {
  grid-column: 4 / -1; grid-row: 2;
  position: relative; margin-top: clamp(12px, 1.4vw, 24px);
  aspect-ratio: 2 / 1; overflow: hidden; background: var(--surface);
}
.hero-slides .slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 900ms ease, transform 7s linear;
}
.hero-slides .slide.is-active { opacity: 1; transform: scale(1); }
.hero-slides .slide:not(.is-active) { pointer-events: none; }
.stamp {
  position: absolute; left: 16px; bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(16, 41, 44, 0.72); color: #fff;
  font-size: var(--step-small); font-variant-numeric: tabular-nums;
}
.rec { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); animation: rec 1.6s steps(2, jump-none) infinite; }
@keyframes rec { 50% { opacity: 0.2; } }
.hero-lead {
  grid-column: 1 / 4; grid-row: 2; align-self: end;
  display: grid; gap: 24px; justify-items: start;
}
.hero-lead p { font-size: var(--step-lead); line-height: 1.3; max-width: 18ch; }

/* ---------- Timelapse: frase fija, fotos que pasan ---------- */
.pinned {
  position: relative;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--m);
  padding: var(--gap) var(--m) 0;
}
.pinned-stage {
  grid-column: 1 / 6; grid-row: 1;
  position: sticky; top: 0; align-self: start;
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 32px;
}
.statement { font-size: var(--step-lead); line-height: 1.4; max-width: 30ch; }
.pinned-photos { grid-column: 7 / -1; grid-row: 1; display: grid; gap: 22svh; padding: 12svh 0; }
.pp figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--muted); }
.pp img { width: 100%; object-fit: cover; }
.pp-1 { width: 62%; } .pp-1 img { aspect-ratio: 4 / 5; }
.pp-2 { width: 100%; } .pp-2 img { aspect-ratio: 16 / 10; }
.pp-3 { width: 70%; justify-self: center; } .pp-3 img { aspect-ratio: 1; }

/* ---------- Mueve el tiempo ---------- */
.scrub { padding: var(--gap) var(--m) 0; }
.scrub-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px; margin-bottom: clamp(24px, 3vw, 48px); }
.scrub-head p { font-size: var(--step-lead); line-height: 1.3; max-width: 24ch; }
.scrub-media { background: var(--field); }
.scrub-media video { width: 100%; aspect-ratio: 2048 / 600; object-fit: cover; }
.scrub-controls { display: flex; align-items: center; gap: 20px; margin-top: 20px; }
.scrub-controls .btn { min-width: 112px; }
.scrub-range { flex: 1; min-width: 0; display: flex; }
.scrub-controls output { min-width: 4ch; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: grab; }
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: var(--surface); }
input[type="range"]::-moz-range-track { height: 6px; background: var(--surface); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--accent); border: 0; transition: transform 120ms var(--ease-out); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 0; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }

/* ---------- Servicios: tarjetas que cruzan una foto fija ---------- */
.cards-run { position: relative; height: 240svh; margin-top: var(--gap); }
.cards-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--field); }
.cards-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55); }
.cards-title {
  flex: 0 0 auto; align-self: center; width: min(560px, 44vw);
  font-size: var(--step-head); font-weight: 900; letter-spacing: -0.04em; line-height: 0.95; color: var(--paper);
}
.cards-clip { position: absolute; inset: 0 var(--m); overflow: hidden; }
.cards-track {
  position: absolute; top: 50%; left: 0; z-index: 1;
  display: flex; gap: 40px;
  transform: translate3d(var(--x, 0px), -40%, 0);
  will-change: transform;
}
.card { flex: 0 0 auto; width: min(640px, 70vw); background: var(--tone); color: #fff; }
.card img, .card video { width: 100%; aspect-ratio: 16 / 9.4; object-fit: cover; background: #0b1d1f; }
.card-panel { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px 28px 28px; min-height: 150px; }
.card h3 { font-size: var(--step-lead); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; max-width: 11ch; }
.card p { font-size: var(--step-body); line-height: 1.4; max-width: 26ch; text-align: right; }

/* ---------- Obras ---------- */
.archive { padding: var(--gap) var(--m) 0; }
.archive-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px; margin-bottom: clamp(24px, 3vw, 48px); }
.archive-head p { font-size: var(--step-lead); line-height: 1.3; max-width: 24ch; }
.justify { display: flex; flex-wrap: wrap; gap: clamp(6px, 0.8vw, 12px); }
.j-item { flex: var(--r) 1 calc(var(--r) * clamp(120px, 15vw, 280px)); overflow: hidden; background: var(--surface); }
.j-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .j-item:hover img { transform: scale(1.04); } }

/* ---------- Estudio ---------- */
.about {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--m); row-gap: clamp(40px, 6vw, 96px);
  padding: var(--gap) var(--m) 0;
}
.about-text { grid-column: 1 / 7; display: grid; gap: 24px; align-content: start; }
.about-text p { font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; }
.about-text p:last-child { font-size: var(--step-body); color: var(--muted); }
.about-video { grid-column: 7 / -1; aspect-ratio: 16 / 9; background: var(--field); }
.about-video iframe { width: 100%; height: 100%; border: 0; }
.about-photo { grid-column: 1 / -1; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }

/* ---------- Clientes ---------- */
.proof { margin-top: var(--gap); }
.band { background: var(--field); color: var(--paper); overflow: hidden; padding: clamp(28px, 5vw, 64px) 0; }
.band-track { display: flex; width: max-content; animation: band 60s linear infinite; }
.band-track span {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: clamp(2.5rem, 1rem + 6vw, 7rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1;
}
.band-track span::after { content: ""; width: 0.22em; height: 0.22em; margin: 0 0.45em; border-radius: 50%; background: var(--accent); }
@keyframes band { to { transform: translateX(-50%); } }
.proof-body { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--m); padding: clamp(40px, 5vw, 80px) var(--m) 0; }
.proof-head { grid-column: 1 / 5; display: grid; gap: 20px; align-content: start; }
.proof-head p { font-size: var(--step-lead); line-height: 1.3; max-width: 20ch; }
.proof-body img { grid-column: 5 / -1; width: 100%; }

/* ---------- Contacto ---------- */
.visit { position: relative; margin-top: var(--gap); min-height: 100svh; }
.visit-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.visit-card {
  position: absolute; top: 60px; left: var(--m);
  width: min(400px, calc(100% - 2 * var(--m)));
  background: var(--paper); padding: 32px; display: grid; gap: 20px;
}
.visit-card h2 { font-size: var(--step-lead); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.visit-card dl { display: grid; gap: 10px; }
.visit-card dl div { display: flex; justify-content: space-between; gap: 16px; }
.visit-card dt { color: var(--muted); }
.visit-card dd a { text-decoration: none; font-weight: 500; }
.visit-card .btn { margin-top: -4px; }

/* ---------- Footer ---------- */
.footer { display: grid; grid-template-columns: 1fr 1fr; min-height: 100svh; background: var(--surface); }
.footer-photo { width: 100%; height: 100%; object-fit: cover; }
.footer-side { display: flex; flex-direction: column; gap: clamp(32px, 4vw, 64px); padding: clamp(40px, 6vw, 80px) var(--m) var(--m) clamp(24px, 5vw, 96px); }
.footer-mark { width: 150px; }
.footer-menu { display: grid; gap: 8px; justify-items: start; }
.footer-menu a {
  font-size: clamp(2rem, 1rem + 2.6vw, 3.5rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.05;
  text-decoration: none; transition: transform 200ms var(--ease-out), opacity 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .footer-menu:hover a { opacity: 0.45; }
  .footer-menu a:hover { opacity: 1; transform: translateX(12px); }
}
.footer-blocks { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: start; }
.footer-blocks p { margin-bottom: 6px; }
.footer-blocks a { text-decoration: none; }
.fieldscan { display: grid; gap: 8px; text-decoration: none; transition: opacity 160ms ease; }
.fieldscan img { width: 150px; }
.fieldscan span { font-size: var(--step-small); color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .fieldscan:hover { opacity: 0.7; } }
.legal { margin-top: auto; font-size: var(--step-small); color: var(--muted); }

/* ---------- WhatsApp flotante (más alto, sobre el aviso de Netlify) ---------- */
.wa-float {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wa); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); /* taste-skill-ignore: botón flotante */
  transition: transform 180ms var(--ease-out);
}
.wa-float svg { width: 32px; height: 32px; }
.wa-float:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .wa-float:hover { transform: scale(1.06); } }

/* ---------- Formulario ---------- */
.contact { border: 0; padding: 0; background: transparent; width: min(520px, calc(100vw - 32px)); max-width: none; }
.contact::backdrop { background: rgba(16, 41, 44, 0.6); }
.contact form { position: relative; background: var(--paper); padding: 32px; display: grid; gap: 16px; font-family: var(--font); color: var(--ink); }
.contact h2 { font-size: var(--step-lead); font-weight: 900; letter-spacing: -0.02em; }
.contact label { display: grid; gap: 6px; font-size: var(--step-small); font-weight: 500; }
.contact input, .contact textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 12px; border: 1px solid #b9aca4; background: #fff; border-radius: 0; color: var(--ink); }
.contact .close { position: absolute; top: 8px; right: 12px; width: 44px; height: 44px; border: 0; background: none; font-size: 2rem; cursor: pointer; color: var(--ink); }
.contact .btn { justify-self: start; }
.contact[open] { animation: pop 200ms var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }

/* ---------- Visor ---------- */
.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 20, 22, 0.94); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 92vh; width: auto; height: auto; }

/* ---------- Entradas al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .hero-frame { grid-column: 1 / -1; grid-row: 2; aspect-ratio: 4 / 3; }
  .hero-b { grid-row: 3; }
  .hero-lead { grid-column: 1 / -1; grid-row: 4; margin-top: 28px; }
  .hero-lead p { max-width: 28ch; }
  .about-text, .about-video { grid-column: 1 / -1; }
  .proof-head, .proof-body img { grid-column: 1 / -1; }
  .proof-body img { margin-top: 32px; }
}

/* ---------- Servicios apilados (tablet y teléfono) ---------- */
@media (max-width: 900px) {
  .cards-run { height: auto; }
  .cards-stage { position: relative; height: auto; overflow: visible; padding: 0 0 var(--m); }
  .cards-bg { position: relative; aspect-ratio: 4 / 5; height: auto; }
  .cards-title { position: absolute; top: -40px; left: var(--m); transform: translateY(-100%); width: auto; color: var(--paper); }
  .cards-clip { position: relative; inset: auto; overflow: visible; }
  .cards-track { position: relative; top: auto; transform: none; flex-direction: column; gap: 24px; padding: 0 var(--m); margin-top: -40px; }
  .card { width: 100%; }
  .card-panel { flex-direction: column; align-items: start; min-height: 0; }
  .card p { text-align: left; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav .btn-small { margin-left: auto; }
  .hero-a, .hero-b { font-size: 11.6vw; }
  .pinned { display: block; }
  .pinned-stage { position: static; min-height: 0; padding-bottom: 48px; }
  .pinned-photos { gap: 48px; padding: 0; }
  .pp-1 { width: 64%; } .pp-2 { width: 100%; } .pp-3 { width: 70%; justify-self: end; }
  .scrub-media video { aspect-ratio: 16 / 9; }
  .about-photo { aspect-ratio: 4 / 3; }
  .justify { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .j-item { aspect-ratio: 1; }
  .visit { min-height: 0; display: flex; flex-direction: column; }
  .visit-bg { position: relative; height: 70svh; }
  .visit-card { position: relative; top: auto; left: auto; width: auto; margin: -80px var(--m) 0; }
  .footer { grid-template-columns: 1fr; }
  .footer-photo { height: 50svh; }
  .footer-side { padding: 40px var(--m); }
  .wa-float { width: 56px; height: 56px; bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slides .slide { transition: opacity 300ms ease; transform: none; }
  .band-track, .rec { animation: none; }
  .cards-track { transition: none; }
}

/* ---------- Contenido editable y modo edición (solo administrador) ---------- */
[data-edit] { white-space: pre-line; }
.hero-a[data-edit], .hero-b[data-edit] { white-space: nowrap; }
.admin-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.form-error { color: #a3261d; font-size: var(--step-small); }

body.editing { padding-top: 64px; }
body.editing [data-edit] { outline: 2px dashed rgba(93, 107, 71, 0.7); outline-offset: 4px; cursor: text; }
body.editing [data-edit]:focus { outline-style: solid; outline-color: var(--accent); }
body.editing [data-edit-img], body.editing .j-item img { cursor: pointer; outline: 3px dashed rgba(255, 255, 255, 0.85); outline-offset: -8px; }
body.editing .cards-title[data-edit] { outline-color: rgba(255, 255, 255, 0.8); }
body.editing .j-item { position: relative; }
.edit-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px var(--m); background: var(--ink); color: var(--paper); font-size: var(--step-small);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25); /* taste-skill-ignore: barra fija */
}
.edit-bar strong { font-weight: 900; margin-right: auto; }
.edit-bar .btn { min-height: 40px; padding: 0 16px; font-size: var(--step-small); }
.edit-bar .btn-ghost { color: var(--paper); border-color: var(--paper); }
.edit-status { opacity: 0.8; }
.j-remove {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(16, 41, 44, 0.85); color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.j-add {
  flex: 1 1 220px; min-height: 160px; display: grid; place-items: center;
  border: 2px dashed var(--accent); background: var(--bg); color: var(--accent);
  font: 500 var(--step-body) var(--font); cursor: pointer;
}
.uploading { opacity: 0.4; transition: opacity 200ms ease; }
