/* ---------- Identidad (la del panel) ---------- */
:root {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --border: #e0e4e6;
  --text: #14181b;
  --text-muted: #878787;     /* sólo decorativo: 3,4:1 sobre --bg */

  --marca-1: #5fa3d1;
  --marca-2: #64b0a8;
  --degrade: linear-gradient(120deg, #5fa3d1, #64b0a8);
  --accent-ink: #2f7ba4;
  --r-lg: 18px;

  /* Agregados para llegar a 4,5:1 */
  --texto-suave: #555c61;    /* 6,2:1 sobre --bg */
  --tinta-acento: #28698d;   /* 5,5:1 sobre --bg */
  --negro-marca: #14181b;

  --tinte: #e6eff0;          /* fondo de sección alterno */
  --pie: #14181b;
  --pie-texto: #c4cacd;      /* 10:1 sobre el pie */
  --pie-fuerte: #eef1f2;
  --marca-ejemplo: #b4570f;  /* sólo para señalar contenido de ejemplo */

  --r-pildora: 999px;
  --alto-barra: 68px;
  --ancho: 1160px;
  --margen: clamp(20px, 5vw, 56px);

  --curva: cubic-bezier(.2, .7, .2, 1);
  --rapida: 160ms;
  --media: 240ms;
  --entrada: 560ms;

  --fuente: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1214;
    --surface: #161b1e;
    --border: #273035;
    --text: #e7ecee;
    --text-muted: #7c8589;
    --texto-suave: #a7b0b5;
    --tinta-acento: #7dbbe2;
    --accent-ink: #7dbbe2;
    --tinte: #131a1c;
    --pie: #1e252a;          /* un escalón arriba del fondo */
    --pie-texto: #b9c1c5;
    --marca-ejemplo: #f0a15e;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--alto-barra) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--fuente);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, address { margin: 0; }
address { font-style: normal; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--tinta-acento); text-underline-offset: 3px; }
a:hover { color: var(--text); }
::selection { background: color-mix(in srgb, var(--marca-1) 35%, transparent); }
:focus-visible { outline: 3px solid var(--tinta-acento); outline-offset: 3px; }

.icono {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.saltar {
  position: absolute; left: 12px; top: 12px; z-index: 100;
  padding: 12px 16px; border-radius: 12px;
  background: var(--negro-marca); color: #fff; font-weight: 700; text-decoration: none;
  transform: translateY(-200%);
}
.saltar:focus { transform: none; }

.rotulo {
  font-size: .8125rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1.3; color: var(--tinta-acento);
}
.titulo-seccion { font-size: clamp(2rem, 5.5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; margin-top: 10px; }

/* ---------- Marca de contenido de ejemplo ---------- */
.ejemplo {
  position: relative;
  outline: 2px dashed var(--marca-ejemplo); outline-offset: 6px;
  border-radius: 6px;
}
.ejemplo::before {
  content: "Texto de ejemplo";
  position: absolute; top: -18px; right: 0; z-index: 1;
  padding: 2px 8px; border-radius: 6px;
  background: var(--marca-ejemplo); color: #fff;
  font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5;
}
@media (prefers-color-scheme: dark) { .ejemplo::before { color: #14181b; } }
.foto__marca {
  position: absolute; left: 12px; top: 12px;
  padding: 4px 10px; border-radius: 8px;
  background: var(--marca-ejemplo); color: #fff;
  font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
@media (prefers-color-scheme: dark) { .foto__marca { color: #14181b; } }
.nota-maqueta {
  max-width: var(--ancho); margin: 0 auto; padding: 0 var(--margen) 40px;
  font-size: .9375rem; color: var(--texto-suave);
}
.nota-maqueta strong { color: var(--marca-ejemplo); }

/* ---------- Botones ---------- */
.boton {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: 0 1.3rem;
  border: 0; border-radius: var(--r-pildora);
  font: 700 1rem/1.1 var(--fuente); text-decoration: none; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform var(--rapida) var(--curva);
}
.boton::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; background: currentColor;
  opacity: 0; transition: opacity var(--rapida) var(--curva);
}
.boton:hover { transform: translateY(-2px); }
.boton:hover::after { opacity: .08; }
.boton:active { transform: scale(.96); }
.boton:active::after { opacity: .16; }
.boton .icono { width: 19px; height: 19px; }
.boton--marca  { background: var(--degrade); color: var(--negro-marca); }
.boton--marca:hover { color: var(--negro-marca); }
.boton--borde  { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.boton--borde:hover { color: var(--text); }
.boton--chico  { min-height: 44px; padding: 0 1rem; font-size: .9375rem; }
.boton--grande { min-height: 56px; padding: 0 1.6rem; font-size: 1.0625rem; }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Barra de navegación ---------- */
.barra {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--alto-barra);
}
.barra::before {
  content: ""; position: absolute; inset: 0;
  background: var(--bg); box-shadow: 0 1px 0 var(--border);
  transition: opacity var(--media) var(--curva);
}
.js-barra .barra:not(.solida)::before { opacity: 0; }
.barra__interior {
  position: relative; height: 100%;
  max-width: var(--ancho); margin: 0 auto; padding: 0 var(--margen);
  display: flex; align-items: center; gap: 12px;
}
.barra__marca {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto;
  color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; font-size: 1.0625rem;
}
.barra__marca:hover { color: var(--text); }

.navegacion { display: none; }
.navegacion__lista { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.navegacion__enlace {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .9375rem;
}
.navegacion__enlace::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 2px;
  background: var(--degrade); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--media) var(--curva);
}
.navegacion__enlace:hover { color: var(--text); }
.navegacion__enlace:hover::after, .navegacion__enlace.actual::after { transform: scaleX(1); }

.barra__whatsapp span { display: none; }
.barra__whatsapp { width: 44px; padding: 0; }

/* Menú hamburguesa */
.menu { position: static; }
.menu__boton {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  list-style: none; cursor: pointer; color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--rapida) var(--curva);
}
.menu__boton::-webkit-details-marker { display: none; }
.menu__boton:active { transform: scale(.92); }
.menu__lineas { position: relative; width: 22px; height: 16px; }
.menu__lineas span {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform var(--media) var(--curva), opacity var(--rapida) var(--curva);
}
.menu__lineas span:nth-child(1) { top: 0; }
.menu__lineas span:nth-child(2) { top: 7px; }
.menu__lineas span:nth-child(3) { top: 14px; }
.menu[open] .menu__lineas span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu[open] .menu__lineas span:nth-child(2) { opacity: 0; }
.menu[open] .menu__lineas span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu__panel {
  position: absolute; top: calc(var(--alto-barra) - 4px); left: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 24px 48px -20px rgb(20 24 27 / .35);
}
.menu__panel a:not(.boton) {
  display: flex; align-items: center; min-height: 52px; padding: 0 14px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem;
}
.menu__panel a:not(.boton):active { background: var(--tinte); }
.menu__panel .boton { margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .menu[open] .menu__panel { animation: panel var(--media) var(--curva); }
}
@keyframes panel { from { opacity: 0; transform: translate3d(0, -8px, 0) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Portada ---------- */
.portada {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
}
.portada__degrade {
  position: absolute; z-index: -1;
  width: 120vmax; height: 120vmax; right: -50vmax; top: -30vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--marca-2) 40%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 60%, color-mix(in srgb, var(--marca-1) 38%, transparent), transparent 70%);
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .portada__degrade { animation: deriva 22s ease-in-out infinite alternate; }
  .portada.fuera .portada__degrade { animation-play-state: paused; }
}
@keyframes deriva { from { transform: translate3d(0,0,0) rotate(0); } to { transform: translate3d(-12vmax, 10vmax, 0) rotate(25deg); } }

.portada__interior {
  width: 100%; max-width: var(--ancho); margin: 0 auto;
  padding: calc(var(--alto-barra) + 24px) var(--margen) 48px;
  display: grid; gap: 36px; align-items: center;
}
.portada__texto { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.portada__nombre {
  font-size: clamp(2.75rem, min(11vw, 11vh), 5.5rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: .98;
}
.portada__credencial { font-size: 1.0625rem; font-weight: 700; color: var(--texto-suave); }
.portada__frase { font-size: clamp(1.1875rem, 2.6vw, 1.4375rem); line-height: 1.45; max-width: 34ch; }
.portada .ejemplo { margin-top: 14px; }
.portada .boton { margin-top: 10px; }

.foto { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--border); }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto--portada { height: min(46vh, 520px); }
.foto--retrato { aspect-ratio: 4 / 5; }

@media (prefers-reduced-motion: no-preference) {
  .entrada { animation: entrar var(--entrada) var(--curva) backwards; animation-delay: calc(var(--orden, 0) * 70ms); }
  .entrada--foto { animation-name: entrar-foto; animation-duration: 600ms; }
}
@keyframes entrar { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes entrar-foto { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Secciones ---------- */
.seccion { max-width: var(--ancho); margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--margen); }
.seccion--tinte { max-width: none; background: var(--tinte); }
.seccion__interior { max-width: var(--ancho); margin: 0 auto; }
.seccion__encabezado { margin-bottom: 32px; }

/* Sobre mí */
.sobre { display: grid; gap: 36px; align-items: center; }
.sobre__texto { display: flex; flex-direction: column; gap: 14px; }
.sobre__credencial { font-weight: 700; color: var(--texto-suave); }
.sobre .ejemplo { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; font-size: 1.125rem; line-height: 1.65; max-width: 58ch; }

/* Servicios */
.servicios { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 16px; }
.servicio {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--media) var(--curva);
}
.servicio:hover { transform: translateY(-3px); }
.servicio__icono {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 6px;
  background: color-mix(in srgb, var(--marca-1) 16%, var(--surface)); color: var(--tinta-acento);
}
.servicio__icono .icono { width: 24px; height: 24px; }
.servicio__titulo { font-size: 1.1875rem; font-weight: 800; }
.servicio p { color: var(--texto-suave); }

/* Obras sociales */
.obras { display: flex; flex-direction: column; gap: 20px; }
.obras__lista {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--border);
}
.obras__lista li {
  display: flex; align-items: center; min-height: 88px; padding: 16px 0;
  font-size: clamp(1.375rem, 4.4vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  border-bottom: 2px solid var(--border);
}
.obras__lista li:nth-child(even) { padding-left: 20px; border-left: 2px solid var(--border); }
@media (min-width: 720px) {
  .obras__lista { grid-template-columns: repeat(4, auto); justify-content: start; border-top: 0; }
  .obras__lista li { border-bottom: 0; padding: 8px clamp(20px, 3vw, 40px); border-left: 2px solid var(--border); }
  .obras__lista li:first-child { padding-left: 0; border-left: 0; }
}

/* Cómo llegar */
.seccion--llegar { padding-top: 0; }
.llegar { display: grid; gap: 32px; align-items: stretch; }
.llegar__texto { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.llegar__direccion { display: flex; flex-direction: column; font-size: 1.25rem; color: var(--texto-suave); }
.llegar__direccion strong { font-size: clamp(1.75rem, 4.5vw, 2.5rem); color: var(--text); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.llegar__telefono { font-size: 1.0625rem; }
.llegar__telefono a { font-weight: 800; }
.llegar .acciones { margin-top: 8px; }
.mapa { min-height: 320px; border-radius: var(--r-lg); overflow: hidden; background: var(--border); border: 1px solid var(--border); }
.mapa iframe { display: block; width: 100%; height: 100%; min-height: 320px; border: 0; }

/* ---------- Pie (sin cambios) ---------- */
.pie {
  position: relative;
  background: var(--pie); color: var(--pie-texto);
  font-size: 1rem;
}
.pie::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--degrade);
}
.pie__interior {
  max-width: var(--ancho); margin: 0 auto;
  padding: 56px var(--margen) calc(48px + env(safe-area-inset-bottom));
  display: grid; gap: 32px;
}
.pie__marca { display: flex; align-items: flex-start; gap: 14px; }
.pie__marca img { flex: none; }
.pie__nombre { color: var(--pie-fuerte); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.pie__datos { display: grid; gap: 16px; line-height: 1.7; }
.pie a { color: var(--pie-fuerte); display: inline-block; padding: 4px 0; }
.pie a:hover { color: #fff; }
.pie :focus-visible { outline-color: var(--marca-1); }

/* ---------- Aparición al bajar (sólo si el JS agregó .js-aparecer) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js-aparecer .aparecer:not(.visible) > * { opacity: 0; }
  .js-aparecer .aparecer.visible > * {
    animation: entrar 600ms var(--curva) backwards;
    animation-delay: calc(var(--i, 0) * 80ms);
  }
  .js-aparecer .servicios.visible > * { animation-delay: calc(var(--i, 0) * 60ms); }
}

/* ---------- Movimiento reducido: todo quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Pantallas anchas ---------- */
@media (min-width: 640px) {
  .servicios { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .pie__interior { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .pie__datos { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .navegacion { display: block; }
  .menu { display: none; }
  .barra__whatsapp { width: auto; padding: 0 1rem; }
  .barra__whatsapp span { display: inline; }
  .portada__interior { grid-template-columns: 1.1fr .9fr; gap: 56px; padding-bottom: 64px; }
  .foto--portada { height: min(72vh, 640px); }
  .sobre { grid-template-columns: 5fr 7fr; gap: 72px; }
  .servicios { grid-template-columns: repeat(3, 1fr); }
  .llegar { grid-template-columns: 5fr 7fr; gap: 48px; }
  .mapa, .mapa iframe { min-height: 420px; }
}

@media print {
  .barra, .portada__degrade, .mapa { display: none; }
  .portada { min-height: 0; }
  .aparecer > * { opacity: 1 !important; animation: none !important; }
}
