@font-face { font-family: "PP Neue Montreal"; src: url("../assets/fonts/PPNeueMontreal-Book.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PP Neue Montreal"; src: url("../assets/fonts/PPNeueMontreal-Medium.otf") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "PP Neue Montreal"; src: url("../assets/fonts/PPNeueMontreal-Italic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }

/* Mismo sistema que la landing: frame de 1440px */
:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.55);
  --rule: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.18);
  --gutter: clamp(16px, 4.17vw, 60px);
  --fs-small: clamp(14px, 1.53vw, 22px);
  --fs-body: clamp(17px, 1.67vw, 24px);
  --fs-row: clamp(26px, 3.9vw, 56px);
  --fs-display: clamp(40px, 6.4vw, 92px);
  --fs-hero: clamp(48px, 8.4vw, 121px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-blind: cubic-bezier(.77, 0, .18, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "PP Neue Montreal", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
figure, h1, h2, h3, p { margin: 0; }
u { text-decoration-thickness: 0.05em; text-underline-offset: 0.12em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.small { font-size: var(--fs-small); }
.muted { color: var(--muted); }

/* Texto pequeño con línea horizontal */
.rule-row { display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); font-size: var(--fs-small); white-space: nowrap; }
.rule { flex: 1; height: 1px; background: var(--rule); }
.eyebrow { margin: 0 0 clamp(28px, 3.5vw, 50px); }
.eyebrow em { font-style: italic; }
.display { font-size: var(--fs-display); font-weight: 400; line-height: 1.2; letter-spacing: -0.02em; }
.title-xl { font-size: var(--fs-hero); font-weight: 500; line-height: 0.9; letter-spacing: -0.03em; }

/* NAV: fija, en modo "difference" para que se lea sobre fotos y sobre negro */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(16px, 1.7vw, 24px) var(--gutter);
  font-size: var(--fs-small);
  mix-blend-mode: difference;
  transition: opacity .5s ease, transform .5s var(--ease);
}
.nav.is-hidden { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.nav__links { display: flex; gap: clamp(16px, 2vw, 32px); }
.nav a { position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* HERO (home): slider con fundido sobre negro */
.hero {
  position: relative; height: min(100svh, 62.7vw); min-height: 520px;
  background: #000; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero__slides { position: absolute; inset: 0; }
.hero__slides::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 60%, rgba(0,0,0,.5)); }
.hero__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 1s ease, transform 3.2s ease-out; }
.hero__slide.is-active { opacity: 1; transform: none; }
.hero__top, .hero__bottom { position: relative; z-index: 1; }
.hero__top { padding: clamp(20px, 2.1vw, 30px) var(--gutter) 0; }
.hero__logo { flex-shrink: 0; height: clamp(40px, 5.1vw, 74px); width: auto; }
.hero__bottom { display: flex; align-items: baseline; justify-content: space-between; padding: 0 20px 8px; }
.hero__title { font-size: var(--fs-hero); font-weight: 500; letter-spacing: -0.03em; line-height: 0.85; }

/* SECCIONES */
.section { padding: clamp(64px, 7.8vw, 112px) var(--gutter) 0; }
.page-top { padding-top: clamp(110px, 12vw, 170px); }
.lead { max-width: 30em; margin-top: clamp(24px, 3vw, 44px); font-size: var(--fs-body); line-height: 1.35; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); margin-top: clamp(28px, 4vw, 60px); font-size: var(--fs-body); line-height: 1.35; color: var(--muted); }

/* ÍNDICE DE PROYECTOS: filas tipográficas con vista previa que sigue al cursor */
.index { border-bottom: 1px solid var(--line); }
.row {
  position: relative; display: grid; align-items: baseline;
  grid-template-columns: 4em 1fr 22em 4em;
  gap: 20px; padding: clamp(14px, 1.6vw, 22px) 0;
  border-top: 1px solid var(--line);
  transition: color .4s ease;
}
.row__n, .row__cat, .row__year { font-size: var(--fs-small); color: var(--muted); }
.row__year { text-align: right; }
.row__title { font-size: var(--fs-row); letter-spacing: -0.02em; line-height: 1.05; transition: transform .5s var(--ease); }
.row__thumb { display: none; }
@media (hover: hover) {
  .index:hover .row { color: rgba(255, 255, 255, .35); }
  .index:hover .row:hover { color: var(--fg); }
  .row:hover .row__title { transform: translateX(clamp(10px, 1.5vw, 24px)); }
}
.preview {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: clamp(220px, 22vw, 320px); aspect-ratio: 4 / 5; overflow: hidden;
  opacity: 0; transform: translate(-50%, -50%) scale(.85);
  transition: opacity .35s ease, transform .5s var(--ease);
}
.preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.preview img.is-current { opacity: 1; }

/* CARRUSEL de imágenes (como en la landing) */
.marquee { margin-top: clamp(56px, 7vw, 100px); overflow: hidden; }
.marquee__track { display: flex; gap: clamp(20px, 3.7vw, 53px); width: max-content; animation: marquee 60s linear infinite; }
.marquee__track a { flex-shrink: 0; }
.marquee__track img { height: clamp(164px, 23.1vw, 333px); width: auto; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s var(--ease), box-shadow .5s ease; }
@media (hover: hover) { .marquee__track a:hover img { transform: scale(1.05); box-shadow: 0 24px 48px rgba(0,0,0,.6); } }
@keyframes marquee { to { transform: translateX(calc(-50% - clamp(10px, 1.85vw, 26.5px))); } }

/* CLIENTES: logos en blanco, separados por líneas */
.clients { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.clients div { display: grid; place-items: center; height: clamp(110px, 12vw, 170px); border-left: 1px solid var(--line); }
.clients div:first-child { border-left: 0; }
.clients img { max-width: 60%; max-height: 42%; width: auto; height: auto; filter: brightness(0) invert(1); opacity: .7; transition: opacity .4s ease, transform .5s var(--ease); }
.clients div:hover img { opacity: 1; transform: scale(1.06); }

/* CARDS (página Works) */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.1vw, 16px); row-gap: clamp(28px, 3vw, 48px); }
.cards a { display: block; }
.cards .blind__img { overflow: hidden; aspect-ratio: 4 / 5; }
.cards img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.cards figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: clamp(12px, 1.4vw, 20px); font-size: var(--fs-small); }
.cards figcaption span:last-child { color: var(--muted); }
.cards figure:nth-child(3n+2) { --delay: .12s; }
.cards figure:nth-child(3n) { --delay: .24s; }
@media (hover: hover) { .cards a:hover img { transform: scale(1.05); } }

