/* =========================================================
   Sitio académico — Jorge Adrián Osorio Acevedo
   Tesis doctoral · Producción académica · Ponencias
   Hoja de estilos única, sin dependencias externas.
   ========================================================= */

:root {
  --bg: #f7f5f1;
  --bg-elev: #ffffff;
  --surface: #fbfaf7;
  --text: #1f2328;
  --text-soft: #4b5563;
  --text-faint: #6b7280;
  --border: #e2ddd3;
  --border-strong: #cfc8ba;
  --primary: #0f4c5c;
  --primary-hover: #0b3946;
  --primary-soft: #e2edef;
  --accent: #bb6b2a;
  --accent-soft: #f6e7d8;
  --focus: #1d7a91;
  --shadow: 0 1px 2px rgba(24, 32, 40, .05), 0 8px 24px rgba(24, 32, 40, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --bg-elev: #1c2024;
    --surface: #20252a;
    --text: #e9e7e2;
    --text-soft: #b7bcc2;
    --text-faint: #8b9199;
    --border: #2c3238;
    --border-strong: #3a424a;
    --primary: #56c1d6;
    --primary-hover: #7bd0e1;
    --primary-soft: #1e3238;
    --accent: #e0925a;
    --accent-soft: #33251a;
    --focus: #56c1d6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 40px);
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: .01em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  flex: none;
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: .95rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: .95rem;
  font-weight: 500;
}
.site-nav a:hover { background: var(--primary-soft); text-decoration: none; color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 12px; gap: 2px; }
  .site-nav a { padding: 12px 14px; font-size: 1rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(48px, 9vw, 96px) 0 clamp(36px, 6vw, 64px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(1200px 400px at 12% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(900px 380px at 100% 0%, var(--accent-soft), transparent 55%);
}
.hero .eyebrow {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  line-height: 1.17;
  margin: 0 0 22px;
  max-width: 22ch;
  letter-spacing: -0.005em;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.3vw, 1.24rem);
  color: var(--text-soft);
  max-width: 62ch;
  margin: 0 0 30px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: .92rem;
  color: var(--text-faint);
}
.hero-meta strong { color: var(--text); font-weight: 600; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--primary-soft); }

/* ---------- Sections ---------- */
main { display: block; }
section { padding: clamp(44px, 7vw, 76px) 0; }
section + section { border-top: 1px solid var(--border); }

.section-head { max-width: 66ch; margin-bottom: 34px; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
  line-height: 1.25;
  margin: 0 0 12px;
}
.section-head p { color: var(--text-soft); margin: 0; }

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.24rem;
  margin: 2em 0 .6em;
}
h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 1.6em 0 .5em;
}

p { margin: 0 0 1.1em; }
.prose { max-width: 68ch; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent); }

.lead {
  font-size: 1.12rem;
  color: var(--text-soft);
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .tag {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.card p:last-child { margin-bottom: 0; }
a.card { color: inherit; display: block; transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease; }
a.card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 2px 4px rgba(24,32,40,.06), 0 16px 40px rgba(24,32,40,.1); }
a.card .more { color: var(--primary); font-weight: 600; font-size: .9rem; }

/* ---------- Definition / meta list ---------- */
.datalist {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 24px;
  margin: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
}
.datalist dt { color: var(--text-faint); font-weight: 600; }
.datalist dd { margin: 0; color: var(--text); }
@media (max-width: 620px) {
  .datalist { grid-template-columns: 1fr; gap: 4px 0; }
  .datalist dd { margin-bottom: 14px; }
  .datalist dd:last-child { margin-bottom: 0; }
}

/* ---------- Keyword chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .85rem;
  font-weight: 500;
}

/* ---------- Callout ---------- */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
  margin: 1.6em 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }

/* ---------- Timeline / structure ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding: 0 0 22px 46px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 700;
  font-family: var(--sans);
}
.steps li::after {
  content: "";
  position: absolute;
  left: 15px; top: 36px; bottom: 2px;
  width: 2px;
  background: var(--border-strong);
}
.steps li:last-child::after { display: none; }
.steps li h4 { margin: 4px 0 4px; }
.steps li p { margin: 0; color: var(--text-soft); font-size: .95rem; }

/* ---------- Publication entry ---------- */
.entry {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}
.entry > .tag {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.entry h3 { margin: 0 0 .4em; font-size: 1.3rem; }
.entry .byline { color: var(--text-faint); font-size: .92rem; margin: 0 0 1.2em; }
.entry .cite {
  font-size: .88rem;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 1.2em 0 0;
}
details.abstract {
  margin-top: 1.2em;
  border-top: 1px solid var(--border);
  padding-top: 1em;
}
details.abstract summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  font-size: .95rem;
  list-style: none;
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::before { content: "▸ "; }
details.abstract[open] summary::before { content: "▾ "; }
details.abstract .prose { margin-top: 1em; }
.pdf-frame {
  margin-top: 1em;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}
.pdf-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; min-width: 520px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface); font-weight: 700; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 44px 0;
  font-size: .9rem;
  color: var(--text-faint);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.site-footer h4 { margin: 0 0 8px; color: var(--text); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.site-footer a { color: var(--text-soft); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 5px; }
.site-footer .copyright { width: 100%; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- Utilities ---------- */
.muted { color: var(--text-faint); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.note {
  font-size: .86rem;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface);
}
