/* ==========================================================================
   MF Arquitectos — sitio público
   ========================================================================== */

@font-face { font-family: "Surgena"; src: url("../fonts/Surgena-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Surgena"; src: url("../fonts/Surgena-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Surgena"; src: url("../fonts/Surgena-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #262833;
  --ink-soft: #3b3d49;
  --paper: #fbfaf7;
  --white: #ffffff;
  --sand: #eae3d9;
  --sand-soft: #f3efe9;
  --brown: #39291c;
  --muted: #6e6f78;
  --line: rgba(38, 40, 51, 0.14);
  --line-light: rgba(234, 227, 217, 0.18);

  --f-display: "Surgena", "Montserrat", system-ui, sans-serif;
  --f-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1680px;
  --header-h: 84px;
  --section: clamp(96px, 13vw, 200px);

  --ease: cubic-bezier(0.65, 0.05, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-curtain: cubic-bezier(0.77, 0, 0.18, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { margin: 0; font-weight: 300; }
::selection { background: var(--ink); color: var(--sand); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 2000; padding: 10px 16px; background: var(--ink); color: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.label {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- Reveal animations ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
.line-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.reveal-line { display: block; }
.js .reveal-line { transform: translateY(110%); transition: transform 1.3s var(--ease-out); transition-delay: var(--d, 0s); }
.js .line-mask.is-in .reveal-line { transform: none; }
/* El recorte va en el hijo: un clip-path en el propio elemento impide que IntersectionObserver lo detecte. */
.js .img-reveal > img, .js .img-reveal > .placeholder { clip-path: inset(0 0 100% 0); transform: scale(1.18); transition: clip-path 1.4s var(--ease-curtain), transform 1.8s var(--ease-out); }
.js .img-reveal.is-in > img, .js .img-reveal.is-in > .placeholder { clip-path: inset(0 0 0 0); transform: none; }

/* ---------- Intro (primera visita de la sesión) ---------- */
.intro { display: none; }
.has-intro .intro {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--ink); color: var(--sand);
  animation: intro-out 1.1s var(--ease-curtain) 2.3s forwards;
}
.has-intro body { overflow: hidden; }
.intro__logo { display: flex; align-items: center; justify-content: center; animation: intro-logo-out 0.6s var(--ease) 2.05s forwards; }
.intro__mark { display: block; width: clamp(120px, 15vw, 210px); clip-path: inset(100% 0 0 0); animation: intro-mark 1.1s var(--ease-curtain) 0.25s forwards; }
.intro__mark svg { width: 100%; height: auto; display: block; }
@keyframes intro-mark { to { clip-path: inset(0 0 0 0); } }
@keyframes intro-logo-out { to { opacity: 0; transform: translateY(-24px); } }
@keyframes intro-out { to { transform: translateY(-100%); } }

/* ---------- Cortina de transición entre páginas ---------- */
.curtain { position: fixed; inset: 0; z-index: 900; background: var(--ink); transform: translateY(100%); pointer-events: none; visibility: hidden; }
.curtain.is-leaving, .curtain.is-entering, .from-transition .curtain { visibility: visible; }
.curtain.is-leaving { transform: translateY(0); transition: transform 0.7s var(--ease-curtain); }
.from-transition .curtain { transform: translateY(0); }
.curtain.is-entering { transform: translateY(-100%); transition: transform 0.9s var(--ease-curtain); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 500;
  height: var(--header-h);
  color: var(--ink);
  transition: transform 0.6s var(--ease), background-color 0.5s ease, color 0.5s ease;
}
.site-header::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--line); opacity: 0; transition: opacity 0.5s ease; }
.site-header__inner { height: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.site-header__logo { display: block; height: 36px; }
.site-header__logo svg { height: 100%; width: auto; }
.site-header--overlay { color: var(--paper); }
.site-header.is-scrolled { background: rgba(251, 250, 247, 0.94); color: var(--ink); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.site-header.is-scrolled::after { opacity: 1; }
.site-header.is-hidden { transform: translateY(-100%); }
.menu-open .site-header { color: var(--sand); background: transparent; transform: none; }
.menu-open .site-header::after { opacity: 0; }

.site-nav { display: flex; gap: clamp(24px, 3vw, 48px); }
.site-nav__link { position: relative; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; padding: 6px 0; }
.site-nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease); }
.site-nav__link:hover::after, .site-nav__link.is-active::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle { display: none; align-items: center; gap: 12px; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; padding: 10px 0; }
.menu-toggle__lines { position: relative; width: 26px; height: 8px; }
.menu-toggle__lines span { position: absolute; left: 0; right: 0; height: 1px; background: currentColor; transition: transform 0.5s var(--ease), top 0.5s var(--ease); }
.menu-toggle__lines span:first-child { top: 0; }
.menu-toggle__lines span:last-child { top: 7px; }
.menu-open .menu-toggle__lines span:first-child { top: 4px; transform: rotate(20deg); }
.menu-open .menu-toggle__lines span:last-child { top: 4px; transform: rotate(-20deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 400;
  background: var(--ink); color: var(--sand);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--header-h) + 40px) var(--gutter) calc(32px + env(safe-area-inset-bottom));
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease-curtain);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { clip-path: inset(0 0 0 0); }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu__link { font-family: var(--f-display); font-weight: 300; font-size: clamp(40px, 11vw, 64px); line-height: 1.15; display: flex; align-items: baseline; gap: 16px; opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.8s var(--ease-out); }
.mobile-menu__link span { font-family: var(--f-body); font-size: 11px; letter-spacing: 0.16em; color: rgba(234, 227, 217, 0.45); }
.mobile-menu.is-open .mobile-menu__link { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__link:nth-child(1) { transition-delay: 0.25s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(2) { transition-delay: 0.31s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(3) { transition-delay: 0.37s; }
.mobile-menu.is-open .mobile-menu__link:nth-child(4) { transition-delay: 0.43s; }
.mobile-menu__foot { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: rgba(234, 227, 217, 0.7); }

/* ---------- Botones y links ---------- */
.link-arrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid currentColor; }
.link-arrow span { display: inline-block; transition: transform 0.5s var(--ease); }
.link-arrow:hover span { transform: translateX(6px); }
.link-arrow sup { font-size: 9px; letter-spacing: 0.08em; color: var(--muted); }

.btn-line { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 34px; border: 1px solid currentColor; font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; overflow: hidden; isolation: isolate; transition: color 0.5s var(--ease); }
.btn-line::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: translateY(101%); transition: transform 0.6s var(--ease); }
.btn-line:hover { color: var(--paper); }
.btn-line:hover::before { transform: none; }
.btn-line--light::before { background: var(--ink); }

.btn-solid { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 40px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; overflow: hidden; isolation: isolate; }
.btn-solid::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--brown); transform: translateY(101%); transition: transform 0.6s var(--ease); }
.btn-solid:hover::before { transform: none; }
.btn-solid[disabled] { opacity: 0.6; cursor: wait; }

.placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: var(--sand-soft); color: rgba(38, 40, 51, 0.12); }
.placeholder svg { width: 26%; height: auto; }
.placeholder--sand { background: var(--sand); color: rgba(57, 41, 28, 0.18); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 20px; margin-bottom: clamp(32px, 5vw, 72px); border-bottom: 1px solid var(--line); }

/* ---------- Hero (home) ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: var(--ink); color: var(--paper); }
.hero__slides, .hero__slide, .hero__media { position: absolute; inset: 0; }
.hero__slide { opacity: 0; visibility: hidden; transition: opacity 1.6s var(--ease), visibility 0s linear 1.6s; }
.hero__slide.is-active { opacity: 1; visibility: visible; transition: opacity 1.6s var(--ease), visibility 0s; z-index: 1; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 8s cubic-bezier(0.25, 0.1, 0.25, 1); }
.hero__slide.is-active .hero__media img { transform: scale(1); }
.hero__shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(20, 21, 28, 0.38) 0%, rgba(20, 21, 28, 0) 26%, rgba(20, 21, 28, 0) 50%, rgba(20, 21, 28, 0.55) 100%); }
.hero__ui { position: absolute; inset: auto 0 0; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding-bottom: clamp(32px, 5vw, 64px); left: 50%; transform: translateX(-50%); pointer-events: none; }
.hero__ui > * { pointer-events: auto; }
.hero__captions { position: relative; flex: 1; min-height: clamp(100px, 12vw, 170px); }
.hero__caption { position: absolute; left: 0; bottom: 0; }
.hero__caption .hero__meta, .hero__caption .hero__title { overflow: hidden; }
.hero__meta { font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 14px; opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.8s var(--ease-out); }
.hero__title { font-family: var(--f-display); font-weight: 300; font-size: clamp(40px, 6.4vw, 104px); line-height: 1; letter-spacing: -0.015em; margin: 0; }
.hero__title a { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease-out); }
.hero__caption.is-active .hero__title a { transform: none; transition-delay: 0.35s; }
.hero__caption.is-active .hero__meta { opacity: 0.85; transform: none; transition-delay: 0.5s; }
.hero__controls { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.hero__count { font-size: 11px; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
.hero__bars { display: flex; gap: 8px; }
.hero__bar { position: relative; width: clamp(28px, 3.4vw, 56px); height: 20px; }
.hero__bar::before, .hero__bar span { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; }
.hero__bar::before { background: rgba(251, 250, 247, 0.35); }
.hero__bar span { background: var(--paper); transform: scaleX(0); transform-origin: left; }
.hero__bar.is-done span { transform: scaleX(1); }
.hero__bar.is-active span { animation: bar var(--hero-duration, 6.5s) linear forwards; }
.hero.is-paused .hero__bar.is-active span { animation-play-state: paused; }
@keyframes bar { to { transform: scaleX(1); } }
.hero__scroll { position: absolute; left: 50%; bottom: 0; z-index: 3; width: 1px; height: clamp(48px, 7vw, 88px); overflow: hidden; transform: translateX(-50%); }
.hero__scroll span { position: absolute; inset: 0; background: var(--paper); animation: scroll-line 2.4s var(--ease) infinite; }
@keyframes scroll-line { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ---------- Statement ---------- */
.statement { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; padding-block: var(--section); }
.statement .label { grid-column: 1 / -1; margin-bottom: clamp(28px, 4vw, 56px); }
.statement__tagline { grid-column: 1 / -1; font-family: var(--f-display); font-weight: 300; font-size: clamp(48px, 9.2vw, 158px); line-height: 0.98; letter-spacing: -0.025em; }
.statement__tagline .line-mask:nth-child(2) { padding-left: 8.3333%; }
.statement__tagline .line-mask:nth-child(3) { padding-left: 16.6666%; }
.statement__body { grid-column: 7 / 12; margin-top: clamp(48px, 6vw, 96px); }
.statement__text { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.65; font-weight: 300; margin-bottom: 36px; }

/* ---------- Selección editorial (home) ---------- */
.selection { padding-bottom: var(--section); }
.selection__list { display: flex; flex-direction: column; gap: clamp(80px, 11vw, 180px); }
.feature__link { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: end; }
.feature__media { position: relative; overflow: hidden; background: var(--sand-soft); aspect-ratio: 3 / 2; }
.feature__media img, .feature__media .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.js .feature__media.is-in img { transition: transform 1.6s var(--ease-out), clip-path 1.4s var(--ease-curtain); }
.feature__link:hover .feature__media.is-in img { transform: scale(1.04); }
.feature__info { padding-bottom: 4px; }
.feature__num { display: block; font-size: 11px; letter-spacing: 0.18em; color: var(--muted); margin-bottom: 18px; }
.feature__title { font-family: var(--f-display); font-weight: 300; font-size: clamp(28px, 3vw, 48px); line-height: 1.05; letter-spacing: -0.01em; margin-bottom: 12px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; display: inline; transition: background-size 0.7s var(--ease); }
.feature__link:hover .feature__title { background-size: 100% 1px; }
.feature__meta { margin: 12px 0 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.feature--a .feature__media { grid-column: 1 / 9; }
.feature--a .feature__info { grid-column: 10 / 13; }
.feature--b .feature__media { grid-column: 5 / 13; grid-row: 1; }
.feature--b .feature__info { grid-column: 1 / 4; grid-row: 1; }
.feature--c .feature__media { grid-column: 3 / 10; aspect-ratio: 16 / 10; }
.feature--c .feature__info { grid-column: 10 / 13; padding-left: 8px; }
.feature--d .feature__media { grid-column: 2 / 7; aspect-ratio: 4 / 5; }
.feature--d .feature__info { grid-column: 8 / 12; }
.selection__more { margin-top: clamp(80px, 10vw, 160px); text-align: center; }

/* ---------- CTA ---------- */
.cta { background: var(--sand); color: var(--ink); padding-block: clamp(96px, 12vw, 180px); }
.cta__inner { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(28px, 3vw, 44px); }
.cta__title { font-family: var(--f-display); font-weight: 300; font-size: clamp(38px, 6.4vw, 108px); line-height: 1; letter-spacing: -0.02em; max-width: 14ch; }

/* ---------- Encabezado de páginas internas ---------- */
.page-head { padding-top: calc(var(--header-h) + clamp(72px, 11vw, 168px)); padding-bottom: clamp(48px, 6vw, 96px); }
.page-head .label { margin-bottom: clamp(20px, 2.6vw, 36px); }
.page-title { font-family: var(--f-display); font-weight: 300; font-size: clamp(56px, 11vw, 188px); line-height: 0.92; letter-spacing: -0.035em; }
.page-head--404 { min-height: 70vh; }
.page-head--404 .page-title { font-size: clamp(44px, 7vw, 110px); margin-bottom: 32px; }

/* ---------- Filtros y grilla de proyectos ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px 56px; padding: 22px 0; margin-bottom: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filters__group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; }
.filters__label { font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.chip { position: relative; font-size: 14px; color: var(--muted); padding: 2px 0; transition: color 0.4s ease; }
.chip::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease); }
.chip:hover { color: var(--ink); }
.chip.is-active { color: var(--ink); }
.chip.is-active::after { transform: scaleX(1); transform-origin: left; }
.filters__count { margin: 0 0 0 auto; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.grid-projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(48px, 5vw, 88px) clamp(20px, 2vw, 32px); padding-bottom: var(--section); }
.grid-projects--three { padding-bottom: 0; }
.card { transition: opacity 0.45s ease, transform 0.6s var(--ease-out); }
.card.is-filtered-out { opacity: 0; transform: translateY(16px); }
.card[hidden] { display: none; }
.card__link { display: block; }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand-soft); }
.card__media img, .card__media .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__media img { transition: transform 1.4s var(--ease-out), filter 0.8s ease; }
.card__media::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }
.card__link:hover .card__media img { transform: scale(1.05); }
.card__link:hover .card__media::after { opacity: 0.08; }
/* Listado de proyectos y obras relacionadas en escala de grises; dentro de cada obra, las fotos van en color. */
.page-projects .card__media img,
.related .card__media img { filter: grayscale(1); }
.card__info { padding-top: 18px; }
.card__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(20px, 1.6vw, 26px); line-height: 1.2; letter-spacing: -0.005em; margin-bottom: 10px; transition: transform 0.6s var(--ease); }
.card__link:hover .card__title { transform: translateX(6px); }
.card__meta { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.grid-empty { padding: 40px 0 var(--section); color: var(--muted); }

/* ---------- Proyecto ---------- */
.preview-bar { position: fixed; z-index: 600; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 12px 20px; background: var(--brown); color: var(--sand); font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); max-width: calc(100% - 32px); }
.preview-bar a { text-decoration: underline; margin-left: 8px; }

.p-hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: var(--ink); color: var(--paper); display: flex; align-items: flex-end; }
.p-hero--empty { height: auto; min-height: 0; padding-top: calc(var(--header-h) + 140px); }
.p-hero__media { position: absolute; inset: -6% 0; will-change: transform; }
.p-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.p-hero .hero__shade { background: linear-gradient(180deg, rgba(20, 21, 28, 0.38) 0%, rgba(20, 21, 28, 0) 24%, rgba(20, 21, 28, 0) 40%, rgba(20, 21, 28, 0.62) 100%); }
.p-hero__content { position: relative; z-index: 3; padding-bottom: clamp(36px, 5vw, 72px); }
.p-hero__back { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: clamp(18px, 2vw, 28px); opacity: 0.85; transition: opacity 0.3s ease; }
.p-hero__back:hover { opacity: 1; }
.p-hero__title { font-family: var(--f-display); font-weight: 300; font-size: clamp(48px, 8.6vw, 148px); line-height: 0.95; letter-spacing: -0.03em; }
.p-hero__meta { margin: 20px 0 0; font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.85; }

.p-intro { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 56px; padding-block: clamp(72px, 10vw, 160px); }
.p-intro__lead { grid-column: 1 / 8; font-family: var(--f-display); font-weight: 300; font-size: clamp(26px, 2.9vw, 46px); line-height: 1.18; letter-spacing: -0.01em; margin: 0; }
.facts { grid-column: 9 / 13; margin: 0; }
.p-intro__lead + .facts { grid-row: 1; }
.facts__row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts__row:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; font-size: 15px; line-height: 1.5; }