/* Aparición tipo "persiana": la imagen empieza como una línea fina y se despliega hacia abajo */
.blind.reveal { opacity: 1; transform: none; }
.blind .blind__img { clip-path: inset(0 0 calc(100% - 3px) 0); transition: clip-path 1.2s var(--ease-blind) var(--delay, 0s); }
.blind figcaption { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; transition-delay: calc(var(--delay, 0s) + .8s); }
.blind.is-visible .blind__img { clip-path: inset(0); }
.blind.is-visible figcaption { opacity: 1; transform: none; }

/* GALERÍA en columnas (Info) */
.masonry { columns: 3; column-gap: clamp(8px, 1.1vw, 16px); padding: 0 var(--gutter); margin-top: clamp(40px, 6vw, 90px); }
.masonry .shot { margin-bottom: clamp(8px, 1.1vw, 16px); break-inside: avoid; }

/* DETALLE DE PROYECTO */
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); margin-top: clamp(28px, 4vw, 60px); }
.detail-meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 30px; font-size: var(--fs-small); align-content: start; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; }
.detail-meta p { font-size: var(--fs-body); line-height: 1.35; }
.shots { display: flex; flex-direction: column; gap: clamp(10px, 1.1vw, 16px); padding: clamp(56px, 7vw, 100px) var(--gutter) 0; }
.shot { display: block; width: 100%; overflow: hidden; cursor: zoom-in; }
.shot img { width: 100%; height: auto; transition: transform .8s var(--ease); }
.shot--wide .blind__img { aspect-ratio: 16 / 10; }
.shot--wide img, .shots__pair img { height: 100%; object-fit: cover; }
@media (hover: hover) { .shot:hover img { transform: scale(1.02); } }
.shots__pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.1vw, 16px); }
.shots__pair .blind__img { aspect-ratio: 1; }
.shots__pair .shot:nth-child(2n) { --delay: .12s; }

