/* =========================================================
   DUCAS Construcciones
   Sistema visual — caliza, carbón y tierra
   ========================================================= */

:root {
  --caliza: #f4f0e8;
  --caliza-2: #ece6da;
  --carbon: #171716;
  --piedra: #6f6a61;
  --tierra: #9a6b4f;
  --verde: #2e3a34;
  --linea: #d8d2c4;
  --linea-dark: rgba(244, 240, 232, 0.18);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1440px;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

[data-theme="dark"] {
  --caliza: #121211;
  --caliza-2: #1b1a18;
  --carbon: #f4f0e8;
  --piedra: #a8a196;
  --tierra: #c08a66;
  --verde: #9fb3a6;
  --linea: #35322c;
  --linea-dark: rgba(18, 18, 17, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--caliza);
  color: var(--carbon);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--tierra);
  color: var(--caliza);
}

:focus-visible {
  outline: 2px solid var(--tierra);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--carbon);
  color: var(--caliza);
  transform: translateY(-200%);
  transition: transform 0.2s;
}

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

.container {
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin-inline: auto;
}

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

.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.h1 {
  font-size: clamp(3.2rem, 8vw, 7.5rem);
}

.h2 {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
}

.h3 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--piedra);
}

.eyebrow--light {
  color: rgba(244, 240, 232, 0.7);
}

.lead {
  max-width: 62ch;
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--piedra);
}

.rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--linea);
}

/* ---------- Acciones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--carbon);
  background: var(--carbon);
  color: var(--caliza);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.btn:hover {
  background: transparent;
  color: var(--carbon);
}

.btn--ghost {
  background: transparent;
  color: var(--carbon);
}

.btn--ghost:hover {
  background: var(--carbon);
  color: var(--caliza);
}

.btn--light {
  border-color: var(--caliza);
  background: var(--caliza);
  color: var(--carbon);
}

.btn--light:hover {
  background: transparent;
  color: var(--caliza);
}

.btn--ghost-light {
  border-color: rgba(244, 240, 232, 0.4);
  background: transparent;
  color: var(--caliza);
}

.btn--ghost-light:hover {
  border-color: var(--caliza);
  background: var(--caliza);
  color: var(--carbon);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: gap 0.3s var(--ease);
}

.link-arrow:hover {
  gap: 0.9rem;
}

/* ---------- Header ---------- */

.site-header {
  --header-color: var(--carbon);
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  padding: 1.1rem 0;
  color: var(--header-color);
  transition:
    background 0.35s var(--ease),
    backdrop-filter 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

.site-header--light {
  --header-color: var(--caliza);
}

.site-header.is-scrolled {
  --header-color: var(--carbon);
  border-bottom: 1px solid var(--linea);
  background: rgba(244, 240, 232, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  color: var(--header-color);
  line-height: 1;
}

.wordmark__main {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.wordmark__sub {
  margin-top: 0.2rem;
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.7;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2.2rem);
}

.nav a {
  position: relative;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--header-color);
  opacity: 0.82;
  transition: opacity 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  opacity: 1;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.45rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: 1px solid currentColor;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease);
}

.header-cta:hover {
  background: var(--header-color);
  color: var(--caliza);
}

.header-cta,
.theme-toggle {
  color: var(--header-color);
}

.site-header--light:not(.is-scrolled) .header-cta,
.site-header--light:not(.is-scrolled) .theme-toggle,
.site-header--light:not(.is-scrolled) .menu-toggle {
  border-color: rgba(244, 240, 232, 0.55);
  background: rgba(23, 23, 22, 0.38);
  color: #f4f0e8;
  backdrop-filter: blur(10px);
}

.site-header--light:not(.is-scrolled) .header-cta:hover,
.site-header--light:not(.is-scrolled) .theme-toggle:hover,
.site-header--light:not(.is-scrolled) .menu-toggle:hover {
  border-color: #f4f0e8;
  background: #f4f0e8;
  color: #171716;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--header-color);
  cursor: pointer;
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease);
}

.theme-toggle:hover {
  background: var(--header-color);
  color: var(--caliza);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle__moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--header-color);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 1.5rem;
  height: 1px;
  margin: 0.3rem auto;
  background: currentColor;
}

