/* =========================================================================
   LNAI (Laboratory of Natural and Artificial Intelligence) — stylesheet
   Minimal, academic, hackable. No build step, no dependencies.

   To re-theme the whole site, edit the CSS variables in :root below.
   Palette is taken from Alireza Modirshanechi's personal site (wine / maroon).
   ========================================================================= */

:root {
  /* Brand colors (from sites.google.com/view/modirsha) */
  --brand:        #4C1130; /* deep wine — headings, lab name */
  --brand-bright: #741B47; /* wine-magenta — links, accents */
  --brand-dark:   #360C22; /* darker wine — hovers */
  --brand-tint:   #EAD1DC; /* soft pink tint — fills */

  /* Neutrals */
  --ink:        #1C1C1C;   /* body text */
  --ink-soft:   #5B4753;   /* secondary text, wine-tinted grey */
  --line:       #E3D3DA;   /* hairline borders */
  --bg:         #FDF6F8;   /* very light pink-tinted page background */

  /* Type — Nunito (loaded via Google Fonts) for body/UI text everywhere,
     paired with a Georgia serif for the big editorial headings (h1/h2) —
     same pairing used on sites.google.com/view/modirsha. One scale, same
     two families, on every page. */
  --sans:  "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           Helvetica, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;

  /* Type scale — matches the proportions of sites.google.com/view/modirsha
     (16px body, ~1.15rem lead, ~0.82rem small print). Reuse these
     everywhere instead of one-off sizes so the whole site reads as one
     scale. */
  --fs-base: 16px;
  --fs-lead: 1.15rem;
  --fs-sm:   0.82rem;

  /* Layout */
  --container: 890px;
}

/* ---------- Reset-ish ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  border-top: 4px solid var(--brand-bright);
}

/* ---------- Accessibility ----------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 3px solid var(--brand-bright);
  outline-offset: 2px;
}
main:focus { outline: none; }

/* ---------- Header / nav ------------------------------------------------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.brand {
  text-decoration: none;
  border-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.brand-icon { height: 20px; width: auto; display: block; }
.brand-word {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.06em;
  line-height: 1;
}
.brand:hover { opacity: 0.8; }

/* reusable inline "LNAI" mark for footers etc. */
.lab-mark {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 0.35em;
  white-space: nowrap;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lab-mark-icon { height: 13px; width: auto; display: block; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.nav a {
  font-size: 1rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--brand-bright); }
.nav a[aria-current="page"] {
  color: var(--brand-bright);
  border-bottom-color: var(--brand-bright);
}

/* ---------- Main content area ------------------------------------------- */
main {
  max-width: var(--container);
  margin: 40px auto;
  padding: 0 24px;
}

.card {
  padding: 8px 0 48px;
}

/* ---------- Photo / figure ---------------------------------------------- */
.photo {
  margin: 2rem 0 0;
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.photo figcaption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

/* ---------- Typography --------------------------------------------------- */
h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.2;
  color: var(--brand);
  margin: 0 0 0.5rem;
}
h1 + .rule {
  width: 64px;
  height: 3px;
  background: var(--brand-bright);
  border: 0;
  margin: 0 0 1.6rem;
}

h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brand);
  margin: 2.4rem 0 0.8rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.6rem 0 0.3rem;
}

p { margin: 0 0 1.1rem; }

.lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  line-height: 1.6;
}

.small { font-size: var(--fs-sm); }

a {
  color: var(--brand-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--brand-tint);
}
a:hover { color: var(--brand-dark); border-bottom-color: var(--brand-bright); }

strong { color: var(--brand); }

/* ---------- Challenges list (Main page) --------------------------------- */
.challenges {
  margin: 0.8rem 0 0 1.2rem;
  padding: 0;
}
.challenges li {
  margin-bottom: 0.5rem;
}
.challenges .label {
  font-weight: 600;
  color: var(--brand);
}
.challenges li::marker,
.doclist li::marker { color: var(--brand); }

