/* Sitio de la Dra. Paula Delgado Márquez.
   Sistema visual: fondos claros y uno oscuro, tipografía del sistema, color de marca con moderación.
   Sin degradados decorativos, sin sombras genéricas, sin animación continua. */

:root {
  --ink: #1d1a21;
  --muted: #5d5764;
  --paper: #ffffff;
  --paper-alt: #f6f4f1;
  --night: #16121a;
  --night-ink: #f4f1f6;
  --night-muted: #b8afbf;
  --purple: #6c3784;
  --purple-hover: #552a69;
  --purple-on-dark: #d4b4e6;
  --accent: #f2a33a;
  --line: rgba(29, 26, 33, .12);
  --line-dark: rgba(244, 241, 246, .16);
  --focus: #6c3784;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --max: 1180px;
  --text: 680px;
  --nav-h: 52px;
  --section: clamp(80px, 10vw, 152px);
  --radius: 18px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --h1: clamp(2.5rem, 1.45rem + 4.3vw, 4.5rem);
  --h2: clamp(2rem, 1.35rem + 2.7vw, 3.5rem);
  --h3: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --lead: clamp(1.125rem, 1.02rem + .45vw, 1.375rem);
  --eyebrow: clamp(1rem, .94rem + .3vw, 1.1875rem);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.5 var(--font); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--purple-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: #e9dcf0; color: var(--ink); }
.shell { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 200; padding: 10px 14px; border-radius: 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.skip-link:focus { top: 12px; }

.eyebrow { margin-bottom: 12px; color: var(--purple); font-size: var(--eyebrow); font-weight: 600; letter-spacing: -.005em; }
.lead { color: var(--muted); font-size: var(--lead); line-height: 1.42; }
.fineprint { color: var(--muted); font-size: .875rem; line-height: 1.45; }

/* Botones y enlaces */
.button, .nav-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--purple); border-radius: 12px; background: var(--purple); color: #fff; font: 600 1rem/1.2 var(--font); text-decoration: none; text-align: center; transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease); }
.button:hover, .nav-cta:hover { background: var(--purple-hover); border-color: var(--purple-hover); color: #fff; }
.button:active, .nav-cta:active { transform: scale(.98); }
.button-quiet, .button.secondary { background: transparent; color: var(--purple); }
.button-quiet:hover, .button.secondary:hover { background: rgba(108, 55, 132, .08); color: var(--purple-hover); }
.link-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }
.link-more::after { content: ""; width: .42em; height: .42em; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ease); }
.link-more:hover { text-decoration: underline; }
.link-more:hover::after { transform: translateX(3px) rotate(45deg); }
.link-out::after { content: "↗"; width: auto; height: auto; border: 0; transform: none; font-weight: 500; }
.link-out:hover::after { transform: translate(2px, -2px); }
.link-down::after { transform: rotate(135deg); margin-top: -.2em; }
.link-down:hover::after { transform: translateY(2px) rotate(135deg); }

/* Encabezado */
/* El desenfoque va en un pseudo-elemento: si estuviera en el encabezado, el menú fijo quedaría contenido en él. */
.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid transparent; transition: border-color .3s var(--ease); }
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); transition: background-color .3s var(--ease); }
.site-header.is-scrolled, .site-header.menu-open { border-bottom-color: var(--line); }
.site-header.is-scrolled::before { background: rgba(255, 255, 255, .92); }
.site-header.menu-open::before { background: var(--paper); }
.nav { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-logo { flex: none; width: 34px; height: 34px; }
.brand-name { overflow: hidden; font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: .875rem; text-decoration: none; opacity: .82; transition: opacity .3s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--ink); }
.nav-links .nav-call { display: none; }
.nav-cta { flex: none; min-height: 34px; padding: 6px 14px; border-radius: 10px; font-size: .875rem; }
.menu-toggle { display: none; position: relative; flex: none; width: 44px; height: 44px; margin-right: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: 10px; }
.menu-toggle span { position: absolute; right: 2px; width: 18px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform .35s var(--ease), top .35s var(--ease); }
.menu-toggle span:first-child { top: 18px; }
.menu-toggle span:last-child { top: 25px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 21.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 21.5px; transform: rotate(-45deg); }

