/* ============================================================
   GARYMAR — Sistema visual
   Brutalismo elegante · concreto · editorial arquitectónico
   ============================================================ */

:root {
  /* Paleta marca */
  --ink: #2f3c40;          /* estructura — acero, hormigón */
  --sea: #b0a89c;          /* horizonte — arena cálida */
  --olive: #637865;        /* tierra */
  --stone: #b0a89c;        /* arena — calidez */

  /* Superficies */
  --paper: #f4f1ea;        /* fondo cálido base — piedra caliza diluida */
  --paper-2: #ece8df;      /* fondo alterno */
  --paper-3: #e3ddd1;      /* divisores cálidos */
  --line: rgba(47, 60, 64, 0.12);
  --line-strong: rgba(47, 60, 64, 0.28);
  --ink-soft: rgba(47, 60, 64, 0.62);

  /* Tipografía */
  --sans: "Urbanist", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Escala */
  --display: clamp(72px, 13vw, 220px);
  --h1: clamp(48px, 7vw, 112px);
  --h2: clamp(36px, 5vw, 72px);
  --h3: clamp(24px, 2.6vw, 36px);
  --body-l: 19px;
  --body: 16px;
  --meta: 12px;

  /* Métrica */
  --container: 1440px;
  --gutter: 32px;
  --pad-x: clamp(24px, 5vw, 80px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  font-size: var(--body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  letter-spacing: -0.005em;
}

/* Grano de hormigón global ----------------------------------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.23 0 0 0 0 0.25 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  background-size: 220px 220px;
  opacity: 0.08;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 999;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Typo helpers ------------------------------------------------ */
/* Microtexto / eyebrows / metadatos — IBM Plex Mono, etiquetas técnicas */
.mono { font-family: var(--mono); font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; }
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.display { font-family: var(--sans); font-weight: 300; font-size: var(--display); line-height: 0.86; letter-spacing: -0.04em; }
.h1 { font-weight: 300; font-size: var(--h1); line-height: 0.95; letter-spacing: -0.035em; }
.h2 { font-weight: 300; font-size: var(--h2); line-height: 1.0; letter-spacing: -0.03em; }
.h3 { font-weight: 400; font-size: var(--h3); line-height: 1.15; letter-spacing: -0.02em; }
.lede { font-size: var(--body-l); font-weight: 400; line-height: 1.45; color: var(--ink); max-width: 60ch; }
.body { font-size: var(--body); line-height: 1.6; color: var(--ink); }
.muted { color: var(--ink-soft); }

/* ================================================================
   NAV
   ================================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  mix-blend-mode: normal;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, padding 0.4s ease;
}
.nav.is-scrolled {
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(12px);
  padding: 14px var(--pad-x);
  border-bottom: 1px solid var(--line);
}
.nav.is-dark { color: var(--paper); }
.nav.is-dark.is-scrolled { background: rgba(47, 60, 64, 0.86); color: var(--paper); border-bottom-color: rgba(255,255,255,0.08); }

.brand { display: flex; align-items: center; gap: 14px; color: #2f3c40; }
.nav.is-dark .brand { color: var(--paper); }
.brand-logo { width: 180px; height: auto; max-width: none; display: block; filter: none; }
.nav .brand-logo { /* SVG uses currentColor via cls-1 fill */ }
.brand-logo-wrap { color: inherit; }
/* Recolor: the SVG fills with currentColor — but the file ships with cls-1 fill:currentColor */
.brand img { color: currentColor; }

.nav-links { display: flex; gap: clamp(18px, 2.2vw, 36px); align-items: center; margin-left: clamp(24px, 12vw, 280px); margin-right: auto; }
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 1px; width: 100%; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover::after, .nav-links a.is-current::after { transform: scaleX(1); }
.nav-links a.is-current { font-weight: 600; }

.nav-cta {
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 18px;
  border: 1px solid #ffffff;
  background: #637865;
  color: #ffffff;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav-cta:hover { background: #4a5a4c; border-color: #4a5a4c; }

.nav-burger { display: none; }

/* ================================================================
   ISOTIPO M placeholder — geometría multidimensional
   (3 trazos verticales sobre fondo, evoca edificios + onda)
   ================================================================ */
.iso-m {
  display: inline-block;
  position: relative;
  width: 38px; height: 38px;
}

/* ================================================================
   Layout helpers
   ================================================================ */
.shell { padding-left: var(--pad-x); padding-right: var(--pad-x); }
.row-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.section {
  padding-top: clamp(90px, 14vw, 200px);
  padding-bottom: clamp(90px, 14vw, 200px);
  position: relative;
}
.section--tight { padding-top: clamp(60px, 9vw, 120px); padding-bottom: clamp(60px, 9vw, 120px); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--dark .muted { color: rgba(244, 241, 234, 0.58); }
.section--dark .eyebrow { color: rgba(244, 241, 234, 0.55); }

/* Header con número de sección — patrón editorial */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: clamp(56px, 8vw, 120px);
}
.section-head__index {
  display: flex; align-items: baseline; gap: 14px;
  width: fit-content;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}
.section-head__index .num { font-family: var(--mono); font-weight: 300; font-size: 13px; letter-spacing: 0.15em; }
.section-head__index .label { font-family: var(--mono); font-weight: 300; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.section--dark .section-head__index { border-top-color: rgba(244,241,234,0.22); }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 18px 26px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background 0.4s ease, color 0.4s ease, transform 0.4s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.section--dark .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.section--dark .btn:hover { background: transparent; color: var(--paper); }
.section--dark .btn--ghost { background: transparent; color: var(--paper); border-color: var(--paper); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; font-weight: 300;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  transition: gap 0.3s ease;
}
.link-arrow:hover { gap: 22px; }

/* ================================================================
   Placeholder editorial (imagen)
   ================================================================ */
.ph {
  position: relative;
  background: var(--paper-2);
  overflow: hidden;
  isolation: isolate;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(47,60,64,0.05) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, var(--paper-3) 0%, var(--paper-2) 60%, var(--stone) 200%);
  z-index: 0;
}
.ph::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.23 0 0 0 0 0.25 0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.6;
  z-index: 0;
}
.ph__tag {
  position: absolute; left: 16px; top: 16px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 11px; font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 10px;
  background: rgba(47, 60, 64, 0.88);
  color: var(--paper);
  display: inline-flex; align-items: center; gap: 8px;
}
.ph__tag::before { content: ""; width: 6px; height: 6px; background: var(--sea); display: inline-block; }
.ph__caption {
  position: absolute; right: 16px; bottom: 14px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 11px; font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.96);
  text-align: right;
  text-shadow: 0 1px 4px rgba(10, 13, 14, 0.6);
}
/* Scrim inferior: asegura legibilidad del caption sobre fotos claras */
.ph__caption { pointer-events: none; }
.ph__caption::before {
  content: "";
  position: absolute; left: -100vw; right: -16px; bottom: -14px;
  height: 220px;
  z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(12,15,16,0.66) 0%, rgba(12,15,16,0.3) 45%, transparent 100%);
}
/* Real image inside .ph — replaces the gradient placeholder */
.ph__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.ph:has(.ph__img)::before,
.ph:has(.ph__img)::after { display: none; }
.ph--dark::before {
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #1d2729 0%, #2f3c40 60%, #3d4d51 100%);
}
.ph--blue::before {
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 18px),
    linear-gradient(180deg, #998f80 0%, #b0a89c 70%);
}
.ph--olive::before {
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 16px),
    linear-gradient(180deg, #4f5f51 0%, #637865 70%, #7c9180 110%);
}
.ph--stone::before {
  background-image:
    repeating-linear-gradient(135deg, rgba(47,60,64,0.05) 0 1px, transparent 1px 16px),
    linear-gradient(180deg, #c8c0b4 0%, #b0a89c 60%, #998f80 110%);
}

/* ================================================================
   Footer
   ================================================================ */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 64px var(--pad-x) 28px;
  position: relative;
}
.footer__big {
  font-size: clamp(48px, 9vw, 160px);
  font-weight: 200;
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin-bottom: 80px;
}
.footer__logo {
  display: block;
  margin-bottom: 56px;
  color: var(--paper);
}
.footer__logo img {
  display: block;
  width: 200px;
  height: auto;
  max-height: none;
  /* SVG cargado como <img> no hereda currentColor del CSS host —
     forzamos blanco/papel sobre fondo oscuro #2f3c40. */
  filter: brightness(0) invert(1);
  opacity: 0.96;
}
.footer__cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gutter);
  padding-top: 48px;
  border-top: 1px solid rgba(244,241,234,0.18);
}
.footer__col h6 {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(244,241,234,0.55);
  margin-bottom: 18px; font-weight: 300;
}
.footer__col ul { list-style: none; display: grid; gap: 8px; }
.footer__col a { font-size: 15px; }
.footer__col a:hover { color: var(--olive); }
.footer__base {
  margin-top: 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 300; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244,241,234,0.55);
}
/* Wordmark grande a sangre en el pie del footer */
.footer__brand {
  margin: 56px calc(-1 * var(--pad-x)) 0;
  padding: 0;
  line-height: 0;
}
.footer__brand img {
  display: block;
  width: 100%;
  height: auto;
  filter: none;
  opacity: 0.10;
}