.next { display: grid; grid-template-columns: 1fr clamp(160px, 22vw, 320px); align-items: end; gap: 30px; }
.next__img { overflow: hidden; aspect-ratio: 4 / 5; }
.next__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.next__title { transition: transform .5s var(--ease); }
@media (hover: hover) { .next:hover .next__img img { transform: scale(1.06); } .next:hover .next__title { transform: translateX(clamp(10px, 1.5vw, 24px)); } }

/* CONTACTO: titular que se escribe + subrayado que se dibuja */
.typewriter .ch { opacity: 0; }
.typewriter .ch.is-typed { opacity: 1; }
.typewriter.is-done .ch { opacity: 1; }
.caret { position: relative; display: inline-block; width: 0; }
.caret::after { content: ""; position: absolute; left: .04em; bottom: -.12em; width: .05em; height: 1em; background: currentColor; animation: caret-blink .9s steps(1) infinite; }
.typewriter.is-typing .caret::after { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }
.draw-underline { background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - .1em) / 0% .05em; transition: background-size .9s var(--ease-blind); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.typewriter.is-underlined .draw-underline { background-size: 100% .05em; }
.contact__mail { display: inline-block; margin-top: clamp(28px, 4vw, 56px); font-size: var(--fs-row); letter-spacing: -0.02em; transition: opacity .3s ease; }
.contact__mail:hover { opacity: .7; }
.contact__social { margin-top: clamp(40px, 5vw, 72px); }
.contact__social a { transition: opacity .3s ease; }
.contact__social a:hover { opacity: .6; }

/* FOOTER: 3 columnas, flecha al centro (como la landing) */
/* FOOTER: el logotipo cortado por la mitad en el borde inferior, con los textos a los lados */
.footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: clamp(80px, 11vw, 160px) 20px 0; font-size: var(--fs-small); }
.footer > span { padding-bottom: clamp(20px, 3.4vw, 48px); }
.footer > span:last-child { justify-self: end; }
.footer__logo { display: block; width: clamp(240px, 47vw, 680px); aspect-ratio: 1234 / 448.5; overflow: hidden; }
.footer__logo svg { display: block; width: 100%; height: auto; }

