/* ---------------------------------------------------------------
   Anda Skeja — personal academic site
   --------------------------------------------------------------- */

:root {
  --bg:          #fbfaf7;
  --surface:     #ffffff;
  --text:        #1f2328;
  --muted:       #61697a;
  --faint:       #8b93a3;
  --rule:        #e6e2da;
  --accent:      #3c6e71;
  --accent-soft: #eaf1f0;
  --maxw:        1080px;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(60, 110, 113, 0.28);
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------
   Navigation
   --------------------------------------------------------------- */

.nav-wrap {
  border-bottom: 1px solid var(--rule);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

nav a {
  display: inline-block;
  padding: 18px 0;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--text); border-bottom-color: var(--rule); }
nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 32px 24px;
}

.home {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: start;
}

.sidebar { position: sticky; top: 108px; }

/* ---------------------------------------------------------------
   Portrait + identity card
   --------------------------------------------------------------- */

.portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.04), 0 8px 24px -12px rgba(31, 35, 40, 0.18);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform .4s ease;
}
.portrait:hover img { transform: scale(1.03); }
.portrait .monogram {
  display: none;
  font-family: var(--serif);
  font-size: 60px;
  letter-spacing: .04em;
  color: var(--accent);
}
.portrait .hint {
  display: none;
  position: absolute;
  bottom: 10px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: .04em;
}
.portrait.no-img { position: relative; }
.portrait.no-img .monogram,
.portrait.no-img .hint { display: block; }

.sidebar h1 {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -.01em;
}

.role {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.affil {
  margin: 2px 0 20px;
  font-size: 14.5px;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.links a {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
}
.links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.contact-label {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.contact-email {
  margin: 0;
  font-size: 14px;
}

.cv-note {
  margin: -8px 0 22px;
  font-size: 15px;
}

/* ---------------------------------------------------------------
   CV page
   --------------------------------------------------------------- */

.cv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.cv-bar .page-intro { margin: 0; }

.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  flex-shrink: 0;
}
.cv-download:hover { background: #2f5a5c; border-color: #2f5a5c; }

.cv-text {
  margin: 0 0 18px;
  max-width: 68ch;
}

.cv-pubs {
  margin: 0 0 8px;
  padding-left: 22px;
}
.cv-pubs li {
  margin: 0 0 12px;
  padding-left: 4px;
  font-size: 14.5px;
  line-height: 1.55;
}
.cv-pubs li::marker {
  font-size: 13px;
  color: var(--faint);
}

@media (max-width: 560px) {
  .cv-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cv-download { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------
   Prose
   --------------------------------------------------------------- */

.prose > :first-child { margin-top: 0; }

.prose h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 44px 0 14px;
}

.prose h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.prose p { margin: 0 0 18px; }

.lead { font-size: 16.5px; line-height: 1.6; }

.page-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 10px;
}

.page-intro {
  color: var(--muted);
  max-width: 100%;
  margin: 0 0 8px;
}

.note {
  font-size: 14px;
  color: var(--faint);
  margin: 0 0 8px;
}

/* ---------------------------------------------------------------
   News
   --------------------------------------------------------------- */

.news-list {
  margin: 0 0 8px;
  padding-left: 22px;
}
.news-list li {
  margin: 0 0 12px;
  padding-left: 4px;
  font-size: 15.5px;
  line-height: 1.6;
}
.news-list li:last-child { margin-bottom: 0; }
.news-list li::marker { color: var(--faint); }

/* ---------------------------------------------------------------
   Publications
   --------------------------------------------------------------- */

.pub-list { margin: 0; padding: 0; list-style: none; }

.pub {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.pub:last-child { border-bottom: none; }

.pub .title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 5px;
}

.pub .authors { margin: 0 0 3px; font-size: 15px; color: var(--text); }
.pub .authors .me { font-style: italic; }

.pub .venue { margin: 0; font-size: 14.5px; color: var(--muted); }

.pub .meta { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
}
a.tag:hover { background: var(--accent); color: #fff; }

.alpha { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------
   Two-column entry rows (teaching, talks, grants)
   --------------------------------------------------------------- */

.entries { margin: 0; padding: 0; list-style: none; }

.entry {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.entry:last-child { border-bottom: none; }

.entry .what { margin: 0; }
.entry .what strong { font-weight: 600; }
.entry .sub { display: block; font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.entry .when {
  font-size: 14px;
  color: var(--faint);
  text-align: right;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Bulleted entry lists (teaching page)
   --------------------------------------------------------------- */

.page-narrow { max-width: 880px; }

.page > h3 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.page > h3:first-of-type { margin-top: 28px; }

/* Two-column CV sections: serif label rail on the left, entries on the right */
.cv-section {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 48px;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
.cv-section:first-of-type { border-top: none; padding-top: 24px; }
.cv-section:last-of-type { padding-bottom: 8px; }

.cv-label {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
  margin: 0;
}

.cv-body { min-width: 0; }

.group-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 28px 0 12px;
}
.cv-body .group-title:first-child { margin-top: 4px; }

.item-list { margin: 0; padding: 0; list-style: none; }
.item-list li { margin: 0 0 16px; }
.item-list li:last-child { margin-bottom: 0; }

.item-name {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.45;
}
.item-name strong { font-weight: 600; }

.item-sub {
  margin: 3px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .cv-section { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 32px 56px;
  border-top: 1px solid var(--rule);
  margin-top: 56px;
  font-size: 13.5px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer a { color: var(--faint); border-bottom-color: var(--rule); }
footer a:hover { color: var(--accent); }
footer .updated { font-size: 12.5px; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; max-width: 100%; }
  .page { padding: 36px 22px 16px; }
  nav { padding: 0 22px; gap: 20px; }
  footer { padding: 32px 22px 44px; }
  .entry { grid-template-columns: 1fr; gap: 2px; }
  .entry .when { text-align: left; }
  .page-title { font-size: 32px; }
}

/* Phone: portrait sits beside identity instead of stacking as a full-width square */
@media (max-width: 560px) {
  .home { gap: 28px; }
  .sidebar {
    display: grid;
    grid-template-columns: 100px 1fr;
    grid-template-areas:
      "photo identity"
      "contact contact";
    column-gap: 16px;
    row-gap: 16px;
    align-items: center;
  }
  .portrait {
    grid-area: photo;
    width: 140px;
    aspect-ratio: 1 / 1;
    margin-bottom: 0;
    border-radius: 8px;
    align-self: start;
  }
  .sidebar {
    grid-template-columns: 140px 1fr;
  }
  .portrait .monogram { font-size: 40px; }
  .portrait .hint { display: none !important; }
  .identity { grid-area: identity; }
  .sidebar h1 { font-size: 21px; margin-bottom: 5px; line-height: 1.15; }
  .role { font-size: 13.5px; }
  .affil { font-size: 13px; margin: 2px 0 0; }
  .contact { grid-area: contact; }
  .lead { font-size: 16.5px; }
  .prose h2 { font-size: 22px; margin-top: 32px; }
  .pub .title { font-size: 17.5px; }
  nav { gap: 14px; padding: 0 12px; flex-wrap: nowrap; overflow-x: auto; justify-content: center; }
  nav a { padding: 14px 0; font-size: 13px; white-space: nowrap; }
  .page { padding: 28px 16px 12px; }
  footer { padding: 28px 16px 40px; flex-direction: column; gap: 6px; }
}
