/* ---------------------------------------------------------------
   Nika Mansouri Ghiasi — academic site
   Layout modelled on the Hugo Blox (Wowchemy) Academic template.
   --------------------------------------------------------------- */

:root {
  --accent:      #1565c0;
  --accent-dark: #0d47a1;
  --ink:         #232323;
  --muted:       #5b6472;
  --muted-warm:  #a9505f;
  --faint:       #828b98;
  --label:       #b02a3d;
  --flag:        #9c1f33;
  --flag-line:   #d4566a;
  --flag-bg:     #fdf0f2;
  --paper:       #ffffff;
  --alt:         #f5f7fa;
  --rule:        #e4e8ed;

  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --nav-h: 3.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 100;
  padding: .5rem .8rem; background: var(--accent); color: #fff;
}

/* --- navbar ---------------------------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.navbar__inner {
  max-width: 62rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar__brand {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.navbar__brand:hover { color: var(--accent); text-decoration: none; }

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar__menu a {
  font-size: .86rem;
  font-weight: 400;
  color: var(--muted);
  padding: .2rem 0;
  border-bottom: 2px solid transparent;
}

.navbar__menu a:hover { color: var(--accent); text-decoration: none; }

.navbar__menu a.is-active {
  color: var(--accent);
  font-weight: 500;
  border-bottom-color: var(--accent);
}

.navbar__toggle {
  display: none;
  width: 2.4rem; height: 2.2rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.navbar__bars,
.navbar__bars::before,
.navbar__bars::after {
  display: block;
  width: 1.1rem; height: 2px;
  margin: 0 auto;
  background: var(--muted);
  position: relative;
}

.navbar__bars::before,
.navbar__bars::after { content: ""; position: absolute; left: 0; }
.navbar__bars::before { top: -6px; }
.navbar__bars::after  { top: 6px; }

/* --- profile (photo + about, side by side) ---------------------- */

.profile {
  padding: 3rem 1.25rem 3.25rem;
  border-bottom: 1px solid var(--rule);
}

.profile__inner {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 3.25rem;
  align-items: start;
}

.profile__card { text-align: center; }

.profile__avatar {
  display: block;
  width: 100%;
  max-width: 17rem;
  height: auto;
  margin: 0 auto;
  border-radius: 0;
  border: 4px solid #fff;
  box-shadow: 0 3px 14px rgba(20, 30, 50, .13);
  background: var(--alt);
}

.profile__name {
  margin: 1.1rem 0 .25rem;
  font-size: 1.42rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.profile__role { margin: 0 0 .15rem; font-size: .95rem; color: var(--muted); }
.profile__org  { margin: 0 0 .35rem; font-size: .88rem; line-height: 1.45; }

.profile__mail {
  margin: 0 0 1.1rem;
  font-size: .8rem;
  color: var(--faint);
  word-break: break-word;
}

.profile__links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
}

.profile__body > p { margin: 0 0 1.1rem; }

.callout {
  margin: 2rem 0 0;
  padding: 1rem 1.2rem;
  background: var(--flag-bg);
  border-left: 3px solid var(--flag-line);
  border-radius: 0 5px 5px 0;
}

.callout p { margin: 0; font-size: .98rem; }

/* Leads the right-hand column. The 4px top offset matches the photo's white
   border, so the callout's top edge lines up with the visible top of the image. */
.callout--lead { margin: 4px 0 1.6rem; }

.callout__label {
  margin-bottom: .3rem !important;
  font-size: .72rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--flag);
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1.9rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}

/* --- pills & buttons ------------------------------------------- */

.pill {
  display: inline-block;
  padding: .28rem .8rem;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.pills { margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }

.button {
  display: inline-block;
  padding: .5rem 1.15rem;
  font-size: .88rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
}

.button:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }

.button--ghost {
  color: var(--accent);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.button--ghost:hover { color: #fff; background: var(--accent); }

/* --- sections -------------------------------------------------- */

.section { padding: 3.5rem 1.25rem; }
.section--alt { background: var(--alt); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section--top { padding-top: 2.75rem; }

.container { max-width: 62rem; margin: 0 auto; }
.container--narrow { max-width: 42rem; }
.container--mid { max-width: 52rem; }

.section__title {
  margin: 0 0 2rem;
  font-size: 1.65rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: -.005em;
}

.section__title--left {
  margin-top: .2rem;
  margin-bottom: 1.4rem;
  text-align: left;
  font-size: 1.5rem;
}

.sub {
  margin: 2rem 0 .9rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--label);
}

.sub:first-of-type { margin-top: 0; }

.page__title { margin: 0 0 .4rem; font-size: 2rem; font-weight: 500; }
.page__lede { margin: 0 0 2.25rem; color: var(--muted); font-size: .95rem; }

.year {
  margin: 2.5rem 0 .9rem;
  padding-bottom: .35rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 2px solid var(--rule);
}

/* --- about ----------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 3rem;
}

.about__bio p { margin: 0 0 1.1rem; }
.about__bio p:last-child { margin-bottom: 0; }

.side__head {
  margin: 0 0 .7rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--label);
}

.side__list {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  font-size: .92rem;
}

.side__list:last-child { margin-bottom: 0; }

.side__list li {
  padding: .18rem 0 .18rem .95rem;
  position: relative;
  color: var(--muted);
}

.side__list li::before {
  content: "";
  position: absolute;
  left: 0; top: .82em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.side__list--edu li { padding-bottom: .7rem; }

.side__degree { display: block; color: var(--ink); font-weight: 500; line-height: 1.45; }
.side__place  { display: block; font-size: .85rem; color: var(--faint); }

.theses { margin-top: 0; max-width: 46rem; }

/* --- news ------------------------------------------------------ */

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

.news__item {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--rule);
}

.news__item:last-child { border-bottom: 0; }

.news__date {
  font-size: .82rem;
  font-weight: 500;
  color: var(--accent);
  padding-top: .1em;
  white-space: nowrap;
}

.news__text { font-size: .95rem; }

.more { margin-top: 1.1rem; }

/* --- awards ---------------------------------------------------- */

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

.awards__item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
}

