:root {
  color-scheme: light;
  --cal: #f8f1e7;
  --paper: #fffaf3;
  --mar: #182b3e;
  --mar-dk: #142638;
  --muted: #5b5952;
  --ocre: #996734;
  --sand: #edddbe;
  --line: #dacebc;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
  --nav-height: 5.4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-height) + .5rem); }
body { margin: 0; color: var(--mar); background: var(--cal); font: 400 1.0625rem/1.6 var(--sans); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font: 400 1em/1.12 var(--serif); letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 5vw, 3.6rem); }
h3 { font-size: clamp(1.18rem, 2.4vw, 1.55rem); }
p { text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid #b77b42; outline-offset: 4px; }
[hidden] { display: none !important; }

.container { width: min(100% - clamp(1.75rem, 6vw, 5rem), 68rem); margin-inline: auto; }
.page-section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.eyebrow { font-size: .75rem; line-height: 1.35; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; color: var(--ocre); margin-bottom: .85rem; }
.skip { position: absolute; top: 0; left: .5rem; z-index: 50; background: var(--paper); padding: .65rem; transform: translateY(-120%); }
.skip:focus { transform: none; }

.nav { position: sticky; top: 0; z-index: 5; background: var(--cal); border-bottom: 1px solid transparent; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { min-height: var(--nav-height); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.brand { text-decoration: none; }
.brand__logo { display: grid; justify-items: start; padding-bottom: .32rem; background: linear-gradient(to right, var(--ocre) 75%, transparent 75%) left bottom / 100% 2px no-repeat; }
.brand__roof { display: block; width: 3.7rem; height: 1.05rem; background: #b48250; clip-path: polygon(0 100%, 48% 0, 73% 49%, 73% 6%, 86% 6%, 86% 76%, 100% 100%, 87% 100%, 48% 20%, 9% 100%, 0 100%, 77% 11%, 77% 56%, 82% 67%, 82% 11%, 77% 11%); }
.brand b { font: 400 clamp(1.42rem, 4.8vw, 2rem)/1.16 var(--serif); }
.brand small { font-size: clamp(.56rem, 1.9vw, .68rem); line-height: 1.5; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.nav__links { display: flex; align-items: center; gap: clamp(.7rem, 3vw, 2.3rem); }
.nav__links a { text-decoration: none; font-size: .95rem; font-weight: 650; }
.nav__links a:hover, .nav__links a:focus-visible { text-decoration: underline; text-underline-offset: .22em; }
.nav__toggle { background: transparent; border: 0; display: none; width: 2.75rem; height: 2.75rem; cursor: pointer; flex: none; }
.nav__toggle span { display: block; height: 2px; width: 1.35rem; border-radius: 2px; background: var(--mar); margin: 4px auto; }

.hero {
  display: grid;
  gap: clamp(.5rem, 1.3svh, .85rem);
  text-align: center;
  padding-block: .45rem clamp(.65rem, 2svh, 1.3rem);
}
.hero__art { display: grid; place-items: center; min-block-size: 0; }
.hero__copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: clamp(.42rem, 1.1svh, .72rem);
}
@media (min-width: 18rem) and (min-height: 32rem),
       (min-width: 18rem) and (max-width: 740px) and (min-height: 28rem) {
  .hero {
    /* Reserve space for the text and button, then fit the portrait in what remains. */
    block-size: min(calc(100svh - var(--nav-height) - 1px), 56rem);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .hero__art { container-type: size; }
  .hero .hero__portrait { width: min(100cqw, 138.59cqh, 54rem); }
}
.hero__portrait, .about__photo {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  background: var(--cal);
}
.hero__portrait {
  width: min(100%, 54rem);
  margin-inline: auto;
  border-radius: clamp(.95rem, 3.2vw, 2rem);
  aspect-ratio: 966 / 697;
}
.hero__portrait img, .about__photo img {
  position: absolute;
  height: auto;
  max-width: none;
}
/* Source portrait spans x=29–995 and y=216–913 in the approved reference. */
.hero__portrait img { width: 106.004%; left: -3.002%; top: -22.36cqw; }
.hero__place { display: flex; justify-content: center; align-items: center; gap: .75rem; }
.hero__place::before, .hero__place::after { content: ""; height: 1px; width: clamp(.6rem, 9vw, 4.4rem); background: var(--ocre); }
.hero__place span { font-size: .75rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; padding: .26rem .72rem; border: 1px solid var(--ocre); border-radius: 999px; }
.hero h1 { font-size: clamp(1.9rem, 5.3vw, 3.7rem); line-height: 1.04; }
.hero__experience { padding: .34rem .92rem; color: #3b3022; background: #f0dfbc; border: 1px solid #e8d3af; border-radius: .6rem; font: 400 clamp(1rem, 2.7vw, 1.45rem)/1.34 var(--serif); }
.action { display: inline-flex; min-height: 3.2rem; padding: .64rem 1.2rem; border-radius: .82rem; border: 1px solid transparent; align-items: center; justify-content: center; gap: .6rem; text-decoration: none; text-align: center; font: 700 1.05rem/1.2 var(--sans); cursor: pointer; }
.action--main { background: var(--mar); color: var(--paper); }
.action--main:hover { background: #284456; }
.action--light { color: var(--paper); border-color: #b0b8ba; background: transparent; }
.action--light:hover { background: #2d4456; }
.action--full { width: 100%; }
.action svg { width: 1.16rem; height: 1.16rem; fill: currentColor; }
.hero__call { width: min(100%, 23rem); min-height: 3.35rem; }

.services__grid { border-top: 1px solid var(--line); margin-top: clamp(1.35rem, 4vw, 2.6rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(1rem, 3.5vw, 2.8rem); }
.services__grid > div { border-bottom: 1px solid var(--line); padding: 1.35rem 0 1.55rem; }
.services__grid h3 a { text-decoration-thickness: 1px; text-underline-offset: .2em; }
.services__grid h3 a span { color: #745129; white-space: nowrap; }
.services__grid h3 a:hover { color: #745129; }
.services__grid p { color: var(--muted); margin-top: .4rem; }
.about { background: #eee4d4; }
.about__grid { display: grid; align-items: center; grid-template-columns: .68fr 1fr; gap: clamp(1.5rem, 6vw, 5rem); }
.about__portrait { width: min(100%, 28rem); }
.about__photo { aspect-ratio: 752 / 700; border-radius: 1rem; }
/* Reframe the cover portrait around Manolo, at x=156 and y=213. */
.about__photo img { width: calc(100% * 1024 / 752); left: calc(-100% * 156 / 752); top: calc(-100% * 213 / 700); }
.about__portrait figcaption { color: var(--muted); font-size: .85rem; margin-top: .6rem; }
.about__text p { margin-top: 1rem; max-width: 37ch; color: var(--muted); }
@media (max-width: 740px) {
  .about__text { grid-row: 1; }
  .about__portrait { max-width: 22rem; }
}
.questions h2 { font-size: clamp(1.85rem, 4vw, 2.75rem); margin-bottom: 1.35rem; }
.questions details { border-top: 1px solid var(--line); padding: .9rem 0; }
.questions details:last-child { border-bottom: 1px solid var(--line); }
.questions summary { cursor: pointer; font-weight: 700; }
.questions details p { padding: .45rem 0 .1rem; max-width: 44rem; color: var(--muted); }
.contact { padding-bottom: clamp(2rem, 5vw, 4rem); }
#contacto .salas-contact {
  --contact-highlight: #f0dfbc;
  --contact-soft: #e3dcd0;
  --contact-rule: #ffffff38;
  container-type: inline-size;
  color-scheme: light;
  color: var(--paper);
  background: var(--mar-dk);
  border-radius: 1rem;
  overflow: hidden;
  font: 400 1rem/1.55 var(--sans);
}
#contacto .salas-contact *,
#contacto .salas-contact *::before,
#contacto .salas-contact *::after { box-sizing: border-box; }
#contacto .salas-contact [hidden] { display: none !important; }
#contacto .contact-layout {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: start;
}
#contacto .contact-house {
  position: relative;
  margin: 0;
  align-self: stretch;
  min-height: 15rem;
}
#contacto .contact-house img {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 54% center;
}
#contacto .contact-house figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2rem 1rem .75rem;
  background: linear-gradient(transparent, #142638e8);
  color: var(--paper);
  font-size: .78rem;
}
#contacto .contact-copy { padding: clamp(1.25rem, 5cqw, 3.25rem); }
#contacto .contact-label {
  color: var(--contact-highlight);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#contacto h2 {
  color: var(--paper);
  font: 400 clamp(2.35rem, 6cqw, 4.25rem)/1.04 var(--serif);
  letter-spacing: -.04em;
  margin: .65rem 0 .85rem;
  text-wrap: balance;
}
#contacto .contact-lead { color: var(--contact-soft); max-width: 30ch; }
#contacto .contact-person {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--contact-rule);
  display: flex;
  align-items: center;
  gap: .8rem;
}
#contacto .contact-avatar {
  position: relative;
  flex: 0 0 3.4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--contact-highlight);
}
#contacto .contact-avatar img {
  position: absolute;
  width: calc(100% * 1024 / 326);
  height: auto;
  max-width: none;
  left: calc(-100% * 366 / 326);
  top: calc(-100% * 215 / 326);
}
#contacto .contact-person strong { display: block; font-weight: 700; }
#contacto .contact-person span { color: var(--contact-soft); font-size: .875rem; }
#contacto .contact-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.25rem; }
#contacto .contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  padding: .55rem .85rem;
  font: 700 .94rem/1.3 var(--sans);
  text-align: center;
  text-decoration: none;
}
#contacto button.contact-button { cursor: pointer; }
#contacto .contact-button svg { fill: currentColor; flex: none; width: 1rem; height: 1rem; }
#contacto .contact-button-main { background: var(--contact-highlight); color: var(--mar-dk); }
#contacto .contact-button-main:hover { background: var(--paper); }
#contacto .contact-button-more {
  background: transparent;
  color: var(--paper);
  border-color: #a7b1bb;
}
#contacto .contact-button-more:hover,
#contacto .contact-button-more[aria-expanded='true'] { background: #2a4358; }
#contacto .contact-draft {
  margin-top: 1.25rem;
  background: var(--paper);
  color: var(--mar-dk);
  border-radius: .75rem;
  padding: 1rem;
}
#contacto .contact-draft h3 { color: inherit; font: 400 1.27rem/1.2 var(--serif); }
#contacto .draft-fields { display: grid; gap: .75rem; margin: .85rem 0; }
#contacto .draft-fields label { display: grid; gap: .28rem; font-weight: 600; font-size: .87rem; }
#contacto .draft-fields input,
#contacto .draft-fields select {
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: .45rem .65rem;
  border: 1px solid #a59b8c;
  border-radius: .45rem;
  background: #fffdf9;
  color: var(--mar-dk);
  font: 400 1rem/1.3 var(--sans);
}
#contacto .draft-message {
  display: block;
  padding: .7rem .85rem;
  background: #ece6d9;
  border-radius: .5rem;
  font-size: .94rem;
  overflow-wrap: anywhere;
}
#contacto .draft-note { color: #514c44; margin: .55rem 0 .8rem; font-size: .85rem; }
#contacto .draft-open { background: var(--mar); color: var(--paper); }
#contacto .draft-open:hover { background: #2a4358; }
@container (max-width: 620px) {
  #contacto .contact-layout { grid-template-columns: minmax(0, 1fr); }
  #contacto .contact-copy { grid-row: 1; }
  #contacto .contact-house { min-height: 0; aspect-ratio: 2.2; }
  #contacto .contact-house img { object-position: 50% 54%; }
}
@container (max-width: 390px) {
  #contacto .contact-actions { display: grid; }
}

