@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/fira-sans-500.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, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/fira-sans-700.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, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../assets/fonts/fira-sans-800.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, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/open-sans-var.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, U+FEFF, U+FFFD;
}

/* ============================================
   HEMALYS — Medicina Hematológica Integral
   Sistema de diseño derivado del manual de marca
   ============================================ */

:root {
  /* Color — paleta oficial del brandbook (rojo / negro / grises / blanco) */
  --rojo: #e52330;
  --rojo-oscuro: #c81f2d;
  --negro: #1d1d1b;
  --gris-1: #91989c;
  --gris-2: #ededed;
  --gris-3: #f7f7f6;
  --blanco: #ffffff;

  /* Tipografía */
  --font-display: "Fira Sans", sans-serif;
  --font-body: "Open Sans", sans-serif;

  /* Espaciado */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* Layout */
  --max-width: 1180px;
  --radius: 6px;

  /* Movimiento: salida suave, nunca ease-in en interfaz */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sombra-suave: 0 1px 2px rgba(29, 29, 27, 0.04), 0 8px 24px rgba(29, 29, 27, 0.06);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-delay: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--negro);
  background: var(--blanco);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--negro);
}

h1,
h2 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  line-height: 1.08;
}
h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.12;
}
h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 var(--space-2);
  color: #3a3a38;
  text-wrap: pretty;
}

a {
  color: inherit;
}

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

img {
  max-width: 100%;
  display: block;
}

.section {
  padding: clamp(4rem, 9vw, 7.5rem) 0;
}
.section--compact {
  padding: var(--space-5) 0;
}
/* El encabezado fijo no debe tapar el título al saltar a una ancla */
[id] {
  scroll-margin-top: 5.5rem;
}
.section--alt {
  background: var(--gris-3);
}
.section--dark {
  background: var(--negro);
  color: var(--blanco);
}
.section--dark h2,
.section--dark p {
  color: var(--blanco);
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--rojo);
  display: inline-block;
  margin-bottom: var(--space-2);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-4);
}

.section-head p {
  color: var(--gris-1);
}
.section--alt .section-head p,
.section--alt .card p {
  color: #5a5a58;
}

/* ---------- Header ---------- */
.announce-bar {
  background: var(--negro);
  padding: 0.55rem 0;
}
.announce-bar .container {
  display: flex;
  justify-content: center;
}
.announce-bar span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blanco);
  text-align: center;
  letter-spacing: 0.01em;
}
@media (max-width: 560px) {
  .announce-bar span {
    font-size: 0.75rem;
    padding: 0 var(--space-3);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gris-2);
  transition: box-shadow 0.25s var(--ease-out);
}
.site-header.is-scrolled {
  box-shadow: 0 6px 20px rgba(29, 29, 27, 0.07);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo-lockup {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a:not(.btn) {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--negro);
  padding: 0.4rem 0;
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--rojo);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn):focus-visible::after {
  transform: scaleX(1);
}

.nav-appointment {
  display: flex;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--negro);
  margin: 5px 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.16s var(--ease-out),
    background 0.16s var(--ease-out),
    border-color 0.16s var(--ease-out),
    color 0.16s var(--ease-out);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--rojo);
  color: var(--blanco);
  box-shadow: 0 1px 2px rgba(29, 29, 27, 0.12);
}
.btn--primary:hover {
  background: var(--rojo-oscuro);
}

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

.btn--on-dark {
  border-color: var(--blanco);
  color: var(--blanco);
}
.btn--on-dark:hover {
  border-color: var(--rojo);
  color: var(--rojo);
}

