:root {
  --ivory: #f2eee7;
  --mineral: #fbfaf7;
  --paper: #fff;
  --graphite: #24211f;
  --ink: #393431;
  --muted: #746d68;
  --terracotta: #b86649;
  --terracotta-dark: #93472f;
  --cement: #d6d0c8;
  --line: rgba(36, 33, 31, .16);
  --header: 78px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: 280ms cubic-bezier(.2,.65,.3,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; color: var(--ink); background: var(--mineral); font-family: var(--sans); line-height: 1.6; overflow-x: hidden; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(184,102,73,.75); outline-offset: 4px; }

.skip-link { position: fixed; left: 20px; top: -100px; z-index: 999; padding: 12px 18px; background: var(--graphite); color: white; text-decoration: none; }
.skip-link:focus { top: 12px; }
.container { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.section { padding: clamp(76px, 9vw, 144px) 0; }
.eyebrow { margin: 0 0 18px; color: var(--terracotta-dark); font-size: .72rem; font-weight: 760; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow.light { color: #e5a88f; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); color: var(--graphite); font-weight: 500; line-height: 1.03; }
h1 { font-size: clamp(3rem, 7vw, 7rem); }
h2 { margin-bottom: 20px; font-size: clamp(2.25rem, 4.8vw, 4.75rem); letter-spacing: -.035em; }
h3 { font-size: 1.45rem; }
p { color: var(--muted); }
.lead { color: var(--ink); font-family: var(--serif); font-size: clamp(1.35rem, 2.1vw, 2rem); line-height: 1.35; }

.site-header { position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header); color: white; border-bottom: 1px solid rgba(255,255,255,.18); transition: background var(--ease), color var(--ease), box-shadow var(--ease); }
.site-header.scrolled { color: var(--graphite); background: rgba(251,250,247,.94); backdrop-filter: blur(15px); box-shadow: 0 10px 40px rgba(35,31,28,.08); }
.header-inner { width: min(1380px, calc(100% - 48px)); height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid currentColor; font-family: var(--serif); font-size: 1.15rem; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .9rem; letter-spacing: .14em; }
.brand small { margin-top: 2px; opacity: .75; font-size: .59rem; letter-spacing: .11em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); }
.main-nav > a:not(.button) { position: relative; padding: 8px 0; color: inherit; font-size: .82rem; font-weight: 650; text-decoration: none; }
.main-nav > a:not(.button)::after { content: ''; position: absolute; inset: auto 0 2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--ease); }
.main-nav > a:not(.button):hover::after { transform: scaleX(1); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 14px 24px; border: 1px solid var(--terracotta); background: var(--terracotta); color: white; font-size: .78rem; font-weight: 760; letter-spacing: .03em; text-decoration: none; transition: transform var(--ease), background var(--ease), border var(--ease); cursor: pointer; }
.button:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); transform: translateY(-2px); }
.button-small { min-height: 42px; padding: 10px 17px; }
.site-header:not(.scrolled) .button-small { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.12); backdrop-filter: blur(8px); }
.menu-toggle { display: none; width: 48px; height: 48px; border: 0; background: transparent; color: inherit; padding: 12px; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 1.5px; margin: 5px auto; background: currentColor; transition: transform var(--ease), opacity var(--ease); }
.menu-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.hero { position: relative; min-height: 850px; height: 100svh; max-height: 1040px; color: white; isolation: isolate; }
.hero-image, .hero-overlay { position: absolute; inset: 0; }
.hero-image { z-index: -3; background: url('assets/images/hero-vivienda-referencia.webp') center / cover no-repeat; }
.hero-overlay { z-index: -2; background: linear-gradient(90deg, rgba(24,21,19,.9) 0%, rgba(24,21,19,.72) 42%, rgba(24,21,19,.2) 78%), linear-gradient(0deg, rgba(24,21,19,.22), transparent 45%); }
.hero-grid { height: 100%; display: grid; grid-template-columns: 1fr auto; align-items: end; padding-bottom: clamp(65px, 9vh, 110px); }
.hero-copy { max-width: 850px; }
.hero h1 { margin-bottom: 30px; color: white; letter-spacing: -.045em; }
.hero h1 em { color: #d79377; font-weight: 400; }
.hero-text { max-width: 680px; margin-bottom: 34px; color: rgba(255,255,255,.78); font-size: clamp(1rem, 1.3vw, 1.18rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button-ghost { border-color: rgba(255,255,255,.55); background: transparent; }
.button-ghost:hover { border-color: white; background: white; color: var(--graphite); }
.hero-note { margin: 26px 0 0; color: rgba(255,255,255,.62); font-size: .72rem; }
.hero-index { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; writing-mode: vertical-rl; }
.hero-index i { display: block; width: 1px; height: 68px; background: rgba(255,255,255,.5); }

.intro { background: var(--mineral); }
.intro-grid { display: grid; grid-template-columns: .25fr 1.25fr 1fr; gap: 6vw; align-items: start; }
.section-number { color: var(--terracotta); font-family: var(--serif); font-size: 1.15rem; }
.intro-title h2 { max-width: 730px; }
.intro-copy { padding-top: 44px; }
.intro-copy p:last-child { max-width: 580px; }

.services { background: var(--ivory); }
.section-heading { display: grid; grid-template-columns: 1.25fr .75fr; gap: 8vw; align-items: end; margin-bottom: clamp(46px, 6vw, 80px); padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.section-heading p { max-width: 520px; margin-bottom: 8px; }
.section-heading.compact { margin-bottom: 50px; }
.services-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(36px, 6vw, 90px); }
.service-feature { background: white; }
.service-feature-image { min-height: 520px; background: url('assets/images/cocina-referencia.webp') center / cover no-repeat; }
.service-feature-copy { display: grid; grid-template-columns: 55px 1fr; padding: 30px; }
.service-feature-copy span { color: var(--terracotta); font-family: var(--serif); }
.service-feature-copy h3 { margin-bottom: 10px; font-size: clamp(1.7rem, 3vw, 2.7rem); }
.service-feature-copy p { grid-column: 2; margin: 0; }
.service-list { border-top: 1px solid var(--line); }
.service-list article { display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.service-list span { color: var(--terracotta); font-family: var(--serif); font-size: .9rem; }
.service-list h3 { margin-bottom: 7px; font-size: 1.5rem; }
.service-list p { margin: 0; font-size: .9rem; }

.transformations { background: var(--mineral); }
.editorial-gallery { display: grid; grid-template-columns: 1.25fr .75fr; grid-auto-rows: 240px; gap: 18px; }
.gallery-item { position: relative; margin: 0; overflow: hidden; background: var(--cement); }
.gallery-item img { transition: transform 650ms ease; }
.gallery-item:hover img { transform: scale(1.025); }
.gallery-wide { grid-row: span 2; }
.gallery-tall { grid-row: span 3; }
.gallery-item:nth-child(3), .gallery-item:nth-child(4) { grid-row: span 2; }
.gallery-item:nth-child(5) { grid-row: span 2; }
.gallery-item::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(20,18,16,.82)); }
.gallery-item figcaption { position: absolute; z-index: 2; inset: auto 24px 22px; color: white; }
.gallery-item figcaption span, .gallery-item figcaption small { display: block; }
.gallery-item figcaption span { font-family: var(--serif); font-size: 1.3rem; }
.gallery-item figcaption small { margin-top: 5px; color: rgba(255,255,255,.68); }

.vision { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 740px; padding: 0; background: var(--graphite); }
.vision-image { min-height: 660px; }
.vision-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(60px, 8vw, 130px); }
.vision-copy h2 { color: white; }
.vision-copy p { max-width: 600px; color: rgba(255,255,255,.66); }
.text-link { display: inline-flex; align-items: center; gap: 12px; width: fit-content; margin-top: 22px; padding-bottom: 5px; border-bottom: 1px solid #d79377; color: #f3d1c3; text-decoration: none; }

.orientation { background: var(--mineral); }
.orientation-head { max-width: 850px; margin-bottom: 70px; }
.orientation-head > p:last-child { max-width: 650px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step { min-height: 310px; padding: 36px clamp(24px, 3vw, 46px); border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step span { display: inline-block; margin-bottom: 64px; color: var(--terracotta); font-family: var(--serif); font-size: 1.25rem; }
.step h3 { font-size: clamp(1.55rem, 2.2vw, 2rem); }

.area { position: relative; background: #ddd5ca; overflow: hidden; }
.area-grid { position: relative; display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 8vw; }
.area-badge { position: relative; display: grid; place-items: center; width: min(100%, 400px); aspect-ratio: 1; border: 1px solid rgba(36,33,31,.22); border-radius: 50%; }
.area-badge::before, .area-badge::after { content: ''; position: absolute; background: rgba(36,33,31,.16); }
.area-badge::before { width: 100%; height: 1px; }
.area-badge::after { width: 1px; height: 100%; }
.area-badge strong { z-index: 1; padding: 12px 20px; background: #ddd5ca; font-family: var(--serif); font-size: clamp(2.1rem, 4vw, 4rem); font-weight: 500; }
.area-badge span { position: absolute; z-index: 2; padding: 3px 8px; background: #ddd5ca; font-size: .64rem; letter-spacing: .12em; }
.area-badge span:first-child { top: 24%; left: 3%; }
.area-badge span:last-child { right: 3%; bottom: 24%; }
.area-copy p:last-child { max-width: 500px; font-size: 1.08rem; }
.area-lines { position: absolute; z-index: 0; right: -15%; bottom: -50%; width: 560px; height: 560px; opacity: .12; pointer-events: none; }
.area-lines i { position: absolute; inset: 0; border: 1px solid var(--graphite); border-radius: 50%; }
.area-lines i:nth-child(2) { inset: 70px; }
.area-lines i:nth-child(3) { inset: 140px; }

.contact { background: var(--graphite); color: white; }
.contact-heading { max-width: 800px; margin-bottom: 60px; }
.contact-heading h2 { color: white; }
.contact-heading > p:last-child { max-width: 660px; color: rgba(255,255,255,.64); }
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(40px, 7vw, 100px); }
.contact-details { border-top: 1px solid rgba(255,255,255,.2); }
.contact-details a { display: block; padding: 24px 0; border-bottom: 1px solid rgba(255,255,255,.2); text-decoration: none; }
.contact-details a span, .contact-details a strong { display: block; }
.contact-details a span { margin-bottom: 7px; color: #d79377; font-size: .67rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.contact-details a strong { color: white; font-family: var(--serif); font-size: clamp(1.1rem, 2vw, 1.7rem); font-weight: 500; overflow-wrap: anywhere; }
.form-panel { padding: clamp(30px, 5vw, 60px); background: var(--mineral); color: var(--ink); }
.form-panel h3 { margin-bottom: 10px; font-size: 2rem; }
.form-intro { margin-bottom: 18px; }
.form-notice { margin-bottom: 26px; padding: 13px 15px; border: 1px solid rgba(184,102,73,.32); background: rgba(184,102,73,.08); color: #704230; font-size: .78rem; }
.form-panel label { display: block; margin: 16px 0 7px; color: var(--graphite); font-size: .71rem; font-weight: 750; letter-spacing: .07em; }
.form-panel input, .form-panel select, .form-panel textarea { width: 100%; border: 0; border-bottom: 1px solid #bdb5ad; border-radius: 0; background: transparent; color: var(--ink); padding: 12px 2px; outline: 0; }
.form-panel textarea { resize: vertical; }
.form-panel input:focus, .form-panel select:focus, .form-panel textarea:focus { border-color: var(--terracotta); box-shadow: 0 1px 0 var(--terracotta); }
.form-button { width: 100%; margin-top: 25px; border: 0; }
.form-feedback { margin: 16px 0 0; padding: 12px; background: #e7e0d7; color: var(--ink); font-size: .8rem; }

.footer { padding: 70px 0 24px; background: #171513; color: white; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 60px; padding-bottom: 60px; }
.footer-brand { color: white; font-family: var(--serif); font-size: 1.8rem; text-decoration: none; }
.footer p { color: rgba(255,255,255,.48); }
.footer-grid strong { display: block; margin-bottom: 17px; color: #d79377; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }
.footer-grid > div > a:not(.footer-brand) { display: block; width: fit-content; margin: 9px 0; color: rgba(255,255,255,.72); font-size: .83rem; text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.38); font-size: .68rem; }
.back-top { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--terracotta); color: white; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--ease), transform var(--ease); cursor: pointer; }
.back-top.visible { opacity: 1; transform: none; pointer-events: auto; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 650ms ease, transform 650ms ease; }
.reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  :root { --header: 70px; }
  .main-nav { position: fixed; inset: var(--header) 0 auto; display: none; flex-direction: column; align-items: stretch; gap: 0; max-height: calc(100vh - var(--header)); padding: 14px 24px 24px; overflow-y: auto; background: var(--mineral); color: var(--graphite); border-top: 1px solid var(--line); box-shadow: 0 22px 45px rgba(34,30,28,.12); }
  .main-nav.open { display: flex; }
  .main-nav > a:not(.button) { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: .95rem; }
  .site-header .main-nav .button { width: 100%; margin-top: 14px; border-color: var(--terracotta); background: var(--terracotta); color: white; }
  .menu-toggle { display: block; }
  .site-header:not(.scrolled) .menu-toggle.active, .site-header:not(.scrolled):has(.main-nav.open) { color: var(--graphite); background: var(--mineral); }
  .intro-grid { grid-template-columns: 70px 1fr; }
  .intro-copy { grid-column: 2; padding-top: 0; }
  .vision-copy { padding: 70px 50px; }
}

@media (max-width: 820px) {
  .container { width: min(100% - 36px, 680px); }
  .header-inner { width: calc(100% - 28px); }
  .hero { min-height: 760px; max-height: none; }
  .hero-image { background-position: 62% center; }
  .hero-overlay { background: linear-gradient(90deg, rgba(24,21,19,.9), rgba(24,21,19,.48)), linear-gradient(0deg, rgba(24,21,19,.42), transparent 58%); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-index { display: none; }
  .section-heading { grid-template-columns: 1fr; gap: 12px; }
  .services-layout { grid-template-columns: 1fr; }
  .service-feature-image { min-height: 420px; }
  .editorial-gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 220px; }
  .gallery-wide, .gallery-tall, .gallery-item:nth-child(3), .gallery-item:nth-child(4), .gallery-item:nth-child(5) { grid-row: span 2; }
  .vision { grid-template-columns: 1fr; }
  .vision-image { min-height: 480px; }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .step span { margin-bottom: 34px; }
  .area-grid, .contact-grid { grid-template-columns: 1fr; }
  .area-badge { width: min(80vw, 360px); margin: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: span 2; }
}

@media (max-width: 540px) {
  .section { padding: 72px 0; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: .78rem; }
  .brand small { font-size: .52rem; }
  .hero { min-height: 700px; height: 100svh; }
  .hero-grid { padding-bottom: 46px; }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4.5rem); }
  .hero-text { font-size: .93rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .hero-note { font-size: .66rem; }
  .intro-grid { grid-template-columns: 1fr; gap: 14px; }
  .section-number { margin-bottom: 16px; }
  .intro-copy { grid-column: 1; }
  .service-feature-image { min-height: 340px; }
  .service-feature-copy { grid-template-columns: 38px 1fr; padding: 24px 20px; }
  .editorial-gallery { display: block; }
  .gallery-item { height: 360px; margin-bottom: 14px; }
  .gallery-tall { height: 430px; }
  .gallery-item figcaption { inset: auto 17px 17px; }
  .gallery-item figcaption span { font-size: 1.12rem; }
  .vision-image { min-height: 370px; }
  .vision-copy { padding: 64px 20px; }
  .orientation-head { margin-bottom: 45px; }
  .step { padding: 30px 4px; }
  .area-badge { width: min(88vw, 330px); }
  .contact-grid { gap: 46px; }
  .form-panel { padding: 28px 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 38px; }
  .footer-grid > div:first-child { grid-column: 1; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 350px) {
  .container { width: calc(100% - 28px); }
  .header-inner { width: calc(100% - 20px); }
  .brand small { display: none; }
  .hero h1 { font-size: 2.55rem; }
  .hero-text { font-size: .87rem; }
  .button { padding-inline: 16px; }
  .gallery-item { height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
