/* ===== Cristian Lazo Quispe — minimalist site (al-folio inspired) ===== */

:root {
  --ink:    #111418;
  --muted:  #555b62;
  --faint:  #8a9099;
  --accent: #0b5bd3;        /* link blue */
  --accent-soft: #e8f0fe;
  --rule:   #e9eaec;
  --bg:     #ffffff;
  --maxw:   760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:    #e9ebee;
    --muted:  #aab1b9;
    --faint:  #7b828b;
    --accent: #6ea8ff;
    --accent-soft: #1b2433;
    --rule:   #262a30;
    --bg:     #0f1115;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- top nav ---------- */
.nav {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 10;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-size: 1.02rem;
}
.brand:hover { text-decoration: none; }
.tabs { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.tabs a {
  color: var(--muted);
  font-size: 0.95rem;
}
.tabs a:hover { color: var(--accent); text-decoration: none; }
.tabs a.active { color: var(--ink); font-weight: 600; }

/* ---------- page body ---------- */
main { padding: 2.8rem 0 4rem; }
section { margin: 2.2rem 0; }
section + section { padding-top: 2rem; border-top: 1px solid var(--rule); }

h1 { font-size: 1.7rem; margin: 0 0 .2rem; letter-spacing: -0.02em; }
.role { margin: 0 0 .15rem; font-weight: 600; }
.tagline { margin: 0 0 .7rem; color: var(--muted); font-size: 0.95rem; }

.page-title { font-size: 1.5rem; margin: 0 0 1.4rem; letter-spacing: -0.02em; }

h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 700;
  margin: 0 0 1rem;
}
h3 { font-size: 0.98rem; color: var(--ink); margin: 1.4rem 0 .55rem; font-weight: 700; }
.muted { color: var(--muted); }
.sec-intro { color: var(--muted); font-size: 0.9rem; margin-top: -0.35rem; }

/* ---------- header (about) ---------- */
.head { display: flex; align-items: flex-start; gap: 1.6rem; margin-bottom: 1.6rem; }
.avatar {
  width: 150px; height: 188px;
  object-fit: cover; border-radius: 10px; flex-shrink: 0;
  float: right;
}
.head-text { min-width: 0; }
.links { display: flex; flex-wrap: wrap; gap: 0 1.1rem; font-size: 0.95rem; }

/* about layout: photo floats right, bio wraps */
.about .avatar { margin: 0 0 1rem 1.6rem; }
.about h1, .about .role, .about .tagline, .about .links { }

/* ---------- news / awards ---------- */
ul.news, ul.awards { list-style: none; margin: 0; padding: 0; }
ul.news li, ul.awards li { margin: 0 0 .55rem; padding-left: 5.4rem; position: relative; }
.date {
  position: absolute; left: 0; top: 0; width: 4.9rem;
  color: var(--faint); font-size: 0.8rem; font-variant-numeric: tabular-nums;
}

/* ---------- publications ---------- */
ul.pubs { list-style: none; margin: 0; padding: 0; }
ul.pubs li { margin: 0 0 1.1rem; padding-left: 1.05rem; position: relative; }
ul.pubs li::before { content: "·"; position: absolute; left: 0; color: var(--faint); }
.ptitle { font-weight: 600; }
.me { text-decoration: underline; text-underline-offset: 2px; }
.venue { color: var(--muted); font-size: 0.85rem; }

/* selected highlight — subtle left accent bar, no background flood */
ul.pubs li.selected { border-left: 2px solid var(--accent); margin-left: -1.05rem; padding-left: 2.1rem; }
ul.pubs li.selected::before { content: none; }

/* venue / award badges — blue = venue, one gold = award, rest neutral */
.badge {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600; line-height: 1.5;
  padding: 0.05rem 0.5rem; margin: .3rem .3rem 0 0;
  border-radius: 999px; letter-spacing: 0.01em; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.badge.neutral { background: transparent; color: var(--faint); border-color: var(--rule); }
.badge.award {
  background: color-mix(in srgb, #c88a00 14%, var(--bg));
  color: #b07d00; border-color: color-mix(in srgb, #c88a00 40%, transparent);
}
@media (prefers-color-scheme: dark) {
  .badge.award { color: #f0c869; background: color-mix(in srgb, #f0c869 12%, var(--bg)); }
}

/* link row — small outlined pills */
.plinks { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.plinks a {
  font-size: 0.74rem; padding: 0.12rem 0.62rem; border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
  transition: background .15s, color .15s, border-color .15s;
}
.plinks a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

.seeall { font-size: 0.9rem; margin-top: .6rem; }

/* research interests block */
.interests p { margin: 0 0 .5rem; }
.interests .topics { color: var(--muted); font-size: 0.9rem; }

/* ---------- teaching ---------- */
.tc { margin: 0 0 2rem; }

.tc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.3rem;
}

.tc-inst {
  display: block;
  font-weight: 700;
  font-size: 0.97rem;
}

.tc-course {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.05rem;
}

.tc-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 0.05rem;
}

.tc-meta {
  font-size: 0.8rem;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.tc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: cls;
}

.tc-list li {
  counter-increment: cls;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.22rem 0;
  font-size: 0.88rem;
}

.tc-list li::before {
  content: counter(cls, decimal-leading-zero);
  color: var(--faint);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 1.6rem;
}

.tc-topic {
  flex: 1;
  color: var(--ink);
}

.tc-links {
  display: flex;
  gap: 0.55rem;
  flex-shrink: 0;
  font-size: 0.78rem;
}

.tc-links a { color: var(--accent); }

/* ---------- projects ---------- */
.proj { margin: 0 0 2.4rem; }
.proj-who { font-size: 0.85rem; color: var(--faint); margin: .15rem 0 .7rem; }
.proj-decision {
  border-left: 2px solid var(--accent);
  padding: 0 0 0 .9rem;
  margin: .6rem 0 .8rem;
  font-size: 0.9rem;
}
.proj-decision .lbl { font-weight: 600; color: var(--ink); }
.proj-stack { font-size: 0.8rem; color: var(--faint); margin: .5rem 0 .35rem; }
.proj-note { color: var(--muted); font-size: 0.9rem; }
.proj-thumb { display: block; margin: .2rem 0 1rem; }
.proj-thumb img {
  width: 100%; display: block; border-radius: 10px;
  border: 1px solid var(--rule); background: var(--accent-soft);
  aspect-ratio: 16 / 9; object-fit: cover; object-position: top center;
  transition: opacity .15s;
}
.proj-thumb img:hover { opacity: .93; }
.proj-video {
  width: 100%; aspect-ratio: 16 / 9; margin: .2rem 0 1rem;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--rule);
  background: var(--accent-soft);
}
.proj-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- gallery / highlights ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; margin: 1.4rem 0; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; display: block; border-radius: 8px;
  aspect-ratio: 3 / 2; object-fit: cover;      /* uniform tiles */
  border: 1px solid var(--rule); background: var(--accent-soft);
  cursor: zoom-in; transition: opacity .15s;
}
.gallery img:hover { opacity: 0.92; }
.gallery figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.45; }

