/* ═══════════════════════════════════════════════════════════════
   Quisilema Medical Group · Rediseño editorial (estilo Awwwards) · SimCodec
   ═══════════════════════════════════════════════════════════════ */

/* ─── Fuentes locales (un archivo woff2 real por peso) ─── */
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-tight-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/inter-tight-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-600-normal.woff2') format('woff2'); }

/* ─── Tokens ─── */
:root {
  --paper: #F5F4F0;
  --paper-2: #ECE9E1;
  --surface: #FFFFFF;
  --ink: #141414;
  --ink-2: #3A3936;
  --muted: #5C5A55;          /* 6.6:1 sobre --paper */
  --gold: #E3BD74;           /* dorado de marca: decoración, nunca texto pequeño */
  --gold-text: #7A5A1C;      /* dorado para texto: 6:1 sobre --paper */
  --line: rgba(20, 20, 20, 0.14);
  --line-strong: rgba(20, 20, 20, 0.3);
  --dark: #141414;
  --dark-text: #F5F4F0;
  --dark-muted: #CFCABE;     /* 10:1 sobre --dark */

  --f-display: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --header-h: 120px;         /* se recalcula en main.js con la altura real */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 2px;
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
html.lenis, html.lenis body { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico--lg { width: 2.2rem; height: 2.2rem; stroke-width: 1.2; }
.ico--xl { width: 3.2rem; height: 3.2rem; stroke-width: 1; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .6rem 1rem; }
.skip-link:focus { top: 1rem; }
.only-mobile { display: none; }

.eyebrow {
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* Títulos monumentales: la línea se revela con SplitText (overflow oculto por línea) */
.section__title, .hero__title {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: .9;
  color: var(--ink);
}
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }

/* ─── Botones ─── */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: 1rem 1.6rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
  cursor: pointer;
}
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: var(--gold-text); border-color: var(--gold-text); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn .ico { transition: transform .5s var(--ease); }
.btn:hover .ico { transform: translateX(4px); }

/* ═════════ AVISO + ENCABEZADO ═════════ */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; }
.demo-bar { background: var(--dark); color: var(--dark-text); font-size: .8rem; }
.demo-bar__text {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .25rem .75rem; padding: .55rem var(--gutter); text-align: center;
}
.demo-bar__text .ico { color: var(--gold); }
.demo-bar__link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--gold); font-weight: 600; text-underline-offset: 3px;
}
.demo-bar__link:hover { color: var(--paper); }

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: .75rem var(--gutter);
  background: rgba(245, 244, 240, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), padding .4s var(--ease);
}
.header.is-scrolled .nav { border-bottom-color: var(--line); padding-top: .55rem; padding-bottom: .55rem; }
.nav__logo img { width: 128px; height: auto; }
.nav__links { display: flex; align-items: center; gap: clamp(1.2rem, 2.6vw, 2.6rem); }
.nav__links a, .nav__cta {
  white-space: nowrap;
  font-size: .9rem; font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--gold-text); transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.1rem; border: 1px solid var(--ink); border-radius: var(--radius);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.nav__cta:hover { background: var(--ink); color: var(--paper); }