/* GALERÍA A PANTALLA COMPLETA */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #161616; opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s .4s; }
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .4s ease; }
.lightbox:focus { outline: none; }
.lightbox__stage { position: absolute; inset: 0; overflow: hidden; }
.lightbox__slide { position: absolute; left: 50%; top: 46%; object-fit: cover; cursor: pointer; user-select: none; -webkit-user-drag: none; transition: transform .7s var(--ease), filter .7s ease, opacity .7s ease; }
.lightbox__slide.is-current { cursor: default; }
.lightbox__close { position: absolute; top: 24px; right: var(--gutter); z-index: 1; font-size: var(--fs-small); }
.lightbox__close span { opacity: .5; margin-left: 6px; }
.lightbox__controls { position: absolute; left: 0; right: 0; bottom: clamp(20px, 4vh, 40px); display: flex; justify-content: center; align-items: center; gap: 28px; font-size: var(--fs-small); }
.lightbox__nav { font-size: clamp(20px, 1.8vw, 26px); opacity: .7; transition: opacity .2s; }
.lightbox__nav:hover { opacity: 1; }
.lightbox__counter { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
body.is-locked { overflow: hidden; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .blind figcaption { opacity: 1; transform: none; transition: none; }
  .blind .blind__img { clip-path: none; transition: none; }
  .hero__slide, .lightbox, .lightbox__slide { transition: none; }
  .marquee__track { animation: none; }
}

@media (max-width: 1023px) {
  .row { grid-template-columns: 3em 1fr 4em; }
  .row__cat { display: none; }
  .clients { grid-template-columns: repeat(3, 1fr); }
  .clients div:nth-child(4) { border-left: 0; }
  .clients div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards figure:nth-child(n) { --delay: 0s; }
  .cards figure:nth-child(2n) { --delay: .12s; }
}

@media (max-width: 767px) {
  .hero { height: 88svh; }
  .hero__top .hero__claim, .hero__top .rule { display: none; }
  .hero__top { justify-content: center; }
  .hero__logo { height: 44px; }
  .hero__bottom { flex-wrap: wrap; padding: 0 16px 16px; }
  .hero__title { order: -1; width: 100%; margin-bottom: 12px; font-size: 13.5vw; }
  .rule-row { white-space: normal; }
  .display br { display: none; }
  .cols, .detail-meta { grid-template-columns: 1fr; }
  .row { grid-template-columns: 64px 1fr auto; align-items: center; }
  .row__n { display: none; }
  .row__thumb { display: block; width: 64px; aspect-ratio: 4 / 5; object-fit: cover; }
  .preview { display: none; }
  .cards figcaption { flex-direction: column; gap: 2px; }
  .masonry { columns: 2; }
  .shots__pair { grid-template-columns: 1fr; }
  .next { grid-template-columns: 1fr 120px; }
  .contact__mail { font-size: 6vw; }
  .footer { grid-template-columns: 1fr 1fr; padding: 80px 16px 0; row-gap: 32px; }
  .footer > span { padding-bottom: 0; grid-row: 1; }
  .footer__logo { grid-row: 2; grid-column: 1 / -1; justify-self: center; width: 78vw; }
}

/* Página Contact: ocupa la pantalla para que el footer quede abajo */
body:has(.contact-main) { display: flex; flex-direction: column; min-height: 100svh; }
.contact-main { flex: 1; }
.contact__copied { display: inline-block; margin-left: clamp(12px, 1.5vw, 24px); font-size: var(--fs-small); color: var(--muted); opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s var(--ease); vertical-align: middle; }
.contact__copied.is-on { opacity: 1; transform: none; }

/* Flecha que señala el correo: se despliega al acabar el titular y luego empuja hacia él */
.contact__arrow { display: inline-block; max-width: 0; margin-right: 0; opacity: 0; overflow: hidden; vertical-align: bottom; transition: max-width .8s var(--ease), margin-right .8s var(--ease), opacity .5s ease; }
.contact__arrow i { display: inline-block; font-style: normal; padding-right: .3em; }
.contact__mail.is-pointed .contact__arrow { max-width: 1.6em; margin-right: .15em; opacity: 1; }
.contact__mail.is-pointed .contact__arrow i { animation: nudge 1.3s ease-in-out .9s infinite; }
.contact__mail:hover .contact__arrow i { animation-play-state: paused; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(.25em); } }
@media (prefers-reduced-motion: reduce) { .contact__mail.is-pointed .contact__arrow i { animation: none; } }
/* En la página Contact todo cabe en una pantalla: espacios y logo se adaptan a la altura */
.contact-main .page-top { padding-top: clamp(80px, 12svh, 170px); }
.contact-main .contact__mail { margin-top: clamp(20px, 4svh, 56px); }
.contact-main .contact__social { margin-top: clamp(24px, 5svh, 72px); }
body:has(.contact-main) .footer { padding-top: 24px; }
body:has(.contact-main) .footer__logo { width: clamp(200px, min(47vw, 70svh), 680px); }