.footer { padding-block: 1.8rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer b { font: 400 1.18rem var(--serif); }
.footer p, .footer a { font-size: .9rem; }
.footer nav { display: flex; gap: .75rem; flex-wrap: wrap; }

@media (max-width: 740px) {
  :root { --nav-height: 4.5rem; }
  .nav__toggle { display: block; }
  .nav__links { display: none; }
  .nav__links.is-open { display: grid; position: absolute; top: 100%; inset-inline: 0; gap: 0; background: var(--cal); padding: .4rem max(.875rem, 3vw); border-bottom: 1px solid var(--line); }
  .nav__links a { display: block; padding: .66rem .2rem; }
  .hero h1 { font-size: clamp(1.72rem, 7.3vw, 3.2rem); }
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 741px) and (min-height: 32rem) and (min-aspect-ratio: 1 / 1) {
  .hero__portrait { aspect-ratio: 966 / 650; }
  .hero .hero__portrait { width: min(100cqw, 148.61cqh, 58rem); }
  .hero h1 { font-size: clamp(2.15rem, 4.75vw, 3rem); }
}
@media (min-width: 65rem) and (min-height: 32rem) and (min-aspect-ratio: 1 / 1) {
  .hero h1 { font-size: clamp(2.6rem, 4vw, 3.15rem); }
  .hero h1 br { display: none; }
}
@media (min-width: 18rem) and (max-width: 740px) and (min-height: 28rem) {
  .hero {
    --portrait-width: calc(100vw - clamp(1.75rem, 6vw, 5rem));
    block-size: min(
      calc(100svh - var(--nav-height) - 1px),
      calc(var(--portrait-width) * .722 + 16rem)
    );
  }
}
@media (orientation: landscape) and (min-width: 42rem) and (max-height: 32rem) {
  .hero {
    block-size: calc(100svh - var(--nav-height) - 1px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(.8rem, 3vw, 2rem);
  }
  .hero__art { align-self: stretch; container-type: size; }
  .hero .hero__portrait { width: min(100cqw, 138.59cqh); }
  .hero h1 { font-size: clamp(1.5rem, 3.2vw, 2.55rem); }
}
@media (max-width: 420px) {
  .services__grid { grid-template-columns: 1fr; }
  .hero__place { gap: .5rem; }
  .hero__place span { font-size: .69rem; }
}

/* Recorrido de obra y reforma */
.reform-history {
  --era-nav-height: 3.25rem;
  background: var(--paper);
  padding-top: clamp(2.5rem, 6vw, 5rem);
}

.history-intro { padding-bottom: 1.2rem; }
.history-intro > p { color: var(--muted); margin-top: .55rem; }
.history-intro .history-note { font-size: .86rem; }
.history-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: .7rem; }
.history-links a { color: var(--mar); font-size: .92rem; text-underline-offset: .2em; }

.era-nav {
  display: flex;
  align-items: center;
  gap: clamp(.15rem, 2vw, 1rem);
  position: sticky;
  top: var(--nav-height);
  z-index: 4;
  min-height: var(--era-nav-height);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.era-nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding-inline: clamp(.35rem, 1.8vw, .8rem);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: clamp(.75rem, 2.6vw, .9rem);
  text-decoration: none;
}
.era-nav a:hover, .era-nav a[aria-current] { color: var(--mar); border-bottom-color: var(--ocre); }
.reform-history .chapter {
  min-height: 138svh;
  scroll-margin-top: var(--era-nav-height);
}
.chapter__pin {
  position: sticky;
  top: calc(var(--nav-height) + var(--era-nav-height));
  display: grid;
  grid-template-columns: minmax(170px, .68fr) minmax(0, 2.2fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding-block: .9rem 1rem;
  background: var(--paper);
}
.chapter__text h3 { font-size: clamp(1.55rem, 3.3vw, 2.8rem); }
.chapter__text p { margin: .5rem 0 .8rem; color: var(--muted); max-width: 27ch; min-height: 3em; }
.chapter figure {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: min(62svh, 40rem);
  background: #2c2722;
  border-radius: .5rem;
}
.chapter figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transition: opacity .36s ease;
}
.chapter [data-photo="after"], .chapter[data-stage="after"] [data-photo="before"] { opacity: 0; }
.chapter[data-stage="after"] [data-photo="after"] { opacity: 1; }

.compare {
  width: fit-content;
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 99px;
}
.compare button {
  border: 0;
  min-height: 44px;
  padding: 0 .46rem;
  color: var(--muted);
  background: transparent;
  border-radius: 99px;
  font: 650 .86rem var(--sans);
  cursor: pointer;
}
.compare button[aria-pressed="true"] { background: var(--mar); color: var(--paper); }

@media (max-width: 740px), (max-height: 590px) {
  .reform-history .chapter { min-height: 122svh; }
  .chapter__pin { grid-template-columns: minmax(0, 1fr); gap: .55rem; align-items: start; }
  .chapter__text { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .5rem; align-items: center; }
  .chapter__text p { grid-column: 1 / -1; grid-row: 2; min-height: 2.6em; margin: 0; max-width: none; font-size: .91rem; }
  .compare { grid-column: 2; grid-row: 1; }
  .chapter figure { height: min(45svh, calc(100cqw * 2 / 3)); }
  .reform-history > .container { container-type: inline-size; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .chapter__pin { grid-template-columns: minmax(152px, .7fr) minmax(0, 2fr); }
  .chapter__text { display: block; }
  .chapter__text p { margin: .35rem 0; }
}
@media (max-width: 740px) and (prefers-reduced-motion: no-preference) {
  .reform-history .chapter { min-height: 0; }

  /* Leave a short interval for the before/after change while the photo is pinned. */
  .reform-history .chapter::after {
    content: "";
    display: block;
    height: clamp(7rem, 20svh, 11rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reform-history .chapter { min-height: 0; margin-bottom: 1.6rem; }
  .chapter__pin { position: static; }
  .chapter figure img { transition: none; }
}

.craft { border-top: 1px solid var(--line); }
.craft h2 { font-size: clamp(2rem, 5vw, 4.25rem); line-height: 1.04; }
.craft-intro { max-width: 55ch; margin: .65rem 0 1.55rem; color: var(--muted); }
.craft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(240px, 1fr);
  gap: clamp(18px, 4vw, 56px);
  align-items: start;
}
.craft-photo {
  position: relative;
  aspect-ratio: 926 / 610;
  overflow: hidden;
  background: #d0bda4;
}
.craft-photo img {
  position: absolute;
  width: 165.875%;
  max-width: none;
  height: auto;
  left: -8.1%;
  top: -40.16%;
}
.craft-pin {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 100%;
  border: 2px solid #f5f0e6;
  background: var(--mar);
  color: #fff;
  box-shadow: 0 2px 9px #20130066;
  font: 600 1rem var(--sans);
  cursor: pointer;
}
.craft-pin[aria-pressed="true"] { background: var(--ocre); box-shadow: 0 0 0 3px var(--ocre), 0 2px 8px #20130066; }
.craft-pin:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.craft-choices { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.craft-choice {
  min-height: 44px;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--mar);
  background: transparent;
  font: 600 .84rem var(--sans);
  cursor: pointer;
}
.craft-choice[aria-pressed="true"] { background: var(--mar); border-color: var(--mar); color: var(--paper); }
.craft-panel { padding-top: 1rem; min-height: 9.2rem; }
.craft-panel h3 { margin: 0; font: 400 clamp(1.55rem, 2.8vw, 2.25rem)/1.08 var(--serif); }
.craft-panel p { margin: .5rem 0 0; color: var(--muted); max-width: 37ch; }
.craft-note { margin: .65rem 0 0; color: var(--muted); font-size: .8rem; }
@media (max-width: 730px) {
  .craft-grid { grid-template-columns: 1fr; gap: 14px; }
  .craft-panel { min-height: 8.5rem; }
}