.gallery { padding-bottom: clamp(72px, 9vw, 140px); }
.gallery__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.gallery__nav { display: flex; align-items: center; gap: 12px; }
.gallery__count { font-size: 12px; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; margin-right: 12px; color: var(--muted); }
.gallery__count [data-gallery-current] { color: var(--ink); }
.gallery__arrow { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 16px; transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, opacity 0.3s; }
.gallery__arrow:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.gallery__arrow:disabled { opacity: 0.3; pointer-events: none; }
.gallery__track {
  --gh: min(76vh, 52vw);
  display: flex; align-items: flex-start; gap: clamp(12px, 1.5vw, 24px);
  overflow-x: auto; overflow-y: hidden;
  padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  scrollbar-width: none; -ms-overflow-style: none;
  cursor: grab; outline: none;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior-x: contain;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.gallery__track.is-dragging * { pointer-events: none; }
.gallery__item { flex: none; margin: 0; width: calc(var(--gh) * var(--ar)); max-width: calc(100vw - 2 * var(--gutter)); scroll-snap-align: start; }
.gallery__frame { position: relative; width: 100%; aspect-ratio: var(--ar); background: var(--sand-soft); overflow: hidden; }
.gallery__frame img, .gallery__frame video, .gallery__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.gallery__item--video .gallery__frame { background: #000; }
.gallery__item--video video { object-fit: contain; }
.gallery__zoom { position: absolute; inset: 0; width: 100%; height: 100%; cursor: zoom-in; }
.gallery__zoom img { transition: transform 1.2s var(--ease-out); }
.gallery__zoom:hover img { transform: scale(1.025); }
.gallery__item figcaption { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.gallery__progress { position: relative; height: 1px; margin-top: 32px; }
.gallery__progress::before { content: ""; position: absolute; inset: 0 var(--gutter); background: var(--line); }
.gallery__progress span { position: absolute; top: 0; left: var(--gutter); height: 1px; width: 0; background: var(--ink); transition: width 0.15s linear; }

.memoria { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; padding-bottom: var(--section); }
.memoria .label { grid-column: 1 / 4; padding-top: 8px; }
.memoria__text { grid-column: 5 / 12; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.8; font-weight: 300; columns: 2; column-gap: 48px; }
.memoria__text p { break-inside: avoid; }
.memoria__text p:first-child { column-span: all; font-size: clamp(19px, 1.5vw, 23px); line-height: 1.6; margin-bottom: 1.4em; font-weight: 400; }

.related { padding-bottom: var(--section); }

.next-project { position: relative; display: flex; align-items: flex-end; min-height: 72vh; overflow: hidden; background: var(--ink); color: var(--paper); }
.next-project__media { position: absolute; inset: 0; }
.next-project__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transform: scale(1.03); transition: transform 1.8s var(--ease-out), opacity 1s ease; }
.next-project:hover .next-project__media img { transform: scale(1); opacity: 0.72; }
.next-project__content { position: relative; z-index: 1; padding-block: clamp(48px, 6vw, 96px); }
.next-project .label { color: rgba(251, 250, 247, 0.75); display: block; margin-bottom: 18px; }
.next-project__title { font-family: var(--f-display); font-weight: 300; font-size: clamp(40px, 7vw, 120px); line-height: 1; letter-spacing: -0.025em; }
.next-project__title span { display: inline-block; transition: transform 0.7s var(--ease); }
.next-project:hover .next-project__title span { transform: translateX(16px); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1100; background: #17181f; color: var(--paper); display: grid; grid-template-rows: auto 1fr auto; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0s linear 0.5s; touch-action: pan-y; }
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.5s ease; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--gutter); font-size: 12px; letter-spacing: 0.16em; }
.lightbox__close { font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; padding: 8px 0; }
.lightbox__stage { position: relative; min-height: 0; overflow: hidden; }
/* La imagen ocupa toda el área y se ajusta con object-fit: siempre se ve completa, sin recortes. */
.lightbox__stage img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; padding: 0 clamp(16px, 7vw, 120px); object-fit: contain; transition: opacity 0.4s ease, transform 0.6s var(--ease-out); }
.lightbox__arrow { z-index: 1; }
.lightbox__stage img.is-loading { opacity: 0; transform: scale(0.98); }
.lightbox__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(251, 250, 247, 0.3); display: grid; place-items: center; transition: background-color 0.3s; }
.lightbox__arrow:hover { background: rgba(251, 250, 247, 0.1); }
.lightbox__arrow--prev { left: clamp(12px, 2vw, 32px); }
.lightbox__arrow--next { right: clamp(12px, 2vw, 32px); }
.lightbox__caption { padding: 18px var(--gutter) 24px; min-height: 64px; font-size: 13px; color: rgba(251, 250, 247, 0.7); text-align: center; }

