:root {
  --ink: #0e0e0e;
  --paper: #f3f2ee;
  --paper-2: #e8e6e1;
  --text: #141414;
  --muted: #6e6c67;
  --muted-dark: #8f8d88;
  --line: rgba(20, 20, 20, 0.14);
  --line-dark: rgba(243, 242, 238, 0.12);

  --pad: clamp(16px, 3.9vw, 56px);
  --pad-wide: clamp(16px, 6.45vw, 93px);
  --section-y: clamp(88px, 11vw, 160px);

  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---------- Tipografía base ---------- */

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--muted);
}

.dark .label,
.hero .label {
  color: var(--muted-dark);
}

.display {
  font-family: var(--display);
  font-stretch: 66%;
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.fit {
  font-size: 12.4vw;
  white-space: nowrap;
}

.fit > span {
  display: inline-block;
}

.lead {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(21px, 2vw, 29px);
  line-height: 1.38;
}

.lead + .lead {
  margin-top: 0.8em;
}

.dark {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Media / placeholders ---------- */

.media {
  position: relative;
  overflow: hidden;
  background: var(--ph, #2e2e2e);
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media__note {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 242, 238, 0.85);
  pointer-events: none;
}

.media:not(.media--empty) .media__note {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* ---------- Barra superior ---------- */

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad) 0;
  color: var(--paper);
}

.logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(243, 242, 238, 0.75);
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.logo--img {
  width: 56px;
  height: 56px;
  border: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo--img:hover {
  transform: scale(1.06);
}

.logo--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 42px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topnav__link:hover,
.langs__link:hover {
  opacity: 0.7;
}

.langs {
  display: flex;
  gap: 14px;
  font-weight: 400;
}

.langs__link {
  color: var(--muted-dark);
}

.langs__link.is-active {
  color: var(--paper);
  font-weight: 600;
}

.langs__sep {
  color: #555;
}

/* ---------- Portada ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding: 120px var(--pad) clamp(60px, 6vw, 90px);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 561fr 752fr;
  height: clamp(520px, 50vw, 720px);
}

.hero__intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 40px clamp(140px, 21vw, 300px) 0;
}

.hero__roles {
  line-height: 1.95;
}

.hero__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(34px, 3.9vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.hero__media {
  min-height: 420px;
}

.hero__media :is(img, video) {
  /* Encuadre hacia arriba para no cortar la cabeza en retratos verticales */
  object-position: 50% 18%;
}

.hero__media .media__note,
.hero__reel {
  bottom: clamp(70px, 7vw, 100px);
}

.hero__reel {
  position: absolute;
  right: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
}

.hero__reel:hover {
  opacity: 0.7;
}

.hero__bottom {
  position: relative;
  z-index: 2;
}

.hero__bottom .display {
  margin-top: -0.36em;
  color: #f2f2f0;
}

.hero__scroll {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  padding: 2px 0 2px 16px;
  border-left: 1px solid rgba(243, 242, 238, 0.4);
}

/* ---------- Cine ---------- */

.film {
  background: var(--paper);
  padding: var(--section-y) var(--pad-wide);
}

.film + .film {
  padding-top: 0;
}

.film__grid {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 86px);
  align-items: center;
  max-width: 1254px;
  margin: 0 auto;
}

.film--reverse .film__grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
}

.film--reverse .film__poster {
  order: 2;
}

.film__poster {
  aspect-ratio: 2 / 3;
}

.film__title {
  margin-top: 30px;
  font-size: clamp(54px, 6vw, 88px);
  line-height: 0.92;
  font-stretch: 70%;
}

.film__subtitle {
  margin-top: 14px;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 1.9vw, 27px);
  color: var(--muted);
}

.film__desc {
  margin-top: 30px;
  max-width: 620px;
  font-weight: 300;
  font-size: clamp(19px, 1.65vw, 24px);
  line-height: 1.42;
}

.film__desc + .film__desc {
  margin-top: 0.7em;
}

.film__closing {
  margin-top: 18px;
  max-width: 620px;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 1.4vw, 21px);
  line-height: 1.45;
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.meta dt {
  line-height: 1.4;
}