/* ---------- Menú móvil ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem var(--gutter) 2rem;
  background: var(--caliza);
  color: var(--carbon);
  visibility: hidden;
  transform: translateY(-100%);
  transition:
    transform 0.6s var(--ease),
    visibility 0.6s;
}

.mobile-menu.is-open {
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu__brand {
  display: inline-flex;
  flex-direction: column;
  color: var(--carbon);
  line-height: 1;
}

.mobile-menu__brand-main {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.mobile-menu__brand-sub {
  margin-top: 0.2rem;
  font-family: var(--sans);
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.7;
}

.menu-close {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu nav {
  display: grid;
  gap: 0.5rem;
  margin: 2rem 0;
}

.mobile-menu nav a {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.mobile-menu__meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--piedra);
}

body.menu-open {
  overflow: hidden;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100vh;
  height: 100svh;
  padding: 8rem 0 2.5rem;
  overflow: hidden;
  color: var(--caliza);
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.hero__slide.is-active {
  opacity: 1;
}

.hero--intro .hero__media {
  animation: heroZoom 26s var(--ease) infinite alternate;
  transform-origin: center 55%;
  will-change: transform;
}

@keyframes heroZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.07);
  }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(23, 23, 22, 0.78) 0%,
      rgba(23, 23, 22, 0.5) 45%,
      rgba(23, 23, 22, 0.18) 100%
    ),
    linear-gradient(
      180deg,
      rgba(23, 23, 22, 0.35) 0%,
      rgba(23, 23, 22, 0.55) 50%,
      rgba(23, 23, 22, 0.9) 100%
    );
}

.hero__title,
.hero__lead {
  text-shadow: 0 1px 30px rgba(0, 0, 0, 0.35);
}

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

.hero__title {
  max-width: 1440px;
  font-size: clamp(3rem, 4vw, 6rem);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero__lead {
  max-width: 54ch;
  margin: 1.5rem 0 0;
  color: rgba(244, 240, 232, 0.78);
  font-size: clamp(1rem, 1.4vw, 1.35rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(1.5rem, 4vh, 3rem);
  padding-top: 0.75rem;
  border-top: 1px solid rgba(244, 240, 232, 0.25);
  color: rgba(244, 240, 232, 0.65);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero--intro .hero__content > * {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
  animation: heroFallback 0.01s linear 6s forwards;
}

@keyframes heroFallback {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-ready .hero--intro .hero__content > * {
  animation: heroIn 1.6s var(--ease) both;
}

body.page-ready .hero--intro .hero__content > :nth-child(1) {
  animation-delay: 0.15s;
}

body.page-ready .hero--intro .hero__content > :nth-child(2) {
  animation-delay: 0.4s;
}

body.page-ready .hero--intro .hero__content > :nth-child(3) {
  animation-delay: 0.65s;
}

body.page-ready .hero--intro .hero__content > :nth-child(4) {
  animation-delay: 0.9s;
}

body.page-ready .hero--intro .hero__content > :nth-child(5) {
  animation-delay: 1.15s;
  animation-name: heroInFoot;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroInFoot {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Secciones ---------- */

.section {
  padding: clamp(4.5rem, 9vw, 9rem) 0;
}

.section--tight {
  padding: clamp(3rem, 5vw, 5rem) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 4vw, 4rem);
}

.intro__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.intro__right p + p {
  margin-top: 1rem;
}

/* ---------- Obra ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 4vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
}

.work-card {
  display: block;
}

.work-card:first-child {
  grid-column: 1 / -1;
}

.work-card__media,
.media-placeholder {
  position: relative;
  overflow: hidden;
  background: var(--caliza-2);
}

.work-card__media {
  aspect-ratio: 4 / 3;
}

.work-card:first-child .work-card__media {
  aspect-ratio: 16 / 9;
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.work-card:hover .work-card__media img {
  transform: scale(1.025);
}

.work-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--piedra);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.work-card__title {
  margin: 0.45rem 0 0.25rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  font-weight: 400;
  line-height: 1.1;
}

.work-card:first-child .work-card__title {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
}

.work-card__place {
  margin: 0;
  color: var(--piedra);
  font-size: 0.8125rem;
}

/* ---------- Placeholder editorial ---------- */

.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
}

.media-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--linea) 1px, transparent 1px),
    linear-gradient(90deg, var(--linea) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
}