/* ---------- Featured PI card (People page) -------------------------------- */
.pi-feature {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin: 1.2rem 0 2.2rem;
  background: rgba(76,17,48,0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pi-feature img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.pi-feature .name { font-weight: 600; color: var(--brand); font-size: 1.1rem; }
.pi-feature .role { color: var(--ink-soft); margin-top: 2px; }
.pi-feature .links { margin-top: 6px; font-size: var(--fs-sm); }

/* ---------- People grid (open positions) ---------------------------------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
  margin: 1.2rem 0 0;
}
.person {
  text-align: center;
}
.person .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 1.6rem;
  font-weight: 700;
  object-fit: cover;
  overflow: hidden;
}
.person .name { font-weight: 600; color: var(--brand); }
.person .role { font-size: var(--fs-sm); color: var(--ink-soft); }
.person .links { font-size: var(--fs-sm); margin-top: 4px; }

/* Open position slots — a hollow dashed circle that reads as an invitation */
.person--open .avatar {
  background: transparent;
  border: 2px solid var(--brand);
  color: var(--brand);
}
.person--open .avatar-icon { width: 56px; height: 56px; }

/* ---------- Reading list (Resources page) -------------------------------- */
/* Each entry: linked title, then an italic byline, then an optional bold
   note — same stack and square-bullet indent as the personal site. */
.doclist { list-style: square; margin: 0.6rem 0 0 1.1rem; padding: 0; }
.doclist li { margin-bottom: 0.55rem; }
.doclist .byline,
.doclist .note {
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.3;
  color: var(--ink-soft);
}
.doclist .byline { font-style: italic; margin-top: 1px; }
.doclist .note { font-weight: 700; margin-top: 1px; }
.acro { color: var(--brand); font-weight: 700; }

/* ---------- Publication list (title / authors / venue stacked) ---------- */
.pub-list { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.pub-list li {
  padding: 8px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--line);
  border-radius: 4px;
  transition: background-color 0.15s ease;
}
.pub-list li:hover { background: rgba(76,17,48,0.035); }
.pub-list li:last-child { border-bottom: 0; }
.pub-title { display: block; font-weight: 600; color: var(--brand); line-height: 1.3; }

/* Entries with a journal-cover thumbnail (see Publications page) */
.pub-item--cover { display: flex; flex-direction: row-reverse; gap: 14px; align-items: flex-start; }
.pub-cover {
  width: 64px;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  margin-top: 2px;
}
.pub-item--cover .pub-body { flex: 1; min-width: 0; }

/* Key Publications — highlighted card, star-marked titles */
.pub-list--key {
  background: rgba(76,17,48,0.045);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 14px;
  margin-top: 1rem;
}
.pub-list--key li:hover { background: rgba(76,17,48,0.06); }
.pub-list--key .pub-title::before {
  content: "★";
  display: inline-block;
  margin-right: 0.4em;
  color: var(--brand-bright);
  font-size: 0.8em;
}
/* authors/venue/extra are indented under the title, like on the personal site */
.pub-authors,
.pub-venue,
.pub-extra {
  display: block;
  margin-top: 1px;
  padding-left: 1rem;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-style: italic;
  line-height: 1.3;
}
.pub-extra { font-style: normal; }

/* ---------- Homepage figure (robot + brain mark) --------------------------- */
.home-figure {
  margin: 2rem 0;
  text-align: center;
}
.home-figure img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

/* ---------- Hero illustration (Resources page) --------------------------- */
.hero-figure {
  margin: 0.4rem 0 1.6rem;
  text-align: center;
}
.hero-illustration {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 6px;
  margin: 0 auto;
}
/* wide banner-shaped figures (e.g. a strip of portraits) span the full
   content width instead of being capped like a small square illustration */
.hero-figure--banner .hero-illustration {
  max-width: 100%;
  aspect-ratio: 4 / 1;
  object-fit: cover;
}

/* ---------- Resource sections (Resources page) ---------------------------
   Each topic gets its own tinted card with alternating background, echoing
   the banded sections of the personal site while staying inside our card
   system rather than going full-bleed. */
.resource-block {
  position: relative;
  padding: 1.5rem 1.75rem;
  margin: 0 0 1.75rem;
  border-radius: 8px;
}
.resource-block h2 { margin-top: 0; }
.resource-block:nth-of-type(odd) {
  background: rgba(76,17,48,0.05);
}
.resource-block:nth-of-type(even) {
  background: rgba(234,209,220,0.32);
}

/* Domain icon (Research page) — tucked into the bottom-right corner of
   each box; extra bottom padding keeps it clear of the list above it. */
.resource-block:has(.block-icon) { padding-bottom: 4.75rem; }
.block-icon {
  position: absolute;
  right: 1.6rem;
  bottom: 1.3rem;
  width: 46px;
  height: auto;
  opacity: 0.92;
}
/* the brain/robot illustrations read smaller than the sigma glyph at the
   same width, so give them a bit more size to feel visually consistent */
.block-icon[src$="brain.svg"],
.block-icon[src$="robot.svg"] {
  width: 62px;
}
.hero-figure figcaption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-style: italic;
}

/* ---------- PI subpage header -------------------------------------------- */
.pi-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.pi-header img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.pi-header .pi-header-text { flex: 1; min-width: 240px; }
.pi-header h1 { margin-bottom: 0.5rem; }
.pi-header .pi-header-text p {
  margin: 0 0 0.25rem;
  color: var(--ink-soft);
}
.pi-header .pi-header-text .role {
  color: var(--brand-bright);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.1rem;
}
.pi-header .pi-header-text .pi-email {
  font-size: var(--fs-sm);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.pi-links { display: grid; grid-template-columns: repeat(4, auto); gap: 10px 28px; margin-top: 8px; }
.pi-links .link-row { display: inline-flex; align-items: center; gap: 0.45em; border-bottom: 0; }
.pi-links .arrow { color: var(--ink-soft); }
.pi-links .link-icon { width: 16px; height: 16px; }

/* ---------- Talk cards with thumbnails ------------------------------------ */
.talk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 24px;
  margin: 1.2rem 0 0;
}
.talk-card {
  display: block;
  text-decoration: none;
  border-bottom: 0;
}
.talk-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 10px;
}
.talk-card .talk-title { font-weight: 600; color: var(--brand); display: block; }
.talk-card .talk-meta { color: var(--ink-soft); font-size: var(--fs-sm); display: block; margin-top: 2px; }
.talk-card:hover .talk-title { color: var(--brand-bright); }
.talk-card:hover img { opacity: 0.88; }

