/* ============================================================
   Veredictum Consultoría Jurídica — Estilos
   Paleta: navy de marca (#16244d), grafito azulado (#39445e), piedra fría (#f2f5fa),
           azul medio (#2d5a92) y azul claro (#aac4e9) como acentos.
   Colores tomados del material gráfico del despacho (Facebook).
   Tipografía: Cormorant Garamond (titulares) + Montserrat (texto/UI,
               la misma familia del logotipo).
   ============================================================ */

:root {
  --ink: #16244d;
  --ink-2: #1f2f5e;
  --graphite: #39445e;
  --muted: #5a6885;
  --stone: #f2f5fa;
  --stone-2: #e4eaf4;
  --line: #d5dfee;
  --accent: #2d5a92;
  --accent-light: #aac4e9;
  --white: #ffffff;
  --whatsapp: #1fa855;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max: 1180px;
  --header-h: 76px;
  --radius: 4px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--graphite);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
h1 { font-size: clamp(2.6rem, 5.6vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3rem); }
h3 { font-size: 1.5rem; }
em { font-style: italic; }
h1 em, h2 em { color: var(--accent); font-weight: 500; }

p { margin: 0 0 18px; color: var(--muted); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

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

.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 3px; }

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

/* ============ Etiquetas de sección ============ */
.eyebrow, .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.eyebrow::before, .section-eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
}