/* ---------- Estudio ---------- */
.about { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; padding-bottom: var(--section); }
.about__lead { grid-column: 1 / 11; font-family: var(--f-display); font-weight: 300; font-size: clamp(28px, 3.6vw, 58px); line-height: 1.15; letter-spacing: -0.015em; margin-bottom: clamp(48px, 6vw, 96px); }
.about__text { grid-column: 6 / 12; font-size: clamp(16px, 1.2vw, 19px); line-height: 1.8; font-weight: 300; }

.team { padding-bottom: var(--section); }
.team__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(56px, 6vw, 96px) clamp(24px, 4vw, 72px); }
/* Todas las fotos del equipo con el mismo marco (4:5) ocupando toda la columna, para que queden
   parejas y alineadas. El encuadre se ancla arriba: siempre se ve la cara; si la foto es más
   alargada que el marco, se recorta por abajo. */
.member__photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sand); margin-bottom: 28px; }
.member__photo img, .member__photo .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.member__name { font-family: var(--f-display); font-weight: 400; font-size: clamp(26px, 2.4vw, 38px); line-height: 1.1; margin-bottom: 8px; }
.member__role { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.member__bio { font-weight: 300; line-height: 1.75; max-width: 56ch; }

.areas { background: var(--ink); color: var(--sand); padding-block: var(--section); }
.areas .label { color: rgba(234, 227, 217, 0.55); margin-bottom: 28px; }
.areas__inner { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 56px; }
.areas__inner > div { grid-column: 1 / 6; }
.areas__text { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.7; font-weight: 300; }
.areas__list { grid-column: 7 / 13; list-style: none; margin: 0; padding: 0; }
.areas__list li { display: flex; align-items: baseline; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line-light); font-family: var(--f-display); font-weight: 300; font-size: clamp(22px, 2.2vw, 34px); line-height: 1.2; }
.areas__list li:last-child { border-bottom: 1px solid var(--line-light); }
.areas__list span { font-family: var(--f-body); font-size: 11px; letter-spacing: 0.16em; color: rgba(234, 227, 217, 0.5); min-width: 22px; }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 64px; padding-bottom: var(--section); }
.contact__info { grid-column: 1 / 6; }
.contact__intro { font-family: var(--f-display); font-weight: 300; font-size: clamp(24px, 2.4vw, 38px); line-height: 1.2; margin-bottom: 48px; max-width: 18ch; }
.contact__list { margin: 0; }
.contact__list > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.contact__list > div:last-child { border-bottom: 1px solid var(--line); }
.contact__list dt { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.contact__list dd { margin: 0; font-size: 16px; }
.contact__list a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.6s var(--ease); }
.contact__list a:hover { background-size: 100% 1px; }
.contact__social { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.contact__form-wrap { grid-column: 7 / 13; }
.form { display: flex; flex-direction: column; gap: 28px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.field label { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field label small { font-size: inherit; text-transform: none; letter-spacing: 0.04em; font-weight: 400; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid rgba(38, 40, 51, 0.3); border-radius: 0; padding: 10px 0 12px; transition: border-color 0.4s ease; }
.field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.field.has-error input, .field.has-error textarea { border-bottom-color: #9b3b2e; }
.field__error, .form__error { display: block; margin-top: 8px; font-size: 13px; color: #9b3b2e; }
.form .btn-solid { align-self: flex-start; margin-top: 8px; }
.form-sent {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start;
  margin-bottom: 40px; padding: clamp(28px, 3.5vw, 44px); padding-right: 64px;
  background: var(--ink); color: var(--sand);
  outline: none;
}
.form-sent[hidden] { display: none; }
.form-sent.is-visible { animation: sent-in 0.9s var(--ease-out) both; }
.form-sent.is-hiding { animation: sent-out 0.5s var(--ease) both; }
@keyframes sent-in { from { opacity: 0; transform: translateY(24px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes sent-out { to { opacity: 0; transform: translateY(-12px); } }
.form-sent__icon { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid rgba(234, 227, 217, 0.4); border-radius: 50%; }
.form-sent__icon svg { width: 26px; height: 26px; }
.form-sent__icon path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.form-sent.is-visible .form-sent__icon path { animation: check-draw 0.7s var(--ease-out) 0.45s forwards; }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
.form-sent__title { font-family: var(--f-display); font-weight: 300; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.05; margin: 4px 0 12px; color: var(--paper); }
.form-sent__text { margin: 0; font-size: 16px; line-height: 1.6; color: rgba(234, 227, 217, 0.85); max-width: 42ch; }
.form-sent__close { position: absolute; top: 18px; right: 20px; width: 36px; height: 36px; display: grid; place-items: center; font-size: 14px; color: rgba(234, 227, 217, 0.7); transition: color 0.3s; }
.form-sent__close:hover { color: var(--paper); }
@media (max-width: 640px) { .form-sent { grid-template-columns: 1fr; gap: 16px; } }
.map { padding-bottom: var(--section); }
.map iframe { width: 100%; height: clamp(320px, 40vw, 520px); border: 0; filter: grayscale(1) contrast(1.05) brightness(1.02); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--sand); font-size: 14px; }
.site-footer__top { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 56px; padding-block: clamp(72px, 9vw, 128px); }
.site-footer__brand { grid-column: 1 / 5; }
.site-footer__logo { display: block; width: clamp(200px, 20vw, 280px); }
.site-footer__logo svg { width: 100%; height: auto; }
.site-footer__cols { grid-column: 6 / 13; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 40px 24px; }
.site-footer__col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.site-footer__col .label { color: rgba(234, 227, 217, 0.5); margin-bottom: 10px; }
.site-footer__col a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.6s var(--ease); word-break: break-word; }
.site-footer__col a:hover { background-size: 100% 1px; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 24px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-light); font-size: 12px; color: rgba(234, 227, 217, 0.55); }
.back-top { font-size: 12px; color: inherit; transition: color 0.3s; }
.back-top:hover { color: var(--sand); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-projects { grid-template-columns: repeat(2, 1fr); }
  .grid-projects--three > :nth-child(3) { display: none; }
  .statement__body { grid-column: 5 / 13; }
  .memoria__text { grid-column: 4 / 13; columns: 1; }
  .facts { grid-column: 8 / 13; }
  .p-intro__lead { grid-column: 1 / 7; }
}

@media (max-width: 860px) {
  :root { --header-h: 68px; }
  .site-header__logo { height: 29px; }
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }

  .statement__tagline .line-mask:nth-child(n) { padding-left: 0; }
  .statement__body { grid-column: 1 / -1; }

  .feature__link { display: block; }
  .feature__media, .feature--c .feature__media, .feature--d .feature__media { aspect-ratio: 4 / 3; }
  .feature--d .feature__media { width: 78%; aspect-ratio: 4 / 5; }
  .feature--b .feature__media { margin-left: 12%; }
  .feature__info { margin-top: 22px; }
  .feature__num { margin-bottom: 10px; }

  .p-intro { display: block; }
  .p-intro__lead { margin-bottom: 48px; }
  .memoria { display: block; }
  .memoria .label { margin-bottom: 24px; }

  .about { display: block; }
  .areas__inner > div, .areas__list { grid-column: 1 / -1; }
  .contact__info, .contact__form-wrap { grid-column: 1 / -1; }
  .site-footer__brand, .site-footer__cols { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .grid-projects { grid-template-columns: 1fr; }
  .grid-projects--three > :nth-child(3) { display: block; }
  .team__grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .filters { gap: 18px; }
  .filters__count { margin-left: 0; width: 100%; }
  .hero__ui { flex-direction: column; align-items: flex-start; }
  .hero__controls { align-items: flex-start; flex-direction: column-reverse; }
  .hero__scroll { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .facts__row, .contact__list > div { grid-template-columns: 100px 1fr; }

  /* Galería: swipe nativo con snap */
  .gallery__head .gallery__arrow { display: none; }
  .gallery__track { scroll-snap-type: x mandatory; cursor: auto; -webkit-user-select: auto; user-select: auto; }
  .gallery__item { width: min(86vw, calc(64svh * var(--ar))); scroll-snap-align: center; }
  .lightbox__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .reveal, .js .reveal-line, .js .img-reveal, .js .img-reveal img { opacity: 1; transform: none; clip-path: none; }
}

/* ---------- Página "Próximamente" ---------- */
.page-soon { background: var(--ink); color: var(--sand); }
.soon { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding: clamp(24px, 5vw, 56px) var(--gutter) calc(clamp(24px, 4vw, 40px) + env(safe-area-inset-bottom)); }
.soon__center { align-self: center; justify-self: center; text-align: center; display: flex; flex-direction: column; align-items: center; }
.soon__logo { width: clamp(150px, 18vw, 230px); margin: 0 0 clamp(36px, 5vw, 56px); color: var(--sand); }
.soon__logo svg { display: block; width: 100%; height: auto; }
.soon__title { margin: 0 0 16px; font-size: 12px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; color: var(--sand); }
.soon__text { margin: 0; max-width: 38ch; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.7; font-weight: 300; color: rgba(234, 227, 217, 0.72); }
.soon__contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px clamp(20px, 3vw, 40px); padding-top: 28px; border-top: 1px solid var(--line-light); font-size: 14px; color: rgba(234, 227, 217, 0.85); text-align: center; }
.soon__contact a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.6s var(--ease), color 0.3s; }
.soon__contact a:hover { color: var(--paper); background-size: 100% 1px; }
/* Entrada suave */
.soon__logo, .soon__title, .soon__text, .soon__contact { animation: soon-in 1.2s var(--ease-out) both; }
.soon__title { animation-delay: 0.25s; }
.soon__text { animation-delay: 0.4s; }
.soon__contact { animation-delay: 0.6s; }
@keyframes soon-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Aviso para el administrador cuando el sitio está en modo "Próximamente" */
.mode-bar { position: fixed; z-index: 650; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; max-width: calc(100% - 32px); background: var(--brown); color: var(--sand); font-size: 12px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.mode-bar::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e0a458; }
.mode-bar a { text-decoration: underline; white-space: nowrap; }
.has-mode-bar .preview-bar { bottom: 76px; }
