/* ==== Tipografías (alojadas localmente, sin llamar a Google Fonts) ==== */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* ==== Tokens ==== */
:root {
  --grafito: #1B1F23;
  --grafito-deep: #14171A;
  --ambar: #E2762B;
  --ambar-soft: rgba(226, 118, 43, 0.16);
  --hueso: #F4F1EA;
  --hueso-dim: rgba(244, 241, 234, 0.72);
  --acero: #3A5A6D;
  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--grafito);
  color: var(--hueso);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 16px;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; margin-bottom: 8px; }
p { margin: 0 0 16px; }

a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ambar); color: var(--grafito); padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ==== Buttons ==== */
.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-amber { background: var(--ambar); color: var(--grafito-deep); }
.btn-amber:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px var(--ambar); }
.btn-ghost { background: transparent; border: 1px solid var(--acero); color: var(--hueso); }
.btn-ghost:hover { border-color: var(--ambar); color: var(--ambar); }
.section-light .btn-ghost { border-color: rgba(27, 31, 35, 0.3); color: var(--grafito); }
.btn-lg { padding: 20px 42px; font-size: 1.2rem; }

/* ==== Header ==== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(27, 31, 35, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-name-sm { font-family: var(--font-head); font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.95rem; color: var(--hueso-dim); }
.site-nav a:hover { color: var(--hueso); }
.site-nav a[aria-current="page"] { color: var(--ambar); }
.site-nav a.nav-cta, .site-nav a.nav-cta[aria-current="page"] { color: var(--grafito-deep); }

.nav-links { display: flex; align-items: center; gap: 28px; }

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

@media (min-width: 781px) {
  /* Centra los enlaces de navegación en el header, independientemente del ancho del logo o del botón */
  .nav-links {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--grafito);
    flex-direction: column; align-items: flex-start; gap: 18px;
    padding: 20px 24px 28px;
    border-bottom: 1px solid rgba(244, 241, 234, 0.08);
    display: none;
  }
  .nav-toggle-input:checked ~ .site-nav { display: flex; }
  .nav-links { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* ==== Hero ==== */
.hero { position: relative; overflow: hidden; padding: 96px 0 88px; }
.hero-inner { position: relative; z-index: 1; text-align: center; }
.glow {
  position: absolute; top: -180px; right: -120px;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--ambar-soft), transparent 70%);
  pointer-events: none;
  animation: glow-pulse 7s ease-in-out infinite;
}
.glow-alt { top: auto; bottom: -220px; left: -160px; right: auto; }

@keyframes glow-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
}

.eyebrow, .kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ambar);
  margin-bottom: 18px;
}

.hero-sub { font-size: 1.15rem; color: var(--hueso-dim); max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-actions { margin-top: 28px; }
.hero-actions .btn + .btn, .hero-actions .btn + a { margin-left: 14px; }
.hero-note { font-size: 0.85rem; color: var(--hueso-dim); margin-top: 12px; }

/* ==== Page hero (inner pages) ==== */
.page-hero { position: relative; overflow: hidden; padding: 72px 0 60px; }
.page-hero h1 { max-width: 760px; }
.page-hero-sub { font-size: 1.05rem; color: var(--hueso-dim); max-width: 640px; }

.page-hero-center .wrap { text-align: center; }
.page-hero-center h1, .page-hero-center .page-hero-sub { margin-left: auto; margin-right: auto; }

/* ==== Fondos con textura (dot field a la deriva) ==== */
.hero::before, .page-hero::before, .cta-final::before,
.problema::before, .metodo::before, .section-dark::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(244, 241, 234, 0.06) 1px, transparent 1.4px);
  background-size: 30px 30px;
  z-index: 0;
  pointer-events: none;
  animation: dot-drift 90s linear infinite;
}
@keyframes dot-drift {
  to { background-position: 180px 180px; }
}
.hero > .wrap, .page-hero > .wrap, .cta-final > .wrap,
.problema > .wrap, .metodo > .wrap, .section-dark > .wrap {
  position: relative; z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .hero::before, .page-hero::before, .cta-final::before,
  .problema::before, .metodo::before, .section-dark::before { animation: none; }
}

