:root {
  --project-ink: #292621;
  --project-muted: #746d65;
  --project-paper: #f7f2ec;
  --project-card: #fffdf9;
  --project-accent: #c86f49;
  --project-line: rgba(41, 38, 33, 0.14);
  --project-shadow: 0 24px 70px rgba(72, 52, 38, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--project-paper);
  color: var(--project-ink);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

.work-skip {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--project-ink);
  color: #fff;
  text-decoration: none;
}

.work-skip:focus { transform: translateY(0); }

.work-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 34px;
}

.work-brand,
.work-back {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.work-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(72, 52, 38, 0.12);
}

.work-brand span {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 23px;
  font-weight: 700;
}

.work-back {
  min-height: 44px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.work-back span { color: var(--project-accent); font-size: 18px; }

.work-hero {
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
  width: min(1220px, calc(100% - 64px));
  margin: 26px auto 0;
  padding: 30px 0 84px;
}

.work-hero__copy { max-width: 500px; }

.work-kicker {
  margin: 0 0 20px;
  color: var(--project-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.work-hero h1,
.work-gallery__heading h2,
.work-story h2,
.work-contact h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.work-hero h1 {
  max-width: 620px;
  font-size: clamp(54px, 7.2vw, 104px);
  line-height: 0.9;
}

.work-rule {
  display: block;
  width: 74px;
  height: 2px;
  margin: 30px 0;
  background: var(--project-accent);
}

.work-hero__summary {
  margin: 0;
  color: var(--project-muted);
  font-size: clamp(16px, 1.55vw, 20px);
  line-height: 1.7;
}

.work-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 34px 0 0;
}

.work-facts div {
  padding-top: 14px;
  border-top: 1px solid var(--project-line);
}

.work-facts dt {
  color: var(--project-muted);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.work-facts dd {
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.work-hero__media {
  min-height: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 34px;
  background: #e8dfd5;
  box-shadow: var(--project-shadow);
}

.work-hero__media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.work-gallery {
  overflow: hidden;
  padding: 86px 0 96px;
  background: #2b2823;
  color: #fff;
}

.work-gallery__heading,
.work-gallery__controls {
  width: min(1220px, calc(100% - 64px));
  margin-inline: auto;
}

.work-gallery__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.work-gallery__heading h2 {
  max-width: 720px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
}

.work-gallery__heading p:last-child {
  max-width: 330px;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.65;
}

.work-gallery__track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: max(32px, calc((100vw - 1220px) / 2));
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 max(32px, calc((100vw - 1220px) / 2)) 10px;
}

.work-gallery__track::-webkit-scrollbar { display: none; }

.work-gallery__slide {
  position: relative;
  flex: 0 0 min(480px, 40vw);
  aspect-ratio: 4 / 3;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 26px;
  background: #191816;
  scroll-snap-align: start;
}

.work-gallery__slide img,
.work-gallery__slide video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.work-gallery__slide--video figcaption {
  bottom: 58px;
}
.work-gallery__slide--external-video figcaption { bottom: 16px; }

.work-gallery__video-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.work-gallery__video-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-gallery__video-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 16, .08), rgba(20, 18, 16, .3));
}

.work-gallery__play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  padding-left: 3px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(255, 253, 249, .94);
  color: var(--project-ink);
  font-size: 21px;
  transform: translate(-50%, -50%);
  box-shadow: 0 12px 32px rgba(19, 17, 15, .28);
}

.work-gallery__video-link:hover .work-gallery__play { transform: translate(-50%, -50%) scale(1.06); }

.work-gallery__slide figcaption {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.68);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.work-gallery__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.work-gallery__counter {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.work-gallery__counter strong {
  color: #fff;
  font-size: 15px;
}

.work-gallery__buttons { display: flex; gap: 10px; }

.work-gallery__buttons button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 21px;
}

.work-gallery__buttons button:hover:not(:disabled) {
  border-color: var(--project-accent);
  background: var(--project-accent);
}

.work-gallery__buttons button:disabled { opacity: 0.28; cursor: default; }

.work-gallery--single .work-gallery__track { justify-content: center; }
.work-gallery--single .work-gallery__controls { display: none; }

.work-story {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: clamp(40px, 8vw, 130px);
  width: min(1050px, calc(100% - 64px));
  margin: 0 auto;
  padding: 112px 0;
}

.work-story h2 {
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
}

.work-story__copy {
  align-self: end;
  margin: 0;
  color: var(--project-muted);
  font-size: clamp(17px, 1.65vw, 21px);
  line-height: 1.75;
}

.work-contact {
  width: min(1160px, calc(100% - 64px));
  margin: 0 auto 76px;
  padding: clamp(44px, 7vw, 82px);
  border-radius: 34px;
  background: #eadfd3;
  text-align: center;
}