/* lightbox popup — full image at natural size */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  padding: 2.5rem 1.5rem; background: rgba(0,0,0,0.88); cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: 94vw; max-height: 90vh; text-align: center; }
.lightbox img { max-width: 94vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 10px 50px rgba(0,0,0,0.55); }
.lightbox figcaption { color: #d7dce2; font-size: 0.86rem; margin-top: 0.7rem; line-height: 1.5; }
.lightbox-close {
  position: fixed; top: 0.8rem; right: 1.1rem; color: #fff; font-size: 2.1rem;
  line-height: 1; background: none; border: none; cursor: pointer; opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* ---------- certifications ---------- */
.certgroup { margin: 0 0 1.4rem; }
.certgroup h3 { margin: 0 0 .5rem; }
ul.certlist { list-style: none; margin: 0; padding: 0; }
ul.certlist li { margin: 0 0 .5rem; padding-left: 1.05rem; position: relative; line-height: 1.5; }
ul.certlist li::before { content: "·"; position: absolute; left: 0; color: var(--faint); }
.certlist .ctitle { font-weight: 600; }
.certlist .corg { color: var(--muted); }
.certlist .cnote { color: var(--faint); font-size: 0.85rem; }

/* ---------- footer ---------- */
footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.colophon { color: var(--faint); font-size: 0.8rem; margin-top: .7rem; }

/* ---------- responsive ---------- */
@media (max-width: 730px) {
  .nav-inner { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  main { padding: 2rem 0 3rem; }
  .about .avatar { float: none; width: 120px; height: 150px; margin: 0 0 1rem; display: block; }
  .head { flex-direction: column; gap: 1rem; }
  ul.news li, ul.awards li { padding-left: 0; }
  .date { position: static; display: block; width: auto; margin-bottom: .1rem; }
  .tc-head { flex-direction: column; gap: 0.2rem; }
  .tc-list li { flex-wrap: wrap; gap: 0.2rem; }
  .tc-topic { flex: 1 1 100%; }
  .tc-links { padding-left: 1.6rem; }
  .nav-inner { flex-direction: column; gap: .4rem; align-items: flex-start; }
}
