/* ============================================================
   Laboratorio de Patologia - Sistema de diseno
   CSS moderno, mobile-first, sin frameworks
   ============================================================ */

/* === Design tokens === */
:root {
  /* Marca - azul medico */
  --c-primary-50:  #eff6fb;
  --c-primary-100: #d8eaf3;
  --c-primary-200: #b3d3e8;
  --c-primary-300: #8db8d6;
  --c-primary-400: #5f9bc1;
  --c-primary-500: #4185b6;  /* color base original */
  --c-primary-600: #356f9a;
  --c-primary-700: #2c5b7e;
  --c-primary-800: #244865;
  --c-primary-900: #1c3850;

  --c-accent: #0ea5e9;

  /* Neutros */
  --c-ink-900: #0f172a;
  --c-ink-700: #334155;
  --c-ink-600: #475569;
  --c-ink-500: #64748b;
  --c-ink-400: #94a3b8;
  --c-ink-300: #cbd5e1;
  --c-ink-200: #e2e8f0;
  --c-ink-100: #f1f5f9;
  --c-ink-50:  #f8fafc;
  --c-white:   #ffffff;

  /* Estados */
  --c-success: #16a34a;
  --c-warning: #d97706;
  --c-danger:  #dc2626;
  --c-info:    #0284c7;

  /* Tipografia */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, monospace;

  /* Escala */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);

  --container: 1200px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink-900);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}
img, picture, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-primary-800); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--c-primary-500); outline-offset: 2px; border-radius: 3px; }

/* === Tipografia === */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; color: var(--c-ink-900); }
h1 { font-size: clamp(2.2rem, 4vw + 1rem, 3.6rem); }
h2 { font-size: clamp(1.8rem, 2.5vw + 1rem, 2.6rem); }
h3 { font-size: clamp(1.3rem, 1vw + 1rem, 1.7rem); }
h4 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 600; }
p  { margin: 0 0 1em; }
.lede { font-size: 1.15rem; color: var(--c-ink-600); max-width: 60ch; }

/* === Layout === */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
@media (min-width: 768px) { .section { padding: 96px 0; } }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* === Header / Nav === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--c-ink-200);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--c-ink-900);
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.brand-name { display: none; }
@media (min-width: 480px) { .brand-name { display: inline; } }

.nav-links {
  display: none;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--r-md);
  color: var(--c-ink-700);
  font-size: .95rem;
  font-weight: 500;
}
.nav-links a:hover { background: var(--c-ink-100); color: var(--c-primary-700); }
.nav-links a.active { color: var(--c-primary-700); background: var(--c-primary-50); }

.nav-cta { display: none; align-items: center; gap: 8px; }
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-cta { display: flex; }
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--c-ink-100);
  border: none;
  color: var(--c-ink-700);
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.mobile-menu {
  position: fixed;
  inset: 64px 0 0 0;
  background: white;
  padding: 24px;
  border-top: 1px solid var(--c-ink-200);
  z-index: 9999;
  overflow-y: auto;
  animation: menu-slide-down .22s cubic-bezier(.22,1,.36,1);
}
@keyframes menu-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li { border-bottom: 1px solid var(--c-ink-100); }
.mobile-menu a { display: block; padding: 16px 4px; color: var(--c-ink-900); font-size: 1.05rem; }
.mobile-menu a.active { color: var(--c-primary-600); }
.mobile-menu .mm-cta { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  background: var(--c-ink-100);
  color: var(--c-ink-900);
  transition: transform .18s cubic-bezier(.22,1,.36,1), background .15s, box-shadow .18s, color .15s, border-color .15s;
}
.btn:hover { background: var(--c-ink-200); color: var(--c-ink-900); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--c-primary-600);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--c-primary-700); color: white; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn-outline { background: transparent; border-color: var(--c-ink-300); color: var(--c-ink-700); }
.btn-outline:hover { background: var(--c-ink-50); border-color: var(--c-primary-400); color: var(--c-primary-700); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* === Hero === */
.hero {
  position: relative;
  padding: 80px 0 96px;
  background:
    radial-gradient(ellipse 800px 400px at 90% -10%, rgba(65, 133, 182, 0.18), transparent 60%),
    radial-gradient(ellipse 600px 400px at -10% 110%, rgba(65, 133, 182, 0.10), transparent 60%),
    var(--c-ink-50);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero { padding: 120px 0 140px; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 64px; }
}
.hero h1 em {
  font-style: italic;
  color: var(--c-primary-600);
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: white;
  border: 1px solid var(--c-ink-200);
  font-size: .82rem;
  font-weight: 500;
  color: var(--c-ink-600);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.hero .eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-success); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--c-ink-200);
}
.hero-meta .label { font-size: .8rem; color: var(--c-ink-500); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.hero-meta .value { font-family: var(--font-serif); font-size: 1.4rem; color: var(--c-ink-900); }

.hero-visual {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--c-primary-800);
  box-shadow: var(--shadow-lg);
}
.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(15, 40, 90, .55) 0%,
    rgba(15, 40, 90, .35) 60%,
    rgba(15, 40, 90, .6) 100%
  );
}

/* === Eyebrow / section heading === */
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-primary-600);
  margin-bottom: 16px;
}
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head .eyebrow { color: var(--c-primary-600); }
.section-head h2 em { color: var(--c-primary-600); font-style: italic; }

/* === Cards === */
.card {
  background: white;
  border: 1px solid var(--c-ink-200);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--c-primary-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--c-primary-50);
  color: var(--c-primary-600);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.card p { color: var(--c-ink-600); margin-bottom: 0; }

