/* ==========================================================================
   IBIMUNIR Constructora — main stylesheet
   Palette inspired by Ibiza: whitewash, sandstone, Mediterranean blue, terracotta
   ========================================================================== */

:root {
  --white: #ffffff;
  --lime: #f7f4ee;          /* whitewash / cal */
  --sand: #e9e1d3;
  --stone: #b9a98f;
  --ink: #1d2a33;
  --ink-soft: #4a5862;
  --sea: #0e5e7e;
  --sea-dark: #0a4660;
  --terracotta: #c2643b;
  --terracotta-dark: #a44f2b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(29, 42, 51, .08);
  --shadow-lg: 0 20px 50px rgba(29, 42, 51, .14);
  --max: 1200px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--lime);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }
ul { padding-left: 1.2em; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section--white { background: var(--white); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--ink); color: #e8ecef; }
.section--dark h2, .section--dark h3 { color: #fff; }
.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: .9rem;
}
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 46rem; }
.section--dark .lead { color: #b8c3ca; }
.section-head { max-width: 48rem; margin-bottom: 3rem; }
.section-head.center { text-align: center; margin-inline: auto; }
.center .lead { margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--ink); color: #fff; padding: .7rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--terracotta); color: #fff; box-shadow: 0 8px 20px rgba(194, 100, 59, .3); }
.btn--primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn--ghost { border-color: currentColor; color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--ink); }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn svg { width: 18px; height: 18px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 244, 238, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(29, 42, 51, .07);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.logo svg { width: 40px; height: 40px; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text strong { font-family: var(--font-serif); font-size: 1.35rem; letter-spacing: .06em; }
.logo-text span { font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft); margin-top: .3rem; }
.nav-menu { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-menu a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .97rem; position: relative; padding: .3rem 0; }
.nav-menu a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--terracotta); transition: width .25s;
}
.nav-menu a:hover::after, .nav-menu a[aria-current="page"]::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-switch { display: flex; border: 1px solid rgba(29, 42, 51, .2); border-radius: 999px; overflow: hidden; font-size: .8rem; font-weight: 700; }
.lang-switch a, .lang-switch span { padding: .35rem .7rem; text-decoration: none; color: var(--ink); }
.lang-switch span { background: var(--ink); color: #fff; }
.nav-cta { padding: .65rem 1.2rem; font-size: .9rem; }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 76px); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--lime);
    padding: 1rem 1.25rem 2rem;
    border-bottom: 1px solid rgba(29, 42, 51, .1);
    box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-10px);
    visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav-menu.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav-menu li { border-bottom: 1px solid rgba(29, 42, 51, .08); }
  .nav-menu a { display: block; padding: 1rem 0; font-size: 1.1rem; }
  .nav-menu a::after { display: none; }
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: flex; align-items: center;
  color: #fff;
  overflow: hidden;
  background: var(--sea-dark);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img, .hero-bg svg { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 30, 42, .82) 0%, rgba(10, 30, 42, .55) 45%, rgba(10, 30, 42, .05) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 6rem 0; max-width: 40rem; }