.media-placeholder::after {
  content: attr(data-number);
  position: relative;
  color: rgba(23, 23, 22, 0.12);
  font-family: var(--serif);
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.media-placeholder span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  color: var(--piedra);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.work-card:first-child .media-placeholder {
  aspect-ratio: 16 / 9;
}

/* ---------- Manifiesto ---------- */

.manifesto {
  padding: clamp(4.5rem, 10vw, 9rem) 0;
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
  text-align: center;
}

.manifesto__text {
  max-width: 1000px;
  margin: 0 auto 2rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.4vw, 4.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.manifesto__signature {
  color: var(--piedra);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Cifras ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-top: 2rem;
  border-top: 1px solid var(--linea);
}

.stat__number {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.8vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.stat__number small {
  margin-left: 0.35rem;
  color: var(--piedra);
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat__label {
  margin: 0.75rem 0 0;
  color: var(--piedra);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ---------- Trayectoria teaser ---------- */

.trajectory-teaser__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.portrait {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--caliza-2);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.trajectory-teaser__content p + p {
  margin-top: 1rem;
}

/* ---------- Método ---------- */

.method {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-top: 2rem;
  border-top: 1px solid var(--linea);
}

.method__number {
  color: var(--tierra);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.method__step h3 {
  margin: 0.75rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
}

.method__step p {
  margin: 0;
  color: var(--piedra);
  font-size: 0.875rem;
}

/* ---------- CTA ---------- */

.cta {
  padding: clamp(5rem, 9vw, 8rem) 0;
  background: var(--carbon);
  color: var(--caliza);
}

.cta .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  grid-template-areas:
    "eyebrow eyebrow"
    "title lead"
    "title actions";
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: 1.5rem;
  align-items: end;
}

.cta .eyebrow {
  grid-area: eyebrow;
}

.cta__title {
  grid-area: title;
  max-width: 14ch;
  margin: 0;
  font-size: clamp(3.2rem, 7vw, 7.5rem);
}

.cta__lead {
  grid-area: lead;
  max-width: 46ch;
  margin: 0;
  color: rgba(244, 240, 232, 0.68);
}

.cta__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0;
}

/* ---------- Footer ---------- */

.footer {
  padding: clamp(3rem, 5vw, 4.5rem) 0 1.5rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer__phrase {
  max-width: none;
  margin: 0.85rem 0 0;
  color: var(--piedra);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.35;
}

.footer__nav,
.footer__contact {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  color: var(--piedra);
  font-size: 0.8125rem;
}

.footer__nav a:hover,
.footer__contact a:hover {
  color: var(--carbon);
}

.footer__legal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--linea);
  color: var(--piedra);
  font-size: 0.6875rem;
}

.footer__legal a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- Páginas interiores ---------- */

.page-hero {
  padding: clamp(8rem, 12vw, 11rem) 0 clamp(3rem, 5vw, 5rem);
}

.page-hero .display {
  max-width: 1100px;
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.page-hero .lead {
  margin-top: 1.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 4vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
}

/* ---------- Caso de estudio ---------- */

.case-hero {
  padding: clamp(8rem, 12vw, 11rem) 0 0;
}

.case-hero .display {
  max-width: 1100px;
  font-size: clamp(3.4rem, 8.5vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.case-hero .display em {
  font-style: italic;
  font-weight: 400;
}

.case-hero .lead {
  max-width: 60ch;
  margin-top: 1.75rem;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
}

.case-hero .lead::after {
  content: "";
  display: block;
  width: 80px;
  height: 1px;
  margin-top: 2rem;
  background: var(--linea);
}

.case-hero .eyebrow {
  margin-bottom: 1.5rem;
}

.case-hero .eyebrow,
.case-hero .display,
.case-hero .lead {
  animation: heroIn 1.4s var(--ease) both;
}

.case-hero .display {
  animation-delay: 0.15s;
}

.case-hero .lead {
  animation-delay: 0.35s;
}

.case-hero__media {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--caliza-2);
}

.case-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-hero__media.media-placeholder {
  aspect-ratio: 16 / 9;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
}

.case-meta dt {
  color: var(--piedra);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.case-meta dd {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.case-body {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3rem, 5vw, 5rem) 0;
}

.case-body h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
}

.case-body p {
  max-width: 65ch;
}

.case-body p + p {
  margin-top: 1rem;
}

.case-body ul {
  padding-left: 1.2rem;
}

.case-body li + li {
  margin-top: 0.5rem;
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: clamp(3rem, 5vw, 5rem);
}

.case-figure {
  margin: 0 0 clamp(2.5rem, 4vw, 4rem);
}

.case-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.case-figure figcaption {
  margin-top: 0.55rem;
  color: var(--piedra);
  font-size: 0.6875rem;
  line-height: 1.4;
}

.case-gallery img,
.case-gallery .media-placeholder {
  aspect-ratio: 4 / 3;
}

.case-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-grid figure {
  margin: 0;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-grid figcaption {
  margin-top: 0.55rem;
  color: var(--piedra);
  font-size: 0.6875rem;
  line-height: 1.4;
}

/* ---------- Timeline ---------- */

.timeline {
  border-top: 1px solid var(--linea);
}

.timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--linea);
}

.timeline__year {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.1;
}

.timeline__content h3 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.15;
}

.timeline__content p {
  max-width: 65ch;
  margin: 0;
  color: var(--piedra);
}

.case-disclaimer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--linea);
  color: var(--piedra);
  font-size: 0.6875rem;
}

.credit {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--linea);
  color: var(--piedra);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.credit a {
  color: var(--carbon);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.next-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--linea);
}

