:root {
    --tinta: #0e0e0e;
    --papel: #ffffff;
    --hueso: #f4f3ef;
    --linea: #e6e4de;
    --gris: #8a877f;
    --grafito: #3a3935;
    --display: "Funnel Display", "Helvetica Neue", Arial, sans-serif;
    --mono: "Geist Mono", ui-monospace, Menlo, monospace;
    --g: clamp(16px, 4vw, 56px);
    --ease: cubic-bezier(.22, .7, .18, 1);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    background: var(--papel); color: var(--tinta);
    font-family: var(--display); font-size: 17px; line-height: 1.5;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
  }
  img { display: block; width: 100%; height: auto; }
  a { color: inherit; }
  .mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--gris); text-transform: uppercase; }

  .link {
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px;
    transition: background-size .5s var(--ease);
    padding-bottom: 2px;
  }
  .link:hover { background-size: 0 1px; background-position: 100% 100%; }

  /* ---------- header ---------- */
  header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px var(--g);
    position: sticky; top: 0; z-index: 5;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
  .logo img { height: 22px; width: auto; }
  header nav { display: flex; gap: 24px; }
  header nav a { text-decoration: none; color: var(--gris); transition: color .3s; }
  header nav a:hover { color: var(--tinta); }

  /* ---------- intro ---------- */
  .intro { padding: clamp(80px, 16vw, 220px) var(--g) clamp(64px, 10vw, 140px); }
  .intro h1 {
    font-weight: 600; letter-spacing: -.025em; line-height: 1.02;
    font-size: clamp(40px, 7vw, 112px); max-width: 13ch;
  }
  .intro h1 span { color: var(--gris); }
  .intro .mono { margin-top: 32px; display: block; }

  /* ---------- index ---------- */
  .toc { list-style: none; padding: 0 var(--g); border-top: 1px solid var(--linea); margin: 0 var(--g); padding: 0; }
  .toc li { border-bottom: 1px solid var(--linea); }
  .toc a {
    display: grid; grid-template-columns: 3em 1fr auto; align-items: baseline; gap: 12px;
    padding: 18px 0; text-decoration: none;
  }
  .toc .t { font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.015em; transition: transform .5s var(--ease); }
  .toc a:hover .t { transform: translateX(10px); }
  .toc .r { text-align: right; }

  /* ---------- work ---------- */
  .work { padding: clamp(96px, 14vw, 200px) var(--g) 0; scroll-margin-top: 60px; }
  .head {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--g); align-items: end;
    margin-bottom: clamp(28px, 4vw, 48px);
  }
  .head h2 { font-weight: 600; letter-spacing: -.025em; line-height: 1; font-size: clamp(36px, 5.4vw, 80px); }
  .head .meta { display: flex; flex-direction: column; gap: 14px; max-width: 46ch; }
  .head p { color: var(--grafito); font-size: 18px; line-height: 1.45; }
  .head .row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
  .head .row a { font-size: 16px; }

  .frame { background: var(--hueso); border: 1px solid var(--linea); overflow: hidden; }
  .grid { display: grid; gap: clamp(8px, 1.2vw, 16px); margin-top: clamp(8px, 1.2vw, 16px); }
  .grid.dm { grid-template-columns: 2.6fr 1fr; align-items: stretch; }
  .grid.dm .frame:last-child { position: relative; }
  .grid.dm .frame:last-child img {
    position: absolute; top: clamp(14px, 2.2vw, 32px); left: 50%; transform: translateX(-50%);
    width: 72%; border: 1px solid var(--linea);
  }
  .grid.two { grid-template-columns: 1fr 1fr; }

  /* ---------- footer ---------- */
  footer { padding: clamp(120px, 18vw, 260px) var(--g) 40px; }
  footer h2 { font-weight: 600; letter-spacing: -.025em; line-height: 1.02; font-size: clamp(36px, 6vw, 96px); max-width: 14ch; }
  footer h2 a { text-decoration: none; }
  footer h2 .u { background: linear-gradient(currentColor, currentColor) no-repeat 0 92% / 100% 3px; transition: background-size .55s var(--ease); }
  footer h2 a:hover .u { background-size: 0 3px; background-position: 100% 92%; }
  .base { display: flex; justify-content: space-between; align-items: center; margin-top: clamp(80px, 12vw, 160px); padding-top: 20px; border-top: 1px solid var(--linea); }
  .base img { height: 18px; width: auto; }