.btn--sm {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
}
.btn svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-6) 0 var(--space-5);
  background: linear-gradient(180deg, #ffffff 0%, var(--gris-3) 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}

.hero-copy .eyebrow {
  margin-bottom: var(--space-3);
}

.hero-lead {
  font-size: 1.08rem;
  color: #3a3a38;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.hero-note {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--gris-1);
}

.hero-note a {
  color: var(--negro);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 0.35rem;
  white-space: nowrap;
}
.hero-note a:hover {
  color: var(--rojo);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual .drop-mark {
  width: 78%;
  max-width: 340px;
  height: auto;
  overflow: visible;
}

/* Isotipo: las dos mitades se encuentran y luego aparece el trazo blanco. Una sola vez. */
.drop-mark .mark-a {
  animation: markA 0.95s var(--ease-out) 0.15s backwards;
}
.drop-mark .mark-b {
  animation: markB 0.95s var(--ease-out) 0.15s backwards;
}
.drop-mark .mark-c {
  animation: markC 1.2s cubic-bezier(0.45, 0, 0.25, 1) 0.5s backwards;
}
@keyframes markA {
  from {
    opacity: 0;
    transform: translate(16px, -20px);
  }
}
@keyframes markB {
  from {
    opacity: 0;
    transform: translate(-16px, 20px);
  }
}
/* El trazo blanco se dibuja de arriba hacia abajo dentro de la gota */
@keyframes markC {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(
    circle,
    rgba(229, 35, 48, 0.06) 0%,
    rgba(229, 35, 48, 0) 70%
  );
  z-index: -1;
}


/* ---------- Personalidad / tono strip ---------- */
.traits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.trait {
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.trait h3 {
  color: var(--blanco);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.trait p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  margin: 0;
}
.trait .trait-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  color: var(--rojo);
}

.trait .trait-mark svg {
  width: 1.55rem;
  height: 1.55rem;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.trait:nth-child(1) .trait-mark svg {
  width: 1.45rem;
  height: 1.45rem;
}

.trait:nth-child(2) .trait-mark svg,
.trait:nth-child(3) .trait-mark svg,
.trait:nth-child(4) .trait-mark svg {
  width: 1.55rem;
  height: 1.55rem;
}

/* ---------- Sobre la doctora ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-5);
  align-items: center;
}

.about-lead {
  font-size: 1.05rem;
}

.about-actions {
  margin-top: var(--space-3);
}

.about-photo {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--gris-2), var(--gris-3));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-photo.placeholder {
  border: 1.5px dashed var(--gris-1);
}
.about-photo.placeholder .ph-label {
  font-size: 0.95rem;
  color: var(--rojo);
  text-align: center;
  padding: var(--space-3);
  font-weight: 700;
  line-height: 1.5;
}
.ph-label__sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--gris-1);
  font-weight: 500;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.gallery-photo {
  aspect-ratio: 4/3;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
/* Orientación horizontal en pantallas bajas (móvil apaisado): compactar alto de fotos */
@media (max-height: 480px) and (orientation: landscape) {
  .gallery-photo {
    aspect-ratio: 16/9;
  }
  .about-photo {
    aspect-ratio: 16/10;
  }
}

.credentials {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.credentials li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.95rem;
  color: #3a3a38;
}
.credentials li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rojo);
  margin-top: 0.5rem;
  flex-shrink: 0;
}

/* ---------- Servicios ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.card {
  background: var(--blanco);
  border: 1px solid var(--gris-2);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3) var(--space-3);
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rojo);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
@media (hover: hover) {
  .card:hover::before {
    transform: scaleX(1);
  }
  .card:hover {
    border-color: var(--gris-1);
    box-shadow: var(--sombra-suave);
    transform: translateY(-2px);
  }
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
}
.card p {
  font-size: 0.92rem;
  margin: 0;
  color: #5a5a58;
}

/* ---------- Modalidades ---------- */
.modalidades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.modalidad {
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--gris-2);
}

.modalidad h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.modalidad .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rojo);
  background: rgba(229, 35, 48, 0.08);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
}

.faq-item {
  border-bottom: 1px solid var(--gris-2);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: var(--space-3) 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--negro);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.faq-question .icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  position: relative;
  transition: transform 0.3s var(--ease-out);
}
.faq-item.open .faq-question .icon {
  transform: rotate(180deg);
}
.faq-question .icon::before,
.faq-question .icon::after {
  content: "";
  position: absolute;
  background: var(--rojo);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out);
}
.faq-question .icon::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.faq-question .icon::after {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.faq-item.open .faq-question .icon::after {
  transform: translateX(-50%) scaleY(0);
}

/* La altura la fija js/script.js según el contenido */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
}
.faq-answer p {
  padding-bottom: var(--space-3);
  margin: 0;
  color: #5a5a58;
}
/* ---------- Ubicación / contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: stretch;
}

.contact-grid > * {
  min-width: 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}

.contact-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.contact-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  font-size: 0.98rem;
}

.contact-list strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gris-1);
  margin-bottom: 0.15rem;
}

.contact-actions {
  margin-top: auto;
  padding-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.map-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.map-frame__ratio {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gris-2);
  flex: 1;
  min-height: 280px;
}
.map-frame__ratio iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.map-load {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: var(--space-3);
  border: 0;
  background: var(--gris-2);
  font: inherit;
  color: var(--negro);
  cursor: pointer;
  text-align: center;
}
.map-load:hover,
.map-load:focus-visible {
  background: #e2e2e2;
}
.map-load__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.map-load__note {
  font-size: 0.8rem;
  color: #5c6266;
}
.map-directions {
  margin-top: var(--space-4);
  align-self: flex-start;
}

/* ---------- CTA final ---------- */
.cta-final {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--negro);
  color: rgba(255, 255, 255, 0.7);
  /* espacio extra abajo para que el botón flotante no tape el texto final */
  padding: var(--space-4) 0 5.5rem;
  font-size: 0.85rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: var(--space-3);
}

.footer-logo {
  height: 24px;
  opacity: 0.95;
}