.next-project span {
  color: var(--piedra);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.next-project a {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  line-height: 1.1;
}

/* ---------- Puertas de portafolio ---------- */

.portfolio-doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.door {
  position: relative;
  display: flex;
  min-height: clamp(420px, 52vw, 680px);
  overflow: hidden;
  color: #f4f0e8;
}

.door__media {
  position: absolute;
  inset: 0;
}

.door__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.door:hover .door__media img {
  transform: scale(1.04);
}

.door__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(23, 23, 22, 0.18) 0%,
    rgba(23, 23, 22, 0.5) 55%,
    rgba(23, 23, 22, 0.9) 100%
  );
  transition: background 0.5s var(--ease);
}

.door:hover .door__overlay {
  background: linear-gradient(
    180deg,
    rgba(23, 23, 22, 0.28) 0%,
    rgba(23, 23, 22, 0.62) 55%,
    rgba(23, 23, 22, 0.94) 100%
  );
}

.door__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.door__number {
  position: absolute;
  top: clamp(1.5rem, 3vw, 2.5rem);
  right: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--serif);
  font-size: 1.25rem;
  opacity: 0.7;
}

.door__title {
  max-width: 12ch;
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 3.6vw, 3.8rem);
}

.door__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: gap 0.3s var(--ease);
}

.door:hover .door__link {
  gap: 0.9rem;
}

.portfolio-doors .door:nth-child(2) {
  transition-delay: 80ms;
}

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

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
}

.contact-details {
  display: grid;
  align-content: start;
  gap: 2rem;
}

.contact-detail {
  padding-top: 1rem;
  border-top: 1px solid var(--linea);
}

