/* =========================================================
   Ruiz Quintana Albañilería S.L.
   ========================================================= */

:root {
  --orange: #f26a0f;
  --orange-dark: #d95a06;
  --ink: #3a3a3a;
  --ink-soft: #555;
  --muted: #6b6b6b;
  --bg: #faf9f7;
  --bg-warm: #f1ede7;
  --dark: #262624;
  --line: #d9d4cc;
  --white: #fff;

  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --container: 1140px;
  --header-h: 96px;
  --radius: 2px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
}

p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Utilidades ---------- */

.eyebrow {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: .75rem;
}

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  margin-bottom: 1.5rem;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon--fill { fill: currentColor; stroke: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: .85rem 1.8rem;
  border-radius: var(--radius);
  transition: background-color .2s, transform .2s, color .2s;
}
.btn--primary {
  background: var(--orange);
  color: var(--white);
}
.btn--primary:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn--primary .icon:last-child { transition: transform .2s; }
.btn--primary:hover .icon:last-child { transform: translateX(3px); }

.btn--ghost { color: var(--white); padding-inline: 1rem; }
.btn--ghost:hover { color: var(--orange); }

/* ---------- Cabecera ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 247, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.header__logo img { width: 316px; height: auto; }

.nav { display: flex; gap: 2.2rem; }

.nav__link {
  position: relative;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  padding: .4rem 0;
  transition: color .2s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transition: transform .25s;
}
.nav__link:hover,
.nav__link.is-active { color: var(--orange); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(420px, 60vh, 560px);
  background: #34352c;
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 62%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
}

/* Fundido del fondo oscuro sobre la foto para dar legibilidad al texto */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #34352c 0%, #34352c 39%, rgba(52, 53, 44, .7) 50%, rgba(52, 53, 44, .25) 62%, rgba(52, 53, 44, 0) 75%),
    linear-gradient(0deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 40%);
}

.hero__content { padding-block: 4rem; }

.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--white);
  margin-bottom: 1.4rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .25);
}

.hero__subtitle {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  font-weight: 500;
  color: var(--white);
  margin-bottom: 2.2rem;
}

/* ---------- Servicios ---------- */

.services { padding: 2.25rem 0 2.5rem; }

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service__img {
  aspect-ratio: 280 / 148;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.service__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.service:hover .service__img img { transform: scale(1.05); }

.service__title {
  font-size: 1.3rem;
  margin-bottom: .6rem;
}

.service p { max-width: 30ch; }

/* ---------- Sobre nosotros ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-warm);
}

.about__media img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.about__content {
  align-self: center;
  max-width: 440px;
  padding: 3rem 2rem 2.5rem;
  margin-left: clamp(1rem, 3vw, 2rem);
}

/* ---------- Valores ---------- */

.values { padding: 2.75rem 0; }

.values__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.value {
  text-align: center;
  padding: .5rem 2rem;
}
.value + .value { border-left: 1px solid var(--line); }

.value__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto .8rem;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.value h3 { font-size: 1.1rem; margin-bottom: .4rem; }

.value p {
  font-size: .9rem;
  line-height: 1.5;
  max-width: 24ch;
  margin: 0 auto;
}

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

.contact {
  position: relative;
  background: var(--dark) url("../images/contacto.jpg") right center / auto 100% no-repeat;
  color: var(--white);
  padding: 2.5rem 0 3rem;
  isolation: isolate;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--dark) 0%, var(--dark) 38%, rgba(38, 38, 36, .6) 55%, rgba(38, 38, 36, 0) 75%);
}

.contact .section-title { color: var(--white); margin-bottom: 1rem; }
.contact p:not(.eyebrow) { color: rgba(255, 255, 255, .9); }

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
}

/* ---------- Pie ---------- */

.footer {
  background: #1d1d1b;
  color: rgba(255, 255, 255, .6);
  font-size: .85rem;
}
.footer__inner {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding-block: 1.2rem;
}
.footer__mark { width: 28px; height: auto; }
.footer p { margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  :root { --header-h: 76px; }

  .header__logo img { width: 230px; }

  .nav-toggle { display: block; }

  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .06);
    padding: .5rem 24px 1rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__link { padding: .8rem 0; border-bottom: 1px solid #eee; }
  .nav__link:last-child { border-bottom: 0; }
  .nav__link::after { display: none; }

  .hero__media { width: 100%; }
  .hero::before {
    background: linear-gradient(90deg, rgba(40, 40, 34, .85) 0%, rgba(40, 40, 34, .55) 60%, rgba(40, 40, 34, .2) 100%);
  }

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

  .about { grid-template-columns: 1fr; }
  .about__media img { height: 300px; }
  .about__content { max-width: none; margin: 0; padding: 2.5rem 24px; }

  .contact { background-size: cover; }
  .contact::before { background: rgba(30, 30, 28, .72); }
}

@media (max-width: 640px) {
  .services__grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .service p { max-width: none; }

  .values__grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .value + .value { border-left: 0; border-top: 1px solid var(--line); padding-top: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
