/* Lic. Eduardo Revilla y Asociados */

:root {
  --bg: #070d18;
  --bg-2: #0a1222;
  --surface: #0d1729;
  --surface-2: #111d33;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f4f1ea;
  --muted: rgba(244, 241, 234, .66);
  --dim: rgba(244, 241, 234, .45);
  --gold-1: #f3dca6;
  --gold-2: #d4b16a;
  --gold-3: #a8823f;
  --gold-grad: linear-gradient(100deg, var(--gold-1) 0%, var(--gold-2) 45%, var(--gold-3) 100%);
  --wa: #25d366;
  --wa-hover: #2ee374;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 76px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  font: 400 16px/1.65 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
p { margin: 0 0 1em; }
::selection { background: var(--gold-2); color: var(--bg); }

.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--gold-2); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }

.ico { width: 18px; height: 18px; flex: none; }
.gold { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .95rem 1.35rem; border-radius: 12px; border: 1px solid transparent;
  font: 700 .95rem/1.2 var(--font); letter-spacing: -.01em; text-decoration: none; text-align: center;
  transition: background-color .25s, border-color .25s, transform .25s var(--ease-out), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--wa { background: var(--wa); color: #04150b; box-shadow: 0 10px 30px -12px rgba(37, 211, 102, .6); }
.btn--wa:hover { background: var(--wa-hover); box-shadow: 0 14px 36px -12px rgba(37, 211, 102, .75); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: rgba(255, 255, 255, .03); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: rgba(212, 177, 106, .6); background: rgba(212, 177, 106, .08); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: height .4s var(--ease-out), background-color .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled, .header.is-open {
  height: 64px; background: rgba(7, 13, 24, .72);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 2rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand__logo { width: 48px; transition: width .4s var(--ease-out); }
.header.is-scrolled .brand__logo { width: 40px; }
.brand__name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.brand__name span { color: var(--dim); font-weight: 500; }

.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: .5rem .9rem; border-radius: 999px; transition: color .25s, background-color .25s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.burger { display: none; }

/* ---------- Portada ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background: url("/assets/img/hero-biblioteca.webp") center / cover no-repeat;
  filter: brightness(.5) saturate(.8);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 13, 24, .92) 0%, rgba(7, 13, 24, .7) 38%, rgba(7, 13, 24, 0) 70%),
    radial-gradient(110% 80% at 85% 15%, rgba(7, 13, 24, 0) 0%, rgba(7, 13, 24, .45) 55%, var(--bg) 92%),
    linear-gradient(to top, var(--bg) 2%, rgba(7, 13, 24, 0) 40%);
}
.hero::after { /* grano sutil */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__content { padding: calc(var(--header-h) + 6vh) 0 40px; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1.6rem;
  padding: .4rem .85rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: var(--gold-1); border: 1px solid rgba(212, 177, 106, .35); background: rgba(212, 177, 106, .07);
  backdrop-filter: blur(6px);
}
.pill__stars { color: var(--gold-2); }

.hero__title {
  font-size: clamp(2.6rem, 1rem + 5vw, 5.6rem); line-height: 1; letter-spacing: -.045em;
  max-width: 14ch; margin-bottom: 1.4rem; text-wrap: balance;
}
.hero__lead { max-width: 46ch; color: var(--muted); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); margin-bottom: 2.2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.strip {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(40px, 7vh, 80px);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: rgba(13, 23, 41, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.strip a {
  display: block; padding: 1.15rem 1.35rem; text-decoration: none; font-weight: 700; letter-spacing: -.01em;
  border-right: 1px solid var(--line); transition: background-color .3s;
  position: relative;
}
.strip a:last-child { border-right: 0; }
.strip a::after {
  content: "→"; position: absolute; right: 1.2rem; top: 1.15rem; color: var(--gold-2);
  opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .3s var(--ease-out);
}
.strip a:hover { background: rgba(255, 255, 255, .04); }
.strip a:hover::after { opacity: 1; transform: none; }
.strip small { display: block; font-weight: 500; color: var(--dim); font-size: .82rem; margin-top: .15rem; }

/* ---------- Secciones ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.section--alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { margin-bottom: clamp(36px, 5vw, 56px); }
.kicker { font-size: .82rem; font-weight: 600; color: var(--gold-2); margin-bottom: .9rem; }
.h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); max-width: 18ch; text-wrap: balance; }

/* Cards con brillo que sigue al cursor */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  isolation: isolate; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 177, 106, .12), transparent 60%);
}
.card:hover::before { opacity: 1; }

/* Sobre el despacho */
.about { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.about__lead { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.45; font-weight: 500; letter-spacing: -.02em; color: var(--muted); margin-bottom: 2rem; }
.about__lead strong { color: var(--text); font-weight: 700; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fact { padding: 1.5rem; }
.fact p { margin: .8rem 0 0; color: var(--muted); font-size: .95rem; }
.fact__num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fact__ico { width: 40px; height: 40px; padding: 9px; border-radius: 10px; color: var(--gold-2); background: rgba(212, 177, 106, .1); }
.about__media { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: brightness(.85); }

/* Especialidades */
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.pillar { display: flex; flex-direction: column; transition: border-color .4s, transform .5s var(--ease-out); }
.pillar:hover { border-color: rgba(212, 177, 106, .35); transform: translateY(-4px); }
.pillar__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.pillar__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--surface) 0%, rgba(13, 23, 41, 0) 55%); }
.pillar__media img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.8) saturate(.85); transition: transform 1.4s var(--ease-out), filter .6s; }
.pillar:hover .pillar__media img { transform: scale(1.05); filter: brightness(.95) saturate(1); }
.pillar__body { padding: 0 1.75rem 1.9rem; margin-top: -1.5rem; position: relative; flex: 1; display: flex; flex-direction: column; }
.pillar__idx { align-self: flex-start; display: inline-block; font-size: .78rem; font-weight: 700; color: var(--gold-2); border: 1px solid rgba(212, 177, 106, .35); border-radius: 999px; padding: .15rem .6rem; margin-bottom: .9rem; }
.pillar h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin-bottom: .7rem; }
.pillar__sub { color: var(--gold-1); font-weight: 600; font-size: .9rem; margin: -.3rem 0 .7rem; }
.pillar__text { color: var(--muted); margin: 0 0 1.5rem; }
.pillar__cta { margin-top: auto; align-self: flex-start; padding: .75rem 1.1rem; font-size: .9rem; }