/* ==== Aurora: el glow gana un giro lento en tonos ámbar/acero ==== */
.glow::after {
  content: '';
  position: absolute; inset: -40%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--ambar-soft), transparent 30%, rgba(58, 90, 109, 0.18), transparent 70%, var(--ambar-soft));
  /* El conic-gradient no se difumina hacia el borde por sí solo: la máscara radial evita el corte duro al llegar al límite de la sección */
  -webkit-mask-image: radial-gradient(circle, black 0%, black 35%, transparent 72%);
  mask-image: radial-gradient(circle, black 0%, black 35%, transparent 72%);
  opacity: 0.55;
  animation: aurora-spin 26s linear infinite;
}
@keyframes aurora-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .glow::after { animation: none; }
}

/* ==== Spotlight que sigue al cursor en las cabeceras ==== */
.hero::after, .page-hero::after {
  content: '';
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(360px circle at var(--sx, 50%) var(--sy, 15%), rgba(226, 118, 43, 0.12), transparent 70%);
}
.hero.spotlight-active::after, .page-hero.spotlight-active::after { opacity: 1; }

/* ==== Texto con brillo: recorre el titular de Auditoría una vez al aparecer ==== */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1.shine-once {
    background: linear-gradient(100deg, var(--hueso) 30%, var(--ambar) 45%, var(--hueso) 60%);
    background-size: 250% 100%;
    background-position: 200% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .hero h1.shine-once.is-visible {
    animation: shine-text 1.6s ease-out 0.3s 1 forwards;
  }
}
@keyframes shine-text {
  to { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1.shine-once { animation: none; background: none; -webkit-text-fill-color: currentColor; color: var(--hueso); }
}

/* ==== Botones magnéticos: pequeño tirón hacia el cursor (ver main.js) ==== */
.hero-actions .btn-amber { will-change: transform; }

/* ==== Glare: brillo que sigue al cursor sobre las tarjetas ==== */
.card > *:not(.card-tag), .case-card > * {
  position: relative; z-index: 1;
}
.card::before, .case-card::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 0.35s ease;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(226, 118, 43, 0.16), transparent 65%);
}
.card.glare-active::before, .case-card.glare-active::before { opacity: 1; }

/* ==== Beams: haces de luz a la deriva en el CTA final ==== */
.cta-final::after {
  content: '';
  position: absolute; inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 40%, rgba(226, 118, 43, 0.10) 48%, transparent 56%),
    linear-gradient(115deg, transparent 60%, rgba(58, 90, 109, 0.14) 68%, transparent 76%);
  background-size: 200% 200%;
  animation: beams-drift 18s ease-in-out infinite;
}
@keyframes beams-drift {
  0%, 100% { background-position: 0% 0%, 100% 100%; }
  50% { background-position: 100% 100%, 0% 0%; }
}
@media (prefers-reduced-motion: reduce) {
  .cta-final::after { animation: none; }
}

/* ==== Sections generic ==== */
section { padding: 88px 0; }
.section-lead { font-size: 1.1rem; color: var(--hueso-dim); max-width: 680px; }

.problema, .metodo, .cta-final { background: var(--grafito); position: relative; }
.metodo { text-align: center; }
.metodo .section-lead { margin-left: auto; margin-right: auto; }
.servicios, .sobre-nosotros { background: var(--hueso); color: var(--grafito); }
.servicios .kicker, .sobre-nosotros .kicker { color: var(--ambar); }
.servicios .section-lead, .sobre-nosotros p { color: rgba(27, 31, 35, 0.72); }
.cta-final { position: relative; overflow: hidden; text-align: center; padding-bottom: 100px; }
.cta-final .section-lead { margin: 0 auto 8px; }
.cta-final .hero-actions { display: flex; flex-direction: column; align-items: center; }

/* Reusable light/dark section utilities for inner pages */
.section-light { background: var(--hueso); color: var(--grafito); }
.section-light .kicker { color: var(--ambar); }
.section-light .section-lead,
.section-light p { color: rgba(27, 31, 35, 0.72); }
.section-light h1, .section-light h2, .section-light h3 { color: var(--grafito); }
.section-dark { background: var(--grafito); position: relative; }

