/* Pablo Zapata — portfolio. Dirección "Pinned poster": blanco cálido, negro tinta y azul rey, TikTok Sans ancha para títulos. */
:root {
  --bg: #f6f6f4;
  --surface: #e9e9e6;
  --ink: #111318;
  --muted: #565b66;
  --accent: #1d3fc4;
  --accent-ink: #ffffff;

  --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.25rem, 1rem + 4vw, 4.5rem);

  --m: clamp(20px, 2.2vw, 32px);
  --gap: clamp(120px, 13vw, 200px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.45 "TikTok Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.contact :focus-visible { outline-color: #ffffff; }
::selection { background: var(--ink); color: var(--bg); }

.display {
  font-weight: 800; font-stretch: 150%; font-variation-settings: "wdth" 150;
  text-transform: uppercase; letter-spacing: -0.01em; line-height: 1;
}
.h2 { font-size: var(--step-head); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  font: 600 1rem/1 "TikTok Sans", sans-serif; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  transition: background-color .25s ease, transform .25s var(--ease);
}
.btn:hover { background: #2f55e6; }
.btn:active { transform: scale(.97); }

/* ---------- Navegación ---------- */
.nav {
  position: absolute; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px var(--m) 0; font-size: 0.9375rem; font-weight: 500;
}
.nav .mark { font-weight: 700; text-decoration: none; font-size: 1rem; }
.nav ul { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); }
.nav ul a:not(.btn) { text-decoration: none; transition: color .2s ease; }
.nav ul a:not(.btn):hover { color: var(--accent); }
.nav .btn { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }

/* ---------- Portada: una ventana que se abre hasta los bordes ---------- */
.hero { position: relative; height: 100svh; }
.motion-on .hero { height: 200svh; }
.hero-stage { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: hidden; --p: 0; --y: max(96px, calc((100svh - 45vw) / 2)); }
.hero-window {
  position: absolute; inset: 0; background: var(--surface);
  clip-path: inset(calc(var(--y) * (1 - var(--p))) calc(32vw * (1 - var(--p))));
}
.feed {
  position: absolute; left: 0; right: 0; top: 50%;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  transform: translateY(-50%);
}
.feed img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.motion-on .feed { transform: translateY(-50%) scale(calc(1 + 0.9 * (1 - var(--p)))); }
.hero-title { position: absolute; z-index: 2; left: var(--m); bottom: var(--y); font-size: clamp(2.75rem, 4.6vw, 4.75rem); line-height: .95; }
.hero-title span { display: block; }
.hero-title small { display: none; }
.hero-side { position: absolute; z-index: 2; right: var(--m); bottom: var(--y); width: min(26ch, 24vw); }
.hero-side p { font-size: 1.125rem; line-height: 1.4; }
.hero-side .btn { margin-top: 24px; }

/* ---------- Trabajos de marca: índice fijo, carrusel grande ---------- */
.pin-stage { display: grid; grid-template-columns: 38fr 62fr; align-items: start; }
.pin-stage > * { min-width: 0; }
.pin-left { position: sticky; top: 0; height: 100svh; padding: 112px var(--m) 32px; display: flex; flex-direction: column; }
.pin .h2 { font-size: clamp(2rem, .8rem + 3.2vw, 3.75rem); }
.pin-left > p { margin-top: 24px; max-width: 30ch; }
.pin-index { margin-top: auto; padding-top: 48px; }
.pin-index li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; color: var(--muted); transition: color .4s ease; }
.pin-index li.on { color: var(--ink); }
.pin-index strong { font-size: var(--step-lead); font-weight: 700; }
.pin-index span { font-size: var(--step-small); text-align: right; }
.pin-right { background: var(--surface); }
.pin-panel { min-height: 100svh; padding: 48px 0; display: flex; flex-direction: column; justify-content: center; }
.pin-name { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 0 var(--m) 24px; }
.pin-name strong { font-size: var(--step-lead); font-weight: 700; }
.pin-name span { color: var(--muted); font-size: var(--step-small); text-align: right; }