/* ---------- Simple link lists (Open Positions / Talks) ------------------ */
.linklist { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.linklist li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.linklist li:last-child { border-bottom: 0; }
.linklist .meta { color: var(--ink-soft); font-size: var(--fs-sm); }

/* ---------- Callout (Open Positions) ------------------------------------ */
.callout {
  background: rgba(76,17,48,0.05);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 24px;
  margin: 1.4rem 0;
}

.button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 11px 22px;
  border-radius: 4px;
  border: 0;
  text-decoration: none;
  font-weight: 600;
}
.button:hover { background: var(--brand-dark); color: #fff; }

/* editorial helper for placeholders you should fill in */
.todo {
  background: #fffbe6;
  border: 1px dashed #d6c560;
  color: #6b5d00;
  font-size: var(--fs-sm);
  padding: 2px 7px;
  border-radius: 3px;
}

/* ---------- Footer ------------------------------------------------------- */
.site-footer {
  max-width: var(--container);
  margin: 8px auto 48px;
  padding: 20px 24px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}
.site-footer a { border-bottom: 0; }

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.6rem; }
  .site-header__inner { padding: 16px 20px; }
  main { padding: 0 16px; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .pi-feature { text-align: center; justify-content: center; }
  .pi-links { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 420px) {
  .people-grid { grid-template-columns: 1fr; }
  .pi-links { grid-template-columns: 1fr; }
}
