/* Eli J. Borrego, Ph.D. — site styles */
:root {
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #16212b;
  --ink-soft: #3b4752;
  --muted: #66717c;
  --rule: #dcd7cb;
  --accent: #0e6b6b;
  --accent-dark: #0a4f4f;
  --accent-tint: #e3efed;
  --copper: #a4552f;
  --copper-tint: #f5e8e0;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.wordmark span { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a {
  font-size: 15px; color: var(--ink-soft); text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
}
.nav a:hover { background: var(--accent-tint); color: var(--accent-dark); }
.nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 600; }
.nav .btn { margin-left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600;
  font-size: 15px; text-decoration: none; padding: 10px 18px;
  border-radius: 8px; border: 1.5px solid var(--accent);
  background: var(--accent); color: #fff; line-height: 1.2;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-tint); color: var(--accent-dark); }
.nav .btn { padding: 7px 14px; font-size: 14px; color: #fff; }
.nav .btn:hover { color: #fff; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(34px, 5vw, 50px); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.2vw, 32px); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 21px; font-weight: 600; }
p { margin: 0 0 1em; }
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--copper); margin: 0 0 10px; font-weight: 500;
}
.lede { font-size: 19px; color: var(--ink-soft); max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--rule); }
.page-head { padding-top: 56px; padding-bottom: 36px; }
.page-head .lede { margin-top: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: start;
}
.hero .role {
  font-family: var(--serif); font-size: clamp(20px, 2.4vw, 25px);
  color: var(--accent-dark); margin: 0 0 4px;
}
.hero .loc { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 0 0 24px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.portrait {
  width: 220px; height: 260px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
  position: relative; box-shadow: 0 1px 0 var(--rule);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .initials {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 72px; color: rgba(255,255,255,0.92); letter-spacing: 0.02em;
}
.portrait.empty .initials { display: flex; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--card);
  margin-top: 40px;
}
.stat { padding: 22px 22px 20px; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat .num { font-family: var(--serif); font-size: 38px; font-weight: 600; color: var(--accent-dark); line-height: 1; }
.stat .label { font-size: 14.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.4; }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 24px;
}
.card h3 { margin-bottom: 8px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
a.card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
a.card .more { font-weight: 600; color: var(--accent); font-size: 15px; }

ul.clean { list-style: none; padding: 0; margin: 0; }
ul.ticks { padding-left: 1.1em; margin: 0 0 1em; }
ul.ticks li { margin-bottom: 6px; }
ul.ticks li::marker { color: var(--accent); }

/* ---------- Current role ---------- */
.now {
  display: grid; grid-template-columns: 240px 1fr; gap: 32px;
}
.now .meta { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.now .meta strong { display: block; font-family: var(--serif); font-size: 21px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid; grid-template-columns: 140px 1fr; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-family: var(--mono); font-size: 14px; color: var(--copper); padding-top: 2px; }
.timeline .what strong { display: block; font-weight: 600; }
.timeline .what span { color: var(--muted); font-size: 15.5px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; padding: 0; list-style: none; }
.chips li {
  font-family: var(--mono); font-size: 13.5px; background: var(--accent-tint);
  color: var(--accent-dark); padding: 5px 10px; border-radius: 6px;
}
.chips.warm li { background: var(--copper-tint); color: #7a3d20; }

/* ---------- Expertise blocks ---------- */
.skill-block { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 32px 0; border-top: 1px solid var(--rule); }
.skill-block:first-of-type { border-top: 0; padding-top: 0; }
.skill-block h2 { font-size: 24px; }
.skill-block .sub { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.skill-block .sub:first-child { margin-top: 0; }

/* ---------- Case studies ---------- */
.case {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  padding: 32px; margin-bottom: 28px;
}
.case header { margin-bottom: 18px; }
.case .num { font-family: var(--mono); color: var(--copper); font-size: 13px; letter-spacing: .08em; }
.case h2 { font-size: 26px; margin: 6px 0 4px; }
.case .where { color: var(--muted); font-size: 15.5px; margin: 0; }
.par { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 14px 0; border-top: 1px dashed var(--rule); }
.par .k { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); padding-top: 3px; font-weight: 500; }
.par p { margin: 0; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 16px; line-height: 1.55; }
.pub-list li:last-child { border-bottom: 0; }
.pub-list .t { font-weight: 600; color: var(--ink); }
.pub-list .j { font-style: italic; }
.pub-list .me { font-weight: 700; }
.pub-list .doi { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.year-head { font-family: var(--mono); font-size: 14px; color: var(--copper); letter-spacing: .06em; margin: 28px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 5px; margin-right: 6px;
  background: var(--accent-tint); color: var(--accent-dark); vertical-align: 2px;
}
.tag.warm { background: var(--copper-tint); color: #7a3d20; }
.selected li { padding: 18px 0; }

/* ---------- Tables ---------- */
table.simple { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.simple th, table.simple td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.simple th { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
table.simple td.code { font-family: var(--mono); font-size: 14px; color: var(--accent-dark); white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 48px; margin-top: 24px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14.5px; color: var(--muted); }
.site-footer a { color: var(--ink-soft); margin-left: 16px; }
.site-footer a:first-child { margin-left: 0; }

.cta-band {
  background: var(--ink); color: #e9ecef; border-radius: 14px; padding: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: 24px; margin: 0 0 4px; }
.cta-band p { margin: 0; color: #c3cad1; }
.cta-band .btn { background: #fff; color: var(--ink); border-color: #fff; }
.cta-band .btn:hover { background: var(--accent-tint); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .portrait { width: 160px; height: 190px; order: -1; }
  .portrait .initials { font-size: 54px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .now, .skill-block { grid-template-columns: 1fr; gap: 12px; }
  .par { grid-template-columns: 1fr; gap: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .nav .btn { margin-left: 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .case { padding: 22px; }
  .site-header { position: static; }
}