.meta dd {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.cta {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.cta:hover {
  border-color: currentColor;
}

.film__note {
  margin-top: 54px;
  max-width: 540px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- Relatos ---------- */

.relatos {
  background: var(--paper);
  padding: var(--section-y) var(--pad);
  border-top: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: 553fr 775fr;
  gap: 24px;
}

.split .label {
  padding-top: 0.5em;
}

.stills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 56px;
}

.still__media {
  aspect-ratio: 427 / 266;
}

.still__caption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
}

.still__title {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.still__role {
  color: var(--muted);
}

.relatos__cta {
  margin-top: 48px;
}

/* ---------- Otros medios ---------- */

.across {
  padding: var(--section-y) var(--pad);
}

.across__intro {
  display: grid;
  grid-template-columns: max-content minmax(0, 630px);
  justify-content: start;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  margin-top: 40px;
  padding-bottom: clamp(48px, 7vw, 108px);
  border-bottom: 1px solid var(--line-dark);
}

.across__number {
  font-size: clamp(150px, 22vw, 320px);
  line-height: 0.8;
  font-stretch: 62%;
  letter-spacing: -0.02em;
}

.across .lead {
  font-size: clamp(21px, 2.2vw, 32px);
}

.clients {
  display: flex;
  flex-wrap: wrap;
  padding: 36px 0;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: clamp(22px, 2.3vw, 33px);
  line-height: 1.45;
  text-transform: uppercase;
}

.clients li:not(:last-child)::after {
  content: '·';
  margin: 0 0.32em;
  color: #6b6a66;
}

.across__langs {
  margin-top: 56px;
}

.gallery {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.15fr 0.8fr;
  gap: 16px;
  align-items: end;
  margin-top: clamp(56px, 7vw, 100px);
}

.gallery__item {
  aspect-ratio: 4 / 5;
}

.gallery__item:nth-child(4n + 2) {
  aspect-ratio: 1 / 1;
}

.gallery__item:nth-child(4n + 3) {
  aspect-ratio: 1.45 / 1;
}

/* ---------- Publicaciones ---------- */

.pubs {
  background: var(--paper);
  padding: clamp(110px, 12.5vw, 180px) var(--pad-wide);
}

.pubs__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 43px);
  margin-top: 56px;
}

.pub__cover {
  aspect-ratio: 3 / 4;
}

.pub__link {
  display: block;
}

a.pub__link:hover .pub__title {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.pub__title {
  margin-top: 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.2;
}

.pub__sub {
  margin-top: 12px;
  max-width: 330px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.pub__desc {
  margin-top: 10px;
  max-width: 340px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.45;
  color: #3d3b38;
}

/* ---------- Sobre mí ---------- */

.about {
  background: var(--paper-2);
  padding: clamp(110px, 12vw, 172px) var(--pad-wide);
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 86px);
  align-items: center;
}

.about__portrait {
  aspect-ratio: 4 / 5;
}

.about__lead {
  margin-top: 24px;
  font-weight: 300;
  font-size: clamp(23px, 2.15vw, 31px);
  line-height: 1.36;
}

.about__lead + .about__lead {
  margin-top: 0.7em;
}

.about__body {
  margin-top: 26px;
  font-weight: 300;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.62;
  color: #5d5b57;
}

.about__body + .about__body {
  margin-top: 0.8em;
}

/* ---------- Contacto ---------- */

.contact {
  padding: clamp(110px, 12vw, 172px) var(--pad) 0;
}

.contact .display {
  margin-top: 40px;
}

.contact__roles {
  margin-top: 40px;
  font-size: 13.5px;
}

.contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-top: 40px;
  padding-top: 44px;
  border-top: 1px solid var(--line-dark);
}

.contact__invite {
  margin-bottom: 14px;
}