/* ==== Calculadora ==== */
.calc-card {
  background: var(--grafito-deep);
  border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
}
.calc-inputs { display: flex; gap: 24px; flex-wrap: wrap; }
.calc-inputs label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 0.85rem; color: var(--hueso-dim);
  font-family: var(--font-mono);
}
.calc-inputs input {
  width: 130px;
  background: var(--grafito);
  border: 1px solid var(--acero);
  color: var(--hueso);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 8px;
}
.calc-inputs input:focus { outline: 2px solid var(--ambar); }
.calc-result { text-align: right; }
.calc-label { display: block; font-size: 0.85rem; color: var(--hueso-dim); margin-bottom: 6px; }
.calc-amount {
  display: block; font-family: var(--font-mono); font-weight: 600;
  font-size: 2.4rem; color: var(--ambar); line-height: 1;
}
.calc-fineprint { display: block; font-size: 0.75rem; color: var(--hueso-dim); margin-top: 8px; font-family: var(--font-mono); }
.calc-disclaimer { font-size: 0.85rem; color: var(--hueso-dim); margin-top: 18px; }

@media (max-width: 640px) {
  .calc-result { text-align: left; }
  .calc-card { flex-direction: column; align-items: flex-start; }
}

/* ==== Servicios / cards ==== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.card {
  background: var(--grafito);
  color: var(--hueso);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.5); }
.card-featured { border: 1px solid var(--ambar); }
.card-tag {
  position: absolute; top: -12px; left: 24px;
  background: var(--ambar); color: var(--grafito-deep);
  font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 10px; border-radius: 999px;
}
.card-icon { width: 36px; height: 36px; stroke: var(--ambar); fill: none; margin-bottom: 14px; }
.card p { color: var(--hueso-dim); font-size: 0.95rem; margin-bottom: 0; }
.card a.card-link { display: inline-block; margin-top: 12px; color: var(--ambar); font-size: 0.9rem; text-decoration: none; font-family: var(--font-mono); }
.card a.card-link:hover { text-decoration: underline; }

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

/* ==== Metodo ==== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.step { transition: transform 0.2s ease; }
.step:hover { transform: translateY(-4px); }
.step:hover .step-num { color: var(--ambar); }
.step-num { font-family: var(--font-mono); color: var(--acero); font-size: 1.6rem; display: block; margin-bottom: 10px; transition: color 0.2s ease; }
.step p { color: var(--hueso-dim); }

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

/* ==== Esquema de flujo ==== */
.flow-diagram {
  display: flex; align-items: center; gap: 4px;
  margin: 36px auto 44px; max-width: 640px;
}
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; width: 96px; text-align: center; }
.flow-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.flow-node:hover .flow-icon { transform: translateY(-3px); border-color: var(--ambar); }
.flow-icon svg { width: 26px; height: 26px; stroke: var(--ambar); fill: none; }
.flow-icon-accent { background: var(--ambar); }
.flow-icon-accent svg { fill: var(--grafito-deep); stroke: none; }
.flow-node span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--hueso-dim); line-height: 1.3; }
.flow-line {
  position: relative; flex: 1; height: 2px; min-width: 24px;
  background: rgba(244, 241, 234, 0.15); overflow: visible;
}
.flow-line::after {
  content: ''; position: absolute; top: 50%; left: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ambar); transform: translateY(-50%);
  animation: flow-dot 2.4s ease-in-out infinite;
}
.flow-line:nth-of-type(2)::after { animation-delay: 1.2s; }
@keyframes flow-dot {
  0% { left: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-line::after { animation: none; opacity: 0; }
}
@media (max-width: 560px) {
  .flow-diagram { max-width: 100%; }
  .flow-node { width: 74px; }
  .flow-icon { width: 46px; height: 46px; }
  .flow-icon svg { width: 20px; height: 20px; }
  .flow-node span { font-size: 0.68rem; }
}

/* ==== Sobre nosotros ==== */
.sobre-nosotros-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.sobre-nosotros-mark svg { width: 100%; max-width: 260px; margin: 0 auto; display: block; opacity: 0.85; }

@media (max-width: 780px) {
  .sobre-nosotros-inner { grid-template-columns: 1fr; }
  .sobre-nosotros-mark { order: -1; }
  .sobre-nosotros-mark svg { max-width: 160px; }
}

/* ==== Tags / pills ==== */
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tag {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--acero); color: var(--hueso-dim);
}
.section-light .tag,
.servicios .tag,
.sobre-nosotros .tag { border-color: rgba(27, 31, 35, 0.25); color: rgba(27, 31, 35, 0.65); }