.footer-links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
}
.footer-links a:hover {
  color: var(--rojo);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- WhatsApp floating button ---------- */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  background: var(--rojo);
  color: var(--blanco);
  height: 52px;
  padding: 0 1.2rem 0 1rem;
  gap: 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(29, 29, 27, 0.16), 0 8px 20px rgba(29, 29, 27, 0.18);
  text-decoration: none;
  transition: transform 0.16s var(--ease-out);
  animation: rise 0.6s var(--ease-out) 1.2s backwards;
}
.wa-float:hover {
  transform: translateY(-2px);
}
.wa-float:active {
  transform: scale(0.97);
}
.wa-float svg {
  width: 26px;
  height: 26px;
}
body.cookie-visible .wa-float {
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--negro);
  color: rgba(255, 255, 255, 0.9);
  padding: var(--space-3);
  transform: translateY(110%);
  transition: transform 0.3s ease;
}
.cookie-banner.visible {
  transform: translateY(0);
}
.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cookie-inner p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
}
.cookie-link {
  color: #f0505b;
  font-weight: 700;
}
.cookie-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ---------- Utilities ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* Portada: entrada escalonada al cargar, sin esperar al scroll */
.hero-copy.reveal,
.hero-visual.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
.hero-copy > * {
  animation: rise 0.6s var(--ease-out) backwards;
}
.hero-copy > :nth-child(2) {
  animation-delay: 70ms;
}
.hero-copy > :nth-child(3) {
  animation-delay: 140ms;
}
.hero-copy > :nth-child(4) {
  animation-delay: 210ms;
}
.hero-copy > :nth-child(n + 5) {
  animation-delay: 280ms;
}

/* Servicios: las tarjetas entran una tras otra */
.services-grid.reveal {
  opacity: 1;
  transform: none;
}
.services-grid:not(.is-visible) .card {
  opacity: 0;
}
.services-grid.is-visible .card {
  animation: rise 0.5s var(--ease-out) backwards;
}
.services-grid.is-visible .card:nth-child(2) {
  animation-delay: 60ms;
}
.services-grid.is-visible .card:nth-child(3) {
  animation-delay: 120ms;
}
.services-grid.is-visible .card:nth-child(4) {
  animation-delay: 180ms;
}
.services-grid.is-visible .card:nth-child(5) {
  animation-delay: 240ms;
}
.services-grid.is-visible .card:nth-child(6) {
  animation-delay: 300ms;
}

/* Foto de la doctora: revelado con máscara y leve acercamiento */
.about-photo.reveal {
  opacity: 1;
  transform: none;
  clip-path: inset(10% 0 0 0 round var(--radius));
  transition: clip-path 0.9s var(--ease-out);
}
.about-photo.reveal.is-visible {
  clip-path: inset(0 0 0 0 round var(--radius));
}
.about-photo.reveal img {
  transform: scale(1.06);
  transition: transform 1.1s var(--ease-out);
}
.about-photo.reveal.is-visible img {
  transform: scale(1);
}

/* Títulos de sección: línea roja corta que se dibuja al entrar */
.section-head .eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  margin-right: 0.7rem;
  vertical-align: middle;
  background: var(--rojo);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out) 0.15s;
}
.section-head.is-visible .eyebrow::before {
  transform: scaleX(1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    max-width: 220px;
    margin: 0 auto;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo {
    max-width: 320px;
    margin: 0 auto;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .modalidades {
    grid-template-columns: 1fr;
  }
  .traits {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--blanco);
    flex-direction: column;
    padding: var(--space-3);
    border-bottom: 1px solid var(--gris-2);
    transform: translateY(-110%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.25s ease,
      opacity 0.2s ease;
    gap: var(--space-2);
  }
  .nav-links.open {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links .nav-appointment {
    margin-top: var(--space-1);
  }
  .nav-links .nav-appointment .btn {
    width: 100%;
    justify-content: center;
  }
  .nav-toggle {
    display: block;
  }
  .section--compact {
    padding: var(--space-4) 0;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .contact-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .map-frame__ratio {
    aspect-ratio: 4 / 3;
  }
  .map-directions {
    width: 100%;
    justify-content: center;
  }
  .cta-actions {
    flex-direction: column;
  }
  .cta-final .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-actions .btn,
  .contact-actions .btn,
  .cta-final .btn {
    min-height: 52px;
    font-size: 1rem;
  }
  .hero {
    padding-top: var(--space-4);
  }
  .cookie-banner {
    padding: 0.9rem var(--space-3);
  }
  .cookie-inner {
    gap: 0.75rem;
  }
  .cookie-inner p {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .cookie-extra {
    display: none;
  }
  .cookie-actions {
    width: 100%;
  }
  .cookie-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .traits {
    grid-template-columns: 1fr;
  }
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-links {
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }
}