.nav__toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  position: relative;
}
.nav__toggle span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink);
  transition: transform .5s var(--ease), top .5s var(--ease);
}
.nav__toggle span:nth-child(1) { top: 16px; }
.nav__toggle span:nth-child(2) { top: 26px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 1.5rem var(--gutter) 2rem;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__list li + li { border-top: 1px solid var(--line); }
.mobile-menu__list a {
  display: block; padding: 1rem 0;
  font-family: var(--f-display); font-weight: 700; font-size: 2rem; letter-spacing: -0.03em;
  text-decoration: none; color: var(--ink);
}
.mobile-menu__cta { display: inline-block; margin-top: 1.5rem; }
.mobile-menu__cta { font-weight: 600; background: var(--ink); color: var(--paper); padding: 1rem 1.4rem; text-decoration: none; border-radius: var(--radius); }

/* ═════════ PORTADA ═════════ */
.hero {
  position: relative;
  min-height: min(100svh, 980px);
  padding: calc(var(--header-h) + 3rem) var(--gutter) 4rem;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; max-width: 56rem; }
.hero__eyebrow { margin-bottom: 1.6rem; }
.hero__title { font-size: clamp(4rem, 12.5vw, 13.5rem); }
.hero__title .line + .line { color: var(--ink); }
.hero__lead {
  margin-top: 2rem; max-width: 36rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: var(--ink-2);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.4rem; }
.hero__figure {
  position: absolute; right: calc(var(--gutter) * -0.2); bottom: 0; top: calc(var(--header-h) + 1rem);
  width: min(44vw, 620px);
  z-index: 1;
  pointer-events: none;
}
.hero__figure::before {
  content: ""; position: absolute; left: 8%; top: 12%; width: 72%; aspect-ratio: 1;
  border-radius: 50%; background: var(--gold); opacity: .55;
}
.hero__photo { position: relative; height: 100%; width: auto; margin-left: auto; object-fit: contain; object-position: bottom right; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; z-index: 3;
  color: var(--ink); animation: bob 2.4s var(--ease) infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* ═════════ MARQUESINA ═════════ */
.marquee {
  background: var(--ink); color: var(--paper);
  overflow: hidden; padding: 1.4rem 0;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee__group { display: flex; flex: none; }
.marquee__group li {
  display: flex; align-items: center; white-space: nowrap;
  font-family: var(--f-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 3.6rem); letter-spacing: -0.03em;
}
.marquee__group li::after {
  content: ""; width: .32em; height: .32em; margin: 0 1.2em; border-radius: 50%; background: var(--gold); flex: none;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ═════════ SECCIONES ═════════ */
.section { padding: clamp(6rem, 12vw, 11rem) var(--gutter); }
.section__head { margin-bottom: clamp(3rem, 6vw, 5rem); }
.section__title { margin-top: 1.2rem; font-size: clamp(3.4rem, 9vw, 9rem); }

.nosotros__body {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 6rem);
  max-width: 1200px; margin-bottom: clamp(4rem, 8vw, 7rem);
}
.nosotros__body p { font-size: clamp(1rem, 1.2vw, 1.12rem); }
.nosotros__lead {
  font-family: var(--f-display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.3rem) !important;
  line-height: 1.2; letter-spacing: -0.02em; color: var(--ink) !important;
}

.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}
.pillars__item {
  padding: 2.4rem 2rem 2.6rem 0; border-bottom: 1px solid var(--line);
  transition: transform .6s var(--ease);
}
.pillars__item + .pillars__item { padding-left: 2rem; border-left: 1px solid var(--line); }
.pillars__item .ico { color: var(--gold-text); margin-bottom: 1.6rem; }
.pillars__item h3 {
  font-family: var(--f-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; color: var(--ink);
  line-height: 1.15; margin-bottom: .7rem;
}
.pillars__item p { font-size: .98rem; color: var(--muted); }

.anesthesia {
  margin-top: clamp(4rem, 8vw, 7rem); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 6rem);
  max-width: 1200px; padding-top: 2rem; border-top: 1px solid var(--line-strong);
}
.anesthesia__title {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 3.6vw, 3.2rem);
  letter-spacing: -0.035em; line-height: 1; color: var(--ink);
}
.anesthesia p { font-size: clamp(1rem, 1.2vw, 1.12rem); }

/* ═════════ SERVICIOS (horizontal fijado en escritorio) ═════════ */
.services { position: relative; background: var(--paper-2); }
.services__pin { padding: clamp(6rem, 12vw, 11rem) 0 clamp(4rem, 8vw, 7rem); }
.services__head { padding: 0 var(--gutter); margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.services__head .section__title { font-size: clamp(3.4rem, 9vw, 9rem); }
.services__hint { margin-top: 1.4rem; font-size: .9rem; color: var(--muted); }
.services__hint .ico { vertical-align: -0.2em; margin-left: .2em; }

.services__track {
  display: flex; gap: clamp(1.25rem, 2vw, 2rem);
  padding: 0 var(--gutter);
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}
.service-card {
  position: relative; flex: 0 0 auto; width: min(82vw, 400px);
  scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.service-card__num {
  position: absolute; top: 1.2rem; left: 1.4rem; z-index: 2;
  font-family: var(--f-display); font-weight: 800; font-size: .95rem; letter-spacing: .04em; color: var(--ink);
  background: var(--gold); padding: .15rem .55rem;
}
.service-card__media { aspect-ratio: 4 / 4.2; overflow: hidden; background: var(--paper-2); }
.service-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.service-card:hover .service-card__media img { transform: scale(1.04); }
.service-card__media--line { display: grid; place-items: center; color: var(--gold-text); background: linear-gradient(160deg, #FFFFFF 0%, var(--paper-2) 100%); }
.service-card__body { padding: 1.6rem 1.6rem 1.9rem; }
.service-card__body h3 {
  font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.025em; line-height: 1.1; color: var(--ink);
  margin-bottom: .5rem;
}
.service-card__body p { font-size: .95rem; color: var(--muted); }

/* ═════════ CONTACTO ═════════ */
.contacto__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 6vw, 7rem);
  align-items: start;
}
.contacto__datos { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.contacto__datos li {
  display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.contacto__datos li > .ico { color: var(--gold-text); margin-top: .2rem; width: 1.5rem; height: 1.5rem; }
.contacto__label { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.contacto__datos p { color: var(--ink); font-size: 1.02rem; }
.contacto__datos a { text-underline-offset: 4px; text-decoration-color: var(--gold-text); }
.contacto__datos a:hover { color: var(--gold-text); }
.contacto__iconos { display: flex; gap: .6rem; }
.contacto__iconos a {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; color: var(--ink);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.contacto__iconos a:hover { background: var(--ink); color: var(--paper); }

.form { background: var(--surface); padding: clamp(1.8rem, 3vw, 2.8rem); border: 1px solid var(--line); }
.form__aviso { font-size: .85rem; color: var(--muted); padding-bottom: 1.2rem; margin-bottom: 1.4rem; border-bottom: 1px dashed var(--line-strong); }
.field + .field { margin-top: 1.4rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: .45rem; }
.field input, .field textarea {
  width: 100%; padding: .85rem .95rem;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); font-size: 1rem;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }
.form__submit { margin-top: 1.8rem; width: 100%; justify-content: center; }
.form__submit .ico { width: 1.1em; height: 1.1em; }

.mapa { margin-top: clamp(4rem, 8vw, 6rem); height: clamp(280px, 40vw, 460px); border: 1px solid var(--line-strong); overflow: hidden; background: var(--paper-2); }
.mapa iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(1.05); }

/* ═════════ PIE ═════════ */
.footer { background: var(--dark); color: var(--dark-text); padding: clamp(4rem, 8vw, 6rem) var(--gutter) 2rem; }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 2rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(245, 244, 240, 0.16); }
.footer__logo { width: 120px; height: auto; background: var(--paper); padding: .6rem .8rem; border-radius: var(--radius); }
.footer__claim { max-width: 26rem; color: var(--dark-muted); font-size: 1rem; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-top: 1.6rem; font-size: .85rem; color: var(--dark-muted); }
.footer__demo { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.footer__demo .ico { color: var(--gold); }
.footer__demo a { display: inline-flex; align-items: center; gap: .3rem; color: var(--gold); font-weight: 600; text-underline-offset: 3px; }
.footer__demo a:hover { color: var(--paper); }

/* ─── WhatsApp flotante ─── */
.wa {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(20, 20, 20, 0.22);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease), background .4s var(--ease);
}
.wa.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.wa:hover { background: var(--gold-text); }

/* ─── Revelado al desplazar (solo si JS funciona; sin JS todo se ve) ─── */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ─── Cursor personalizado (solo puntero fino) ─── */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; }
  .cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
  .cursor__dot { width: 6px; height: 6px; background: var(--ink); }
  .cursor__ring { width: 40px; height: 40px; border: 1px solid var(--ink); transition: width .4s var(--ease), height .4s var(--ease), background .4s var(--ease); }
  .cursor.is-link .cursor__ring { width: 64px; height: 64px; background: rgba(227, 189, 116, 0.35); border-color: transparent; }
  html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }
}

/* ═════════ RESPONSIVE ═════════ */
@media (max-width: 1100px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: block; }
  .hero__figure { width: min(52vw, 520px); opacity: .95; }
}