/* ==== Note / disclaimer banner ==== */
.note-banner {
  border: 1px solid rgba(226, 118, 43, 0.4);
  background: var(--ambar-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.9rem;
  color: var(--hueso-dim);
  margin: 28px 0;
}
.section-light .note-banner { color: rgba(27, 31, 35, 0.75); }

/* ==== Values grid (sobre nosotros) ==== */
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.value-item h3 { font-size: 1.05rem; }
.value-item p { font-size: 0.95rem; }
@media (max-width: 780px) { .values-grid { grid-template-columns: 1fr; } }

/* ==== Cuadrícula de servicios ==== */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 8px; }
.service-card {
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius); padding: 32px; text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.5); }
.service-card .service-anim { max-width: 110px; margin: 0 auto 16px; }
.service-card .service-detail-meta { display: block; }
.service-card h2 { font-size: 1.25rem; margin-bottom: 10px; }
.service-card > p { color: var(--hueso-dim); font-size: 0.92rem; margin-bottom: 0; }
.service-card-body {
  text-align: left; margin-top: 22px; padding-top: 22px;
  border-top: 1px solid rgba(244, 241, 234, 0.08);
}
.service-card-body ul { margin: 0 0 16px; padding-left: 20px; color: var(--hueso-dim); font-size: 0.92rem; }
.service-card-body li { margin-bottom: 6px; }

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

/* ==== Animaciones representativas por servicio ==== */
.service-anim {
  width: 100%; max-width: 200px; aspect-ratio: 1 / 1;
  border-radius: var(--radius); background: var(--grafito-deep);
  border: 1px solid rgba(244, 241, 234, 0.12);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; margin-bottom: 18px;
}
.service-anim-icon { position: relative; z-index: 2; width: 44px; height: 44px; stroke: var(--ambar); fill: none; }

/* Voz: ondas de llamada expandiéndose */
.service-anim-voz .ring {
  position: absolute; border: 1.5px solid var(--ambar); border-radius: 50%;
  width: 44px; height: 44px; opacity: 0;
  animation: voz-pulse 2.4s ease-out infinite;
}
.service-anim-voz .ring2 { animation-delay: 0.8s; }
.service-anim-voz .ring3 { animation-delay: 1.6s; }
@keyframes voz-pulse {
  0% { width: 44px; height: 44px; opacity: 0.6; }
  100% { width: 130px; height: 130px; opacity: 0; }
}

