/* Tipografías alojadas en el propio sitio */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/montserrat-latin.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("/assets/fonts/playfair-display-latin.woff2") format("woff2"); }

/* Paleta académica: verde bosque (biblioteca), ocre dorado y papel crema */
:root {
  --dark: #1D3530;
  --dark-2: #25423C;
  --dark-3: #33554C;
  --accent: #CDA45A;
  --accent-dark: #85601E;
  --ink: #1C2724;
  --muted: #56625E;
  --line: #E2DDD1;
  --paper: #F6F2E9;
  --white: #FFFFFF;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--white); line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1, h2, h3, strong, b { font-variant-numeric: lining-nums; }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 3.2vw, 2.5rem); color: var(--dark); text-wrap: balance; }
h3 { font-size: 1.05rem; font-weight: 600; color: var(--dark); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: .75rem; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; margin-top: 1rem; }
section { padding: clamp(3rem, 6vw, 5rem) 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--white); padding: .5rem 1rem; z-index: 100; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Secciones oscuras y claras (se alternan) */
.dark { background: var(--dark); color: var(--white); position: relative; overflow: hidden; }
.dark::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 88% 0%, rgba(205,164,90,.12), transparent 60%); pointer-events: none; }
.dark > .wrap { position: relative; }
.dark h2, .dark h3 { color: var(--white); }
.dark .eyebrow { color: var(--accent); }
.dark .lead { color: rgba(255,255,255,.72); }
.paper { background: var(--paper); }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .95rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; transition: background .2s, transform .2s, border-color .2s, color .2s; white-space: nowrap; border: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold { background: var(--accent); color: var(--dark); }
.btn-gold:hover { background: #DAB46D; transform: translateY(-1px); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.35); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(29,53,48,.97); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,.06); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1.5rem; }
.logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--white); }
.logo-mark { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; font-family: var(--serif); font-size: 1rem; color: var(--accent); letter-spacing: .02em; flex: none; }
.logo-text { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; line-height: 1.1; }
.logo-text small { display: block; font-family: var(--sans); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-top: .2rem; }
.nav { display: flex; gap: 1.75rem; }
.nav a { color: rgba(255,255,255,.78); text-decoration: none; font-size: .9rem; font-weight: 500; }
.nav a:hover { color: var(--white); }
.header-cta .btn { padding: .65rem 1.15rem; font-size: .88rem; }

/* Portada */
.hero { padding: clamp(3.5rem, 7vw, 5.5rem) 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.5rem, 5.4vw, 4.2rem); letter-spacing: -.01em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .sub { margin-top: 1.25rem; color: rgba(255,255,255,.8); font-size: 1.12rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.hero-photo { justify-self: end; width: 100%; max-width: 400px; aspect-ratio: 22 / 25; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); outline: 1px solid rgba(205,164,90,.35); outline-offset: 10px; }
.hero-photo picture { display: block; height: 100%; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.trust { margin-top: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid rgba(255,255,255,.1); }
.trust ul { padding: 1.75rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.trust strong { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; color: var(--accent); line-height: 1.15; }
.trust span { font-size: .88rem; color: rgba(255,255,255,.72); }

/* Biografía */
.bio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.prose > * + * { margin-top: 1.1rem; }
.prose p { color: #34403C; font-size: 1.02rem; line-height: 1.75; }
.prose p:first-of-type::first-letter { font-family: var(--serif); float: left; font-size: 3.4rem; line-height: .9; padding: .35rem .5rem 0 0; color: var(--accent-dark); }
.facts { position: sticky; top: 96px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 1.6rem 1.5rem; }
.facts h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.facts dl { margin: 1.1rem 0 0; display: grid; gap: .9rem; }
.facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }
.facts dd { margin: .15rem 0 0; font-size: .93rem; color: var(--ink); }

/* Formación (oscuro) */
.degrees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
.degree { background: var(--dark-2); border: 1px solid var(--dark-3); border-radius: var(--radius); padding: 1.75rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; }
.degree .yr { font-family: var(--serif); font-size: 2rem; color: var(--accent); line-height: 1; }
.degree h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-top: .4rem; }
.degree p { color: rgba(255,255,255,.72); font-size: .93rem; }
.degree .tag { margin-top: auto; padding-top: .6rem; font-size: .8rem; font-weight: 600; color: var(--accent); }
.wes { margin-top: 1.25rem; font-size: .85rem; color: rgba(255,255,255,.6); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); margin-top: 3.25rem; }
.cols h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin-bottom: 1.1rem; }

