/* RG Soluciones Integrales · propuesta de sitio
   Concepto: 60 % papel y aire, 40 % Azul RG. Bloques planos, sin degradados ni sombras (manual de marca).
   El movimiento (aparición de portada, marquesina, palabras que se encienden, imágenes que cambian) hace el trabajo de impacto. */

:root {
  --blue: #22326E;
  --paper: #F7F5F0;
  --paper-2: #EDEAE3;
  --card: #FBFAF7;
  --ink: #1E2233;
  --muted: #4A4E5E;
  --gray: #8A8A8A;
  --line: #D8D4CA;
  --on-blue: #F7F5F0;
  --on-blue-2: #C9CDE0;
  --error: #A12626;
  --f-display: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-body: 'Jost', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 clamp(17px, .35vw + 15.5px, 19px)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, figure, blockquote { margin: 0; padding: 0; }
ul { list-style: none; }
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.04;
  text-wrap: balance;
}
h2 { font-size: clamp(34px, 4.4vw, 64px); color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.on-blue :focus-visible, .hdr:not(.is-solid) :focus-visible, .foot :focus-visible { outline-color: var(--on-blue); }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow {
  font: 600 15px/1.2 var(--f-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
}
.skip {
  position: absolute; left: 16px; top: -80px; z-index: 100;
  background: var(--blue); color: var(--on-blue); padding: 12px 18px; text-decoration: none;
}
.skip:focus { top: 12px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 0 28px;
  border: 1.5px solid var(--blue); border-radius: 2px;
  background: var(--blue); color: var(--on-blue);
  font: 600 17px/1 var(--f-body); letter-spacing: .02em; text-decoration: none;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { width: 20px; height: 20px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(5px); }
.btn:hover { background: transparent; color: var(--blue); }
.btn--light { background: var(--on-blue); color: var(--blue); border-color: var(--on-blue); }
.btn--light:hover { background: transparent; color: var(--on-blue); }
.link {
  display: inline-block; font-weight: 500; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100%/100% 1.5px no-repeat;
  padding-bottom: 4px; transition: background-size .35s var(--ease);
}
.link:hover { background-size: 0 1.5px; background-position: 100% 100%; }

/* Header */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--on-blue);
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s;
  border-bottom: 1px solid transparent;
}
.hdr.is-solid { background: var(--paper); color: var(--blue); border-bottom-color: var(--line); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; height: 84px; gap: 24px; }
.hdr__logo { position: relative; display: block; width: 112px; height: 65px; flex: none; }
.hdr__logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .35s; }
.hdr__logo .l-color { opacity: 0; }
.hdr.is-solid .l-color { opacity: 1; }
.hdr.is-solid .l-white { opacity: 0; }
.nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.nav a:not(.btn) {
  font-weight: 500; font-size: 17px; text-decoration: none; position: relative; padding: 6px 0;
}
.nav a:not(.btn)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.hdr .btn { min-height: 44px; padding: 0 22px; background: var(--on-blue); color: var(--blue); border-color: var(--on-blue); }
.hdr .btn:hover { background: transparent; color: var(--on-blue); }
.hdr.is-solid .btn { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.hdr.is-solid .btn:hover { background: transparent; color: var(--blue); }
.burger {
  display: none; width: 48px; height: 48px; border: 0; background: none; color: inherit; cursor: pointer; position: relative;
}
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: currentColor; transition: transform .35s var(--ease), opacity .2s; }
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 23px; }
.burger span:nth-child(3) { top: 29px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 899px) {
  .hdr__in { height: 76px; }
  .hdr__logo { width: 96px; height: 56px; }
  .burger { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--blue); color: var(--on-blue);
    padding: 8px var(--gutter) 28px;
  }
  .nav a:not(.btn) { font-size: 24px; font-family: var(--f-display); font-weight: 700; padding: 16px 0; border-bottom: 1px solid rgba(247,245,240,.2); }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn, .hdr.is-solid .nav .btn { margin-top: 22px; background: var(--on-blue); color: var(--blue); border-color: var(--on-blue); justify-content: center; }
}