.hero h1 { color: #fff; margin-bottom: 1.2rem; }
.hero p { font-size: 1.2rem; color: #dbe5ea; margin-bottom: 2.2rem; }
.hero .eyebrow { color: #f0b594; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 3rem; font-size: .92rem; color: #cfdbe1; list-style: none; padding: 0; }
.hero-badges li { display: flex; align-items: center; gap: .5rem; }
.hero-badges svg { width: 20px; height: 20px; color: #f0b594; }

.page-hero {
  background: var(--ink);
  color: #fff;
  padding: clamp(4rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 100, 59, .35), transparent 70%);
}
.page-hero h1 { color: #fff; max-width: 48rem; position: relative; }
.page-hero .lead { color: #b8c3ca; position: relative; }
.breadcrumb { font-size: .85rem; margin-bottom: 1.4rem; position: relative; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; color: #6f7f89; }
.breadcrumb a { color: #f0b594; text-decoration: none; }
.breadcrumb span { color: #b8c3ca; }

/* Grids & cards */
.grid { display: grid; gap: 1.6rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
  border: 1px solid rgba(29, 42, 51, .05);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); margin-bottom: 0; }
.card-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(14, 94, 126, .08); color: var(--sea);
  margin-bottom: 1.3rem;
}
.card-icon svg { width: 28px; height: 28px; }
.card-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1.1rem; font-weight: 600; text-decoration: none; }

.service-detail { padding: 2.5rem 0; border-top: 1px solid rgba(29, 42, 51, .1); display: grid; grid-template-columns: 80px 1fr; gap: 1.8rem; scroll-margin-top: 100px; }
.service-detail:first-child { border-top: 0; }
.service-detail .card-icon { width: 72px; height: 72px; margin: 0; }
.service-detail ul { columns: 2; column-gap: 2rem; color: var(--ink-soft); margin: 0; }
.service-detail li { margin-bottom: .35rem; break-inside: avoid; }
@media (max-width: 640px) {
  .service-detail { grid-template-columns: 1fr; }
  .service-detail ul { columns: 1; }
}

/* Media blocks (illustrations used as image placeholders) */
.media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
  background: var(--sand);
}
.media img, .media svg { width: 100%; height: 100%; object-fit: cover; }

.checklist { list-style: none; padding: 0; margin: 1.5rem 0 2rem; }
.checklist li { position: relative; padding-left: 2rem; margin-bottom: .8rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: var(--terracotta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Process steps */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 3.6rem; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: 0; left: 0;
  font-family: var(--font-serif); font-size: 2.4rem; font-weight: 600; color: var(--terracotta); line-height: 1;
}
.section--dark .step p { color: #b8c3ca; }

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem; }
.filter-btn {
  border: 1px solid rgba(29, 42, 51, .2); background: transparent; color: var(--ink);
  padding: .55rem 1.2rem; border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: background .2s, color .2s;
}
.filter-btn:hover { border-color: var(--ink); }
.filter-btn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.project {
  background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project[hidden] { display: none; }
.project-media { aspect-ratio: 3 / 2; overflow: hidden; }
.project-media svg, .project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project:hover .project-media svg, .project:hover .project-media img { transform: scale(1.05); }
.project-body { padding: 1.4rem 1.6rem 1.7rem; }
.project-tag { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--terracotta); }
.project h3 { margin: .4rem 0 .3rem; font-size: 1.2rem; }
.project p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.project-meta { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--ink-soft); margin-top: .8rem; }
.project-meta svg { width: 16px; height: 16px; }

/* Areas */
.areas { display: flex; flex-wrap: wrap; gap: .7rem; list-style: none; padding: 0; margin: 0; }
.areas li { background: var(--white); border-radius: 999px; padding: .55rem 1.1rem; font-weight: 500; font-size: .95rem; box-shadow: var(--shadow); }

/* FAQ */
.faq { max-width: 52rem; margin-inline: auto; }
.faq details {
  background: var(--white); border-radius: var(--radius); margin-bottom: .9rem; box-shadow: var(--shadow);
  border: 1px solid rgba(29, 42, 51, .05);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 1.3rem 3.5rem 1.3rem 1.6rem; font-weight: 600; font-size: 1.05rem; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%);
  font-size: 1.6rem; font-weight: 400; color: var(--terracotta); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 1.6rem 1.4rem; margin: 0; color: var(--ink-soft); }

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--sea-dark), var(--sea));
  color: #fff; border-radius: calc(var(--radius) * 1.5);
  padding: clamp(2.5rem, 6vw, 4rem);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem;
  position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.cta-band h2 { color: #fff; margin-bottom: .4rem; }
.cta-band p { color: #cfe2ea; margin: 0; max-width: 36rem; }
.cta-band .btn { position: relative; z-index: 1; }

/* Values */
.value { padding: 1.8rem; border-left: 3px solid var(--terracotta); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; }
.value h3 { font-size: 1.15rem; }
.value p { color: var(--ink-soft); margin: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { list-style: none; padding: 0; margin: 0 0 2rem; }
.contact-info li { display: flex; gap: 1rem; margin-bottom: 1.4rem; }
.contact-info .card-icon { width: 48px; height: 48px; flex-shrink: 0; margin: 0; }
.contact-info .card-icon svg { width: 22px; height: 22px; }
.contact-info strong { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.contact-info a, .contact-info address { font-style: normal; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.contact-info a:hover { color: var(--terracotta); }

.form { background: var(--white); border-radius: calc(var(--radius) * 1.3); padding: clamp(1.6rem, 4vw, 2.8rem); box-shadow: var(--shadow-lg); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: .85rem 1rem; border: 1.5px solid #d6d0c4; border-radius: 10px; background: #fcfbf8; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(14, 94, 126, .12); background: #fff;
}
.field .error { color: #b3261e; font-size: .85rem; margin-top: .3rem; display: none; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #b3261e; }
.field.has-error .error { display: block; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.consent input { margin-top: .3rem; width: 18px; height: 18px; accent-color: var(--terracotta); flex-shrink: 0; }
.consent.has-error { color: #b3261e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: 10px; display: none; font-weight: 500; }
.form-status.is-success { display: block; background: #e5f3ea; color: #1d5e35; }
.form-status.is-error { display: block; background: #fbe9e7; color: #8c1d18; }
.form .btn[disabled] { opacity: .6; cursor: wait; }

.map-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 10; background: var(--sand); }
.map-embed iframe { width: 100%; height: 100%; border: 0; }
.map-consent { height: 100%; display: grid; place-items: center; text-align: center; padding: 2rem; }

/* Legal / prose */
.prose { max-width: 50rem; }
.prose h2 { font-size: 1.6rem; margin-top: 2.5rem; }
.prose h3 { margin-top: 1.8rem; }
.prose p, .prose li { color: var(--ink-soft); }

/* Footer */
.site-footer { background: #121c22; color: #aeb9c0; padding: 4.5rem 0 2rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2.5rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-family: var(--font-sans); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.2rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .6rem; }
.site-footer a { color: #aeb9c0; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .logo { color: #fff; margin-bottom: 1.2rem; }
.site-footer .logo-text span { color: #8a98a1; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 3.5rem; padding-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .85rem; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-bottom li { margin: 0; }

/* WhatsApp floating button */
.whatsapp {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
  transition: transform .2s;
}
.whatsapp:hover { transform: scale(1.08); color: #fff; }
.whatsapp svg { width: 30px; height: 30px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; }

/* 404 */
.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.not-found .big { font-family: var(--font-serif); font-size: clamp(5rem, 16vw, 10rem); color: var(--terracotta); line-height: 1; margin-bottom: 1rem; }
