/* ========================================================
   Dr. Amauri Martínez — Médico Ortopedista
   Paleta basada en el logo: gris carbón sobre marfil cálido
   ======================================================== */

:root {
  /* ---- Colores EXACTOS extraídos del logo ---- */
  --logo-bg:      #fff9f9;   /* fondo del logo (blanco cálido) */
  --logo-gray:    #6a6a6a;   /* gris del monograma "M" */

  /* ---- Fondos (todos derivados del fondo del logo) ---- */
  --ivory:        #fff9f9;   /* fondo principal de toda la página */
  --ivory-soft:   #faf1f1;   /* secciones alternas: mismo tono, un punto más profundo */
  --white:        #fffcfc;   /* tarjetas: cálido, nunca blanco puro */

  /* ---- Grises (todos derivados del gris del monograma) ---- */
  --charcoal:     #6a6a6a;   /* color de marca: botones, acentos */
  --charcoal-dk:  #4f4f4f;   /* títulos y estados hover */
  --text:         #5c5a5a;   /* texto de cuerpo */
  --text-soft:    #8d8a8a;   /* texto secundario */
  --line:         #efe4e4;   /* bordes sutiles, en el tono cálido del logo */

  /* Tipografía */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Montserrat', system-ui, -apple-system, sans-serif;

  /* Medidas */
  --maxw: 1160px;
  --radius: 4px;
  --shadow: 0 12px 40px rgba(106, 106, 106, 0.13);
  --transition: 0.25s ease;
}

/* ---------- Reset básico ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--ivory); }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--ivory);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; transition: color var(--transition); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; color: var(--charcoal-dk); line-height: 1.15; }

.section-eyebrow, .hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 14px;
}

.section-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 18px; }
.section-lead  { color: var(--text-soft); max-width: 620px; margin: 0 auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 15px 32px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.btn-primary { background: var(--charcoal); color: var(--logo-bg); }
.btn-primary:hover { background: var(--charcoal-dk); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--charcoal-dk); border-color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: var(--logo-bg); }
.btn-block { width: 100%; text-align: center; }

/* ========================================================
   AVISO: SITIO EN DESARROLLO
   Estética FreeMind — negra, con hexágono y constelación,
   haciendo juego con la barra de créditos del pie
   ======================================================== */
.wip-bar {
  position: sticky;
  top: 0;
  z-index: 110;
  background: #0b0b0b;
  overflow: hidden;
  padding: 10px 16px;
  text-align: center;
}
.wip-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 249, 249, 0.62);
}
.wip-hex {
  height: 14px;
  width: auto;
  flex: none;
  animation: wip-pulse 2.8s ease-in-out infinite;
}
@keyframes wip-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wip-hex { animation: none; opacity: 0.85; }
}

/* ========================================================
   HEADER
   ======================================================== */
.site-header {
  position: sticky;
  /* main.js ajusta este valor a la altura real del aviso */
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 249, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
/* El fondo de la página es idéntico al del logo, así que se funde sin bordes visibles */
.brand-logo { height: 56px; width: auto; }

.nav { display: flex; gap: 30px; }
.nav a {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--text);
  position: relative;
}
.nav a:hover { color: var(--charcoal-dk); }
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1px; background: var(--charcoal); transition: width var(--transition);
}
.nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 18px; }

.lang-toggle {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.1em;
  color: var(--text-soft);
}
.lang-toggle .lang-sep { margin: 0 3px; opacity: 0.5; }
.lang-toggle .active { color: var(--charcoal-dk); font-weight: 600; }

/* Menú hamburguesa (móvil) */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.menu-toggle span { width: 24px; height: 2px; background: var(--charcoal-dk); transition: var(--transition); }

/* ========================================================
   HERO
   ======================================================== */
.hero { padding: 80px 0 90px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.hero-title { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-bottom: 22px; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-soft); max-width: 460px; margin-bottom: 34px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-photo-placeholder, .about-photo-placeholder {
  aspect-ratio: 4 / 5;
  background: var(--ivory-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: 0.85rem; letter-spacing: 0.08em;
}

/* ========================================================
   SECCIONES GENERALES
   ======================================================== */
.section { padding: 90px 0; }
.section-alt { background: var(--ivory-soft); }
.section-head { margin-bottom: 56px; }
.section-head.center { text-align: center; }

/* ---------- Sobre el Dr. ---------- */
.about-inner {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center;
}
.about-content p { margin-bottom: 18px; color: var(--text-soft); }
.about-credentials { list-style: none; margin-top: 26px; }
.about-credentials li {
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 0.9rem; color: var(--text);
}

/* ---------- Servicios ---------- */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 30px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.service-icon {
  font-family: var(--font-display); font-size: 1.6rem; color: var(--text-soft);
  margin-bottom: 16px; letter-spacing: 0.05em;
}
.service-card h3 { font-size: 1.35rem; margin-bottom: 10px; }
.service-card p { color: var(--text-soft); font-size: 0.92rem; }

/* ---------- Por qué elegirlo ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; }
.why-number { font-family: var(--font-display); font-size: 3.2rem; color: var(--charcoal-dk); margin-bottom: 8px; }
.why-item p { color: var(--text-soft); }
.why-item small { color: var(--text-soft); opacity: 0.7; }

/* ---------- Contacto ---------- */
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-list { list-style: none; margin-top: 26px; }
.contact-list li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.contact-label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-soft); }
.contact-list a:hover { color: var(--charcoal-dk); }