/* Opiniones */
.review { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 6vw, 80px); align-items: center; padding: clamp(28px, 5vw, 64px); }
.review__score { display: flex; flex-direction: column; padding-right: clamp(28px, 6vw, 80px); border-right: 1px solid var(--line); }
.review__num { font-size: clamp(4rem, 3rem + 4vw, 6.5rem); font-weight: 800; letter-spacing: -.06em; line-height: .9; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.review__stars { color: var(--gold-2); letter-spacing: 3px; margin: .6rem 0 .2rem; }
.review__src { color: var(--dim); font-size: .88rem; }
.review__maps { margin-top: 1.4rem; padding: .7rem 1rem; font-size: .85rem; }
.carousel { min-width: 0; }
.carousel__track { display: flex; transition: transform .7s var(--ease-out); touch-action: pan-y; }
.carousel { overflow: hidden; }
.slide { flex: 0 0 100%; margin: 0; padding-right: 4px; }
.slide__tag { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--gold-2); border: 1px solid rgba(212, 177, 106, .35); border-radius: 999px; padding: .15rem .65rem; margin-bottom: 1rem; }
.slide blockquote { margin: 0 0 1.1rem; font-size: clamp(1.15rem, .95rem + 1vw, 1.6rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.4; }
.slide figcaption { color: var(--dim); font-size: .9rem; font-style: italic; }
.slide__stars { color: var(--gold-2); font-style: normal; letter-spacing: 2px; margin-right: .35rem; }
.carousel__nav { display: flex; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.carousel__btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
  color: var(--text); font: 600 1.05rem/1 var(--font); cursor: pointer; transition: border-color .25s, background-color .25s;
}
.carousel__btn:hover { border-color: rgba(212, 177, 106, .6); background: rgba(212, 177, 106, .1); }
.carousel__dots { display: flex; gap: 8px; }
.carousel__dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: width .4s var(--ease-out), background-color .3s; }
.carousel__dot[aria-selected="true"] { width: 28px; background: var(--gold-2); }

/* Contacto */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; }
.contact__list { display: flex; flex-direction: column; gap: 12px; }
.contact__item { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.4rem; text-decoration: none; transition: border-color .3s; }
.contact__item:hover { border-color: rgba(212, 177, 106, .35); }
.contact__item .ico { width: 40px; height: 40px; padding: 10px; border-radius: 10px; color: var(--gold-2); background: rgba(212, 177, 106, .1); }
.contact__item small { display: block; color: var(--dim); font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
.contact__item span { font-weight: 600; }
.contact__note { display: block; margin-top: .55rem; font-style: normal; font-weight: 500; font-size: .85rem; color: var(--gold-1); }
.contact__wa { margin-top: 4px; }
.map { min-height: 440px; }
.map iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  filter: invert(.92) hue-rotate(180deg) saturate(.6) brightness(.95) contrast(.95);
}

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .88rem; color: var(--dim); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--gold-1); }
.brand--footer .brand__logo { width: 40px; }
.brand--footer .brand__name { color: var(--text); font-size: .92rem; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: .6rem; height: 56px; padding: 0 16px;
  border-radius: 999px; background: var(--wa); color: #04150b; text-decoration: none; font-weight: 700; font-size: .92rem;
  box-shadow: 0 14px 34px -10px rgba(37, 211, 102, .55), 0 4px 12px rgba(0, 0, 0, .35);
  transform: translateY(16px) scale(.9); opacity: 0; pointer-events: none;
  transition: opacity .35s, transform .5s var(--ease-out), background-color .25s;
}
.wa-float svg { width: 26px; height: 26px; flex: none; }
.wa-float.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.wa-float:hover { background: var(--wa-hover); }