/* Carrusel de una cuenta: se desliza con el dedo, la rueda o las flechas. */
.car { --slide: min(31vw, 46svh); }
.car-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 0 calc(50% - var(--slide) / 2);
}
.car-track::-webkit-scrollbar { display: none; }
.car-track li { flex: none; width: var(--slide); scroll-snap-align: center; }
.car-track img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.car-ui { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px; }
.car-btn {
  width: 48px; height: 48px; border: 0; cursor: pointer;
  font: 600 1.25rem/1 "TikTok Sans", sans-serif; color: var(--ink); background: var(--bg);
  transition: background-color .2s ease, color .2s ease, transform .2s var(--ease);
}
.car-btn:hover { background: var(--ink); color: var(--bg); }
.car-btn:active { transform: scale(.94); }
.car-dots { display: flex; gap: 8px; }
.car-dots i { width: 8px; height: 8px; background: var(--muted); opacity: .5; transition: opacity .3s ease, background-color .3s ease; }
.car-dots i.on { background: var(--ink); opacity: 1; }

/* ---------- Floristerías: tarjetas que cruzan ---------- */
.cards { padding-top: var(--gap); }
.services { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 clamp(24px, 3vw, 48px); align-items: end; }
.cards-head { padding: 0 var(--m); }
.cards-head p { margin-top: 20px; max-width: 52ch; }
.cards-rail { margin-top: 56px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cards-rail::-webkit-scrollbar { display: none; }
@media (min-width: 761px) {
  .motion-on .cards-rail { overflow: hidden; }
  :root:not(.motion-on) .cards-track { display: grid; grid-template-columns: repeat(2, 1fr); width: auto; }
  :root:not(.motion-on) .card { width: auto; }
}
.cards-track { display: flex; gap: 40px; width: max-content; padding: 0 var(--m); }
.card { width: min(720px, 86vw); background: var(--surface); }
.card-slides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; }
.card-slides img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .8s var(--ease); }
.card-slides a { display: block; overflow: hidden; }
.card-slides a:hover img { transform: scale(1.04); }
.card-panel { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 24px 28px 28px; background: #1d3fc4; color: #ffffff; }
.card:nth-child(2) .card-panel { background: #111318; }
.card:nth-child(3) .card-panel { background: #7a1424; }
.card:nth-child(4) .card-panel { background: #24344f; }
.card-panel h3 { font-weight: 800; font-stretch: 125%; text-transform: uppercase; font-size: clamp(1.625rem, 1rem + 1.6vw, 2.5rem); line-height: 1; }
.card-panel p { text-align: right; font-size: 1rem; }

/* ---------- Variedad: tríptico que sube ---------- */
.tri { padding: var(--gap) var(--m) 0; overflow: clip; }
.tri-head { text-align: center; max-width: 40ch; margin: 0 auto; }
.tri-head p { margin-top: 20px; }
.tri-row { display: grid; grid-template-columns: 1fr 1.55fr 1fr; gap: 10px; align-items: start; margin: 56px calc(-1 * var(--m)) 0; }
.tri-row a { display: block; overflow: hidden; }
.tri-row img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.tri-0, .tri-2 { margin-top: 55px; }

/* ---------- Todas las piezas ---------- */
.archive { padding: var(--gap) var(--m) 0; }
.jump { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; }
.jump button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px;
  font: 500 0.9375rem/1 "TikTok Sans", sans-serif; color: var(--ink);
  background: var(--surface); border: 0; cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .25s var(--ease);
}
.jump button span { color: var(--muted); font-variant-numeric: tabular-nums; }
.jump button:hover { background: #dededa; }
.jump button:active { transform: scale(.97); }
.jump button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.jump button[aria-pressed="true"] span { color: var(--accent-ink); }
.grid { margin-top: 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 20px; }
.grid li[hidden] { display: none; }
.piece { display: block; text-decoration: none; color: inherit; }
.frame { display: block; position: relative; aspect-ratio: 4 / 5; background: var(--surface); overflow: hidden; }
.frame img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; transition: transform .9s var(--ease); }
.piece:hover .frame img, .piece:focus-visible .frame img { transform: scale(1.04); }
.cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.cap strong { font-weight: 600; }
.cap span { color: var(--muted); text-align: right; }

/* ---------- Lo que hago ---------- */
.services { margin-top: var(--gap); background: var(--surface); padding: var(--gap) var(--m); align-items: start; }
.services-text { grid-column: 1 / span 5; }
.services-text p { margin-top: 24px; max-width: 40ch; }
.services-text .btn { margin-top: 36px; }
.services-list { grid-column: 7 / span 6; display: grid; gap: 40px; }
.services-list strong { display: block; font-size: var(--step-lead); font-weight: 700; line-height: 1.2; }
.services-list span { display: block; margin-top: 8px; max-width: 48ch; }

/* ---------- Contacto: el correo como titular ---------- */
.contact {
  background: var(--accent); color: var(--accent-ink);
  min-height: 84svh; padding: 40px var(--m) 32px;
  display: grid; grid-template-rows: auto auto 1fr auto;
}
.contact-t { font-size: 1.375rem; font-weight: 700; }
.contact-p { margin-top: 8px; font-size: 1.375rem; max-width: 34ch; }
.contact .mail {
  align-self: end; margin-bottom: 10vh;
  font-size: 8.2vw; font-weight: 500; letter-spacing: -0.035em; line-height: 1;
  text-decoration: none; white-space: nowrap; transition: color .3s ease;
}
.contact .mail:hover { color: #c9d4ff; }
.br-s { display: none; }
.contact-foot { display: flex; justify-content: space-between; gap: 24px; font-size: 0.9375rem; }
.contact-foot p:last-child { text-align: right; }
.contact-foot a { text-decoration: none; }
.contact-foot a:hover { text-decoration: underline; }

/* ---------- Pie: foto y menú ---------- */
.foot { display: grid; grid-template-columns: 1fr 1fr; min-height: 100svh; }
.foot-pic { overflow: hidden; }
.foot-pic img { width: 100%; height: 100%; object-fit: cover; }
.foot-menu { padding: 80px var(--m) 32px clamp(32px, 6vw, 96px); display: flex; flex-direction: column; }
.foot-mark { font-size: 0.9375rem; font-weight: 700; }
.foot-menu nav { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.foot-menu nav a {
  font-weight: 800; font-stretch: 125%; font-size: clamp(1.5rem, 2.6vw, 2.5rem); line-height: 1.05;
  text-decoration: none; transition: transform .35s var(--ease), color .3s ease;
}
.foot-menu nav:hover a { color: var(--muted); }
.foot-menu nav a:hover { color: var(--ink); transform: translateX(12px); }
.foot-info { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 0.9375rem; }
.foot-info a { text-decoration: none; }
.foot-info a:hover { text-decoration: underline; }
.foot-note { margin-top: auto; padding-top: 48px; font-size: 0.8125rem; color: var(--muted); }

/* ---------- Visor ---------- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0f1115; color: #f6f6f4; }
.viewer[open] { display: grid; grid-template-rows: auto 1fr auto; }
.viewer::backdrop { background: #0f1115; }
.viewer-top, .viewer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px var(--m); }
.viewer-top p { font-size: var(--step-small); color: #a3a8b3; font-variant-numeric: tabular-nums; }
.viewer figure { position: relative; min-height: 0; }
.viewer img { position: absolute; inset: 0 var(--m); width: calc(100% - 2 * var(--m)); height: 100%; max-width: none; object-fit: contain; }
.viewer-cap strong { display: block; font-size: var(--step-lead); font-weight: 700; }
.viewer-cap span { color: #a3a8b3; font-size: var(--step-small); }
.viewer button {
  min-height: 48px; min-width: 48px; padding: 0 18px; border: 0; cursor: pointer;
  font: 600 0.9375rem/1 "TikTok Sans", sans-serif; color: #f6f6f4; background: #23262e;
  transition: background-color .2s ease, transform .2s var(--ease);
}
.viewer button:hover { background: #333743; }
.viewer button:active { transform: scale(.96); }
.viewer-nav { display: flex; gap: 8px; }

/* ---------- Entradas ---------- */
.js [data-reveal] > *, .js li[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.js [data-reveal].in > *, .js li[data-reveal].in { opacity: 1; transform: none; }
.js [data-reveal].in > *:nth-child(2) { transition-delay: 80ms; }
.js [data-reveal].in > *:nth-child(3) { transition-delay: 160ms; }

@media (prefers-reduced-motion: reduce) {
  :root:not(.motion) *, :root:not(.motion) *::before, :root:not(.motion) *::after { transition-duration: .01ms !important; animation: none !important; }
  :root:not(.motion).js [data-reveal] > *, :root:not(.motion).js li[data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Tableta ---------- */
@media (max-width: 1000px) {
  .pin-stage { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .services-text, .services-list { grid-column: 1 / -1; }
  .services-list { margin-top: 56px; }
  .car { --slide: min(56vw, 52svh); }
  .pin-left { position: static; height: auto; padding-top: var(--gap); }
  .pin-panel { min-height: 0; }
  .contact { min-height: 70svh; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 760px) {
  .display { font-stretch: 120%; font-variation-settings: "wdth" 120; }
  .nav ul .hide-s { display: none; }
  .hero-stage { --y: 30svh; }
  .hero-window { clip-path: inset(calc(30svh * (1 - var(--p))) calc(11vw * (1 - var(--p))) calc((70svh - 97.5vw) * (1 - var(--p))) calc(11vw * (1 - var(--p)))); }
  .feed { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .feed img:nth-child(n+17) { display: none; }
  .hero-title { top: 92px; bottom: auto; font-size: 11vw; }
  .hero-title small { display: block; margin-top: 12px; font: 500 1.125rem/1.3 "TikTok Sans", sans-serif; text-transform: none; letter-spacing: 0; font-stretch: 100%; font-variation-settings: "wdth" 100; }
  .hero-side { top: calc(30svh + 97.5vw + 20px); bottom: auto; left: var(--m); width: auto; }
  .hero-side p { font-size: 1rem; }
  .hero-side .btn { margin-top: 14px; width: 100%; }
  .h2, .pin .h2 { font-size: 9vw; }
  .pin-left { padding-top: var(--gap); }
  .pin-index { display: none; }
  .car { --slide: 74vw; }
  .cards-rail { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cards-rail::-webkit-scrollbar { display: none; }
  .card { scroll-snap-align: center; }
  .cards-track { gap: 16px; }
  .card-panel { padding: 18px; }
  .tri-row { grid-template-columns: .5fr 2fr .5fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .cap { flex-direction: column; gap: 2px; font-size: 0.9375rem; }
  .cap span { text-align: left; }
  .services { display: block; }
  .contact { min-height: 86svh; }
  .contact .mail { font-size: 10.5vw; white-space: normal; }
  .br-s { display: inline; }
  .contact-foot { flex-direction: column; gap: 12px; }
  .contact-foot p:last-child { text-align: left; }
  .foot { display: block; min-height: 0; }
  .foot-pic { height: 50svh; }
  .foot-menu { padding: 48px var(--m) 32px; }
  .foot-menu nav a { font-size: 8vw; }
  .foot-info { grid-template-columns: 1fr; }
  .viewer-bottom { flex-direction: column; align-items: stretch; }
  .viewer-nav button { flex: 1; }
}