.contact-form-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.contact-form label { display: block; margin-bottom: 18px; }
.contact-form label span { display: block; font-size: 0.78rem; letter-spacing: 0.08em; margin-bottom: 6px; color: var(--text); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.9rem; color: var(--text);
  background: var(--ivory); resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--charcoal); }
.form-note { font-size: 0.75rem; color: var(--text-soft); margin-top: 12px; }

/* ========================================================
   FOOTER
   ======================================================== */
/* Footer: gris del monograma como fondo, textos en el blanco cálido del logo */
.site-footer { background: var(--charcoal-dk); color: var(--logo-bg); padding-top: 56px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 40px; }
/* El PNG ya viene en blanco cálido con fondo transparente: sin filtros ni recuadro */
.footer-logo { height: 118px; width: auto; opacity: 0.92; }
.footer-cols { display: flex; gap: 70px; flex-wrap: wrap; }
.footer-col h4 { color: var(--logo-bg); font-size: 1rem; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255, 249, 249, 0.68); font-size: 0.88rem; padding: 5px 0; }
.footer-col a:hover { color: var(--logo-bg); }
.footer-bottom { border-top: 1px solid rgba(255, 249, 249, 0.14); padding: 22px 0; }
.footer-bottom p { font-size: 0.8rem; color: rgba(255, 249, 249, 0.55); }

/* ========================================================
   BARRA DE DESARROLLO — FreeMind I&T
   Negra, delgada, con una constelación discreta de fondo
   ======================================================== */
.dev-band { position: relative; background: #0b0b0b; overflow: hidden; }

.constellation { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cn-lines line   { stroke: rgba(255, 249, 249, 0.10); stroke-width: 1; }
.cn-stars circle { fill: rgba(255, 249, 249, 0.55); animation: twinkle 5s ease-in-out infinite; }
.cn-stars circle:nth-child(3n)   { animation-delay: 1.7s; }
.cn-stars circle:nth-child(3n+1) { animation-delay: 3.4s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.9; }
}

.dev-band-inner {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 11px;
  padding-bottom: 11px;
}
.dev-credit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 249, 249, 0.5);
}
.dev-credit strong { color: rgba(255, 249, 249, 0.85); font-weight: 500; }
.dev-credit:hover { color: rgba(255, 249, 249, 0.75); }
.dev-hex { height: 17px; width: auto; opacity: 0.7; transition: opacity var(--transition); }
.dev-credit:hover .dev-hex { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .cn-stars circle { animation: none; opacity: 0.6; }
}

/* ========================================================
   ANIMACIONES DE ENTRADA
   Sutiles y cortas, para no romper la formalidad del sitio.
   El prefijo .js-anim lo agrega main.js: si el JS no carga,
   todo se ve normal en vez de quedar invisible.
   ======================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* Los elementos se ocultan por selector, no por una clase que agregue
     el JS: así ya nacen ocultos y no hay parpadeo en el primer pintado.
     Sin IDs en la lista, para que .is-visible pueda ganarles después. */
  .js-anim :is(
    .hero-eyebrow, .hero-title, .hero-subtitle, .hero-cta,
    .about-content > *,
    .section-head > *,
    .service-card,
    .why-item,
    .contact-info > *,
    .contact-form-wrap
  ) {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.75s cubic-bezier(0.22, 0.61, 0.36, 1),
      transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--d, 0s);
  }

  /* Las fotos entran con un acercamiento apenas perceptible */
  .js-anim :is(.hero-media, .about-media) {
    opacity: 0;
    transform: scale(0.97);
    transition:
      opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
      transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--d, 0s);
  }

  /* Va al final a propósito: misma especificidad, gana por orden */
  .js-anim .is-visible { opacity: 1; transform: none; }
}

/* El header gana una sombra tenue al hacer scroll */
.site-header { transition: box-shadow 0.35s ease, background 0.35s ease; }
.site-header.scrolled { box-shadow: 0 6px 28px rgba(106, 106, 106, 0.11); }

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 900px) {
  .hero-inner, .about-inner, .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-media, .about-media { order: -1; max-width: 380px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; gap: 30px; }

  .menu-toggle { display: flex; }
  .nav {
    position: fixed; top: 0; right: -100%; height: 100vh; width: 75%; max-width: 320px;
    background: var(--ivory); flex-direction: column; gap: 0; padding: 90px 30px;
    box-shadow: -10px 0 40px rgba(106, 106, 106, 0.18); transition: right 0.35s ease; z-index: 90;
  }
  .nav.open { right: 0; }
  .nav a { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .header-actions .btn-primary { display: none; }
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .section { padding: 64px 0; }

  .dev-credit { font-size: 0.64rem; letter-spacing: 0.1em; gap: 7px; }
  .dev-hex { height: 15px; }
  .wip-inner { font-size: 0.62rem; letter-spacing: 0.09em; gap: 7px; }
  .wip-hex { height: 12px; }
}