/* ---------- Animaciones ---------- */
@keyframes heroIn { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes heroBg { from { transform: scale(1.15); opacity: 0; } to { transform: scale(1.02); opacity: 1; } }

.js .hero__bg { animation: heroBg 2.4s var(--ease-out) both; }
.js .hero__in { opacity: 0; animation: heroIn 1.1s var(--ease-out) forwards; animation-delay: calc(.25s + var(--d) * .12s); }

.js .reveal { opacity: 0; transform: translateY(28px); filter: blur(4px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }
.js .pillar.reveal { transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out), border-color .4s; }

.js .reveal-img { clip-path: inset(0 0 100% 0 round var(--radius)); transition: clip-path 1.3s var(--ease-out); }
.js .reveal-img img { transform: scale(1.15); transition: transform 2s var(--ease-out); }
.js .reveal-img.is-in { clip-path: inset(0 0 0 0 round var(--radius)); }
.js .reveal-img.is-in img { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .burger {
    display: grid; place-content: center; gap: 6px; margin-left: auto; width: 44px; height: 44px;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer;
  }
  .burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .35s var(--ease-out); }
  .header.is-open .burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .header.is-open .burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav {
    position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0;
    padding: 8px 16px 20px; background: rgba(7, 13, 24, .96); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); visibility: hidden; transition: opacity .3s, transform .4s var(--ease-out), visibility .3s;
  }
  .header.is-open .nav { opacity: 1; transform: none; visibility: visible; }
  .nav a { padding: 1rem .25rem; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav a:hover { background: none; }

  .strip { grid-template-columns: 1fr 1fr; }
  .strip a:nth-child(2) { border-right: 0; }
  .strip a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .about { grid-template-columns: 1fr; }
  .about__media img { aspect-ratio: 16 / 10; }
  .contact { grid-template-columns: 1fr; }
  .map { min-height: 340px; }
}

@media (max-width: 640px) {
  .brand__name { font-size: .92rem; }
  .brand__name span { display: block; font-size: .82rem; }
  .hero { align-items: center; }
  .hero__bg { filter: brightness(.38) saturate(.7); background-position: 70% center; }
  .hero__content { padding-top: calc(var(--header-h) + 32px); }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .strip a { padding: 1rem; font-size: .92rem; }
  .strip a::after { display: none; }
  .strip small { font-size: .76rem; }
  .facts { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .pillar__body { padding: 0 1.25rem 1.5rem; }
  .review { grid-template-columns: 1fr; }
  .review__score { border-right: 0; padding: 0 0 1.5rem; border-bottom: 1px solid var(--line); }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .wa-float { right: 16px; bottom: 16px; width: 56px; padding: 0; justify-content: center; }
  .wa-float__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hero__in, .js .reveal { opacity: 1; transform: none; filter: none; }
  .js .reveal-img { clip-path: none; }
  .js .reveal-img img { transform: none; }
}

/* ---------- Páginas internas (aviso, 404) ---------- */
.page .header { background: rgba(7, 13, 24, .72); backdrop-filter: blur(16px); border-color: var(--line); height: 64px; }
.legal { padding: calc(64px + 64px) 0 96px; }
.legal .wrap { max-width: 780px; }
.legal__logo { width: min(200px, 55%); margin: 0 0 2.5rem; padding: 18px; background: #f4f1ea; border-radius: var(--radius); }
.legal h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); margin-bottom: .6rem; }
.legal h2 { font-size: 1.35rem; letter-spacing: -.02em; margin: 2.4rem 0 .7rem; }
.legal p, .legal li { color: var(--muted); }
.legal a { color: var(--gold-1); }
.legal ul { padding-left: 1.2rem; }
.legal .updated { font-size: .85rem; color: var(--gold-2); font-weight: 600; }
.legal .back { margin-top: 2.5rem; color: var(--text); }
.notfound { min-height: calc(100vh - 90px); display: flex; align-items: center; }
.notfound__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.notfound__actions .back { margin-top: 0; }

/* ---------- Textos justificados ---------- */
.hero__lead, .about__lead, .fact p, .pillar__text, .slide blockquote,
.legal p, .legal li, .notfound p {
  text-align: justify; text-justify: inter-word;
  -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3;
}

/* Bloque 20+ en una sola tarjeta horizontal */
.facts { grid-template-columns: 1fr; }
.fact--wide { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.25rem); padding: 1.6rem 2rem; }
.fact--wide .fact__num { font-size: clamp(3rem, 2.2rem + 2.5vw, 4.4rem); flex: none; }
.fact--wide p { margin: 0; font-size: 1rem; padding-left: clamp(1.25rem, 3vw, 2.25rem); border-left: 1px solid var(--line-2); }
@media (max-width: 480px) {
  .fact--wide { flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1.4rem; }
  .fact--wide p { padding-left: 0; border-left: 0; }
}

.about__title { margin-bottom: 1.4rem; }