@media (max-width: 999px) {
  .nav { gap: 12px; }
  .menu-toggle { display: block; }
  .nav-cta { margin-left: auto; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px var(--gutter) 28px; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .32s var(--ease), transform .32s var(--ease), visibility 0s linear .32s; }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; transition: opacity .32s var(--ease), transform .32s var(--ease), visibility 0s; }
  .nav-links a { padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1.375rem; font-weight: 600; opacity: 1; }
  .nav-links .nav-call { display: flex; justify-content: center; margin-top: 20px; padding: 12px 20px; border: 0; border-radius: 12px; background: var(--purple); color: #fff; font-size: 1.0625rem; }
  .nav-links .nav-call:hover { color: #fff; background: var(--purple-hover); }
}
@media (max-width: 559px) {
  .nav-cta { display: none; }
  .menu-toggle { margin-left: auto; }
}

/* Movimiento: solo se activa cuando el script confirma que se permite (clase en <html>) */
.motion .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--delay, 0s); }
.motion .reveal.is-visible { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: none; } }

/* Portada · héroe */
.hero { padding: clamp(40px, 6vw, 88px) 0 clamp(64px, 8vw, 120px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.hero-copy h1 { font-size: var(--h1); line-height: 1.04; letter-spacing: -.03em; }
.hero-copy .lead { max-width: 34em; margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 32px; }
.hero-meta { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9375rem; }
.hero-meta strong { color: var(--ink); font-weight: 600; }
.hero-figure { margin: 0; }
.hero-figure-frame { overflow: hidden; border-radius: 28px; background: var(--paper-alt); aspect-ratio: 540 / 530; }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }
.hero-figure figcaption { margin-top: 12px; color: var(--muted); font-size: .875rem; }
.motion .hero-copy > * { animation: rise .8s var(--ease-out) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: .08s; }
.motion .hero-copy > :nth-child(3) { animation-delay: .16s; }
.motion .hero-copy > :nth-child(4) { animation-delay: .24s; }
.motion .hero-copy > :nth-child(5) { animation-delay: .32s; }
.motion .hero-figure-frame { animation: settle .9s var(--ease-out) .1s both; }
.hero-figure img { transform: translateY(var(--parallax, 0px)) scale(1.08); will-change: transform; }

@media (max-width: 859px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-copy { display: contents; }
  .hero-copy .eyebrow { order: 1; }
  .hero-copy h1 { order: 2; }
  .hero-figure { order: 3; width: 100%; max-width: 620px; margin-top: 28px; }
  .hero-figure-frame { aspect-ratio: 4 / 3; border-radius: 22px; }
  .hero-figure img { object-position: 50% 18%; }
  .hero-copy .lead { order: 4; margin-top: 28px; }
  .hero-actions { order: 5; }
  .hero-meta { order: 6; }
}

/* Portada · consultorio (escena ligada al desplazamiento) */
.clinic { position: relative; background: var(--paper); }
.clinic-stage { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.clinic-media { position: absolute; inset: 0; margin: 0; overflow: hidden; background: var(--night);
  clip-path: inset(calc((1 - var(--p, 1)) * 7%) calc((1 - var(--p, 1)) * 9%) round calc((1 - var(--p, 1)) * 28px)); }
.clinic-media img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 62%; transform: scale(calc(1 + (1 - var(--p, 1)) * .08)); transform-origin: 50% 60%; }
.clinic-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 10, 17, .78) 0%, rgba(14, 10, 17, .45) 34%, rgba(14, 10, 17, 0) 62%); }
.clinic-copy { position: absolute; left: 0; right: 0; bottom: clamp(40px, 8vh, 88px); color: #fff; opacity: var(--copy, 1); transform: translateY(calc((1 - var(--copy, 1)) * 24px)); }
.clinic-copy > * { max-width: 620px; }
.clinic-copy .eyebrow { color: #f1d6ff; }
.clinic-copy h2 { font-size: var(--h2); line-height: 1.06; letter-spacing: -.025em; }
.clinic-copy p { margin-top: 16px; color: rgba(255, 255, 255, .88); font-size: var(--lead); line-height: 1.42; }
.clinic-copy .link-more { margin-top: 12px; color: #fff; }
.motion-scene .clinic { height: 165svh; }
.motion-scene .clinic-stage { position: sticky; top: 0; }

/* Secciones genéricas */
.section-pad { padding: var(--section) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { font-size: var(--h2); line-height: 1.07; letter-spacing: -.025em; }
.section-head .lead { margin-top: 20px; }
.alt { background: var(--paper-alt); }

/* Portada · atención (carrusel accesible) */
.rail { position: relative; }
.rail-track { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(264px, 26vw, 330px); gap: 16px; margin: 0; padding: 4px max(var(--gutter), calc((100% - var(--max)) / 2)) 8px; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2)); scrollbar-width: none; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > li { scroll-snap-align: start; display: flex; }
.service { display: flex; flex-direction: column; width: 100%; min-height: 340px; padding: 28px 28px 20px; border-radius: var(--radius); background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .45s var(--ease); }
.service:hover { color: var(--ink); transform: scale(1.015); }
.service-stage { color: var(--purple); font-size: .9375rem; font-weight: 600; }
.service h3 { margin-top: 14px; font-size: var(--h3); line-height: 1.18; letter-spacing: -.015em; }
.service p { margin-top: 12px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.service .link-more { margin-top: auto; padding-top: 16px; color: var(--purple); font-size: 1rem; }
.service:hover .link-more { text-decoration: underline; }
.rail-controls { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.rail-controls[hidden] { display: none; }
.rail-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(29, 26, 33, .08); color: var(--ink); cursor: pointer; transition: background-color .3s var(--ease), opacity .3s var(--ease); }
.rail-btn:hover { background: rgba(29, 26, 33, .14); }
.rail-btn:disabled { opacity: .35; cursor: default; }
.rail-btn::before { content: ""; width: 9px; height: 9px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateX(-2px) rotate(45deg); }
.rail-prev::before { transform: translateX(2px) rotate(-135deg); }
.alt .service { background: var(--paper); }

/* Portada · perfil (sección oscura) */
.profile { background: var(--night); color: var(--night-ink); }
.profile a { color: var(--purple-on-dark); }
.profile a:hover { color: #fff; }
.profile :focus-visible { outline-color: var(--accent); }
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; max-width: 1000px; }
.profile-photo { width: clamp(160px, 20vw, 240px); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.profile-head .eyebrow { color: var(--purple-on-dark); }
.profile-head h2 { font-size: var(--h2); line-height: 1.07; letter-spacing: -.025em; }
.profile-head p:last-child { margin-top: 20px; color: var(--night-muted); font-size: var(--lead); line-height: 1.45; max-width: 36em; }
.credentials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(48px, 7vw, 96px) 0 0; border-top: 1px solid var(--line-dark); }
.credentials > div { padding: 28px 28px 8px 0; }
.credentials > div + div { padding-left: 28px; border-left: 1px solid var(--line-dark); }
.credentials dt { color: var(--night-muted); font-size: .9375rem; }
.credentials .num { margin: 8px 0 0; font-family: var(--display); font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.credentials dd { margin: 6px 0 0; color: var(--night-ink); font-size: 1rem; line-height: 1.45; }
.profile-links { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-top: 40px; }
.motion .credentials > div:nth-child(2) { --delay: .1s; }
.motion .credentials > div:nth-child(3) { --delay: .2s; }
@media (max-width: 759px) {
  .profile-head { grid-template-columns: 1fr; }
  .credentials { grid-template-columns: 1fr; }
  .credentials > div, .credentials > div + div { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line-dark); }
}

/* Portada · orientación en Instagram */
.clips { display: grid; grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: center; gap: clamp(16px, 3vw, 40px); margin: 0; padding: 0; list-style: none; }
.clip { margin: 0; }
.clip img { width: 100%; height: auto; aspect-ratio: 640 / 1090; object-fit: contain; border-radius: var(--radius); background: var(--paper-alt); }
.clip figcaption { margin-top: 14px; }
.clip figcaption strong { display: block; font-size: 1.0625rem; font-weight: 600; }
.clip figcaption span { color: var(--muted); font-size: .9375rem; }
.motion .clips > li:nth-child(2) .reveal { --delay: .1s; }
.motion .clips > li:nth-child(3) .reveal { --delay: .2s; }
.clips-foot { margin-top: 32px; text-align: center; }
@media (max-width: 759px) {
  .clips { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: min(72%, 280px); justify-content: start; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 0 var(--gutter) 4px; margin-inline: calc(-1 * var(--gutter)); scrollbar-width: none; }
  .clips::-webkit-scrollbar { display: none; }
  .clips > li { scroll-snap-align: start; }
}

/* Portada · invitación a la app */
.app-invite-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 96px); align-items: center; }
.app-invite-copy { max-width: 560px; }
.app-invite-copy .app-name { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--ink); font-size: var(--eyebrow); font-weight: 600; }
.app-invite-copy .app-name img { width: 40px; height: 40px; }
.app-invite-copy h2 { font-size: var(--h2); line-height: 1.07; letter-spacing: -.025em; }
.app-invite-copy .lead { margin-top: 20px; }
.app-invite-copy .hero-actions { margin-top: 24px; }
.screen { width: clamp(220px, 24vw, 310px); margin: 0; }
.screen img { width: 100%; border-radius: 34px; border: 1px solid var(--line); background: #fdf6ef; }
.screen figcaption { margin-top: 12px; color: var(--muted); font-size: .875rem; text-align: center; }
@media (max-width: 759px) {
  .app-invite-grid { grid-template-columns: 1fr; }
  .screen { width: min(62vw, 240px); margin-inline: auto; }
}

/* Portada · contacto */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.contact-copy h2 { font-size: var(--h2); line-height: 1.07; letter-spacing: -.025em; }
.contact-copy .lead { margin-top: 20px; }
.contact-list { margin: 32px 0 0; border-top: 1px solid var(--line); }
.contact-list > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 4px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-list dt { color: var(--muted); font-size: .9375rem; padding-top: 2px; }
.contact-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.contact-list dd a { font-weight: 600; }
.contact-list .sub { display: block; color: var(--muted); font-size: .9375rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: 28px; }
.urgent { margin-top: 32px; padding: 18px 20px; border-radius: 14px; background: #fbefee; color: #5c1d1a; font-size: .9375rem; line-height: 1.5; }
.urgent strong { color: #8a1f17; }
.map { overflow: hidden; border-radius: var(--radius); background: var(--paper-alt); aspect-ratio: 4 / 3.4; }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 859px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .contact-list > div { grid-template-columns: 1fr; }
}

/* Pie */
.site-footer { padding: 40px 0 32px; background: var(--paper-alt); color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand strong { display: block; font-size: .9375rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-top: 20px; }
.footer-bottom p { max-width: 60em; }

/* Aviso de cookies */
.consent-banner { position: fixed; left: 50%; bottom: 16px; z-index: 150; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; width: min(100% - 32px, 640px); padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .97); color: var(--ink); font-size: .9375rem; line-height: 1.45; transform: translateX(-50%); box-shadow: 0 10px 40px rgba(29, 26, 33, .12); }
.consent-banner p { flex: 1 1 280px; margin: 0; }
.consent-actions { display: flex; gap: 10px; flex: none; }
.consent-actions button { min-height: 44px; padding: 8px 18px; border: 1px solid var(--purple); border-radius: 12px; font: 600 .9375rem/1 var(--font); cursor: pointer; transition: background-color .3s var(--ease); }
.consent-reject { background: transparent; color: var(--purple); }
.consent-reject:hover { background: rgba(108, 55, 132, .08); }
.consent-accept { background: var(--purple); color: #fff; }
.consent-accept:hover { background: var(--purple-hover); }

/* Páginas interiores */
.article-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(36px, 5vw, 64px); background: var(--paper-alt); }
.article-hero h1 { max-width: 18em; font-size: clamp(2.125rem, 1.4rem + 3vw, 3.75rem); line-height: 1.06; letter-spacing: -.028em; }
.article-hero .eyebrow { display: block; }
.article-hero .lead { max-width: 40em; margin-top: 20px; }
.breadcrumb { margin-bottom: 28px; font-size: .875rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin: 0 10px; color: rgba(29, 26, 33, .3); }
.breadcrumb a { color: var(--muted); }
.article { display: grid; grid-template-columns: minmax(0, var(--text)) minmax(0, 320px); justify-content: space-between; gap: 64px; padding: clamp(48px, 6vw, 88px) 0 var(--section); }
.article-main { min-width: 0; font-size: 1.0625rem; line-height: 1.6; }
.article-main h2 { margin: 2.2em 0 .6em; font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem); line-height: 1.2; letter-spacing: -.02em; }
.article-main h2:first-child { margin-top: 0; }
.article-main h3 { margin: 1.6em 0 .5em; font-size: 1.25rem; }
.article-main p, .article-main ul, .article-main ol { margin: 0 0 1em; }
.article-main ul, .article-main ol { padding-left: 1.25em; }
.article-main li { margin: .4em 0; }
.article-main li::marker { color: var(--purple); }
.source-list { font-size: .9375rem; }
.side-card { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; padding: 28px; border-radius: var(--radius); background: var(--paper-alt); }
.side-card h3 { font-size: 1.25rem; line-height: 1.25; }
.side-card p { margin-top: 8px; color: var(--muted); }
.side-card .button { width: 100%; margin-top: 20px; }
.side-card .fineprint { margin-top: 16px; }
@media (max-width: 899px) {
  .article { grid-template-columns: 1fr; gap: 40px; }
  .side-card { position: static; }
}

/* 404 */
.section { display: grid; place-items: center; min-height: 70vh; padding: var(--section) 0; text-align: center; }
.section h1 { margin-bottom: 16px; font-size: var(--h2); letter-spacing: -.025em; }
.section .eyebrow { display: block; }
.section .button { margin-top: 28px; }

/* Subpágina /app */
.localnav { position: sticky; top: 0; z-index: 90; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.localnav-inner { display: flex; align-items: center; gap: 16px; height: 52px; }
.localnav-title { margin-right: auto; color: var(--ink); font-size: 1.1875rem; font-weight: 600; letter-spacing: -.015em; text-decoration: none; white-space: nowrap; }
.localnav-title:hover { color: var(--ink); }
.localnav-links { display: flex; gap: 4px; }
.localnav-links a { padding: 8px 10px; color: var(--ink); font-size: .8125rem; text-decoration: none; opacity: .82; }
.localnav-links a:hover { opacity: 1; color: var(--ink); }
.localnav .nav-cta { min-height: 30px; padding: 4px 12px; font-size: .8125rem; }
.app-page .site-header { position: relative; }
@media (max-width: 559px) { .localnav-links { display: none; } .localnav .nav-cta { display: inline-flex; } }

.app-hero { padding: clamp(56px, 8vw, 112px) 0 0; text-align: center; overflow: hidden; }
.app-hero-logo { width: 88px; height: 88px; margin: 0 auto 20px; }
.app-hero h1 { font-size: var(--h1); line-height: 1.04; letter-spacing: -.03em; }
.app-hero .lead { max-width: 32em; margin: 20px auto 0; }
.app-hero .hero-actions { justify-content: center; }
.app-hero .screen { width: clamp(240px, 26vw, 320px); margin: clamp(48px, 6vw, 80px) auto 0; }
.app-hero .screen img { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.app-hero .screen-crop { overflow: hidden; height: clamp(320px, 34vw, 440px); }
.motion .app-hero-copy > * { animation: rise .8s var(--ease-out) both; }
.motion .app-hero-copy > :nth-child(2) { animation-delay: .08s; }
.motion .app-hero-copy > :nth-child(3) { animation-delay: .16s; }
.motion .app-hero-copy > :nth-child(4) { animation-delay: .24s; }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.features li { padding: 28px 24px 8px 0; }
.features li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.features h3 { font-size: 1.25rem; letter-spacing: -.015em; }
.features p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
@media (max-width: 899px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features li:nth-child(3) { padding-left: 0; border-left: 0; }
  .features li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 499px) {
  .features { grid-template-columns: 1fr; }
  .features li, .features li + li { padding: 22px 0; border-left: 0; }
  .features li + li { border-top: 1px solid var(--line); }
}

.feature-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 96px); align-items: center; }
.feature-split .section-head { margin-bottom: 0; }
@media (max-width: 759px) { .feature-split { grid-template-columns: 1fr; } .feature-split .screen { width: min(62vw, 240px); margin-inline: auto; } }

.downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.download { display: flex; flex-direction: column; padding: clamp(24px, 3vw, 36px); border-radius: var(--radius); background: var(--paper); }
.download-head { display: flex; align-items: center; gap: 14px; }
.download-head img { width: 40px; height: 40px; }
.download h3 { font-size: var(--h3); letter-spacing: -.015em; }
.download-head p { color: var(--muted); font-size: .9375rem; }
.download dl { margin: 24px 0 0; font-size: .9375rem; }
.download dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.download dt { color: var(--muted); }
.download dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.download .button { margin-top: 24px; align-self: flex-start; }
.download .fineprint { margin-top: 14px; }
@media (max-width: 759px) { .downloads { grid-template-columns: 1fr; } }

.app-privacy { background: var(--night); color: var(--night-ink); text-align: center; }
.app-privacy .eyebrow { color: var(--purple-on-dark); }
.app-privacy h2 { font-size: var(--h2); line-height: 1.07; letter-spacing: -.025em; }
.app-privacy p:not(.eyebrow) { max-width: 34em; margin: 20px auto 0; color: var(--night-muted); font-size: var(--lead); line-height: 1.45; }
.app-privacy a { color: var(--purple-on-dark); }
.app-privacy a:hover { color: #fff; }
.app-privacy :focus-visible { outline-color: var(--accent); }

/* Movimiento reducido: todo visible y estático */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-figure img { transform: none; }
}
.feature-split + .features { margin-top: clamp(48px, 6vw, 88px); }
.map:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Iconos sociales (trazo simple, color del texto) */
.icon { flex: none; width: 1.05em; height: 1.05em; }
.social-link { display: inline-flex; align-items: center; gap: 8px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 0 20px; }

/* Libro 3D con la portada real del ebook.
   Las caras se colocan en 3D; la inclinación se controla con --rx y --ry desde site.js. */
.book-stage { --depth: 14px; position: relative; isolation: isolate; display: grid; place-items: center; padding: 12px 28px 44px; perspective: 1800px; }
.book { position: relative; width: var(--book-w, clamp(200px, 24vw, 320px)); aspect-ratio: 720 / 932; transform-style: preserve-3d; transform: rotateX(var(--rx, 2deg)) rotateY(var(--ry, -18deg)); transition: transform .7s var(--ease-out); }
.book-stage.is-tilting .book { transition-duration: .25s; }
.book-face { position: absolute; display: block; }
.book-front { inset: 0; overflow: hidden; border-radius: 2px 5px 5px 2px; background: #fff; transform: translateZ(calc(var(--depth) / 2)); }
.book-front img { width: 100%; height: 100%; object-fit: cover; }
/* Sombra de la bisagra: indica dónde se dobla la tapa, no es decorativa */
.book-front::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 6%; background: linear-gradient(to right, rgba(0, 0, 0, .16), rgba(255, 255, 255, .14) 45%, rgba(0, 0, 0, 0)); pointer-events: none; }
.book-spine { top: 0; left: 0; width: var(--depth); height: 100%; background: #6c3784; transform: translateX(-50%) rotateY(-90deg); }
.book-edge { top: 3px; bottom: 3px; left: 100%; width: calc(var(--depth) - 2px); background: repeating-linear-gradient(90deg, #fbfaf8 0 1px, #e4dfe8 1px 2px); transform: translateX(-50%) rotateY(90deg); }
.book-back { inset: 0; border-radius: 5px 2px 2px 5px; background: #5a2d6e; transform: translateZ(calc(var(--depth) / -2)) rotateY(180deg); }
.book-shadow { position: absolute; z-index: -1; left: 50%; bottom: 22px; width: var(--book-w, clamp(200px, 24vw, 320px)); height: 26px; border-radius: 50%; background: rgba(29, 26, 33, .32); filter: blur(16px); transform: translateX(-46%) scaleX(.92); }
.motion .book-stage.reveal:not(.is-visible) .book { transform: rotateX(6deg) rotateY(-42deg); }
@media (max-width: 759px) { .book-stage { --book-w: min(58vw, 250px); --depth: 11px; padding: 8px 20px 36px; } }

/* Portada · bloque del ebook */
.ebook-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.ebook-copy { max-width: 560px; }
.ebook-copy h2 { font-size: var(--h2); line-height: 1.07; letter-spacing: -.025em; }
.ebook-sub { margin-top: 10px; color: var(--ink); font-size: var(--h3); font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
.ebook-copy .lead { margin-top: 18px; }
.ebook-meta { margin-top: 18px; color: var(--muted); font-size: .9375rem; }
.ebook-note { margin-top: 20px; color: var(--muted); font-size: .875rem; }
@media (max-width: 859px) {
  .ebook-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ebook-copy { max-width: none; }
}

/* Subpágina del ebook */
.ebook-hero { padding: clamp(32px, 5vw, 72px) 0 clamp(56px, 7vw, 104px); background: var(--paper-alt); }
.ebook-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.ebook-hero h1 { font-size: var(--h1); line-height: 1.04; letter-spacing: -.03em; }
.ebook-hero .ebook-sub { margin-top: 12px; }
.ebook-hero .lead { margin-top: 20px; max-width: 34em; }
.ebook-byline { margin-top: 20px; color: var(--muted); font-size: 1rem; }
.ebook-byline strong { color: var(--ink); font-weight: 600; }
.motion .ebook-hero-copy > * { animation: rise .8s var(--ease-out) both; }
.motion .ebook-hero-copy > :nth-child(2) { animation-delay: .06s; }
.motion .ebook-hero-copy > :nth-child(3) { animation-delay: .12s; }
.motion .ebook-hero-copy > :nth-child(4) { animation-delay: .18s; }
.motion .ebook-hero-copy > :nth-child(n + 5) { animation-delay: .24s; }
@media (max-width: 859px) {
  .ebook-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ebook-hero .book-stage { order: -1; }
}

.toc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); counter-reset: none; }
.toc li { border-bottom: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 12px; align-items: baseline; min-height: 44px; padding: 16px 0; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--purple); }
.toc a:hover .toc-title { text-decoration: underline; }
.toc-page { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.toc-title { font-weight: 600; }
.toc-note { display: block; margin-top: 2px; color: var(--muted); font-size: .9375rem; font-weight: 400; }
@media (max-width: 899px) { .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .toc { grid-template-columns: minmax(0, 1fr); } }

.previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); margin: 0; padding: 0; list-style: none; }
.preview { margin: 0; }
.preview a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: transform .45s var(--ease); }
.preview a:hover { transform: scale(1.015); }
.preview img { width: 100%; height: auto; aspect-ratio: 640 / 828; }
.preview figcaption { margin-top: 12px; }
.preview figcaption strong { display: block; font-weight: 600; }
.preview figcaption span { color: var(--muted); font-size: .9375rem; }
.motion .previews > li:nth-child(2) .reveal { --delay: .08s; }
.motion .previews > li:nth-child(3) .reveal { --delay: .16s; }
.motion .previews > li:nth-child(4) .reveal { --delay: .24s; }
@media (max-width: 899px) {
  .previews { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: min(64%, 260px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 0 var(--gutter) 4px; margin-inline: calc(-1 * var(--gutter)); scrollbar-width: none; }
  .previews::-webkit-scrollbar { display: none; }
  .previews > li { scroll-snap-align: start; }
}

.notice-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.notice-grid h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); line-height: 1.1; letter-spacing: -.02em; }
.notice-grid p { margin-top: 14px; color: var(--muted); font-size: 1.0625rem; }
.notice-grid .urgent { margin-top: 0; font-size: 1rem; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 20px; }
@media (max-width: 759px) { .notice-grid { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .book { transform: rotateX(2deg) rotateY(-18deg) !important; }
}
@media (max-width: 859px) { .ebook-hero .book-stage { --book-w: min(44vw, 210px); --depth: 10px; padding-bottom: 28px; } }
.toc li { display: flex; }
.toc a { flex: 1; }
/* Al enfocar con teclado, el elemento y su contorno quedan separados del borde inferior */
a, button, iframe { scroll-margin-bottom: 24px; }

/* Enlaces rápidos en la tarjeta lateral y servicios relacionados */
.side-links { margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; }
.side-links .link-more { min-height: 36px; font-size: .9375rem; }
.related { padding: 0 0 var(--section); margin-top: calc(-1 * clamp(24px, 4vw, 56px)); }
.related h2 { margin-bottom: 16px; font-size: 1.25rem; letter-spacing: -.015em; }
.related ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.related li { border-bottom: 1px solid var(--line); }
.related a { display: flex; align-items: center; min-height: 48px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.related a:hover { color: var(--purple); text-decoration: underline; }