/* Instagram / Linkedin: icono + flecha, con subrayado y pequeño movimiento al pasar el ratón */
.social { display: inline-flex; align-items: center; gap: .5em; }
.contact__social a.social:hover { opacity: 1; }
.social__icon { width: 1.25em; height: 1.25em; flex-shrink: 0; transition: transform .5s var(--ease); }
.social__label { position: relative; }
.social__label::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.social__arrow { display: inline-block; opacity: .55; transition: transform .45s var(--ease), opacity .3s ease; }
.social:hover .social__icon { transform: rotate(-10deg) scale(1.12); }
.social:hover .social__label::after { transform: scaleX(1); transform-origin: left; }
.social:hover .social__arrow { transform: translate(3px, -3px); opacity: 1; }

/* Info: las imágenes aparecen con un pop up (crecen con un pequeño rebote) en lugar de persiana */
.pop.reveal { opacity: 0; transform: translateY(30px) scale(.86); transition: opacity .6s ease var(--delay, 0s), transform .9s cubic-bezier(.34, 1.56, .64, 1) var(--delay, 0s); }
.pop.reveal.is-visible { opacity: 1; transform: none; }
.masonry .pop:nth-child(3n+2) { --delay: .1s; }
.masonry .pop:nth-child(3n) { --delay: .2s; }
@media (prefers-reduced-motion: reduce) { .pop.reveal { opacity: 1; transform: none; transition: none; } }

/* ACENTOS KINPAKU: oro para marca y estado activo, verdín para "vivo"/foco. La base sigue en blanco y negro. */
:root {
  --kinpaku: oklch(84% 0.19 80.46);
  --kinpaku-deep: oklch(61% 0.085 78);
  --kinpaku-rule: oklch(74% 0.09 82 / 0.6);
  --patina: oklch(70% 0.12 188);
}
::selection { background: var(--kinpaku); color: #000; }

/* Líneas de los titulillos: hilo de oro que se apaga hacia la derecha */
.rule { background: linear-gradient(90deg, var(--kinpaku-rule), var(--rule) 60%); }

/* Nav: el subrayado de la página activa es de oro */
.nav__links a.is-active::after { background: var(--kinpaku); }

/* Índice de proyectos: la fila activa se dora, el número en verdín */
@media (hover: hover) {
  .index:hover .row:hover .row__title { color: var(--kinpaku); }
  .index:hover .row:hover .row__n { color: var(--patina); }
  .row__title { transition: transform .5s var(--ease), color .4s ease; }
  .cards figcaption span:first-child { transition: color .4s ease; }
  .cards a:hover figcaption span:first-child { color: var(--kinpaku); }
  .next:hover .next__title { color: var(--kinpaku); }
  .next__title { transition: transform .5s var(--ease), color .4s ease; }
}

/* Contacto: subrayado, cursor y flecha en oro; el correo se dora al pasar */
.draw-underline { background-image: linear-gradient(var(--kinpaku), var(--kinpaku)); }
.caret::after { background: var(--kinpaku); }
.contact__arrow i { color: var(--kinpaku); }
.contact__mail { transition: color .3s ease; }
.contact__mail:hover { opacity: 1; color: var(--kinpaku); }
.contact__copied { color: var(--patina); }
.social__label::after { background: var(--patina); }
.social:hover .social__arrow { color: var(--patina); }

/* Galería a pantalla completa: contador en oro */
.lightbox__counter { color: var(--kinpaku); }

/* Foco de teclado: verdín con 4px de separación */
button:focus-visible, a:focus-visible { outline-color: var(--patina); }

/* Titular de la home: subrayado de "good imagery" en oro */
.display u { text-decoration-color: var(--kinpaku); }