/* Chatbot: puntos de "escribiendo" */
.service-anim-chat { flex-direction: column; gap: 14px; }
.service-anim-chat .dots { position: absolute; bottom: 30px; display: flex; gap: 5px; z-index: 2; }
.service-anim-chat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ambar); animation: chat-bounce 1.2s ease-in-out infinite; }
.service-anim-chat .dot:nth-child(2) { animation-delay: 0.15s; }
.service-anim-chat .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Citas: check que se dibuja + aviso */
.service-anim-citas .check-path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: check-draw 3s ease-in-out infinite; }
@keyframes check-draw {
  0%, 15% { stroke-dashoffset: 22; }
  40%, 80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 22; }
}
.service-anim-citas .ping {
  position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ambar); z-index: 2;
}
.service-anim-citas .ping::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ambar);
  animation: ping-out 2s ease-out infinite;
}
@keyframes ping-out {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Web: cursor haciendo clic en el botón de reserva */
.service-anim-web .cursor {
  position: absolute; width: 0; height: 0; z-index: 2;
  border-left: 8px solid var(--ambar); border-bottom: 5px solid transparent; border-right: 3px solid transparent;
  transform: rotate(-15deg); animation: cursor-click 2.6s ease-in-out infinite;
}
@keyframes cursor-click {
  0% { top: 62%; left: 60%; opacity: 0; }
  15% { opacity: 1; }
  45%, 55% { top: 52%; left: 48%; transform: rotate(-15deg) scale(0.85); }
  70% { transform: rotate(-15deg) scale(1); }
  90%, 100% { top: 62%; left: 60%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .service-anim-voz .ring { animation: none; opacity: 0; }
  .service-anim-chat .dot { animation: none; opacity: 0.7; }
  .service-anim-citas .check-path { animation: none; stroke-dashoffset: 0; }
  .service-anim-citas .ping::after { animation: none; opacity: 0; }
  .service-anim-web .cursor { animation: none; opacity: 0; }
}

/* Pausar las animaciones de servicio mientras la tarjeta está fuera de pantalla */
.js .service-card:not(.is-visible) .ring,
.js .service-card:not(.is-visible) .dot,
.js .service-card:not(.is-visible) .check-path,
.js .service-card:not(.is-visible) .ping::after,
.js .service-card:not(.is-visible) .cursor {
  animation-play-state: paused;
}

.service-detail-meta {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--acero);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: block;
}
.service-detail h2 { margin-bottom: 10px; }
.service-detail ul { margin: 16px 0; padding-left: 20px; color: var(--hueso-dim); }
.service-detail li { margin-bottom: 8px; }

@media (max-width: 780px) {
  .service-detail { grid-template-columns: 1fr; gap: 18px; }
}

/* ==== Case cards ==== */
.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 32px; }
.case-card {
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.case-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.5); }
.case-card-image { width: 100%; height: 160px; object-fit: cover; display: block; transition: transform 0.35s ease; }
.case-card:hover .case-card-image { transform: scale(1.05); }
.case-card-body { padding: 24px 28px 28px; display: flex; flex-direction: column; flex: 1; }
.case-card-tag {
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--acero); margin-bottom: 12px;
}
.case-card h3 { color: var(--hueso); }
.case-card p { color: var(--hueso-dim); font-size: 0.92rem; }
.case-stat-row { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(244, 241, 234, 0.08); }
.case-stat-row > div { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.case-stat { font-family: var(--font-mono); font-size: 1.25rem; color: var(--ambar); font-weight: 600; }
.case-stat-label { font-size: 0.75rem; color: var(--hueso-dim); text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 640px) { .cases-grid { grid-template-columns: 1fr; } }

/* ==== Contact layout ==== */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; margin-top: 16px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form .field { display: flex; flex-direction: column; }
.contact-form label {
  font-size: 0.85rem; color: var(--hueso-dim); font-family: var(--font-mono);
  margin-bottom: 6px;
}
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; background: var(--grafito-deep); border: 1px solid var(--acero); color: var(--hueso);
  font-family: var(--font-body); font-size: 1rem; padding: 12px 14px; border-radius: 8px;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--ambar); }
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form button { align-self: flex-start; margin-top: 6px; }
.form-status { font-size: 0.85rem; color: var(--hueso-dim); min-height: 1.2em; }

.contact-info {
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius); padding: 32px;
}
.contact-info h3 { margin-bottom: 6px; }
.contact-info a { color: var(--ambar); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }
.contact-info-item { margin-bottom: 22px; }
.contact-info-item:last-child { margin-bottom: 0; }
.contact-info-item p { margin-bottom: 6px; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==== Footer ==== */
.site-footer { background: var(--grafito-deep); border-top: 1px solid rgba(244, 241, 234, 0.08); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding: 44px 0 28px; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { color: var(--hueso-dim); font-size: 0.85rem; margin-top: 10px; margin-bottom: 0; }
.footer-heading {
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--hueso-dim); margin-bottom: 14px;
}
.footer-nav, .footer-contact { display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.footer-nav a, .footer-contact a { color: var(--hueso-dim); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--hueso); }
.footer-bottom {
  border-top: 1px solid rgba(244, 241, 234, 0.08); padding: 18px 0;
  font-size: 0.8rem; color: var(--hueso-dim);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-legal a { color: var(--hueso-dim); text-decoration: none; }
.footer-legal a:hover { color: var(--hueso); }

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 20px; }
}