.section { padding: 120px 0; }
.section-stone { background: var(--stone); }
.section-dark { background: var(--ink); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: #b3c2d9; }
.section-dark .section-eyebrow { color: var(--accent-light); }

.section-head { max-width: 680px; margin-bottom: 64px; }

/* ============ Botones ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn .ic { width: 16px; height: 16px; }

.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-2); }

.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

.btn-whatsapp { background: var(--whatsapp); color: var(--white); }
.btn-whatsapp:hover { background: #188f47; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(22,36,77,0.05); }

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

.brand, .footer-brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 46px; width: auto; }

.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-tag {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav a:not(.btn) {
  position: relative;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--graphite);
  padding: 6px 0;
  transition: color .2s;
}
.main-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.main-nav a:not(.btn):hover { color: var(--ink); }
.main-nav a:not(.btn):hover::after { transform: scaleX(1); }
.nav-mobile-cta { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============ Hero ============ */
.hero {
  position: relative;
  background: var(--stone);
  padding: 48px 0 96px;
  overflow: hidden;
}
.hero::before {
  /* líneas finas de fondo, evocan papel rayado de expediente */
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(22,36,77,0.045) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 72px;
  align-items: center;
}
.hero h1 { margin-bottom: 26px; }
.hero-sub { font-size: 1.06rem; max-width: 540px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.hero-actions .btn-ghost { background: var(--white); }

/* Redes en el hero: visibles al abrir el sitio, sin bajar al pie */
.hero-social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.hero-social-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.hero-social a {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.hero-social a svg { width: 17px; height: 17px; }
.hero-social a:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }

.hero-trust {
  list-style: none;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--graphite);
}
.hero-trust li { display: flex; align-items: center; gap: 10px; }
.hero-trust li::before {
  content: "";
  width: 6px; height: 6px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.hero-visual { display: flex; justify-content: center; }
.hero-frame {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 4 / 5;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 60px -30px rgba(22,36,77,0.25);
}
.hero-frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.hero-frame::after {
  content: "";
  position: absolute;
  inset: -18px 18px 18px -18px;
  border: 1px solid var(--accent);
  opacity: .45;
  z-index: -1;
}
.hero-mark { width: 52%; height: auto; }

/* ============ El Despacho ============ */
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 90px;
  align-items: start;
}
.about-text p { font-size: 1.02rem; }
.about-lead { font-size: 1.1rem; color: var(--graphite); }
.about-text p em { color: var(--ink); }

.pillars { display: grid; gap: 0; border-top: 1px solid var(--line); }
.pillar {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.pillar-num {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}
.pillar h3 { margin-bottom: 6px; }
.pillar p { margin: 0; font-size: 0.95rem; }

/* ============ Áreas de práctica ============ */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
/* Con 7 áreas, la última ocupa la fila completa para no dejar
   una celda vacía mostrando el fondo del grid. */
.areas-grid > .area:last-child { grid-column: 1 / -1; }

.area {
  background: var(--white);
  padding: 44px 38px 46px;
  transition: background .3s var(--ease);
  position: relative;
}
.area::after {
  content: "";
  position: absolute;
  left: 38px; right: 38px; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.area:hover::after { transform: scaleX(1); }
.area-icon { width: 44px; height: 44px; color: var(--ink); margin-bottom: 26px; }
.area h3 { margin-bottom: 10px; }
.area p { margin: 0; font-size: 0.94rem; }

/* ============ Cómo trabajamos ============ */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.step { border-top: 1px solid rgba(255,255,255,0.14); padding-top: 28px; }
.step-num {
  display: block;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 500;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 20px;
}
.step h3 { font-size: 1.4rem; margin-bottom: 10px; }
.step p { margin: 0; font-size: 0.93rem; }

/* ============ Contacto ============ */
.contact-inner {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 64px;
  align-items: start;
}
.contact-lead { font-size: 1.02rem; max-width: 500px; margin-bottom: 36px; }

.contact-list { list-style: none; padding: 0; margin: 0 0 36px; border-top: 1px solid var(--line); }
.contact-list li {
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.6;
}
.contact-list a { transition: color .2s; }
.contact-list a:hover { color: var(--accent); }
.label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

.social { display: flex; align-items: center; gap: 12px; }
.social .label { margin: 0 8px 0 0; }
.social a, .footer-social a {
  width: 42px; height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.social a svg, .footer-social a svg { width: 18px; height: 18px; }
.social a:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

.contact-map {
  min-height: 340px;
  border: 1px solid var(--line);
  padding: 10px;
  background: var(--white);
}
.map-embed {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
  filter: grayscale(1) contrast(1.05);
  transition: filter .4s;
}
.contact-map:hover .map-embed { filter: none; }

/* ============ Footer ============ */
.site-footer { background: var(--ink); color: #9fb0c9; }
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  padding-top: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-logo { height: 40px; width: auto; }
.site-footer .brand-name { color: var(--white); }
.site-footer .brand-tag { color: #8fa2bd; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 30px; }
.footer-nav a { font-size: 0.82rem; letter-spacing: 0.04em; transition: color .2s; }
.footer-nav a:hover { color: var(--white); }

.footer-social { display: flex; gap: 10px; }
.footer-social a { border-color: rgba(255,255,255,0.16); color: #c6d3e6; }
.footer-social a:hover { background: var(--white); border-color: var(--white); color: var(--ink); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 28px;
}
.footer-bottom p { margin: 0; font-size: 0.76rem; color: #8094b0; }

/* ============ WhatsApp flotante ============ */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
  transition: transform .25s var(--ease);
}
.whatsapp-float svg { width: 28px; height: 28px; }
.whatsapp-float:hover { transform: scale(1.06); }

/* ============ Animación de entrada ============ */
/* Solo se oculta si JS está activo, para no esconder contenido a buscadores o sin JS */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .main-nav { transition: none; }
}

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 1024px) {
  .main-nav { gap: 26px; }
  .hero-inner { gap: 48px; }
  .about-inner { gap: 56px; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 48px 40px; }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .section { padding: 90px 0; }

  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 28px 32px;
    background: var(--white);
    border-top: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(22,36,77,0.35);
    /* Se oculta con opacidad y un desplazamiento mínimo hacia arriba.
       Antes usaba translateX(100%), que empujaba el panel un ancho completo
       de pantalla fuera del viewport y generaba desbordamiento horizontal:
       el documento medía el doble de ancho. Quedaba tapado por el
       overflow-x: clip del body, que Safari no soporta antes de la v16. */
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
  }
  .main-nav.open { opacity: 1; transform: none; visibility: visible; }
  .main-nav a:not(.btn) {
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--ink);
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  .main-nav a:not(.btn)::after { display: none; }
  .nav-mobile-cta { display: inline-flex; margin-top: 28px; }
  body.menu-open { overflow: hidden; }

  .hero { padding: 72px 0 90px; }
  .hero-inner, .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-frame { width: min(100%, 240px); aspect-ratio: 1 / 1; }
  .hero-frame::after { inset: -12px 12px 12px -12px; }
  .hero-mark { width: 46%; }

  .areas-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-inner { gap: 56px; }
  .contact-map, .map-embed { min-height: 360px; }
}

/* ============================================================
   Responsive — móvil
   ============================================================ */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .container { padding: 0 22px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 44px; }

  .brand-logo { height: 40px; }
  .brand-name { font-size: 1rem; }
  .brand-tag { font-size: 0.54rem; }

  .hero { padding: 48px 0 72px; }
  .hero::before { background-size: calc(100% / 6) 100%; }
  .hero-frame { width: 190px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-trust { flex-direction: column; gap: 12px; }

  .areas-grid { grid-template-columns: 1fr; }
  .area { padding: 34px 26px 36px; }
  .area::after { left: 26px; right: 26px; }

  .steps { grid-template-columns: 1fr; gap: 36px; }

  .contact-actions { flex-direction: column; }
  .contact-actions .btn { width: 100%; }
  .contact-map, .map-embed { min-height: 300px; }

  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-nav { gap: 14px 24px; }
  .footer-bottom { flex-direction: column; }

  .whatsapp-float { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .whatsapp-float svg { width: 26px; height: 26px; }
}