/* Portada */
.hero { position: relative; background: var(--blue); color: var(--on-blue); overflow: hidden; }
.hero__media { overflow: hidden; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 78% 40%;
  animation: heroZoom 2.4s var(--ease) both;
  will-change: transform;
}
.hero__media { animation: heroReveal 1.4s var(--ease) both; }
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes heroReveal { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.hero__inner { position: relative; padding: 48px var(--gutter) 64px; }
.hero .eyebrow { color: var(--on-blue-2); animation: fadeUp .9s .5s var(--ease) both; }
.hero h1 {
  font-size: clamp(52px, 13.5vw, 118px); color: var(--on-blue); margin-top: 22px;
  line-height: .98;
}
.hero h1 .ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero h1 .ln > span { display: block; animation: lineUp 1.1s var(--ease) both; }
.hero h1 .ln:nth-child(1) > span { animation-delay: .35s; }
.hero h1 .ln:nth-child(2) > span { animation-delay: .5s; }
.hero h1 .ln:nth-child(3) > span { animation-delay: .65s; }
@keyframes lineUp { from { transform: translateY(110%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero__lead { margin-top: 28px; max-width: 30ch; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; color: var(--on-blue); animation: fadeUp .9s .95s var(--ease) both; }
.hero__cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; animation: fadeUp .9s 1.1s var(--ease) both; }
.hero__cta .link { color: var(--on-blue); }
.hero__media { aspect-ratio: 4 / 4.2; }
@media (min-width: 640px) { .hero__media { aspect-ratio: 16 / 9; } .hero__media img { object-position: 85% 40%; } }
@media (min-width: 1100px) {
  .hero { min-height: clamp(640px, 90vh, 840px); display: flex; align-items: center; }
  .hero__media { position: absolute; top: 0; right: 0; bottom: 0; width: 54%; aspect-ratio: auto; }
  .hero__media img { object-position: 100% 50%; }
  .hero__inner { width: min(42vw, 640px); padding: 140px 0 96px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
  .hero h1 { font-size: clamp(54px, 4.8vw, 84px); }
  .hero__lead { max-width: 24ch; }
}
.hero__cue { display: none; }
@media (min-width: 1100px) {
  .hero__cue {
    display: flex; align-items: center; gap: 14px; position: absolute; left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); bottom: 36px;
    font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--on-blue-2);
    animation: fadeUp .9s 1.4s var(--ease) both;
  }
  .hero__cue i { display: block; width: 1.5px; height: 44px; background: rgba(247,245,240,.25); position: relative; overflow: hidden; }
  .hero__cue i::after { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 50%; background: var(--on-blue); animation: cue 2s var(--ease) infinite; }
}
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(200%); } }

/* Marquesina */
.marquee { background: var(--paper); border-bottom: 1px solid var(--line); overflow: hidden; }
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; flex: none; }
.marquee__group span {
  font: 700 clamp(22px, 2.4vw, 32px)/1 var(--f-display); letter-spacing: -.01em; color: var(--blue);
  padding: 30px 0; white-space: nowrap;
}
.marquee__group i { display: block; width: 10px; height: 10px; background: var(--gray); margin: 0 clamp(24px, 3vw, 44px); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Declaración */
.statement { padding-block: clamp(80px, 12vw, 170px); }
.statement p {
  font: 700 clamp(30px, 4.6vw, 66px)/1.14 var(--f-display); letter-spacing: -.02em; max-width: 22em; text-wrap: pretty;
}
.statement .w { color: var(--blue); transition: color .35s; }
.js .statement .w:not(.on) { color: var(--gray); }

/* Servicios */
.services { padding-block: clamp(56px, 8vw, 120px) clamp(72px, 10vw, 150px); background: var(--paper); }
.services__head { display: flex; flex-direction: column; gap: 18px; margin-bottom: clamp(32px, 5vw, 64px); max-width: 760px; }
.services__grid { display: grid; gap: 40px; }
@media (min-width: 1000px) {
  .services__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(48px, 7vw, 112px); align-items: start; }
  .panel { position: sticky; top: 112px; order: 2; aspect-ratio: 4 / 5; }
  .svc { order: 1; }
}
.panel { position: relative; overflow: hidden; background: var(--blue); aspect-ratio: 16 / 10; }
@media (min-width: 1000px) { .panel { aspect-ratio: 4 / 5; } }
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .8s var(--ease), transform 1.4s var(--ease); }
.panel img { opacity: 0; transform: scale(1.05); }
.panel img.is-on { opacity: 1; transform: none; }
.svc { border-bottom: 1px solid var(--line); }
.svc li { border-top: 1px solid var(--line); }
.svc__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; text-align: left;
  padding: clamp(20px, 2.4vw, 30px) 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 700 clamp(24px, 2.7vw, 38px)/1.1 var(--f-display); letter-spacing: -.015em;
  transition: color .3s, padding-left .45s var(--ease);
}
.svc__btn:hover { color: var(--blue); padding-left: 10px; }
.svc li.is-open .svc__btn { color: var(--blue); }
.svc__plus { position: relative; width: 22px; height: 22px; flex: none; }
.svc__plus::before, .svc__plus::after { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: currentColor; transition: transform .45s var(--ease); }
.svc__plus::after { transform: rotate(90deg); }
.svc li.is-open .svc__plus::after { transform: rotate(0); }
.svc__body { display: grid; grid-template-rows: 1fr; }
.js .svc__body { grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.js .svc li.is-open .svc__body { grid-template-rows: 1fr; }
.svc__body > div { overflow: hidden; }
.svc__body p { padding: 0 48px clamp(22px, 2.4vw, 30px) 0; color: var(--muted); max-width: 38em; }

/* Cómo trabajamos */
.process { display: grid; background: var(--blue); color: var(--on-blue); }
.process__img { min-height: 320px; position: relative; overflow: hidden; }
.process__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 92% 50%; }
.process__txt { padding: clamp(56px, 8vw, 112px) var(--gutter); display: flex; flex-direction: column; gap: clamp(32px, 5vw, 56px); }
.process .eyebrow { color: var(--on-blue-2); }
.process h2 { color: var(--on-blue); margin-top: 16px; }
@media (min-width: 900px) {
  .process { grid-template-columns: 6fr 4fr; }
  .process__img { min-height: 640px; }
  .process__txt { padding-right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); padding-left: clamp(40px, 5vw, 80px); justify-content: center; }
}
.steps { position: relative; display: flex; flex-direction: column; gap: 34px; padding-left: 44px; --p: 0; }
.steps::before, .steps::after { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: rgba(247,245,240,.22); }
.steps::after { background: var(--on-blue); transform-origin: top; transform: scaleY(var(--p)); transition: transform .2s linear; }
.step { position: relative; }
.step::before {
  content: ''; position: absolute; left: -44px; top: 6px; width: 14px; height: 14px; background: var(--blue); border: 2px solid rgba(247,245,240,.4);
  transition: background .4s, border-color .4s;
}
.step.on::before { background: var(--on-blue); border-color: var(--on-blue); }
.step small { display: block; font: 600 14px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--on-blue-2); }
.step h3 { margin-top: 10px; font-size: clamp(26px, 2.6vw, 34px); color: var(--on-blue); }
.step p { margin-top: 8px; color: var(--on-blue-2); max-width: 28em; }