.base .firma { display: flex; align-items: center; gap: 8px; color: var(--tinta); font-family: var(--display); text-transform: none; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

  /* ---------- reveal ---------- */
  .rv { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
  .rv.in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) {
    .rv { opacity: 1; transform: none; transition: none; }
    .toc .t, .link, footer h2 .u { transition: none; }
  }

  @media (max-width: 760px) {
    header nav a:first-child { display: none; }
    .head { grid-template-columns: 1fr; gap: 16px; }
    .grid.dm, .grid.two { grid-template-columns: 1fr; }
    .grid.dm .frame:last-child { display: none; }
    .toc a { grid-template-columns: 2.4em 1fr; }
    .toc .r { display: none; }
  }

/* ---------- cover (one image per piece on the index) ---------- */
.cover { display: block; text-decoration: none; }
.cover .frame img { transition: transform 1.2s var(--ease); }
.cover:hover .frame img { transform: scale(1.015); }
.cover .grid { margin-top: 0; }

/* ---------- case pages ---------- */
.case-intro { padding: clamp(72px, 12vw, 180px) var(--g) clamp(48px, 7vw, 96px); }
.case-intro h1 {
  font-weight: 600; letter-spacing: -.03em; line-height: .95;
  font-size: clamp(56px, 11vw, 176px);
}
.case-intro .lead {
  margin-top: clamp(28px, 4vw, 48px); max-width: 40ch;
  font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; color: var(--grafito);
}
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g);
  margin-top: clamp(40px, 6vw, 72px); padding-top: 18px; border-top: 1px solid var(--linea);
}
.facts dt { margin-bottom: 6px; }
.facts dd { font-size: 16px; }

.plates { padding: 0 var(--g); display: flex; flex-direction: column; gap: clamp(56px, 9vw, 140px); }
.plate figcaption { margin-top: 14px; }
.plate.narrow { width: min(100%, 860px); margin: 0 auto; }
.plate .grid.two { margin-top: 0; }

.next { padding: clamp(120px, 16vw, 240px) var(--g) 40px; }
.next a { text-decoration: none; display: inline-block; }
.next .t { display: block; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-size: clamp(48px, 9vw, 144px); transition: transform .6s var(--ease); }
.next a:hover .t { transform: translateX(14px); }

@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- fit images in the viewport ---------- */
.plate { width: min(100%, calc(76vh * var(--ar, 1.6))); margin: 0 auto; }
.plate.narrow { width: min(100%, 860px, calc(76vh * var(--ar, 1.6))); }

/* ---------- strips: a row of images that fills the width at one height ---------- */
.strip { display: flex; gap: clamp(8px, 1.2vw, 16px); width: min(100%, calc(62vh * var(--sum) + (var(--n) - 1) * 16px)); }
.strip > * { flex: var(--ar) 1 0; min-width: 0; aspect-ratio: var(--ar); }
.strip > * > img, .strip > * > video { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .strip { width: 100%; }
  .strip > :not(:first-child) { display: none; }
}

/* built tiles (logos over color or image) */
.tile { position: relative; display: grid; place-items: center; overflow: hidden; }
.tile > img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.tile .mark { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4%; width: 100%; }
.tile.cuervo .mark img:first-child { width: 17%; }
.tile.cuervo .mark img:last-child { width: 46%; }
.tile.neto { background: #2b45ff; color: #fff; }
.tile.neto img { width: 34%; filter: invert(1); }
video { display: block; width: 100%; height: auto; }
.tile { aspect-ratio: var(--ar); }
.tile.sepal { background: #2b45ff; }
.tile.sepal img { width: 38%; }
.strip > .tile > img:not(.bg) { width: 34%; height: auto; object-fit: contain; }
.strip > .tile.sepal > img { width: 38%; }
.tile .mark img { display: block; height: auto; }
.tile.cuervo .mark { gap: clamp(8px, 2.2vw, 28px); }

/* strips always fill the width; height is the natural one, capped at 62vh (images crop a little if needed) */
.strip {
  --gap: clamp(8px, 1.2vw, 16px);
  width: 100%; gap: var(--gap);
  height: min(62vh, calc((100vw - 2 * var(--g) - (var(--n) - 1) * var(--gap)) / var(--sum)));
}
.strip > * { aspect-ratio: auto; height: 100%; }
@media (max-width: 760px) {
  .strip { height: auto; }
  .strip > :first-child { aspect-ratio: var(--ar); height: auto; }
}
.cover { width: 100%; }

/* ---------- sepal tiles ---------- */
.tile .word { position: absolute; top: 7%; left: 8%; font-family: "Outfit", var(--display); font-weight: 600; font-size: clamp(13px, 1.4vw, 20px); letter-spacing: -.02em; color: #f4f2ee; z-index: 1; }
.tile.sepal-city svg { position: relative; width: 34%; }
.tile.sepal-type { background: #2b45ff; place-items: end start; padding: 8%; }
.tile.sepal-type p { font-family: "Outfit", var(--display); font-weight: 600; color: #f4f2ee; line-height: .92; letter-spacing: -.045em; font-size: clamp(32px, 5.2vw, 88px); }
.tile.sepal-type p span { color: rgba(244, 242, 238, .55); }
.tile.sepal-bleed { background: #0d0d0c; }
.tile.sepal-bleed svg { position: absolute; width: 130%; left: -25%; top: 18%; }
#cualquiera .strip img { object-position: center bottom; }
#gestalt .strip img { object-position: center top; }
.tile.sepal-grid { background: #f3f1ec; }
.tile.sepal-grid .word { color: #0d0d0c; }
.tile.sepal-grid svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile.sepal-grid line { vector-effect: non-scaling-stroke; }

/* hero en español: el titular es más largo, más ancho de línea y un pelo más pequeño si la pantalla es baja */
.intro h1 { font-size: clamp(40px, min(7vw, 10.5vh), 112px); }
html[lang="es"] .intro h1 { max-width: 18ch; }