/* ================================================================
   Reveals (scroll-driven cinemático)
   ================================================================ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal--up { transform: translateY(80px); }
.reveal--slow { transition-duration: 1.6s; }
.reveal--stagger > * { opacity: 0; transform: translateY(30px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal--stagger.in > * { opacity: 1; transform: none; }
.reveal--stagger.in > *:nth-child(2) { transition-delay: 0.08s; }
.reveal--stagger.in > *:nth-child(3) { transition-delay: 0.16s; }
.reveal--stagger.in > *:nth-child(4) { transition-delay: 0.24s; }
.reveal--stagger.in > *:nth-child(5) { transition-delay: 0.32s; }

/* Splash / loader cinemático */
.splash {
  position: fixed; inset: 0;
  background: var(--ink);
  z-index: 9999;
  display: grid; place-items: center;
  color: var(--paper);
  pointer-events: none;
  animation: splashOut 1.6s ease 0.6s forwards;
}
.splash__inner { display: grid; place-items: center; gap: 24px; }
.splash__pct { font-family: var(--mono); font-size: 12px; font-weight: 300; letter-spacing: 0.2em; opacity: 0.6; }
.splash__bar { width: 240px; height: 1px; background: rgba(255,255,255,0.18); position: relative; overflow: hidden; }
.splash__bar::after { content:""; position:absolute; inset:0; background: var(--paper); transform-origin: left; animation: splashFill 1.2s ease forwards; }
@keyframes splashFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes splashOut { to { transform: translateY(-100%); opacity: 0.8; } }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1100px) {
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 48px 32px; }
  .nav-links a { letter-spacing: 0.12em; font-size: 11px; }
  .nav-cta { letter-spacing: 0.12em; font-size: 11px; padding: 10px 14px; }
  .brand-logo { width: 140px; }
}
@media (max-width: 1080px) {
  .nav-links {
    display: flex;
    position: fixed;
    inset: 0 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin: 0;
    padding: 104px var(--pad-x) 40px;
    background: rgba(47, 60, 64, 0.98);
    backdrop-filter: blur(14px);
    color: var(--paper);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    z-index: 90;
  }
  .nav.is-menu-open .nav-links { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 15px; letter-spacing: 0.14em; padding: 14px 0; width: 100%; border-bottom: 1px solid rgba(244,241,234,0.14); color: var(--paper); }
  .nav-links a::after { display: none; }
  .nav { justify-content: flex-start; gap: 20px; }
  .nav .nav-cta { margin-left: auto; }
  .nav-burger { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; background: none; border: 0; cursor: pointer; color: inherit; z-index: 2; }
  .nav-burger span { width: 24px; height: 1px; background: currentColor; transition: transform 0.3s ease, opacity 0.3s ease; }
  .nav.is-menu-open .nav-burger { color: var(--paper); }
  .nav.is-menu-open .nav-burger span:first-child { transform: translateY(3px) rotate(45deg); }
  .nav.is-menu-open .nav-burger span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .nav.is-menu-open { background: rgba(47, 60, 64, 0.98); color: var(--paper); }
}
@media (max-width: 1080px) and (prefers-reduced-motion: reduce) {
  .nav-links { transition: none; }
}
@media (max-width: 820px) {
  :root { --gutter: 16px; }
  .footer__cols { grid-template-columns: 1fr; gap: 36px; }
  .footer__base { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ================================================================
   Marquee
   ================================================================ */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px 0; }
.marquee__track { display: flex; gap: 80px; white-space: nowrap; animation: scroll 50s linear infinite; }
.marquee__track > * { flex-shrink: 0; font-family: var(--mono); font-size: 13px; font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 80px; }
.marquee__track > *::after { content: "✕"; opacity: 0.4; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Redes sociales en el footer */
.footer__social { display: flex; gap: 14px; align-items: center; }
.footer__social a { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(244,241,234,0.26); border-radius: 50%; color: rgba(244,241,234,0.72); transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease; }
.footer__social a:hover { color: #fff; border-color: rgba(244,241,234,0.7); background: rgba(244,241,234,0.08); }
.footer__social svg { width: 15px; height: 15px; fill: currentColor; display: block; }

/* Botón flotante de WhatsApp */
.wa-float { position: fixed; right: 26px; bottom: 26px; z-index: 300; display: inline-flex; align-items: center; gap: 0; height: 56px; padding: 0 16px; border-radius: 999px; background: #637865; color: #fff; box-shadow: 0 8px 26px rgba(47,60,64,0.3); transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; }
.wa-float svg { width: 26px; height: 26px; fill: currentColor; display: block; flex-shrink: 0; }
.wa-float__label { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase; max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width 0.4s ease, opacity 0.3s ease, margin-left 0.4s ease; }
.wa-float:hover { background: #52644f; color: #fff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(47,60,64,0.38); }
.wa-float:hover .wa-float__label { max-width: 130px; opacity: 1; margin-left: 12px; }
@media (max-width: 560px) {
  .wa-float { right: 16px; bottom: 16px; height: 52px; padding: 0 13px; }
  .wa-float:hover .wa-float__label { max-width: 0; opacity: 0; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .wa-float, .wa-float__label { transition: none; } }

/* Grano de película — todas las imágenes de empresa */
.grain-layer::after,
.hero--full .hero__media::after,
.cta-right::after,
.cta-banner::after,
.about-hero__media::after,
.longform__figure::after,
.longform__figpair figure::after,
.page-hero__media::after,
.ph:has(.ph__img)::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  display: block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 220px;
  mix-blend-mode: overlay;
  opacity: 0.42;
}
.hero--full .hero__media { overflow: hidden; }
