/* =========================================================
   CJM ASOCIADOS — Design tokens & base styles
   Paleta inspirada en la identidad de marca: negro carbón,
   dorado metálico y grises cálidos. Tipografía editorial
   (Playfair Display) + utilitaria (Inter).
   ========================================================= */

:root {
  /* Color */
  --charcoal-950: #131210;
  --charcoal-900: #1b1a16;
  --charcoal-800: #262420;
  --charcoal-700: #38352e;
  --stone-500: #6b6656;
  --stone-300: #a8a290;
  --cream-100: #f7f4ec;
  --cream-50: #fbf9f4;
  --gold-300: #e9cf8a;
  --gold-400: #d4af5a;
  --gold-500: #b8892e;
  --gold-600: #967122;
  --line: rgba(212, 175, 90, 0.25);

  /* Type */
  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* Layout */
  --container: 1180px;
  --radius: 2px;
  --gold-gradient: linear-gradient(100deg, #967122 0%, #e9cf8a 45%, #b8892e 75%, #7a5c1c 100%);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream-50);
  color: var(--charcoal-900);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--charcoal-950);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--charcoal-800); }

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

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

ul { margin: 0; padding: 0; list-style: none; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-600);
  font-weight: 600;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold-500);
}

/* ---------- On-dark text helpers ----------
   Cualquier bloque con fondo oscuro (.on-dark) fuerza el color
   correcto de encabezados, párrafos y eyebrow para que nunca
   se pierdan contra el fondo. */
.on-dark, .on-dark p { color: var(--cream-100); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--cream-50); }
.on-dark .eyebrow { color: var(--gold-300); }
.on-dark .eyebrow::before { background: var(--gold-300); }

/* ---------- Hover: image zoom ---------- */
.img-frame {
  overflow: hidden;
  position: relative;
}
.img-frame img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-frame:hover img {
  transform: scale(1.06);
}

/* ---------- Hover: arrow link ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gold-600);
}
.link-arrow .arrow { transition: transform 0.3s ease; display: inline-block; }
.link-arrow:hover .arrow { transform: translateX(6px); }
.link-arrow:hover { color: var(--gold-500); }

/* Signature structural device: the gold bar, echoing the brochure's
   section dividers. Used consistently as a section marker. */
.gold-bar {
  height: 6px;
  width: 100%;
  background: var(--gold-gradient);
}
.gold-bar--short {
  width: 84px;
  height: 4px;
  margin: 18px 0 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn-primary {
  background: var(--gold-gradient);
  color: var(--charcoal-950);
  box-shadow: 0 6px 22px -8px rgba(184, 137, 46, 0.65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(184, 137, 46, 0.8); }
.btn-ghost {
  background: transparent;
  color: var(--cream-100);
  border-color: rgba(247, 244, 236, 0.35);
}
.btn-ghost:hover { border-color: var(--gold-400); color: var(--gold-300); }
.btn-dark {
  background: var(--charcoal-950);
  color: var(--cream-100);
}
.btn-dark:hover { background: var(--charcoal-800); transform: translateY(-2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 249, 244, 0.92); /*[cite: 4] */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); /*[cite: 4] */
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
  box-shadow: 0 8px 24px -16px rgba(19, 18, 16, 0.35);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px; /*[cite: 4] */
  position: relative;
}

/* Contenedor del Logo + Texto Flotante */
.nav-logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;           /*[cite: 4] */
  height: 42px;        /*[cite: 4] */
  width: 320px;        /*[cite: 4] */
}

/* La Imagen del Isotipo */
.nav-logo img {
  position: absolute;
  top: -15px;          /*[cite: 4] */
  left: 0;
  height: 85px;        /*[cite: 4] */
  width: auto;
  max-width: none;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  filter: drop-shadow(0 4px 12px rgba(19, 18, 16, 0.06));
  z-index: 2;
}

/* El Texto Tipográfico Dinámico */
.nav-logo .logo-text {
  font-family: var(--font-display); /*[cite: 4] */
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold-600);           /* Corregido: Tonalidad dorada corporativa */
  letter-spacing: 0.03em;
  margin-left: 80px;                /*[cite: 4] */
  white-space: nowrap;
  position: relative;
  padding-left: 16px;
  opacity: 0.85;
  /* Alineación: Ajustado verticalmente a 8px hacia abajo para equilibrar el eje del león */
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Línea divisoria elegante que se genera dinámicamente */
.nav-logo .logo-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;                         /* Ajustado al 10% para balancear la nueva altura */
  width: 1px;
  height: 80%;                      /* Expandido al 80% para cubrir mejor el texto */
  background: var(--gold-400);      /*[cite: 4] */
  transform: scaleY(0.3);           /*[cite: 4] */
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

/* ---------- Animación al hacer Hover ---------- */
.nav-logo:hover img {
  transform: scale(1.04) rotate(-1deg); /*[cite: 4] */
}

.nav-logo:hover .logo-text {
  opacity: 1;
  /* Mantiene los 8px de la alineación y se desplaza sutilmente a la derecha */
  transform: translate(4px, 8px);          
}

.nav-logo:hover .logo-text::before {
  opacity: 1;
  transform: scaleY(1);                 /*[cite: 4] */
}

.nav-links {
  display: flex;
  gap: 34px;
}
.nav-links a {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--charcoal-900);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 1px;
  background: var(--gold-500);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--gold-600); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--gold-600); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--charcoal-900);
  display: block;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--cream-50);
    padding: 20px 24px 28px;
    gap: 18px;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.2s ease;
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal-950);
  color: var(--stone-300);
  padding-top: 56px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-grid h4 {
  color: var(--gold-300);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-body);
  margin-bottom: 16px;
}
.footer-grid a, .footer-grid p { color: var(--stone-300); font-size: 0.92rem; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid li a:hover { color: var(--gold-300); }
.footer-brand img { height: 44px; margin-bottom: 14px; }
.footer-brand p { max-width: 320px; font-size: 0.88rem; }
.footer-bottom {
  border-top: 1px solid rgba(247, 244, 236, 0.1);
  padding: 18px 0 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--stone-500);
}
.footer-bottom a:hover { color: var(--gold-300); }

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Utility / reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
}

section { padding-block: 88px; }
@media (max-width: 780px) { section { padding-block: 56px; } }