/* ==== Páginas legales ==== */
.legal-content { max-width: 760px; }
.legal-content h2 { font-size: 1.35rem; margin-top: 40px; }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content h3 { font-size: 1.05rem; margin-top: 26px; }
.legal-content p, .legal-content li { color: var(--hueso-dim); }
.legal-content ul, .legal-content ol { padding-left: 20px; margin: 0 0 16px; }
.legal-content li { margin-bottom: 8px; }
.legal-content a { color: var(--ambar); }
.legal-content strong { color: var(--hueso); }
.legal-content table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.9rem; }
.legal-content th, .legal-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(244, 241, 234, 0.1); color: var(--hueso-dim); }
.legal-content th { color: var(--hueso); font-family: var(--font-head); font-weight: 600; }
.legal-updated { font-family: var(--font-mono); font-size: 0.8rem; color: var(--acero); margin-bottom: 32px; }

/* ==== Reveal animation (progressive enhancement — visible by default without JS) ==== */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

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

/* ==== Asistente de chat ==== */
.molvana-chat-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ambar); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}
.molvana-chat-toggle:hover { transform: translateY(-2px); }
.molvana-chat-toggle svg { width: 26px; height: 26px; stroke: var(--grafito-deep); fill: none; }

.molvana-chat-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 150;
  width: min(360px, calc(100vw - 40px)); height: min(500px, calc(100vh - 140px));
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.12);
  border-radius: var(--radius); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column; overflow: hidden;
}
.molvana-chat-panel[hidden] { display: none; }

.molvana-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(244, 241, 234, 0.1);
}
.molvana-chat-header-title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--hueso); }
.molvana-chat-close {
  background: none; border: none; color: var(--hueso-dim); font-size: 1.4rem;
  line-height: 1; cursor: pointer; padding: 4px;
}
.molvana-chat-close:hover { color: var(--hueso); }

.molvana-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.molvana-chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 0.92rem; line-height: 1.45; word-wrap: break-word;
}
.molvana-chat-msg a { color: inherit; text-decoration: underline; }
.molvana-chat-msg-bot {
  align-self: flex-start; background: var(--grafito); color: var(--hueso);
  border-bottom-left-radius: 4px;
}
.molvana-chat-msg-user {
  align-self: flex-end; background: var(--ambar); color: var(--grafito-deep);
  border-bottom-right-radius: 4px;
}
.molvana-chat-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.molvana-chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--hueso-dim);
  animation: molvana-chat-blink 1.2s infinite ease-in-out;
}
.molvana-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.molvana-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes molvana-chat-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .molvana-chat-typing span { animation: none; opacity: 0.7; }
}

.molvana-chat-form {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid rgba(244, 241, 234, 0.1);
}
.molvana-chat-input {
  flex: 1; background: var(--grafito); border: 1px solid var(--acero); color: var(--hueso);
  font-family: var(--font-body); font-size: 0.9rem; padding: 10px 12px; border-radius: 999px;
}
.molvana-chat-input:focus { outline: 2px solid var(--ambar); }
.molvana-chat-send {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ambar); border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.molvana-chat-send svg { width: 18px; height: 18px; stroke: var(--grafito-deep); fill: none; }

.molvana-chat-footer {
  padding: 10px 16px; border-top: 1px solid rgba(244, 241, 234, 0.1);
  text-align: center;
}
.molvana-chat-footer a { color: var(--ambar); font-size: 0.85rem; text-decoration: none; }
.molvana-chat-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .molvana-chat-toggle { right: 16px; bottom: 16px; }
  .molvana-chat-panel {
    right: 12px; left: 12px; bottom: 80px;
    width: auto; height: min(60vh, 420px);
  }
}