.contact__email {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(32px, 4.6vw, 66px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contact__site {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.contact__email:hover,
.contact__site:hover,
.social a:hover,
.footer__top:hover {
  opacity: 0.7;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 6px;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: clamp(72px, 8vw, 110px) var(--pad) 24px;
}

.footer .label {
  font-size: 11.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero {
    padding-top: 96px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .hero__intro {
    padding: 8px 0 40px;
    gap: 64px;
  }

  .hero__media {
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

  .hero__scroll {
    display: none;
  }

  .film__grid,
  .film--reverse .film__grid,
  .about__grid {
    grid-template-columns: 1fr;
  }

  .film--reverse .film__poster {
    order: 0;
  }

  .film__poster,
  .about__portrait {
    max-width: 500px;
  }

  .split,
  .across__intro {
    grid-template-columns: 1fr;
  }

  .stills {
    grid-template-columns: 1fr 1fr;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery__item,
  .gallery__item:nth-child(n) {
    aspect-ratio: 4 / 5;
  }

  .pubs__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .topnav {
    gap: 20px;
  }

  .stills,
  .pubs__grid {
    grid-template-columns: 1fr;
  }

  .meta {
    grid-template-columns: 1fr;
  }

  .pub__cover {
    max-width: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Animaciones ---------- */
/* Estados iniciales solo con JS activo (.js) y si el sistema no pide reducir movimiento.
   El script añade .is-in cuando el elemento entra en pantalla. --d es el retraso. */

@media (prefers-reduced-motion: no-preference) {
  :root {
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-wipe: cubic-bezier(0.77, 0, 0.18, 1);
  }

  .js :is([data-reveal], [data-stagger] > *) {
    transition:
      opacity 0.9s var(--ease-out) var(--d, 0ms),
      transform 1.1s var(--ease-out) var(--d, 0ms),
      clip-path 1.3s var(--ease-wipe) var(--d, 0ms);
  }

  /* Sube y aparece */
  .js :is([data-reveal='up'], [data-stagger]:not([data-stagger-reveal]) > *):not(.is-in) {
    opacity: 0;
    transform: translate3d(0, 48px, 0);
  }

  /* Solo aparece */
  .js [data-reveal='fade']:not(.is-in) {
    opacity: 0;
  }

  /* Cortina: la imagen se descubre de abajo arriba (o de izquierda a derecha) con un leve zoom */
  .js :is([data-reveal^='wipe'], [data-stagger-reveal='wipe'] > *) {
    clip-path: inset(0 0 0 0);
  }

  .js :is([data-reveal='wipe'], [data-stagger-reveal='wipe'] > *):not(.is-in) {
    clip-path: inset(100% 0 0 0);
  }

  .js [data-reveal='wipe-left']:not(.is-in) {
    clip-path: inset(0 100% 0 0);
  }

  .js :is([data-reveal^='wipe'], [data-stagger-reveal='wipe'] > *) :is(img, video) {
    transition: transform 1.8s var(--ease-out) var(--d, 0ms);
  }

  .js :is([data-reveal^='wipe'], [data-stagger-reveal='wipe'] > *):not(.is-in) :is(img, video) {
    transform: scale(1.18);
  }

  .js :is([data-reveal^='wipe'], [data-stagger-reveal='wipe'] > *) :is(.media__note, .hero__reel) {
    transition: opacity 0.6s ease calc(var(--d, 0ms) + 800ms);
  }

  .js :is([data-reveal^='wipe'], [data-stagger-reveal='wipe'] > *):not(.is-in) :is(.media__note, .hero__reel) {
    opacity: 0;
  }

  /* Nombres gigantes: emergen desde abajo */
  .js [data-reveal='rise'] > span {
    transition:
      opacity 1s var(--ease-out) var(--d, 0ms),
      transform 1.3s var(--ease-out) var(--d, 0ms);
  }

  .js [data-reveal='rise']:not(.is-in) > span {
    opacity: 0;
    transform: translate3d(0, 38%, 0);
  }

  /* Microinteracciones */
  .pub__cover img {
    transition: transform 0.9s var(--ease-out);
  }

  a.pub__link:hover .pub__cover img {
    transform: scale(1.04);
  }

  .cta span,
  .social a span,
  .footer__top span {
    display: inline-block;
    transition: transform 0.4s var(--ease-out);
  }

  .cta:hover span {
    transform: translateX(6px);
  }

  .social a:hover span {
    transform: translate(3px, -3px);
  }

  .footer__top:hover span {
    transform: translateY(-4px);
  }
}
