/* ==========================================================================
   RDL Soluciones — Sistema visual v2
   Tipografía propia, reglas finas como en un libro contable, motion sobrio.
   ========================================================================== */

/* Tipografías alojadas en el sitio ---------------------------------------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Outfit queda reservada al wordmark, tal como se definió en el logo */
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Tokens ------------------------------------------------------------------- */
:root {
  /* Sitio solo en modo claro */
  color-scheme: light;

  --bg:        oklch(98.5% 0.004 250);
  --surface:   oklch(100% 0 0);
  --ink:       oklch(24% 0.045 250);
  --ink-2:     oklch(44% 0.025 250);
  --rule:      oklch(88% 0.012 250);
  --rule-2:    oklch(78% 0.02 250);

  /* Dorado: relleno decorativo y texto grande (el texto pequeño no lo usa) */
  --gold:      oklch(72% 0.14 80);
  --gold-big:  oklch(54% 0.13 80);
  --gold-ink:  oklch(50% 0.12 80);

  --band-bg:   oklch(24% 0.055 250);
  --band-ink:  oklch(96% 0.01 250);
  --band-ink-2: oklch(80% 0.03 250);
  --band-rule: oklch(38% 0.05 250);
  --footer-bg: oklch(18% 0.03 250);
  --footer-ink: oklch(80% 0.02 250);

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mark: "Outfit", system-ui, sans-serif;

  /* Curvas: siempre ease-out para entradas; ease-in-out solo para movimiento en pantalla */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --radius: 12px;
  --max-width: 1160px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; color: var(--ink-2); text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: oklch(80% 0.12 80 / 0.4); color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.amp, .hl { color: var(--gold-big); }

/* Botones ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  transition:
    transform 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 0.925rem; }

/* WhatsApp: azul con dorado, igual en ambos temas */
.btn-whatsapp {
  background: oklch(26% 0.06 250);
  color: oklch(84% 0.14 80);
  border-color: oklch(84% 0.14 80 / 0.45);
}
.contact .btn-whatsapp { background: oklch(31% 0.07 250); }

@media (hover: hover) and (pointer: fine) {
  .btn-whatsapp:hover {
    background: oklch(20% 0.05 250);
    border-color: oklch(88% 0.13 80);
    color: oklch(90% 0.12 80);
  }
  .contact .btn-whatsapp:hover { background: oklch(37% 0.08 250); }
}

/* Enlace con subrayado que se dibuja */
.link-arrow {
  font-weight: 600;
  padding-block: 4px;
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--rule-2), var(--rule-2));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0 1.5px, 100% 1.5px;
  transition: background-size 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover { background-size: 100% 1.5px, 100% 1.5px; }
}

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-out);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

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

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  color: var(--ink);
}
.logo-text {
  font-family: var(--font-mark);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-rdl { color: var(--gold-big); margin-right: 0.08em; }
.logo-tagline {
  font-family: var(--font-mark);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 32px; }
.site-nav a {
  font-weight: 500;
  font-size: 0.975rem;
  color: var(--ink-2);
  padding-block: 6px;
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1.5px no-repeat;
  transition: color 160ms var(--ease-out), background-size 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { color: var(--ink); background-size: 100% 1.5px; }
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--ink);
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 260ms var(--ease-in-out);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* Hero --------------------------------------------------------------------- */
.hero {
  padding-top: clamp(56px, 9vw, 132px);
  padding-bottom: clamp(72px, 10vw, 144px);
}
.hero h1 {
  font-size: clamp(2.55rem, 6.6vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
  max-width: 17em;
}
.hero-lead {
  margin-top: clamp(24px, 3vw, 40px);
  max-width: 56ch;
  font-size: clamp(1.1rem, 1.5vw, 1.275rem);
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: 36px;
}

/* Entrada del hero: una sola secuencia, escalonada */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 800ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }
}

/* Secciones ---------------------------------------------------------------- */
section { padding-block: clamp(72px, 10vw, 136px); }

