/* =========================================================
   TOKENS
   Fondo claro neutro, tipografía chica, la imagen manda.
   La paleta (sacada de tu gradiente) aparece solo en detalles.
   ========================================================= */
:root {
  --font: "Switzer", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bg: #f3f1ec;
  --ink: #151412;
  --muted: #6b6862;
  --line: rgba(21, 20, 18, 0.16);

  /* paleta: un punto de color por disciplina */
  --dot-product: #a8c4df;   /* celeste */
  --dot-spaces: #6e7a5e;    /* verde salvia */
  --dot-social: #cbb9b4;    /* rosa polvoriento */
  --dot-ux: #b06e3a;        /* terracota */
  --dot-art: #201d08;       /* negro oliva */
  --dot-video: #7a5d2c;     /* marrón oliva */

  --gap: clamp(16px, 2.4vw, 36px);
  --fs: 15px;
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  letter-spacing: -0.005em;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; }
::selection { background: var(--ink); color: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   TRAZO A MANO ALZADA (lo dibuja main.js al pasar el mouse)
   ========================================================= */
[data-scribble] { position: relative; display: inline-block; }
.scribble {
  position: absolute;
  left: 0; top: 0;
  overflow: visible;
  pointer-events: none;
}
.scribble path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
@media (prefers-reduced-motion: reduce) {
  [data-scribble]:hover { text-decoration: underline; text-underline-offset: 4px; }
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px var(--gap);
  transition: background 0.3s ease, color 0.3s ease;
}
.nav.is-scrolled { background: rgba(243, 241, 236, 0.9); backdrop-filter: blur(8px); }
.nav--light { color: #fff; }
.nav__logo img { height: 28px; width: auto; transition: filter 0.3s ease; }
.nav--light .nav__logo img { filter: brightness(0) invert(1); }
.nav__links { display: flex; gap: 26px; font-size: 14px; padding-top: 4px; }
.nav__toggle { display: none; font-size: 14px; min-width: 44px; min-height: 44px; padding: 0 0 0 12px; margin: -10px 0; text-align: right; }

.menu {
  position: fixed; inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px var(--gap) 32px;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(.65, 0, .35, 1);
}
.menu.is-open { transform: translateY(0); }
.menu__top { display: flex; justify-content: space-between; align-items: flex-start; }
.menu__top img { height: 28px; width: auto; }
.menu__links a { display: block; font-size: clamp(40px, 12vw, 72px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.menu__social { display: flex; gap: 20px; font-size: 14px; color: var(--muted); }

@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
}

/* =========================================================
   LANDING TIPOGRÁFICA
   ========================================================= */
.landing { padding: 96px var(--gap) 3vh; }
.landing__hi {
  font-size: clamp(22px, 3.6vw, 50px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.landing__name {
  font-size: clamp(96px, 26.5vw, 460px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.8;
  margin: 2.5vh 0 0 -0.045em;
  white-space: nowrap;
}
.landing__sub, .work__head {
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.01em;
}
.landing__sub { padding-top: 3vh; }

/* =========================================================
   CARPETAS Y PORTADAS (tiles)
   ========================================================= */
.work { padding: 0 var(--gap) 10vh; }
.work__head { color: var(--muted); padding: 5vh 0 16px; align-items: center; }
.work__head .dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3.2vw, 48px) var(--gap); }
@media (max-width: 900px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

.tile[data-scribble] { display: block; }
.tile__tab {
  display: inline-block;
  background: var(--ink); color: var(--bg);
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 6px 12px 5px;
  border-radius: 10px 10px 0 0;
}
.tile__cover {
  position: relative; display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e2dfd8;
  border-radius: 14px;
}
.tile--folder .tile__cover { border-top-left-radius: 0; }
.tile__cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(.2,.7,.2,1);
}
.tile__cover img.is-on { opacity: 1; }
.tile:hover .tile__cover img.is-on { transform: scale(1.03); }
.tile__cover--text { display: flex; align-items: flex-end; padding: 18px; font-size: clamp(26px, 3vw, 40px); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.tile__cap { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 500; text-transform: uppercase; padding-top: 9px; }
.tile__cap span:last-child { color: var(--muted); white-space: nowrap; }

.fhead { padding: 120px var(--gap) 2vh; }
.fhead__title { font-size: clamp(54px, 12vw, 190px); font-weight: 700; letter-spacing: -0.06em; line-height: 0.85; margin: 22px 0 14px -0.04em; }

/* =========================================================
   ABOUT
   ========================================================= */
.about { padding: 8vh var(--gap) 12vh; display: grid; gap: 28px; border-top: 1px solid var(--line); margin: 0 var(--gap); padding-left: 0; padding-right: 0; }
@media (min-width: 900px) { .about { grid-template-columns: 3fr 9fr; } }
.about__label { font-size: 13px; color: var(--muted); }
.about__lead { font-size: clamp(24px, 3.4vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; max-width: 24ch; }
.about__body { display: grid; gap: 16px; max-width: 52ch; margin-top: 28px; font-size: 16px; }
.about__small { color: var(--muted); font-size: 13px; }

/* =========================================================
   PÁGINAS INTERNAS
   ========================================================= */
.page { padding: 120px var(--gap) 6vh; }
.page__back { font-size: 13px; color: var(--muted); }
.page__title { font-size: clamp(30px, 5vw, 64px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; margin: 22px 0 10px; }
.page__meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 9px; }

.flow { display: flex; flex-direction: column; gap: clamp(36px, 7vw, 110px); padding: 5vh var(--gap) 10vh; }
.flow figure { margin: 0; width: 100%; }
.flow figure.land { width: min(100%, 1120px); align-self: center; }
.flow figure.sq { width: min(100%, 760px); align-self: center; }
.flow figure.port { width: min(100%, 520px); }
@media (min-width: 900px) {
  .flow figure.port:nth-of-type(odd) { align-self: flex-start; margin-left: 8vw; }
  .flow figure.port:nth-of-type(even) { align-self: flex-end; margin-right: 8vw; }
}
@media (max-width: 899px) { .flow figure.port { align-self: center; } }
.flow img { width: 100%; height: auto; }
.flow figcaption { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 8px; }
.flow a { display: block; cursor: zoom-in; }

.pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin: 0 var(--gap);
  padding: 26px 0 8vh;
  border-top: 1px solid var(--line);
  font-size: clamp(18px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em;
}
.pager small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-bottom: 4px; }
.pager__next { text-align: right; }

/* reveal suave al scrollear */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s ease, transform 0.9s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox { position: fixed; inset: 0; background: rgba(243, 241, 236, 0.97); display: none; align-items: center; justify-content: center; z-index: 200; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.lightbox__close, .lightbox__nav { position: absolute; font-size: 22px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__nav--prev { left: 8px; }
.lightbox__nav--next { right: 8px; }

/* =========================================================
   SOCIAL MEDIA / CASOS
   ========================================================= */
.sec { padding: 6vh var(--gap); display: grid; gap: 20px; border-top: 1px solid var(--line); margin: 0 var(--gap); padding-left: 0; padding-right: 0; }
@media (min-width: 900px) { .sec { grid-template-columns: 3fr 9fr; } }
.sec__label { font-size: 13px; color: var(--muted); }
.statement { font-size: clamp(24px, 3.4vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; max-width: 26ch; }
.cols { display: grid; gap: 28px; }
@media (min-width: 800px) { .cols { grid-template-columns: 1fr 1fr; } }
.cols h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.cols p { max-width: 46ch; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 17px; }
.tags li::after { content: "/"; margin-left: 18px; color: var(--muted); }
.tags li:last-child::after { content: ""; }

.case { margin: 0 var(--gap); padding: 7vh 0 4vh; border-top: 1px solid var(--line); }
.case__n { font-size: 13px; color: var(--muted); }
.case__title { font-size: clamp(34px, 6vw, 84px); font-weight: 500; letter-spacing: -0.04em; line-height: 0.98; margin: 14px 0 8px; }
.case__meta { font-size: 13px; color: var(--muted); }
.case__lead { font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; max-width: 30ch; margin: 22px 0 28px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 18px; margin: 0 0 34px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border-top: 1px solid var(--ink); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.stat__num { font-size: clamp(30px, 4vw, 52px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.stat__label { font-size: 13px; line-height: 1.35; }
.stat__src { font-size: 11px; color: var(--muted); }
.case__body { display: grid; gap: 22px; margin-bottom: 34px; }
@media (min-width: 800px) { .case__body { grid-template-columns: 1fr 1fr; } }
.case__list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.brandmarks { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.brandmarks img { height: 84px; width: auto; background: #fff; padding: 10px; }
.link-out { display: inline-block; }

.figure { margin: 0 0 22px; }
.figure img { width: 100%; height: auto; }
.figure figcaption { font-size: 12px; color: var(--muted); padding-top: 8px; }
.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 14px; margin: 0 calc(var(--gap) * -1); padding-left: var(--gap); padding-right: var(--gap); scroll-snap-type: x proximity; }
.strip a { flex: 0 0 auto; scroll-snap-align: start; cursor: zoom-in; }
.strip img { height: 380px; width: auto; max-width: none; }
@media (min-width: 900px) { .strip img { height: 500px; } }
.strip--tall img { height: 72vh; }
.hint { font-size: 12px; color: var(--muted); padding-top: 4px; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { padding: 14vh var(--gap) 22px; display: grid; gap: 7vh; }
.footer__cta { font-size: clamp(30px, 5.4vw, 76px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; max-width: 14ch; }
.footer__cta a { display: inline-block; position: relative; }
.footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.footer__row a:hover { color: var(--ink); }

/* ---------- What I do / Results ---------- */
.services, .results { padding: 5vh 0 6vh; margin: 0 var(--gap); display: grid; gap: 28px; border-top: 1px solid var(--line); }
.services { border-top: 0; }
.services__list { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: s; }
.services__list li { counter-increment: s; display: grid; gap: 10px; align-content: start; }
.services__list li::before { content: "0" counter(s); font-size: 13px; color: var(--muted); }
.services__list h2 { font-size: clamp(24px, 3vw, 40px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.services__list p { max-width: 34ch; font-size: 16px; }
.process { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 17px; color: var(--muted); }
.process span:not(:last-child)::after { content: "→"; margin-left: 18px; }
.results__list { display: grid; gap: 0; }
.results__list li { border-top: 1px solid var(--line); }
.results__list li:first-child { border-top: 0; }
.results__list a { display: grid; grid-template-columns: minmax(110px, 0.35fr) 1fr; gap: 20px; align-items: baseline; padding: 20px 0; position: relative; }
.results__list b { font-size: clamp(28px, 4vw, 56px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.results__list span { max-width: 56ch; font-size: 16px; }
@media (max-width: 640px) { .results__list a { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Letras del nombre: cambian de color al apoyar el mouse ---------- */
.landing__name .ch { display: inline-block; transition: color 1.1s ease; }
.landing__name .ch:hover { color: var(--c); transition-duration: .12s; }

/* ---------- Carpetas como en la computadora ---------- */

.folder { display: block; }
.folder__art { position: relative; display: block; aspect-ratio: 4 / 3; }
.folder__back { position: absolute; left: 0; right: 0; top: 10%; bottom: 0; background: var(--fc); border-radius: 4px 12px 12px 12px; filter: brightness(0.94); }
.folder__back::before { content: ""; position: absolute; left: 0; top: -9%; width: 36%; height: 10%; background: inherit; border-radius: 10px 10px 0 0; }
.folder__photo { position: absolute; left: 7%; right: 7%; top: 16%; bottom: 22%; width: 86%; height: 62%; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 6px rgba(0,0,0,.12); transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.folder__front { position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: var(--fc); border-radius: 4px 12px 12px 12px; box-shadow: 0 -1px 0 rgba(255,255,255,.35) inset; transition: transform .55s cubic-bezier(.2,.7,.2,1); transform-origin: bottom; }
.folder:hover .folder__photo, .folder:focus-visible .folder__photo { transform: translateY(-14%); }
.folder:hover .folder__front, .folder:focus-visible .folder__front { transform: scaleY(0.96); }
.folder__cap { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.folder__cap span:last-child { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
.folder[data-scribble] { display: block; }
.folder .scribble { display: none; }
@media (prefers-reduced-motion: reduce) { .folder__photo, .folder__front { transition: none; } }

/* =========================================================
   CARPETAS QUE SE ABREN: las tarjetas salen de la carpeta
   ========================================================= */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }

.work__hint { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; padding: 4vh 0 0; }
.group2 { display: grid; grid-template-columns: minmax(230px, 26vw) 1fr; gap: 0 var(--gap); align-items: start; padding: 5vh 0; border-bottom: 1px solid var(--line); }
.group2:first-of-type { border-top: 0; }
button.folder { appearance: none; background: none; border: 0; padding: 0; margin: 0; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; position: relative; z-index: 2; }
button.folder .folder__cap span:first-child { max-width: 16ch; }
.group2.is-open .folder__photo { transform: translateY(-14%); }
.group2.is-open .folder__front { transform: perspective(700px) rotateX(-16deg); }
button.folder:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 6px; border-radius: 8px; }

.rail { --cw: clamp(150px, 17vw, 230px); display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; overflow-y: hidden; margin-left: -4vw; padding: 3vh 4px 24px 4vw; scrollbar-width: none; position: relative; z-index: 1; pointer-events: none; }
.rail::-webkit-scrollbar { display: none; }
.group2.is-open .rail { pointer-events: auto; }
.card { flex: 0 0 var(--cw); display: block; opacity: 0; transform: translateX(calc((var(--cw) + 16px) * var(--i) * -1 - 12vw)) scale(.82) rotate(-5deg); transform-origin: bottom left; transition: transform .75s cubic-bezier(.2,.8,.2,1) calc(var(--i) * 55ms), opacity .45s ease calc(var(--i) * 55ms); }
.group2.is-open .card { opacity: 1; transform: none; }
.card__img { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 10px; background: #e2dfd8; }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .card__img img { transform: scale(1.04); }
.card__img--text { display: flex; align-items: flex-end; padding: 16px; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.card__cap { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.card__cap span:last-child { color: var(--muted); font-size: 13px; font-weight: 400; }
.group__more { flex: 0 0 auto; align-self: center; margin: 0 24px 0 8px; font-size: 14px; opacity: 0; transition: opacity .5s ease .3s; }
.group2.is-open .group__more { opacity: 1; }

@media (max-width: 800px) {
  .group2 { grid-template-columns: 1fr; }
  button.folder { max-width: 340px; }
  .rail { margin-left: 0; padding: 0; max-height: 0; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; transition: max-height .7s ease, padding .6s ease; -webkit-mask-image: none; mask-image: none; }
  .group2.is-open .rail { max-height: 3600px; padding: 22px 0 8px; }
  .card { flex: none; transform: translateY(-40px) scale(.9); }
  .group__more { grid-column: 1 / -1; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .group2.is-open .card, .folder__photo, .folder__front { transition: none; transform: none; }
}

/* ---------- Ayudas de uso y accesibilidad ---------- */
@media (min-width: 801px) {
  .rail.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 90px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 90px), transparent); }
}
.rail__next { display: none; }
@media (min-width: 801px) {
  .group2.is-open .rail.has-more ~ .rail__next { display: block; }
}
.group2 { position: relative; }
.rail__next { position: absolute; right: 0; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; z-index: 3; }
.rail__next:hover { background: var(--ink); color: var(--bg); }
.rail__next:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.skip:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.scribble:not([width]) { display: none; }

/* =========================================================
   SOCIAL MEDIA: el celular aparece y se abren los resultados
   ========================================================= */
.phonesec { margin: 0 var(--gap); padding: 8vh 0 6vh; border-top: 1px solid var(--line); display: grid; gap: 28px; }
.phonesec__title { font-size: clamp(30px, 4.6vw, 64px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.02; max-width: 15ch; margin: 18px 0 22px; }
.stage { position: relative; min-height: 700px; display: flex; justify-content: center; align-items: flex-start; }
.phone { position: relative; width: clamp(230px, 22vw, 290px); aspect-ratio: 9 / 18.6; border: 9px solid #151412; border-radius: 44px; background: #fff; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(21,20,18,.45); opacity: 0; transform: translateY(46px) scale(.96); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.phone__island { position: absolute; top: 9px; left: 50%; width: 34%; height: 22px; margin-left: -17%; border-radius: 14px; background: #151412; z-index: 3; }
.phone__screen { position: absolute; inset: 0; }
.phone__bar { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 40px 16px 10px; font-size: 13px; font-weight: 500; background: linear-gradient(#fff 70%, rgba(255,255,255,0)); }
.phone__grid { position: absolute; left: 0; right: 0; top: 70px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; animation: phoneScroll 24s ease-in-out infinite alternate; }
.phone__grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
@keyframes phoneScroll { to { transform: translateY(-34%); } }
.phone__scan { position: absolute; left: 9%; right: 9%; top: 24%; bottom: 20%; z-index: 2; pointer-events: none; }
.phone__scan i { position: absolute; width: 22%; height: 18%; border: 0 solid #fff; opacity: 0; transition: opacity .6s ease .4s; filter: drop-shadow(0 0 2px rgba(0,0,0,.35)); }
.phone__scan i:nth-child(1) { left: 0; top: 0; border-width: 3px 0 0 3px; border-top-left-radius: 16px; }
.phone__scan i:nth-child(2) { right: 0; top: 0; border-width: 3px 3px 0 0; border-top-right-radius: 16px; }
.phone__scan i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 16px; }
.phone__scan i:nth-child(4) { right: 0; bottom: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 16px; }
.phonesec.is-live .phone { opacity: 1; transform: none; }
.phonesec.is-live .phone__scan i { opacity: 1; }
.phonesec.is-done .phone__scan i { opacity: 0; transition-delay: 0s; }

.pcard { position: absolute; width: min(340px, 30vw); display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; background: #f8f7f4; border-radius: 22px; box-shadow: 0 18px 40px -22px rgba(21,20,18,.35); opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.6); transition: transform .8s cubic-bezier(.2,.9,.25,1.1), opacity .45s ease; z-index: 4; }
.pcard--1 { top: 2%; right: 2%; --fx: -34%; --fy: 60%; }
.pcard--2 { top: 38%; left: 1%; --fx: 40%; --fy: 0; transition-delay: .18s; }
.pcard--3 { bottom: 4%; right: 7%; --fx: -36%; --fy: -50%; transition-delay: .36s; }
.phonesec.is-done .pcard { opacity: 1; transform: none; }
.pcard:hover { box-shadow: 0 22px 44px -20px rgba(21,20,18,.5); }
.pcard__main { display: grid; gap: 4px; justify-items: start; }
.pcard strong { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.pcard__sub { font-size: 12px; color: var(--muted); }
.pcard__desc { font-size: 13px; line-height: 1.35; margin-top: 4px; }
.pill { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; color: var(--ink); }
.pill--green { background: #c9d3bd; } .pill--rose { background: #e6d6d1; } .pill--blue { background: #cddcea; }
.ring { position: relative; flex: 0 0 76px; width: 76px; height: 76px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: #e7e4de; stroke-width: 4; }
.ring .ring__v { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; transition: stroke-dashoffset 1.3s cubic-bezier(.3,.7,.2,1) .5s; }
.phonesec.is-done .ring__v { stroke-dashoffset: calc(163.4 * (1 - var(--p) / 100)); }
.ring b { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }

@media (max-width: 980px) {
  .stage { flex-direction: column; align-items: center; min-height: 0; gap: 22px; }
  .pcard { position: static; width: 100%; max-width: 420px; transform: translateY(24px); --fx: 0; --fy: 0; }
  .phonesec.is-done .pcard { transform: none; }
  .phone { width: min(70vw, 270px); }
}
@media (prefers-reduced-motion: reduce) {
  .phone, .pcard { transition: none; opacity: 1; transform: none; }
  .phone__grid { animation: none; }
  .ring .ring__v { transition: none; stroke-dashoffset: calc(163.4 * (1 - var(--p) / 100)); }
}

/* =========================================================
   RETOQUE Y COLOR: comparador antes / después
   ========================================================= */
.rflow { padding: 2vh var(--gap) 10vh; display: grid; gap: 9vh; }
.rcase { display: grid; gap: 14px; max-width: 980px; margin: 0 auto; width: 100%; }
.rcase__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.rcase__head h2 { font-size: clamp(22px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.rcase__note { max-width: 56ch; font-size: 15px; color: var(--muted); }
.ba__toggle { display: flex; gap: 6px; }
.ba__toggle button { font: inherit; font-size: 13px; padding: 8px 16px; min-height: 40px; border-radius: 99px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.ba__toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.ba { position: relative; overflow: hidden; border-radius: 6px; background: #e2dfd8; max-width: min(100%, calc(80vh * var(--ar))); margin: 0 auto; width: 100%; user-select: none; }
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba__img--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba__tag { position: absolute; top: 12px; font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 99px; background: rgba(243,241,236,.92); color: var(--ink); pointer-events: none; }
.ba__tag--l { left: 12px; } .ba__tag--r { right: 12px; }
.ba__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(21,20,18,.25); pointer-events: none; }
.ba__line i { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(21,20,18,.3); }
.ba__line i::before, .ba__line i::after { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; border: solid var(--ink); border-width: 0 0 2px 2px; margin-top: -4px; }
.ba__line i::before { left: 11px; transform: rotate(45deg); } .ba__line i::after { right: 11px; transform: rotate(-135deg); }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba:focus-within .ba__line { box-shadow: 0 0 0 2px var(--ink); }

/* miniaturas before/after animadas */
.card__cap em, .rcase__head em, .case__title em, .page__title em { font-style: normal; color: var(--muted); }
.thumb-ba { position: relative; display: block; overflow: hidden; }
.thumb-ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__img.thumb-ba img { transform: none; }
.thumb-ba__after { clip-path: inset(0 100% 0 0); animation: baWipe 5s ease-in-out infinite alternate; }
.thumb-ba__line { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.25); animation: baLine 5s ease-in-out infinite alternate; }
@keyframes baWipe { 0%, 12% { clip-path: inset(0 100% 0 0); } 88%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes baLine { 0%, 12% { left: 0%; } 88%, 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .thumb-ba__after { animation: none; clip-path: inset(0 50% 0 0); }
  .thumb-ba__line { animation: none; left: 50%; }
}
.footer__coffee { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* ---------- Pilas de proyectos ---------- */
.stk { padding: 4vh 0 3vh; border-top: 1px solid var(--line); }
.stk:first-child { border-top: 0; }
.stk__head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stk__head h2 { margin: 0; font-weight: 600; font-size: clamp(30px, 5vw, 64px); letter-spacing: -0.05em; line-height: 1; }
.stk__btn { appearance: none; border: 0; font: inherit; font-size: 14px; color: var(--ink); background: rgba(21,20,18,.07); padding: 9px 16px; border-radius: 99px; cursor: pointer; min-height: 40px; }
.stk__btn:hover { background: var(--ink); color: var(--bg); }
.stk__area { position: relative; transition: height .5s cubic-bezier(.2,.7,.2,1); }
.stk__area:not(.fan) { cursor: pointer; }
.scard { position: absolute; left: 0; top: 0; width: var(--w, 200px); display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.scard__img { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 8px; background: #e2dfd8; }
.scard__img > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scard__img--text { display: flex; align-items: flex-end; padding: 16px; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stk__area:not(.fan) .scard__img { box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.scard__cap { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; opacity: 0; transition: opacity .3s; }
.scard__cap span:last-child { color: var(--muted); font-size: 13px; font-weight: 400; }
.scard__cap em { font-style: normal; color: var(--muted); }
.stk__area.fan .scard__cap { opacity: 1; }
.stk__area.fan .scard:hover .scard__img { transform: translateY(-3px); }
.scard__img { transition: transform .3s; }
@media (prefers-reduced-motion: reduce) { .scard, .stk__area { transition: none; } }