@media (min-width: 900px) {
  /* Servicios: sección fijada que se recorre en horizontal */
  .services__pin { height: 100vh; min-height: 620px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-bottom: 0; }
  .services__track { overflow: visible; scroll-snap-type: none; padding-bottom: 0; will-change: transform; }
  .service-card { width: clamp(300px, 27vw, 420px); }
  .service-card__media { aspect-ratio: 4 / 3.6; }
}

@media (max-width: 900px) {
  .nosotros__body, .anesthesia, .contacto__grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .pillars__item, .pillars__item + .pillars__item { padding: 2rem 0; border-left: 0; }
  .hero__figure { position: relative; top: auto; right: auto; bottom: auto; width: 100%; height: 68vh; margin-top: 2.5rem; }
  .hero { flex-direction: column; align-items: stretch; min-height: auto; padding-bottom: 6rem; }
  .hero__photo { margin: 0 auto; height: 100%; }
  .hero__scroll { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .demo-bar { font-size: .74rem; }
  .only-desktop { display: none; }
  .only-mobile { display: inline; }
  .nav__logo img { width: 110px; }
  .hero__title { font-size: clamp(3.4rem, 16vw, 5rem); }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .section__title, .services__head .section__title { font-size: clamp(2.9rem, 14vw, 4.2rem); }
  .marquee__group li { font-size: 1.6rem; }
  .footer__bottom { flex-direction: column; }
}

/* ═════════ MOVIMIENTO REDUCIDO ═════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee__track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .cursor { display: none !important; }
  .services__track { overflow-x: auto; }
}