.work-contact h2 {
  max-width: 790px;
  margin-inline: auto;
  font-size: clamp(40px, 5.2vw, 68px);
  line-height: 1;
}

.work-contact > p:not(.work-kicker) {
  max-width: 650px;
  margin: 24px auto 30px;
  color: var(--project-muted);
  line-height: 1.7;
}

.work-contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.work-contact__primary,
.work-contact__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.work-contact__primary { background: var(--project-ink); color: #fff; }
.work-contact__secondary { border: 1px solid var(--project-line); }

.work-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 34px;
  border-top: 1px solid var(--project-line);
  color: var(--project-muted);
  font-size: 10px;
  letter-spacing: 0.5px;
}

a:focus-visible,
button:focus-visible,
.work-gallery__track:focus-visible {
  outline: 3px solid var(--project-accent);
  outline-offset: 4px;
}

/* El recorrido vive junto al proyecto: cada foto se muestra completa, sin recorte. */
.work-hero__gallery {
  width: min(100%, 460px);
  min-height: 0;
  aspect-ratio: auto;
  justify-self: end;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.work-hero__gallery .work-gallery__track {
  width: 100%;
  aspect-ratio: 2 / 3;
  gap: 0;
  scroll-padding-inline: 0;
  padding: 0;
}

.work-hero__gallery .work-gallery__slide {
  flex-basis: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 34px;
  background: #e8dfd5;
}

.work-hero__gallery .work-gallery__slide img,
.work-hero__gallery .work-gallery__slide video,
.work-hero__gallery .work-gallery__video-link img {
  object-fit: contain;
}

.work-hero__gallery .work-gallery__slide figcaption { display: none; }

.work-hero__gallery .work-gallery__controls {
  width: 100%;
  margin-top: 16px;
}

.work-hero__gallery .work-gallery__counter { color: var(--project-muted); }
.work-hero__gallery .work-gallery__counter strong { color: var(--project-ink); }

.work-hero__gallery .work-gallery__buttons button {
  border-color: rgba(43, 40, 35, 0.18);
  color: var(--project-ink);
}

.work-hero__gallery .work-gallery__buttons button:hover:not(:disabled) {
  border-color: var(--project-accent);
  color: #fff;
}

@media (max-width: 760px) {
  .work-header { padding: 15px 20px; }
  .work-brand span { font-size: 20px; }
  .work-brand img { width: 38px; height: 38px; }
  .work-back { max-width: 138px; font-size: 8px; letter-spacing: 0.8px; }

  .work-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    width: calc(100% - 36px);
    margin-top: 16px;
    padding: 28px 0 66px;
  }

  .work-kicker { margin-bottom: 15px; font-size: 9px; }
  .work-hero h1 { font-size: clamp(50px, 17vw, 72px); }
  .work-rule { margin: 23px 0; }
  .work-hero__summary { font-size: 15px; line-height: 1.65; }
  .work-facts { margin-top: 26px; }

  .work-hero__media {
    min-height: 0;
    aspect-ratio: 4 / 3;
    border-radius: 24px;
  }

  .work-hero__media img { min-height: 0; }

  .work-hero__gallery {
    width: 100%;
    aspect-ratio: auto;
    justify-self: stretch;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .work-hero__gallery .work-gallery__slide {
    flex-basis: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 24px;
  }

  .work-hero__gallery .work-gallery__controls { margin-top: 14px; }

  .work-gallery { padding: 66px 0 72px; }

  .work-gallery__heading,
  .work-gallery__controls {
    width: calc(100% - 36px);
  }

  .work-gallery__heading {
    display: block;
    margin-bottom: 26px;
  }

  .work-gallery__heading h2 { font-size: 44px; }

  .work-gallery__heading p:last-child {
    margin-top: 18px;
    font-size: 13px;
  }

  .work-gallery__track {
    gap: 12px;
    scroll-padding-inline: 18px;
    padding-inline: 18px;
  }

  .work-gallery__slide {
    flex-basis: min(82vw, 340px);
    border-radius: 21px;
  }

  .work-gallery--single .work-gallery__track { justify-content: flex-start; }

  .work-gallery__buttons button { width: 46px; height: 46px; }

  .work-story {
    grid-template-columns: 1fr;
    gap: 24px;
    width: calc(100% - 36px);
    padding: 82px 0;
  }

  .work-story h2 { font-size: 46px; }
  .work-story__copy { font-size: 16px; }

  .work-contact {
    width: calc(100% - 36px);
    margin-bottom: 38px;
    padding: 42px 20px;
    border-radius: 26px;
  }

  .work-contact h2 { font-size: 42px; }
  .work-contact__actions { display: grid; }
  .work-footer { display: grid; padding: 23px 20px; }
}

/* Ficha vertical: primero el video, después la historia y las fotos. */
.work-feature-video {
  width: min(620px, calc(100% - 64px));
  margin: 18px auto 42px;
}

.work-feature-video__stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: 28px;
  background: #27231f;
  box-shadow: var(--project-shadow);
  color: #fff;
}

