/* ==========================================================
   TABIAN · Tabiquería de ladrillo
   Estilo: limpio y profesional — fondo claro, rojo como acento
   ========================================================== */

:root {
  /* Paleta sacada del logo (ladrillo) */
  /* Blanco y negro como base, el ladrillo como único color */
  /* Paleta: Off-White · Matte Black · Red Orange */
  --bg: #f9f9f9;           /* off-white */
  --bg-soft: #f1f1f1;
  --ink: #28282b;          /* matte black */
  --ink-soft: #5f5f64;
  --line: #e3e3e5;
  --red: #ff4200;          /* red orange */
  --red-dark: #d93700;
  --terracota: #ff4200;    /* acento sobre fondos oscuros */
  --radius: 6px;
  --max: 1180px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { overflow-x: clip; scroll-behavior: smooth; touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  overflow-x: clip;
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  border: 1.5px solid transparent;
  transition: background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { border-color: var(--red); color: var(--red); background: #fff; }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; }
.logo img { height: 66px; width: auto; display: block; }

/* ---------- Cabecera ----------
   Franja blanca translúcida con el borde inferior inclinado,
   siguiendo la inclinación del logo. Se queda fija al bajar. */
:root { --band-h: 108px; --band-cut: 40px; }
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--band-h);
}
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(249, 249, 249, .82);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--band-cut)), 0 100%);
  transition: background .3s;
}
.header.scrolled::before { background: rgba(249, 249, 249, .92); }
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--band-h) - var(--band-cut));
  padding-top: 6px;
}
.logo { margin-top: 18px; }        /* el logo baja hacia la parte más ancha de la franja */
.nav { display: flex; align-items: center; gap: 36px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: color .2s;
}
.nav-links a:hover { color: var(--ink); }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  margin-top: calc(-1 * var(--band-h));   /* la foto pasa por detrás de la franja */
  padding-top: var(--band-h);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
  background: #28282b;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  transform: scale(1.08);
  animation: kenburns 9s ease-out forwards;
}
@keyframes kenburns { from { transform: scale(1.18); } to { transform: scale(1.08); } }
.hero-bg::after {                   /* oscurecido para que se lea el texto */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(28, 28, 31, .92) 0%, rgba(28, 28, 31, .72) 45%, rgba(28, 28, 31, .25) 100%),
    linear-gradient(0deg, rgba(28, 28, 31, .85) 0%, transparent 40%);
}
.hero-content { position: relative; padding-top: 48px; padding-bottom: 44px; }

.eyebrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 26px;
  padding-left: 16px;
  border-left: 3px solid var(--terracota);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.3;
}
.eyebrow-main { color: #fff; }
.eyebrow-zone { color: var(--terracota); }

.hero h1 {
  font-size: clamp(38px, 5.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 0 0 26px;
  max-width: 900px;
}
.hero h1 .accent { color: var(--terracota); }
.hero-lead {
  font-size: 20px;
  color: rgba(255, 255, 255, .82);
  max-width: 560px;
  margin: 0 0 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.footer .btn-ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--ink); }

/* Franja de datos */
.hero-stats {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, .16);
  background: rgba(28, 28, 31, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat {
  padding: 26px 0 26px 24px;
  border-left: 1px solid rgba(255, 255, 255, .16);
  display: flex;
  flex-direction: column;
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat strong { font-size: 34px; font-weight: 800; line-height: 1.1; color: #fff; }
.stat > span { font-size: 14px; color: rgba(255, 255, 255, .7); }

/* Animación de entrada */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.loaded .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg img { animation: none; }
}

/* ---------- Secciones ---------- */
.section-head { max-width: 680px; margin: 0 0 56px; }
.section-kicker {
  margin: 0 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
}
.section-head h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 800;
}
.section-sub { margin: 0; font-size: 19px; color: var(--ink-soft); }

/* ---------- Servicios: tipos de ladrillo ---------- */
.services { padding: 110px 0; background: var(--bg-soft); }
.brick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.brick-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s;
}
.brick-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(0, 0, 0, .10); border-color: #d0d0d0; }
.brick-art {
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 40px 20px;
  background:
    linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box,
    repeating-linear-gradient(-12deg, transparent 0 22px, rgba(0,0,0,.025) 22px 23px);
  background-color: #f7f6f4;
  border-bottom: 1px solid var(--line);
}
.brick-art { background: #f7f6f4 repeating-linear-gradient(-12deg, transparent 0 26px, rgba(0, 0, 0, .03) 26px 27px); }
.brick-art img { height: 100%; width: 100%; object-fit: contain; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.brick-card:hover .brick-art img { transform: translateY(-6px) rotate(-2deg) scale(1.03); }
.brick-body { padding: 28px 30px 32px; }
.brick-num { font-size: 13px; font-weight: 800; color: var(--red); letter-spacing: .1em; }
.brick-body h3 { margin: 6px 0 10px; font-size: 25px; letter-spacing: -.015em; line-height: 1.15; }
.brick-body p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

/* Aparición al hacer scroll */
.on-scroll { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.on-scroll.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .on-scroll { opacity: 1; transform: none; transition: none; } }

/* ---------- Contacto / pie ---------- */
.footer { background: #28282b; color: #fff; padding: 110px 0 36px; }
.footer-cta { max-width: 760px; margin-bottom: 90px; }
.footer-cta h2 { font-size: clamp(36px, 5vw, 64px); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 18px; font-weight: 800; }
.footer-cta .accent { color: var(--terracota); }
.footer-cta p { font-size: 19px; color: rgba(255, 255, 255, .72); margin: 0 0 34px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding-top: 44px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  align-items: start;
}
.footer-logo { height: 70px; width: auto; }
.footer h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--terracota); }
.footer-grid p { margin: 0; color: rgba(255, 255, 255, .8); line-height: 1.8; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-legal { margin: 56px 0 0; font-size: 13px; color: rgba(255, 255, 255, .45); }

/* ---------- 1) Franja en movimiento ---------- */
.marquee-wrap { position: relative; z-index: 2; overflow: hidden; padding: 30px 0; margin: 0 0 56px; }
.marquee {
  position: relative;
  z-index: 2;
  margin: -1px 0;
  padding: 26px 0;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  transform: rotate(-2deg) scale(1.04);   /* misma inclinación que el logo */
  border-top: 4px solid var(--red);
  border-bottom: 4px solid var(--red);
}
.marquee-track { display: flex; width: max-content; will-change: transform; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.marquee span {
  font-size: clamp(34px, 6vw, 80px);
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  padding: 0 .35em;
}
.marquee i {                               /* separador: un ladrillo naranja */
  display: inline-block;
  width: .9em; height: .42em;
  font-size: clamp(34px, 6vw, 80px);
  background: var(--red);
  border-radius: 3px;
  transform: skewY(-12deg);
}
.services { position: relative; z-index: 1; }

/* ---------- 2) Ladrillos que caen y encajan ---------- */
.brick-art .drop { display: block; width: 100%; height: 100%; opacity: 0; transform: translateY(-140px) rotate(-10deg); }
.brick-art.dropped .drop { animation: brickDrop .9s cubic-bezier(.3, 0, .3, 1) forwards; }
@keyframes brickDrop {
  0%   { opacity: 0; transform: translateY(-140px) rotate(-10deg); }
  55%  { opacity: 1; transform: translateY(10px) rotate(2deg); }
  72%  { transform: translateY(-14px) rotate(-1deg); }
  86%  { transform: translateY(3px) rotate(0); }
  100% { opacity: 1; transform: none; }
}
.brick-art img { transform: rotate(var(--tilt, 0deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.brick-card:hover .brick-art img { transform: translateY(-6px) rotate(calc(var(--tilt, 0deg) - 2deg)) scale(1.03); }

/* ---------- 3) Titulares que se construyen ---------- */
h2.build .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
h2.build .wi { display: inline-block; transform: translateY(105%); transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
h2.build.built .wi { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .brick-art .drop { opacity: 1; transform: none; }
  .brick-art.dropped .drop { animation: none; }
  h2.build .wi { transform: none; transition: none; }
}

/* ---------- Obras ---------- */
.works { padding: 110px 0; background: var(--bg); }
.obra {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 48px;
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.obra-info { position: sticky; top: 130px; }
.obra-num { font-size: 13px; font-weight: 800; color: var(--red); letter-spacing: .1em; text-transform: uppercase; }
.obra-info h3 { margin: 8px 0 6px; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.obra-lugar { margin: 0 0 18px; font-weight: 700; color: var(--ink); }
.obra-info p { color: var(--ink-soft); margin: 0 0 22px; }
.obra-info p:last-child { margin-bottom: 0; }
.obra-galeria {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.obra-foto {
  padding: 0; border: 0; cursor: zoom-in;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.obra-foto.is-main { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.obra-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .4s; }
.obra-foto:hover img { transform: scale(1.06); }

/* Visor */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 20, 22, .94);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 16px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-btn {
  position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff;
  width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer;
}
.lb-btn:hover { background: var(--red); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: 14px; margin: 0; padding: 0 20px; }

/* Galería de 2 fotos */
.galeria-2 { grid-template-columns: 1fr 1fr; }
.galeria-2 .obra-foto { aspect-ratio: 4 / 3; }

/* Galería de 5 fotos: la última ocupa dos columnas */
.galeria-5 .obra-foto:last-child { grid-column: span 2; aspect-ratio: auto; position: relative; }
.galeria-5 .obra-foto:last-child img { position: absolute; inset: 0; }

/* Galería de 4 fotos: principal alta y 3 a la derecha */
.galeria-4 .obra-foto.is-main { grid-row: span 3; }

/* Galería de 1 foto */
.galeria-1 { grid-template-columns: 1fr; max-width: 480px; }
.galeria-1 .obra-foto { aspect-ratio: 560 / 650; }

/* ---------- En ejecución ---------- */
.works-live { background: var(--bg-soft); padding-bottom: 80px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--red);
}
.live-badge i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); position: relative; }
.live-badge i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--red);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse { from { transform: scale(1); opacity: .7; } to { transform: scale(2.8); opacity: 0; } }
.galeria-live { grid-template-columns: 1fr 1fr; }
.galeria-live .obra-foto { aspect-ratio: 4 / 3; }
.galeria-live .foto-proyecto { grid-column: 1 / -1; aspect-ratio: 1420 / 860; background: #fff; border: 1px solid var(--line); }
.galeria-live .foto-proyecto img { object-fit: contain; }
.galeria-live .foto-proyecto:hover img { transform: scale(1.02); }

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .photo-slot { aspect-ratio: 4 / 3; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  :root { --band-h: 88px; --band-cut: 26px; }
  .logo img { height: 52px; }
  .logo { margin-top: 14px; }
  .hero-lead { font-size: 17px; }
  .eyebrow { font-size: clamp(10.5px, 3.2vw, 12.5px); letter-spacing: .06em; }
  .hero h1 { font-size: clamp(30px, 10.5vw, 44px); overflow-wrap: break-word; }
  .nav { gap: 12px; min-width: 0; }
  .header .btn-sm { padding: 9px 14px; font-size: clamp(12px, 3.6vw, 14px); }
  .logo img { height: clamp(40px, 13vw, 52px); }
  .hero-lead { font-size: 17px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 16px 0 16px 18px; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.16); }
  .stat strong { font-size: 26px; }
  .stat > span { font-size: 13px; }
  .hero-content { padding-top: 48px; padding-bottom: 36px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .services { padding: 72px 0; }
  .works { padding: 72px 0; }
  .obra { grid-template-columns: 1fr; gap: 24px; padding: 28px 0; }
  .obra-info { position: static; }
  .obra-info h3 { font-size: 23px; }
  .obra-galeria {                      /* carrusel deslizable */
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -24px; padding: 0 24px 6px; scrollbar-width: none;
  }
  .obra-galeria::-webkit-scrollbar { display: none; }
  .obra-foto, .obra-foto.is-main { flex: 0 0 78%; aspect-ratio: 4 / 5; scroll-snap-align: center; }
  .lb-prev, .lb-next { display: none; }
  .galeria-5 .obra-foto:last-child { aspect-ratio: 4 / 5; }
  .galeria-5 .obra-foto:last-child img { position: static; }
  .galeria-1 .obra-foto { flex: 0 0 100%; }
  .galeria-2 .obra-foto, .galeria-live .obra-foto, .galeria-live .foto-proyecto { flex: 0 0 88%; aspect-ratio: 4 / 3; }
  .marquee { padding: 16px 0; transform: rotate(-3deg) scale(1.08); }
  .marquee-wrap { padding: 22px 0; margin-bottom: 36px; }
  .footer { padding: 72px 0 30px; }
  .footer-cta { margin-bottom: 56px; }
  .footer-cta p { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-logo { height: 56px; }
  .brick-grid { grid-template-columns: 1fr; gap: 20px; }
  .brick-art { height: 210px; padding: 22px 28px 14px; }
  .section-head { margin-bottom: 36px; }
  .section-sub { font-size: 17px; }
  .brick-body { padding: 22px 22px 26px; }
  .brick-body h3 { font-size: 22px; }
  /* En móvil la foto se amplía hacia arriba para que no se vea el techo */
  .hero-bg { top: -48%; }
  .hero-bg img { object-position: 50% 100%; }
}