.feature-card {
  background: white;
  border: 1px solid var(--c-ink-200);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-card .num {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--c-primary-500);
  font-weight: 500;
  line-height: 1;
}

.profile-card {
  background: white;
  border: 1px solid var(--c-ink-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
.profile-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.profile-card .photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--c-primary-100), var(--c-primary-300));
}
.profile-card .photo-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 10%;
  display: block;
}
.profile-card .body { padding: 20px 24px 24px; }
.profile-card .name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; margin: 0 0 4px; }
.profile-card .role { color: var(--c-ink-500); font-size: .9rem; margin: 0 0 8px; }

/* === Forms === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .9rem; font-weight: 500; color: var(--c-ink-700); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--c-ink-300);
  border-radius: var(--r-md);
  background: white;
  font-size: .95rem;
  font-family: inherit;
  color: var(--c-ink-900);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--c-primary-500);
  box-shadow: 0 0 0 3px rgba(65, 133, 182, 0.15);
}
textarea.form-control { min-height: 140px; resize: vertical; }
.form-help { font-size: .8rem; color: var(--c-ink-500); margin-top: 4px; }
.form-error { font-size: .85rem; color: var(--c-danger); margin-top: 4px; }

/* === Alerts === */
.alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid;
  margin-bottom: 20px;
  font-size: .92rem;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-warn    { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* === Footer === */
.site-footer {
  background: var(--c-ink-900);
  color: var(--c-ink-300);
  padding: 64px 0 32px;
  margin-top: 96px;
}
.footer-grid {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
  margin-bottom: 48px;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer h4 { color: white; font-family: var(--font-sans); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--c-ink-300); font-size: .92rem; }
.footer a:hover { color: white; }
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: .85rem;
  color: var(--c-ink-400);
}

/* === Utilities === */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--c-ink-500); }
.hidden { display: none; }
@media (min-width: 768px) { .md\:hidden { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* === Hero animated visual === */
.hero-cells-svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.hero-logo-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.hero-logo-img {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  animation: logo-pulse 5s ease-in-out infinite;
  box-shadow: 0 4px 32px rgba(0,0,0,.5), 0 0 0 4px rgba(255,255,255,.15);
}
/* Células flotantes */
.fcell { animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.fcell-a { animation: float-a  7s ease-in-out infinite; }
.fcell-b { animation: float-b  9s ease-in-out infinite; }
.fcell-c { animation: float-c  8s ease-in-out infinite; }
.fcell-d { animation: float-a 11s ease-in-out infinite reverse; }
.fcell-e { animation: float-b  6s ease-in-out infinite; }
/* Anillos pulsantes */
.pring { transform-box: fill-box; transform-origin: center; }
.pring-1 { animation: ring-pulse 4s ease-in-out infinite; }
.pring-2 { animation: ring-pulse 4s ease-in-out infinite -2s; }

@keyframes float-a {
  0%, 100% { transform: translate(0, 0); }
  33%       { transform: translate(6px, -10px); }
  66%       { transform: translate(-4px,  5px); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0); }
  40%       { transform: translate(-8px,  6px); }
  70%       { transform: translate( 5px, -8px); }
}
@keyframes float-c {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(7px, 9px); }
}
@keyframes logo-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 8px 40px rgba(28,56,80,.45); }
  50%       { transform: scale(1.05); box-shadow: 0 14px 50px rgba(28,56,80,.65); }
}
@keyframes ring-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.1); opacity: .3; }
}

/* === Micro strip banner === */
.micro-strip {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  border-radius: var(--r-lg);
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}

/* === Doc cards (Actividad Cientifica) === */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.doc-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-ink-200);
  border-radius: var(--r-lg);
  background: var(--c-white);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.doc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: inherit;
}
.doc-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c-primary-700), var(--c-primary-500));
  position: relative;
  overflow: hidden;
}
.doc-thumb > svg {
  width: 70%;
  height: 70%;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}
.doc-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,.12), transparent 60%);
}
.doc-card[data-ext="ppt"]  .doc-thumb,
.doc-card[data-ext="pptx"] .doc-thumb { background: linear-gradient(135deg, #9a3412, #ea580c); }
.doc-card[data-ext="doc"]  .doc-thumb,
.doc-card[data-ext="docx"] .doc-thumb { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.doc-thumb-ext {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.6);
  position: absolute;
  bottom: 10px;
  right: 14px;
  text-transform: uppercase;
}
.doc-icon {
  color: rgba(255,255,255,.9);
  position: relative;
  z-index: 1;
}
.doc-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-ink-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.doc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.doc-count {
  font-size: .9rem;
  color: var(--c-ink-500);
  margin-bottom: 24px;
}

/* === Map embed === */
.map-embed {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: var(--r-md);
  margin-top: 16px;
  display: block;
}

/* === Animations === */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(44px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Hero entrance stagger */
.hero-anim {
  opacity: 0;
  animation: fade-up .72s cubic-bezier(.22,1,.36,1) forwards;
}
.hero-anim-right {
  opacity: 0;
  animation: slide-in-right .8s cubic-bezier(.22,1,.36,1) forwards;
}
.delay-1 { animation-delay: .12s; }
.delay-2 { animation-delay: .28s; }
.delay-3 { animation-delay: .44s; }
.delay-4 { animation-delay: .60s; }
.delay-5 { animation-delay: .76s; }
.delay-6 { animation-delay: .92s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-anim, .hero-anim-right { opacity: 1 !important; transform: none !important; animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .card, .feature-card, .profile-card, .doc-card { transition: none !important; }
}

/* === Print === */
@media print {
  .site-header, .site-footer, .nav-toggle, .mobile-menu, .no-print { display: none !important; }
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
}