.work-feature-video__stage > img,
.work-feature-video__stage > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-feature-video__stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(25, 21, 18, .18), transparent 45%, rgba(25, 21, 18, .26));
}

.work-feature-video__badge {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 249, .92);
  color: var(--project-ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.work-feature-video__play,
.work-feature-video__toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  padding-left: 3px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(255, 253, 249, .94);
  color: var(--project-ink);
  box-shadow: 0 12px 32px rgba(19, 17, 15, .28);
  font-size: 21px;
  transform: translate(-50%, -50%);
}

.work-feature-video__toggle { cursor: pointer; }
.work-feature-video__stage--external:hover .work-feature-video__play { transform: translate(-50%, -50%) scale(1.06); }

.work-hero {
  display: block;
  width: min(760px, calc(100% - 64px));
  margin: 0 auto;
  padding: 6px 0 34px;
}

.work-hero__copy { max-width: 650px; }
.work-hero__gallery { display: none; }

.work-hero h1 { font-size: clamp(50px, 7vw, 82px); }
.work-rule { margin: 22px 0; }

.work-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.work-facts div {
  padding: 9px 14px;
  border: 1px solid var(--project-line);
  border-radius: 999px;
}

.work-facts dt { display: none; }
.work-facts dd { margin: 0; color: #5d554e; font-size: 12px; }

.work-photos {
  width: min(900px, calc(100% - 64px));
  margin: 0 auto;
  padding: 24px 0 92px;
}

.work-photos__heading { margin-bottom: 24px; }

.work-photos h2 {
  max-width: 650px;
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.work-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.work-photo-open {
  position: relative;
  min-width: 0;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #e8dfd5;
  cursor: zoom-in;
}

.work-photo-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}

.work-photo-open::after {
  content: '';
  position: absolute;
  inset: 54% 0 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(24, 18, 15, .58));
}

.work-photo-open__hint {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 12px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: rgba(35, 29, 25, .68);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

@media (hover: hover) {
  .work-photo-open:hover img { transform: scale(1.035); }
}

.work-lightbox {
  width: min(calc(100% - 28px), 980px);
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: #191512;
  color: #fff;
  box-shadow: 0 28px 90px rgba(20, 14, 10, .48);
}

.work-lightbox:not([open]) { display: none; }
.work-lightbox::backdrop { background: rgba(24, 19, 16, .84); backdrop-filter: blur(8px); }
.work-lightbox__panel { position: relative; }
.work-lightbox__figure { display: grid; height: min(86dvh, 860px); margin: 0; grid-template-rows: minmax(0, 1fr) auto; }
.work-lightbox__image { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #191512; }
.work-lightbox__caption { min-height: 58px; margin: 0; padding: 14px 76px 14px 20px; background: #2b2420; color: rgba(255,255,255,.8); font-size: 12px; line-height: 1.45; }
.work-lightbox__close,
.work-lightbox__nav {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 50%;
  background: rgba(35,29,25,.72);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
}
.work-lightbox__close { top: 14px; right: 14px; }
.work-lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 32px; }
.work-lightbox__nav--previous { left: 14px; }
.work-lightbox__nav--next { right: 14px; }

body.work-lightbox-open { overflow: hidden; }

@media (max-width: 760px) {
  .work-feature-video { width: calc(100% - 36px); margin: 8px auto 34px; }
  .work-feature-video__stage { aspect-ratio: 5 / 4; border-radius: 18px; }
  .work-feature-video__badge { top: 12px; left: 12px; }
  .work-feature-video__play, .work-feature-video__toggle { width: 62px; height: 62px; }
  .work-hero { width: calc(100% - 36px); padding: 0 0 22px; }
  .work-hero h1 { font-size: clamp(46px, 14vw, 62px); }
  .work-hero__summary { max-width: 35ch; }
  .work-photos { width: calc(100% - 36px); padding: 18px 0 66px; }
  .work-photos__heading { margin-bottom: 18px; }
  .work-photos h2 { font-size: 40px; }
  .work-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .work-photo-open { border-radius: 13px; }
  .work-photo-open__hint { right: 8px; bottom: 8px; padding: 7px 9px; font-size: 9px; }
  .work-lightbox { width: calc(100% - 12px); max-height: calc(100dvh - 12px); border-radius: 18px; }
  .work-lightbox__figure { height: calc(100dvh - 12px); }
  .work-lightbox__caption { min-height: 70px; padding: 14px 120px 14px 16px; font-size: 11px; }
  .work-lightbox__nav { top: auto; bottom: 14px; width: 46px; height: 46px; transform: none; }
  .work-lightbox__nav--previous { right: 68px; left: auto; }
  .work-lightbox__nav--next { right: 14px; }
}

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