/* ==========================================================================
   Manzanero & Asociados · Estudio Legal
   Mobile-First · sin dependencias · accesible
   ========================================================================== */

:root {
  --guinda: #5C1026;
  --guinda-deep: #470D1F;
  --guinda-soft: #7A1F3B;
  --guinda-tint: #F5D7DE;
  --guinda-wash: #EBC0CB;
  --ink: #333333;
  --muted: #6B6B6B;
  --paper: #ffffff;
  --paper-deep: #F0EDEA;
  --card: #ffffff;
  --line: #E8E4E0;
  --focus: #8E2A47;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(71, 13, 31, 0.10);
  --shadow-sm: 0 4px 14px rgba(71, 13, 31, 0.08);
  --font-display: "Arial Narrow", "Franklin Gothic Medium", "Haettenschweiler", "Arial Black", Impact, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 72rem;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2 { font-family: var(--font-display); line-height: 1.15; color: var(--ink); margin: 0 0 0.6em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
h3, h4 { font-family: var(--font-sans); line-height: 1.3; color: var(--ink); margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
a { color: var(--guinda); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--guinda-deep); }
address { font-style: normal; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- Accesibilidad ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3.5rem; z-index: 200;
  background: var(--guinda); color: #fff; padding: 0.65rem 1rem;
  border-radius: 0 0 8px 8px; font-weight: 600; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.75rem 0; }
.section--paper { background: var(--paper-deep); }
.section--navy { background: var(--guinda); color: #F3ECEE; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }

.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--guinda); margin-bottom: 0.6rem;
}
.section--navy .eyebrow { color: var(--guinda-tint); }
.section-intro { max-width: 46rem; }
.section-intro p { color: var(--muted); font-size: 1.05rem; }
.section--navy .section-intro p { color: #E9D7DC; }

.grid { display: grid; gap: 1.25rem; }
.grid--2, .grid--3 { grid-template-columns: 1fr; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-sans); font-size: 1rem; font-weight: 600; line-height: 1;
  padding: 0.9rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  min-height: 3rem;
}
.btn--primary { background: var(--guinda); color: #fff; }
.btn--primary:hover { background: var(--guinda-deep); color: #fff; }
.btn--gold { background: var(--guinda-tint); color: var(--guinda-deep); }
.btn--gold:hover { background: var(--guinda-wash); color: var(--guinda-deep); }
.btn--outline { background: transparent; color: var(--guinda); border-color: var(--guinda); }
.btn--outline:hover { background: var(--guinda); color: #fff; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.75); }
.btn--outline-light:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn + .btn { margin-left: 0.75rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-row .btn + .btn { margin-left: 0; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.65rem 1.25rem; max-width: var(--maxw); margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-width: 0; }
.brand img { height: 3rem; width: auto; }
.brand-name { font-family: var(--font-serif); color: var(--guinda); font-size: 1.05rem; font-weight: 700; line-height: 1.15; }
.brand-sub { display: block; font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: 2px solid var(--guinda);
  color: var(--guinda); font-weight: 600; font-size: 0.95rem; padding: 0.55rem 0.9rem; border-radius: 8px; cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { background: var(--guinda); color: #fff; }
.nav-toggle span:last-child { display: none; }

.main-nav { display: none; width: 100%; }
.main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.nav-list { list-style: none; margin: 0; padding: 0.5rem 1.25rem 1rem; }
.nav-list li + li { border-top: 1px solid var(--line); }
.nav-list a {
  display: block; padding: 0.85rem 0.25rem; color: var(--guinda); font-weight: 600; text-decoration: none;
}
.nav-list a:hover, .nav-list a:focus { color: var(--guinda); }
.nav-list a[aria-current="page"] { color: var(--guinda); box-shadow: inset 3px 0 0 var(--guinda); padding-left: 0.75rem; }
.nav-cta { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; background-color: var(--guinda-deep); color: #fff; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(180deg, rgba(71,13,31,0.86) 0%, rgba(71,13,31,0.72) 55%, rgba(71,13,31,0.94) 100%);
  z-index: 1;
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero-inner { position: relative; z-index: 2; padding: 4.5rem 0 4rem; max-width: var(--maxw); margin: 0 auto; }
.hero h1 { color: #fff; margin-bottom: 0.5rem; }
.hero .lead { font-size: 1.15rem; max-width: 40rem; color: #EBD9DE; margin-bottom: 1.75rem; }
.hero .eyebrow { color: var(--guinda-tint); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.18); color: #EBD9DE; font-size: 0.95rem; }
.hero-trust strong { color: var(--guinda-tint); font-weight: 700; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 0.4rem; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 10px; margin-bottom: 1rem;
  background: var(--paper-deep); color: var(--guinda); font-size: 1.5rem; font-weight: 700;
}
.stat-card { text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--guinda); line-height: 1; margin-bottom: 0.35rem; }
.stat-label { color: var(--muted); font-size: 0.95rem; }
.stat-card .card-icon { margin-bottom: 0.75rem; }

.service-card a { text-decoration: none; color: inherit; display: block; }
.service-card a:hover h3 { color: var(--guinda); }
.service-card h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.service-card { border-top: 4px solid var(--guinda-tint); }

.case-card { display: flex; flex-direction: column; }
.case-tag { align-self: flex-start; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--guinda); background: var(--paper-deep); padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: 1rem; }
.case-card h3 { color: var(--guinda); }
.case-result { margin-top: auto; padding-top: 1rem; font-size: 0.95rem; color: var(--guinda); font-weight: 700; }
.case-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1rem; box-shadow: var(--shadow-sm); }

/* ---------- Equipo ---------- */
.team-card { text-align: center; }
.team-card img { border-radius: 50%; aspect-ratio: 1/1; object-fit: cover; margin: 0 auto 1.1rem; width: 11rem; }
.team-card .team-role { color: var(--guinda); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.04em; }
.team-card h3 { margin-bottom: 0.25rem; }
.team-card p { text-align: left; font-size: 0.95rem; }

/* ---------- Imágenes de sección ---------- */
.category-banner { margin: 1.5rem 0 0; }
.category-banner img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.metodo-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Método ---------- */
.step { display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; align-items: start; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem;
  border-radius: 50%; background: var(--guinda); color: var(--guinda-tint);
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
}
.step h3 { margin-bottom: 0.3rem; }
.step + .step { margin-top: 1.5rem; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 30rem; margin-left: auto; margin-right: auto; }
.cta-band p { color: #E9D7DC; max-width: 40rem; margin-left: auto; margin-right: auto; }

/* ---------- Página hero interior ---------- */
.page-hero { background-color: var(--guinda-deep); color: #fff; padding: 3.25rem 0 2.75rem; }
.page-hero h1 { color: #fff; }
.page-hero .lead { color: #E9D7DC; max-width: 44rem; }
.breadcrumb { font-size: 0.85rem; color: #CDB9BF; margin-bottom: 1rem; }
.breadcrumb a { color: var(--guinda-tint); }
.breadcrumb a:hover { color: var(--guinda-wash); }

/* ---------- Formulario ---------- */
.form-card { max-width: 44rem; }
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; min-height: 3rem;
}
.form-field textarea { min-height: 8rem; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus);
}
.form-note { font-size: 0.85rem; color: var(--muted); }
.form-hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.35rem; }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .contact-label { min-width: 6.5rem; font-weight: 700; color: var(--guinda); }
.contact-list .contact-value { color: var(--muted); min-width: 0; }
.contact-list .contact-value a { overflow-wrap: anywhere; }
.contact-list a { font-weight: 600; }

/* ---------- Pie ---------- */
.site-footer { background: var(--guinda-deep); color: #DAC7CC; padding: 3rem 0 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: 0.9rem; font-family: var(--font-sans); font-weight: 700; }
.site-footer a { color: var(--guinda-tint); }
.site-footer a:hover { color: var(--guinda-wash); }
.footer-brand img { height: 3.2rem; width: auto; margin-bottom: 1rem; }
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a { text-decoration: none; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; border-top: 1px solid rgba(255,255,255,0.14); margin-top: 2rem; padding-top: 1.5rem; font-size: 0.85rem; color: #BFA9AF; }
.footer-bottom p { margin: 0; }

/* ---------- Autoría: Ponciano Studio ---------- */
.studio-link {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none !important;
  transition: transform 0.5s ease;
}
.studio-link:focus-visible { transform: scale(1.05); }
.studio-link-label {
  color: #9ca3af; font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  transition: color 0.5s ease;
}
.studio-link:focus-visible .studio-link-label { color: #10b981; }
.studio-link-badge {
  display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem;
  border: 1px solid rgba(55, 65, 81, 0.5); border-radius: 9999px;
  background-color: rgba(31, 41, 55, 0.4); backdrop-filter: blur(4px);
  transition: border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease;
}
.studio-link:focus-visible .studio-link-badge {
  border-color: rgba(16, 185, 129, 0.4); background-color: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.studio-link-icon { color: #10b981; animation: studio-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.studio-link-name { color: #fff; font-size: 0.75rem; font-weight: 900; letter-spacing: -0.025em; }
.studio-link .text-emerald { color: #10b981; }
@keyframes studio-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- Volver arriba ---------- */
.back-top {
  position: fixed; right: 1.25rem; bottom: 5.5rem; z-index: 90;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--guinda); color: #fff; font-size: 1.1rem;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.back-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { background: var(--guinda-soft); }

/* ---------- Botón flotante WhatsApp ---------- */
.whatsapp-float {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 92;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: #25d366; color: #fff;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.42);
  text-decoration: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.whatsapp-float.is-hidden {
  opacity: 0; pointer-events: none; transform: translateY(12px);
}
.whatsapp-float::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  animation: wa-pulse 2.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
}
.whatsapp-float:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 1.1rem rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 40rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 5rem 0; }
}

@media (min-width: 60rem) {
  .nav-toggle { display: none; }
  .nav-toggle span:last-child { display: inline; }
  .main-nav { display: flex !important; width: auto; position: static !important; box-shadow: none !important; border: 0 !important; align-items: center; gap: 1.5rem; }
  .nav-list { display: flex; align-items: center; gap: 1.4rem; padding: 0; margin: 0; }
  .nav-list li + li { border-top: 0; }
  .nav-list a { padding: 0.5rem 0; font-size: 0.95rem; }
  .nav-list a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--guinda); padding-left: 0; }
  .nav-cta { display: inline-flex; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .hero-inner { padding: 6.5rem 0 5.5rem; }
  .form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
}

/* ==========================================================================
   Efectos · Reveal, hero, hover y ambientales
   ========================================================================== */

/* Reveal al scroll (solo con JS; reduced-motion lo desactiva) */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Hero: entrada escalonada */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.hero .eyebrow,
.hero h1,
.hero .lead,
.hero .btn-row,
.hero .hero-trust {
  animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero .eyebrow { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.15s; }
.hero .lead { animation-delay: 0.28s; }
.hero .btn-row { animation-delay: 0.42s; }
.hero .hero-trust { animation-delay: 0.58s; }

/* Hero: línea guinda que crece bajo el H1 */
.hero h1::after {
  content: ""; display: block; width: 0; height: 3px; margin-top: 0.6rem; border-radius: 2px;
  background: linear-gradient(90deg, var(--guinda-tint), transparent);
  animation: grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s both;
}
@keyframes grow { to { width: 6.5rem; } }

/* Hero: Ken Burns sutil en la fotografía */
.hero-img { will-change: transform; animation: hero-zoom 18s ease-out both; }
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }

/* Ambientales: glow suave en secciones guinda */
.section--navy, .page-hero { position: relative; overflow: hidden; }
.section--navy::before {
  content: ""; position: absolute; top: -6rem; right: -6rem; width: 22rem; height: 22rem;
  background: radial-gradient(closest-side, rgba(245, 215, 222, 0.14), transparent 70%);
  pointer-events: none;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(70% 90% at 15% 10%, rgba(245, 215, 222, 0.16), transparent 60%),
    linear-gradient(90deg, rgba(71, 13, 31, 0.94) 0%, rgba(71, 13, 31, 0.82) 55%, rgba(71, 13, 31, 0.64) 100%);
  pointer-events: none;
}
.page-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  will-change: transform; animation: hero-zoom 18s ease-out both;
}
.section--navy > .container { position: relative; z-index: 1; }
.page-hero > .container { position: relative; z-index: 2; }

/* Ambientales: acento guinda superior en el hero */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(60% 55% at 18% 12%, rgba(245, 215, 222, 0.16), transparent 70%);
}

/* Ambientales: marca de agua del logo en el pie */
.site-footer { position: relative; overflow: hidden; }
.site-footer::after {
  content: ""; position: absolute; right: -3rem; bottom: -3rem; width: 16rem; height: 16rem;
  background: url("../img/logo-manzanero-white.png") center / contain no-repeat;
  opacity: 0.05; pointer-events: none;
  animation: float 14s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Micro-interacciones (solo dispositivos con hover) */
@media (hover: hover) {
  .btn {
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease,
      transform 0.18s ease, box-shadow 0.18s ease;
  }
  .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(71, 13, 31, 0.18); }
  .btn--gold:hover { box-shadow: 0 10px 22px rgba(245, 215, 222, 0.38); }

  .card {
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  }
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--guinda-tint); }
  .service-card:hover { border-top-color: var(--guinda); }
  .card-icon { transition: transform 0.25s ease, background-color 0.25s ease; }
  .card:hover .card-icon { transform: translateY(-2px); background: var(--paper); }

  .nav-list a { position: relative; transition: color 0.18s ease; }
  .nav-list a::after {
    content: ""; position: absolute; left: 0; bottom: 0.2rem; height: 2px; width: 100%;
    background: var(--guinda); transform: scaleX(0); transform-origin: left;
    transition: transform 0.25s ease;
  }
  .nav-list a:hover::after, .nav-list a:focus-visible::after { transform: scaleX(1); }

  .team-card img { transition: transform 0.25s ease, box-shadow 0.25s ease; }
  .team-card:hover img { transform: scale(1.04); box-shadow: 0 14px 30px rgba(71, 13, 31, 0.22); }

  .whatsapp-float { transition: opacity 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; }
  .whatsapp-float:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(37, 211, 102, 0.45); }
}

/* Colores forzados: bordes visibles sin color (patrón del proyecto) */
@media (forced-colors: active) {
  .btn, .card { border: 2px solid ButtonText; }
  .whatsapp-float { border: 2px solid ButtonText; }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero .eyebrow, .hero h1, .hero .lead, .hero .btn-row, .hero .hero-trust {
    animation: none !important; opacity: 1 !important;
  }
  .hero h1::after { animation: none !important; width: 6.5rem; }
  .hero-img { animation: none !important; }
  .page-hero-img { animation: none !important; }
  .whatsapp-float::before { animation: none !important; }
  .site-footer::after { animation: none !important; }
}

/* ==========================================================================
   Libro 3D · Casos de éxito
   Libro abierto de dos páginas con lomo, grosor y paso de página.
   Fallback estático (sin JS) y modo 3D (con JS + sin reduced-motion).
   ========================================================================== */
.case-book { margin-top: 2rem; }

.book { position: relative; max-width: 46rem; margin-left: auto; margin-right: auto; }
.book-3d .book::before {
  content: ""; position: absolute; left: 5%; right: 5%; bottom: -1.6rem; height: 2.4rem;
  background: radial-gradient(50% 100% at 50% 50%, rgba(71, 13, 31, 0.30), transparent 70%);
  filter: blur(8px); z-index: 0; pointer-events: none;
}

/* ---------- Caras de contenido (papel y tapas) ---------- */
.book-tilt { position: relative; }
.leaf { position: relative; }
.leaf + .leaf { margin-top: 1.25rem; }
.leaf-face { overflow: hidden; }
.leaf-back { margin-top: 1.25rem; }
.book-board, .book-spine { display: none; }

.leaf-face {
  background: linear-gradient(180deg, #ffffff 0%, #faf8f6 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.book-page-inner {
  display: flex; flex-direction: column;
  padding: clamp(1rem, 3vw, 1.6rem);
  min-height: 100%;
}
.book-page-inner img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 0.9rem;
  box-shadow: 0 2px 8px rgba(71, 13, 31, 0.14);
}
.book-page-inner h3 { margin-bottom: 0.4rem; font-size: clamp(1.05rem, 2.4vw, 1.3rem); }
.book-page-inner p { color: var(--muted); font-size: clamp(0.82rem, 1.9vw, 0.98rem); }
.book-page-inner .case-result {
  margin-top: auto; padding-top: 1rem;
  color: var(--guinda); font-weight: 700;
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
}
.book-page-inner--intro { justify-content: center; text-align: center; }
.book-page-inner--intro h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.book-page-inner--intro p { max-width: 20rem; margin-left: auto; margin-right: auto; }

/* Página final (guinda, CTA "Cada caso es único") */
.book-page-inner--back {
  justify-content: center; align-items: center; text-align: center; gap: 0.5rem;
  background: linear-gradient(160deg, var(--guinda-soft), var(--guinda-deep));
  color: #fff;
}
.book-page-inner--back .eyebrow { color: var(--guinda-tint); }
.book-page-inner--back h3 { color: #fff; }
.book-page-inner--back p { color: #E9D7DC; max-width: 20rem; }
.book-page-inner--back .btn { margin-top: 0.5rem; }

/* Portada (frente de la hoja 0, reverso = caso 1) */
.book-cover-inner {
  min-height: 100%; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; gap: 0.4rem;
  padding: 2rem 1.5rem;
  background:
    linear-gradient(150deg, rgba(255,255,255,0.06), transparent 40%),
    linear-gradient(160deg, #7A1F3B 0%, var(--guinda) 45%, var(--guinda-deep) 100%);
  color: #fff;
}
.book-cover-inner img { height: clamp(2.5rem, 8vw, 4rem); width: auto; margin-bottom: 0.6rem; }
.book-cover-brand { font-family: var(--font-serif); font-size: clamp(0.9rem, 2.4vw, 1.1rem); font-weight: 700; color: #fff; }
.book-cover-brand span { display: block; font-family: var(--font-sans); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #E9D7DC; font-weight: 600; }
.book-cover-title { color: var(--guinda-tint); margin: 1rem 0 0; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(1.15rem, 3.4vw, 1.8rem); }
.book-cover-orn { display: block; width: 3.25rem; height: 2px; margin: 0.6rem auto; background: linear-gradient(90deg, transparent, var(--guinda-tint), transparent); }
.book-cover-inner p { color: #E9D7DC; margin: 0 auto; max-width: 20rem; }

/* ---------- Controles ---------- */
.book-controls { display: none; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.book-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 2px solid var(--guinda); background: #fff; color: var(--guinda);
  font-size: 1.6rem; line-height: 1; padding: 0; cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.book-btn:hover:not(:disabled) { background: var(--guinda); color: #fff; }
.book-btn:disabled { opacity: 0.35; cursor: default; }
.book-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.book-status { font-size: 0.9rem; font-weight: 600; color: var(--muted); min-width: 4rem; text-align: center; }

/* ---------- Modo 3D ---------- */
.book-3d .book-controls { display: flex; }
.book-3d .leaf + .leaf { margin-top: 0; }
.book-3d .leaf-back { margin-top: 0; }
.book-3d .book { perspective: 2400px; }

.book-3d .book-tilt {
  position: relative; width: 100%; min-height: 24rem;
  transform-style: preserve-3d;
  transform: rotateX(1.6deg);
}
.book-3d .book-tilt::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2.6rem;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(71, 13, 31, 0.20), transparent 42%, transparent 58%, rgba(71, 13, 31, 0.20));
  z-index: 55; pointer-events: none;
}

/* Tablero base (tapa trasera del libro) */
.book-3d .book-board {
  display: block; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(160deg, #6E1B33 0%, var(--guinda-deep) 60%, #3A0A18 100%);
  border-radius: 4px 10px 10px 4px;
  box-shadow: 0 26px 55px rgba(71, 13, 31, 0.32);
}

/* Lomo (borde izquierdo, hilo fino) */
.book-3d .book-spine {
  display: block; position: absolute; top: 0; left: 0; bottom: 0; width: 0.4rem;
  z-index: 60; border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #3A0A18 0%, #6E1B33 42%, #470D1F 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.book-3d .book-spine::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: repeating-linear-gradient(180deg, transparent 0 7px, rgba(0, 0, 0, 0.22) 7px 8px);
}

/* Hojas (mitad derecha) */
.book-3d .leaf {
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 1.05s cubic-bezier(0.35, 0.08, 0.22, 1), opacity 0.5s ease;
  will-change: transform;
}
.book-3d .leaf-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 0 8px 8px 0;
  box-shadow: none;
}
.book-3d .leaf-back { transform: rotateY(180deg); }
.book-3d .leaf.is-flipped { transform: rotateY(-180deg); }

/* Grosor de las hojas: borde inferior visible */
.book-3d .leaf-face::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(180deg, rgba(71, 13, 31, 0.10), rgba(71, 13, 31, 0.22));
  pointer-events: none;
}

/* ---------- Móvil (menos de 40rem): libro compacto ---------- */
@media (max-width: 39.99rem) {
  .case-book { margin-top: 1.75rem; }
  .book-3d .book-tilt { min-height: 20rem; }
  .book-page-inner { padding: 0.85rem; }
  .book-page-inner img { margin-bottom: 0.6rem; }
  .book-page-inner h3 { font-size: 1rem; }
  .book-page-inner p { font-size: 0.8rem; line-height: 1.42; }
  .book-page-inner .case-result { padding-top: 0.6rem; font-size: 0.8rem; }
  .case-tag { margin-bottom: 0.7rem; }
  .book-cover-inner { padding: 1.25rem 0.9rem; }
  .book-cover-title { font-size: 1.05rem; }
  .book-cover-brand { font-size: 0.85rem; }
  .book-cover-inner img { height: 2.5rem; }
  .book-controls { margin-top: 1.25rem; }
}