/* Valores */
.values { padding-block: clamp(72px, 10vw, 150px); }
.values h2 { margin-bottom: clamp(36px, 5vw, 72px); }
.values__grid { display: grid; gap: 40px; }
@media (min-width: 800px) { .values__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px); } }
.value { position: relative; padding-top: 28px; }
.value::before, .value::after { content: ''; position: absolute; left: 0; top: 0; height: 2px; }
.value::before { right: 0; background: var(--line); }
.value::after { width: 100%; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 1.1s .2s var(--ease); }
.value.in::after, html:not(.js) .value::after { transform: scaleX(.28); }
.value h3 { font-size: clamp(32px, 3.4vw, 46px); color: var(--blue); }
.value p { margin-top: 14px; color: var(--muted); max-width: 22em; }

/* Testimonios (bloque opcional sobre contacto) */
.quotes { background: var(--paper-2); padding-block: clamp(56px, 7vw, 96px); }
.quotes__grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .quotes__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.quote { position: relative; background: var(--card); border: 1px solid var(--line); padding: 36px 32px 30px; display: flex; flex-direction: column; gap: 22px; }
.quote__mark { width: 40px; height: 32px; color: var(--blue); }
.quote blockquote p { font: 500 clamp(19px, 1.6vw, 22px)/1.5 var(--f-body); color: var(--ink); }
.quote figcaption { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.quote figcaption b { font: 700 18px/1.3 var(--f-display); color: var(--blue); }
.quote figcaption span { color: var(--muted); font-size: 16px; }
.quote__tag { position: absolute; top: 14px; right: 14px; font: 600 12.5px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--gray); padding: 6px 8px; }

/* Banda de imagen */
.band { position: relative; height: clamp(240px, 36vw, 500px); overflow: hidden; background: var(--blue); }
.band img { position: absolute; left: 0; top: -12%; width: 100%; height: 124%; object-fit: cover; transform: translateY(var(--py, 0px)); will-change: transform; }

/* Pie */
.foot { background: var(--blue); color: var(--on-blue); padding-block: clamp(48px, 6vw, 80px) 36px; }
.foot__grid { display: grid; gap: 40px; }
@media (min-width: 800px) { .foot__grid { grid-template-columns: 1.2fr 1.6fr 1fr; gap: 56px; } }
.foot img { width: 128px; height: auto; }
.foot h4 { margin: 0 0 12px; font: 600 14px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--on-blue-2); }
.foot p, .foot a { color: var(--on-blue); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot__base { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(247,245,240,.22); display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 15px; color: var(--on-blue-2); }

/* Aparición al desplazar */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .marquee { overflow-x: auto; }
  .marquee__track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Pie como contacto */
.foot { scroll-margin-top: 0; }
.foot__lead { font: 700 clamp(28px, 3.4vw, 44px)/1.15 var(--f-display); color: var(--on-blue); margin: 0 0 clamp(32px, 4vw, 56px); text-wrap: balance; }
.foot p + p { margin-top: 10px; }
.foot a[href^="mailto"] { overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }
.foot__map { text-decoration: underline; text-underline-offset: 3px; }

/* Encabezado azul sobre la portada dividida */
@media (min-width: 900px) { .hdr:not(.is-solid) { background: var(--blue); } }
@media (min-width: 800px) { .foot__grid { grid-template-columns: 1fr 1.3fr 1.5fr; } }
.foot a[href^="mailto"] { font-size: 16.5px; }