h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  letter-spacing: -0.035em;
  color: var(--gold-big);
}
.section-lead {
  margin-top: 20px;
  max-width: 44ch;
  font-size: 1.1rem;
}

/* Reglas que se dibujan (el movimiento propio del sitio) */
.ruled { position: relative; }
.ruled::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule-2);
  transform-origin: left center;
}
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] .ruled::before { transform: scaleX(0); }
  .js [data-reveal].is-in .ruled::before {
    transform: scaleX(1);
    transition: transform 900ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
}

/* Qué hacemos */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.split-head { position: sticky; top: calc(var(--header-h) + 40px); }

.areas { display: flex; flex-direction: column; gap: clamp(48px, 6vw, 72px); }
.area h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  margin-bottom: 20px;
}
.row { padding-block: 20px; }
.area .row {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
}
.area ul .row:last-child { padding-bottom: 0; }

/* Por qué elegirnos */
.why { border-top: 1px solid var(--rule); }
.why-title { margin-bottom: clamp(40px, 6vw, 72px); max-width: 14em; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 96px);
}
.why-item { padding-block: 28px 44px; }
.why-item h3 { font-size: clamp(1.3rem, 2vw, 1.55rem); margin-bottom: 10px; }
.why-item p { margin: 0; max-width: 40ch; }

/* Quiénes somos */
.about { padding-top: 0; }
.about-head { max-width: 40rem; margin-bottom: clamp(40px, 6vw, 72px); }
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 96px);
}
.profile { padding-block: 28px 8px; }
.profile h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 14px; }
.profile p:last-child { margin: 0; max-width: 46ch; }

/* Contacto: el único bloque de color a escala de página */
.contact {
  background: var(--band-bg);
  color: var(--band-ink);
}
.contact h2 { color: var(--band-ink); }
.contact .hl { color: oklch(82% 0.14 80); }
.contact p { color: var(--band-ink-2); }

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.contact h2 { font-size: clamp(2.25rem, 5.4vw, 4.25rem); line-height: 1; letter-spacing: -0.04em; }
.contact-info p { margin-top: 24px; max-width: 36ch; font-size: 1.15rem; }

.contact-list { margin-bottom: 32px; }
.contact-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-block: 16px;
  border-top: 1px solid var(--band-rule);
  color: var(--band-ink);
}
.contact-list li:last-child { border-bottom: 1px solid var(--band-rule); }
.contact-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--band-ink-2);
}
.contact-list a {
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1.5px no-repeat;
  transition: background-size 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .contact-list a:hover { background-size: 100% 1.5px; }
}
.contact-cta-text { max-width: 38ch; margin-bottom: 20px; }

/* Footer ------------------------------------------------------------------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-block: 28px;
  font-size: 0.875rem;
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 900px) {
  .split, .contact-inner { grid-template-columns: minmax(0, 1fr); }
  .split-head { position: static; }
  .section-lead { max-width: 52ch; }
}

@media (max-width: 720px) {
  :root { --header-h: 68px; }

  .header-cta { display: none; }
  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    left: 16px;
    right: 16px;
    margin: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 16px;
    box-shadow: 0 2px 4px oklch(0% 0 0 / 0.05), 0 16px 40px oklch(0% 0 0 / 0.14);
    transform-origin: top right;
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 200ms var(--ease-out),
      transform 200ms var(--ease-out),
      visibility 0s linear 200ms;
  }
  .site-nav.is-open {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s;
  }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a {
    display: block;
    padding: 14px 12px;
    font-size: 1.05rem;
    color: var(--ink);
    background: none;
  }

  .why-grid, .profiles-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .logo-tagline { font-size: 0.54rem; letter-spacing: 0.08em; white-space: nowrap; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 20px; }
  .hero-actions .link-arrow { align-self: flex-start; }
  .contact .btn { width: 100%; }
  .contact-list li { flex-direction: column; gap: 4px; }
}

/* Menos movimiento ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