.contact-detail dt {
  color: var(--piedra);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.contact-detail dd {
  margin: 0.4rem 0 0;
  font-size: 1rem;
}

.contact-detail a {
  border-bottom: 1px solid var(--linea);
}

.contact-form {
  display: grid;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field label {
  color: var(--piedra);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0;
  border: 0;
  border-bottom: 1px solid var(--linea);
  border-radius: 0;
  background: transparent;
  color: var(--carbon);
  font-family: var(--sans);
  font-size: 1rem;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--carbon);
}

.form-note {
  color: var(--piedra);
  font-size: 0.6875rem;
  line-height: 1.5;
}

/* ---------- Legal ---------- */

.legal {
  max-width: 760px;
}

.legal h2 {
  margin-top: 2.5rem;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
}

.legal p,
.legal li {
  color: var(--piedra);
}

.legal ul {
  padding-left: 1.2rem;
}

/* ---------- 404 ---------- */

.error-page {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 6rem 0;
  text-align: center;
}

.error-page__code {
  color: var(--linea);
  font-family: var(--serif);
  font-size: clamp(6rem, 20vw, 16rem);
  line-height: 0.8;
}

/* ---------- Revelado ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.scroll-text {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(14px);
  transition:
    opacity 1.1s var(--ease),
    filter 1.1s var(--ease),
    transform 1.1s var(--ease);
}

.scroll-text.is-inview {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

/* ---------- Pantalla de carga ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--caliza);
  color: var(--carbon);
  transition:
    opacity 0.8s var(--ease),
    visibility 0.8s var(--ease);
}

.loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.65), transparent 55%);
  pointer-events: none;
}

.loader__inner {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), 380px);
}

.loader__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.loader__word {
  display: block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(16px);
  animation: loaderWord 1.05s var(--ease) forwards;
}

.loader__word--main {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.04em;
  animation-delay: 0.15s;
}

.loader__word--sub {
  color: var(--piedra);
  font-family: var(--sans);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.7;
  animation-delay: 0.75s;
}

.loader__progress {
  width: 170px;
  margin: 0.75rem auto 0;
}

.loader__bar {
  height: 2px;
  overflow: hidden;
  background: var(--linea);
}

.loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--carbon);
  transition: width 0.2s linear;
}

.loader__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  color: var(--piedra);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.is-loading,
body.is-loading {
  overflow: hidden;
}

@keyframes loaderWord {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* ---------- Tema oscuro ---------- */

[data-theme="dark"] .site-header.is-scrolled {
  background: rgba(18, 18, 17, 0.9);
}

[data-theme="dark"] .site-header--light {
  --header-color: #f4f0e8;
}

[data-theme="dark"] .site-header--light.is-scrolled {
  --header-color: var(--carbon);
}

[data-theme="dark"] .hero {
  color: #f4f0e8;
}

[data-theme="dark"] .hero__lead {
  color: rgba(244, 240, 232, 0.78);
}

[data-theme="dark"] .hero__foot {
  border-color: rgba(244, 240, 232, 0.25);
  color: rgba(244, 240, 232, 0.65);
}

[data-theme="dark"] .hero .btn--light {
  border-color: #f4f0e8;
  background: #f4f0e8;
  color: #171716;
}

[data-theme="dark"] .hero .btn--light:hover {
  background: transparent;
  color: #f4f0e8;
}

[data-theme="dark"] .hero .btn--ghost-light {
  border-color: rgba(244, 240, 232, 0.4);
  color: #f4f0e8;
}

[data-theme="dark"] .cta {
  background: #1b1a18;
  color: #f4f0e8;
}

[data-theme="dark"] .cta__lead {
  color: rgba(244, 240, 232, 0.7);
}

[data-theme="dark"] .cta .btn--light {
  border-color: #f4f0e8;
  background: #f4f0e8;
  color: #171716;
}

[data-theme="dark"] .cta .btn--ghost-light {
  border-color: rgba(244, 240, 232, 0.4);
  color: #f4f0e8;
}

[data-theme="dark"] .media-placeholder::after {
  color: rgba(244, 240, 232, 0.12);
}

[data-theme="dark"] .loader {
  background: #121211;
  color: #f4f0e8;
}

[data-theme="dark"] .loader__word--sub,
[data-theme="dark"] .loader__meta {
  color: #a8a196;
}

[data-theme="dark"] .loader__bar {
  background: #35322c;
}

[data-theme="dark"] .loader__bar span {
  background: #f4f0e8;
}

[data-theme="dark"] .loader::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.06), transparent 55%);
}

[data-theme="dark"] .error-page__code {
  color: #2a2824;
}

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

@media (max-width: 1024px) {
  .works-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .work-card:first-child {
    grid-column: auto;
  }

  .work-card:first-child .work-card__media,
  .work-card:first-child .media-placeholder {
    aspect-ratio: 4 / 3;
  }

  .intro__grid,
  .trajectory-teaser__grid,
  .contact-grid,
  .case-body {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .method {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .case-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .nav,
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .header-inner {
    gap: 0.4rem;
  }

  .header-actions {
    margin-left: auto;
  }

  .hero {
    padding-top: 7rem;
  }

  .hero__title {
    max-width: 12ch;
  }

  .hero__foot {
    flex-direction: column;
    gap: 0.35rem;
  }

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

  .portfolio-doors {
    grid-template-columns: 1fr;
  }

  .door {
    min-height: 420px;
  }

  .cta .container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "eyebrow"
      "title"
      "lead"
      "actions";
  }

  .cta__title {
    max-width: 12ch;
  }
}

@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats,
  .method,
  .footer__grid,
  .form-row,
  .case-gallery {
    grid-template-columns: 1fr;
  }

  .footer__legal {
    flex-direction: column;
  }

  .case-meta {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .next-project {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .hero__actions {
    flex-wrap: nowrap;
  }

  .hero__actions .btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding-inline: 1rem;
    white-space: nowrap;
  }

  .hero__foot {
    margin-top: 4rem;
  }
}

/* ---------- Estados interactivos ---------- */

.menu-toggle {
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease);
}