/* Listas con año (claras y oscuras) */
.yl li { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.yl li:first-child { padding-top: 0; }
.yl li:last-child { border-bottom: 0; }
.yl .yr { color: var(--accent-dark); font-weight: 600; font-size: .85rem; padding-top: .12rem; font-variant-numeric: lining-nums; }
.yl b { color: var(--dark); font-weight: 600; display: block; }
.yl span { color: var(--muted); display: block; }
.dark .yl li { border-color: rgba(255,255,255,.1); }
.dark .yl .yr { color: var(--accent); }
.dark .yl b { color: var(--white); }
.dark .yl span { color: rgba(255,255,255,.68); }

/* Áreas de docencia e investigación */
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.25rem 2rem; margin-top: 2.75rem; counter-reset: a; }
.area { border-top: 2px solid var(--dark); padding-top: 1.25rem; }
.area::before { counter-increment: a; content: "0" counter(a); display: block; font-family: var(--serif); color: var(--accent-dark); font-size: 1.1rem; margin-bottom: .5rem; font-variant-numeric: lining-nums; }
.area h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.area p { color: var(--muted); font-size: .93rem; margin-top: .5rem; }

/* Publicaciones (oscuro) */
.pubs { margin-top: 2.5rem; border-top: 1px solid rgba(255,255,255,.12); }
.pubs li { display: grid; grid-template-columns: 96px 1fr; gap: 1.25rem; padding: 1.4rem 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.pubs .yr { font-family: var(--serif); font-size: 1.35rem; color: var(--accent); line-height: 1.2; font-variant-numeric: lining-nums; }
.pubs h3 { font-family: var(--serif); font-size: 1.18rem; font-weight: 500; line-height: 1.35; color: var(--white); }
.pubs p { margin-top: .4rem; font-size: .9rem; color: rgba(255,255,255,.66); }
.pubs p i { color: rgba(255,255,255,.85); }

/* Trayectoria */
.career-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; margin-top: 2.5rem; }
.career-grid h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin-bottom: 1.1rem; }
.folds { border-top: 1px solid var(--line); }
.fold { border-bottom: 1px solid var(--line); }
.fold summary { cursor: pointer; list-style: none; position: relative; padding: 1.25rem 2.5rem 1.25rem 0; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary h3 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.fold summary span { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.fold summary::after { content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--accent-dark); transition: transform .2s; }
.fold[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.fold summary:hover h3 { color: var(--accent-dark); }
.fold > div { padding-bottom: 1.5rem; }

/* Ponencias (oscuro) */
.talks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.talk { background: var(--dark-2); border: 1px solid var(--dark-3); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.talk small { display: block; color: var(--accent); font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.talk h3 { font-family: var(--serif); font-size: 1.08rem; font-weight: 500; line-height: 1.4; margin-top: .45rem; }
.talk p { font-size: .88rem; color: rgba(255,255,255,.66); margin-top: .45rem; }

/* Servicio a la profesión */
.service-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.service-photo { border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; box-shadow: 0 24px 50px -28px rgba(29,53,48,.55); }
.service-photo picture { display: block; height: 100%; }
.service-photo img { width: 100%; height: 100%; object-fit: cover; }
.service-grid h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: 2.25rem 0 1.1rem; }
.service-grid h3:first-of-type { margin-top: 1.75rem; }

/* Contacto */
.final { text-align: center; }
.final h2 { max-width: 24ch; margin-inline: auto; }
.final .lead { margin-inline: auto; }
.final .cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3rem; text-align: left; }
.contact-card { background: var(--dark-2); border: 1px solid var(--dark-3); border-radius: var(--radius); padding: 1.25rem 1.4rem; text-decoration: none; display: flex; gap: 1rem; align-items: center; transition: border-color .2s; }
a.contact-card:hover { border-color: var(--accent); }
.contact-card svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.contact-card small { display: block; color: rgba(255,255,255,.55); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.contact-card b { color: var(--white); font-weight: 600; font-size: .96rem; overflow-wrap: anywhere; }
.final .note { margin-top: 1.5rem; font-size: .85rem; color: rgba(255,255,255,.55); }

/* Pie */
.site-footer { background: var(--dark); color: rgba(255,255,255,.6); font-size: .85rem; padding: 2.5rem 0 2rem; border-top: 1px solid rgba(255,255,255,.08); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1.25rem 2rem; flex-wrap: wrap; align-items: center; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.disclaimer { width: 100%; font-size: .78rem; color: rgba(255,255,255,.55); border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.25rem; }

/* Barra fija del celular */
.mobile-bar { display: none; }

/* Menú ☰ en celular y tableta */
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .nav { display: none; }
  .header-cta { margin-left: auto; }
  .menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 11px; margin-right: -11px; background: none; border: 0; cursor: pointer; }
  .menu-toggle span { display: block; height: 2px; background: var(--white); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .site-header.menu-open .nav { display: flex; flex-direction: column; gap: 0; position: absolute; top: 100%; left: 0; right: 0; background: var(--dark); border-top: 1px solid rgba(255,255,255,.08); padding: .4rem 0 .9rem; box-shadow: 0 22px 30px -14px rgba(0,0,0,.5); }
  .site-header.menu-open .nav a { padding: .95rem 1.5rem; font-size: 1.05rem; text-align: center; color: var(--white); }
  .site-header.menu-open .nav a + a { border-top: 1px solid rgba(255,255,255,.06); }

  .bio-grid, .career-grid { grid-template-columns: 1fr; }
  .facts { position: static; }
  .areas { grid-template-columns: repeat(2, 1fr); }
  .degrees { grid-template-columns: 1fr; max-width: 40rem; }
  .talks { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .service-photo { max-width: 360px; }
}

/* ---------- Celular: todo centrado ---------- */
@media (max-width: 760px) {
  body { padding-bottom: 76px; }
  .header-cta { display: none; }
  .logo-text { font-size: 1.05rem; }
  main, .site-footer { text-align: center; }
  main .lead, main .sub, main h1, main h2 { margin-inline: auto; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid > div:first-child { text-align: center; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 320px; justify-content: center; }
  .hero-photo { justify-self: center; max-width: 300px; order: -1; }
  .trust ul { grid-template-columns: 1fr; gap: 1.3rem; padding: 1.5rem 0; }
  .trust { margin-top: 2.5rem; }

  .prose p:first-of-type::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; font-family: inherit; }
  .facts { text-align: center; border-top-width: 4px; }

  .degrees { margin-inline: auto; }
  .degree { align-items: center; }
  .cols { grid-template-columns: 1fr; margin-top: 2.5rem; }
  .yl li, .pubs li { grid-template-columns: 1fr; gap: .25rem; }
  .areas { grid-template-columns: 1fr; gap: 1.75rem; margin-top: 1.75rem; }
  .pubs .yr { font-size: 1.15rem; }
  .career-grid { margin-top: 1.75rem; }
  .fold summary { padding-left: 2.5rem; }
  .service-photo { margin-inline: auto; }

  .contact-cards { grid-template-columns: 1fr; text-align: center; margin-top: 2rem; }
  .contact-card { flex-wrap: wrap; justify-content: center; gap: .2rem .45rem; padding: 1.1rem 1rem; }
  .contact-card > div { display: contents; }
  .contact-card svg { width: 18px; height: 18px; }
  .contact-card b { flex: 0 0 100%; }
  .final .cta-row { margin-top: 1.75rem; }

  .site-footer .wrap { flex-direction: column; align-items: center; gap: 1rem; }
  .site-footer .links { justify-content: center; gap: .25rem 1.25rem; }
  .site-footer .links a { padding: .7rem .25rem; }

  .mobile-bar { display: flex; gap: .5rem; position: fixed; inset: auto 0 0 0; z-index: 60; padding: .7rem .8rem calc(.7rem + env(safe-area-inset-bottom)); background: var(--dark); border-top: 1px solid var(--dark-3); }
  .mobile-bar .btn { flex: 1 1 0; justify-content: center; padding: .85rem .8rem; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