.awards__item:last-child { border-bottom: 0; }

.awards__year {
  font-size: .82rem;
  font-weight: 500;
  color: var(--label);
  padding-top: .1em;
  white-space: nowrap;
}

.awards__text { font-size: .95rem; }

.more summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
}

.more[open] summary { margin-bottom: .6rem; }

/* --- publications ---------------------------------------------- */

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

.pub {
  padding: 1rem 1.1rem;
  margin-bottom: .7rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.pub:hover {
  border-color: #cfd8e3;
  box-shadow: 0 2px 10px rgba(20, 30, 50, .07);
}

.pub__authors {
  margin: 0 0 .2rem;
  font-size: .87rem;
  line-height: 1.55;
  color: var(--muted);
}

.pub__authors b { color: var(--ink); font-weight: 500; }

.pub__title {
  margin: 0 0 .2rem;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.45;
}

.pub__venue { margin: 0; font-size: .87rem; color: var(--faint); }

.cta { margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

/* --- timeline (experience) ------------------------------------- */

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

.tl {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}

.tl:last-of-type { border-bottom: 0; }

.tl__when {
  margin: 0;
  font-size: .87rem;
  font-weight: 500;
  color: var(--accent);
  padding-top: .12em;
}

.tl__body p { margin: 0 0 .3rem; font-size: .95rem; }
.tl__body p:last-child { margin-bottom: 0; }

.tl__what  { font-weight: 500; font-size: 1.02rem !important; }
.tl__where { color: var(--muted-warm); font-size: .89rem !important; }

/* --- roles (CV-style research experience) ---------------------- */

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

.role {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

.role:last-child { border-bottom: 0; padding-bottom: 0; }

.role__org {
  margin: 0 0 .3rem;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.45;
}

.role__adv {
  font-weight: 400;
  font-size: .89rem;
  color: var(--muted-warm);
}

.role__title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .3rem 1rem;
  margin: 0 0 .1rem;
  font-size: .95rem;
  font-style: italic;
  font-weight: 500;
}

.role__when {
  font-style: normal;
  font-size: .87rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

.role .ticks { margin-top: .45rem; }

/* --- talks ------------------------------------------------------ */

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

.talk {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
}

.talk:last-child { border-bottom: 0; padding-bottom: 0; }

.talk__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.45;
}

.talk__slides {
  font-size: .85rem;
  font-weight: 400;
  color: var(--faint);
  white-space: nowrap;
}

.talk__note {
  display: inline-block;
  margin-left: .4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label);
}

.talk .ticks { margin-top: .35rem; }

/* --- lists / columns ------------------------------------------- */

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }

.ticks { margin: 0; padding: 0; list-style: none; font-size: .95rem; }

.ticks li {
  padding: .3rem 0 .3rem 1.1rem;
  position: relative;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: .95em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.ticks--wide { max-width: 46rem; margin: 0 auto; }

.ticks__when {
  display: block;
  font-size: .85rem;
  color: var(--faint);
}

.sub__when {
  margin-left: .5rem;
  font-weight: 400;
  letter-spacing: .05em;
  color: var(--faint);
}

/* --- contact & footer ------------------------------------------ */

.contact { margin: 0; text-align: center; font-size: 1.05rem; }
.contact__where { margin-top: .35rem; font-size: .92rem; color: var(--muted); }

.footer {
  padding: 1.75rem 1.25rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: .82rem;
  color: var(--faint);
}

.footer p { margin: 0; }

/* --- responsive ------------------------------------------------ */

@media (max-width: 900px) {
  .profile__inner { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .profile__card { text-align: center; }
  .profile__avatar { max-width: 22rem; }
  .section__title--left { text-align: center; }
  .about__grid { gap: 1.5rem; }
  .cols  { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
}

@media (max-width: 780px) {
  .navbar__toggle { display: block; }

  .navbar__menu {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: .5rem 1.25rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 6px 16px rgba(20, 30, 50, .08);
  }

  .navbar__menu.is-open { display: flex; }

  .navbar__menu li { width: 100%; }

  .navbar__menu a {
    display: block;
    width: 100%;
    padding: .5rem 0;
    font-size: .95rem;
    border-bottom: 0;
  }

  .navbar__menu a.is-active { border-bottom: 0; }

  .profile { padding: 2.25rem 1.25rem 2.5rem; }
  .about__grid { grid-template-columns: minmax(0, 1fr); }

  .section { padding: 2.5rem 1.25rem; }
  .section__title { font-size: 1.4rem; margin-bottom: 1.5rem; }

  .news__item,
  .awards__item,
  .tl {
    grid-template-columns: minmax(0, 1fr);
    gap: .15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* --- print ----------------------------------------------------- */

@media print {
  .navbar, .footer, .skip, .profile__links, .cta { display: none; }
  .section, .section--alt { background: #fff; padding: 1rem 0; border: 0; }
  .pub { break-inside: avoid; border: 0; padding: .4rem 0; }
  a { color: #000; }
}