.menu-toggle:hover {
  background: var(--header-color);
  color: var(--caliza);
}

.site-header--light:not(.is-scrolled) .menu-toggle:hover {
  background: #f4f0e8;
  color: #171716;
}

.mobile-menu nav a,
.mobile-menu__meta a,
.mobile-menu__brand,
.menu-close {
  transition:
    color 0.3s var(--ease),
    opacity 0.3s var(--ease);
}

.mobile-menu nav a:hover,
.mobile-menu__meta a:hover,
.menu-close:hover {
  color: var(--tierra);
}

.mobile-menu nav a[aria-current="page"] {
  width: fit-content;
  margin-left: -0.75rem;
  padding: 0.15rem 0.75rem;
  background: var(--carbon);
  color: var(--caliza);
}

.mobile-menu nav a[aria-current="page"]:hover {
  background: var(--carbon);
  color: var(--caliza);
}

.mobile-menu__brand:hover {
  opacity: 0.7;
}

.footer__legal a:hover,
.credit a:hover,
.contact-detail a:hover,
.legal a:hover,
.form-note a:hover {
  color: var(--tierra);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--piedra);
  opacity: 0.7;
}

.form-field select option {
  background: var(--caliza);
  color: var(--carbon);
}

[data-theme="dark"] .hero .btn--light:hover,
[data-theme="dark"] .cta .btn--light:hover {
  border-color: #f4f0e8;
  background: transparent;
  color: #f4f0e8;
}

[data-theme="dark"] .hero .btn--ghost-light:hover,
[data-theme="dark"] .cta .btn--ghost-light:hover {
  border-color: #f4f0e8;
  background: #f4f0e8;
  color: #171716;
}

/* ---------- Ajustes móviles ---------- */

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  touch-action: manipulation;
}

.site-header {
  padding-top: calc(1.1rem + env(safe-area-inset-top));
}

.footer {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

.mobile-menu {
  padding-top: calc(1.5rem + env(safe-area-inset-top));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
  .hero {
    padding-top: 6rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  }

  .hero__title {
    max-width: 100%;
    font-size: clamp(2.2rem, 8.5vw, 3.1rem);
    line-height: 1;
  }

  .hero__lead {
    max-width: 100%;
    margin-top: 1rem;
    font-size: 0.95rem;
  }

  .hero__actions {
    flex-wrap: nowrap;
    margin-top: 1.25rem;
    gap: 0.5rem;
  }

  .hero__foot {
    margin-top: 1.5rem;
    gap: 0.25rem;
    font-size: 0.55rem;
  }

  .page-hero,
  .case-hero {
    padding-top: 7rem;
  }

  .page-hero .display,
  .case-hero .display {
    font-size: clamp(2.4rem, 9vw, 3.4rem);
  }

  .page-hero .lead,
  .case-hero .lead {
    font-size: 1rem;
  }

  .section {
    padding: 4rem 0;
  }

  .section--tight {
    padding: 3rem 0;
  }

  .door {
    min-height: 360px;
  }

  .door__title {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__grid {
    gap: 1.5rem;
  }
}

@media (max-width: 420px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .hero__actions .btn {
    padding-inline: 0.6rem;
    font-size: 0.56rem;
    letter-spacing: 0.08em;
  }
}

@media (max-height: 720px) {
  .hero {
    padding-top: 5.25rem;
    padding-bottom: 1rem;
  }

  .hero__title {
    font-size: clamp(1.9rem, 5.5vh, 3.4rem);
  }

  .hero__lead {
    margin-top: 0.75rem;
    font-size: 0.9rem;
  }

  .hero__actions {
    margin-top: 1rem;
  }

  .hero__foot {
    margin-top: 1rem;
  }
}

@media (max-height: 600px) {
  .hero {
    padding-top: 4.5rem;
    padding-bottom: 0.75rem;
  }

  .hero__title {
    font-size: clamp(1.6rem, 4.8vh, 2.6rem);
  }

  .hero__lead {
    margin-top: 0.6rem;
    font-size: 0.8rem;
  }

  .hero__actions {
    margin-top: 0.75rem;
  }

  .hero__actions .btn {
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.6rem;
  }

  .hero__foot {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    font-size: 0.5rem;
  }
}


