/* Sara Rajaee — site styles. Light theme, no framework. */
:root {
  --text: #16181d;
  --muted: #5b6270;
  --soft: #39404d;
  --body2: #2b313c;
  --authors: #4b5260;
  --faint: #6b7280;
  --line: #e4e7ec;
  --line2: #d6dae1;
  --accent: #2340c9;
  --accent-dark: #16288f;
  --accent-bg: #eef2ff;
  --accent-line: #c7d2fe;
  --next: #d6336c;
  --next-ink: #a61e4d;
  --next-bg: #fff7fa;
  --next-line: #f3c4d4;
  --head: "Space Grotesk", Inter, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; }
h2 { font-size: 30px; letter-spacing: -0.01em; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--text); color: #fff; padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 8px; color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.nav {
  padding-top: 18px; padding-bottom: 18px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.nav-name { font-family: var(--head); font-weight: 600; font-size: 20px; color: var(--text); }
.nav-name:hover { color: var(--text); }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.nav-links a { color: var(--soft); }
.nav-links a.nav-cv { color: var(--accent); font-weight: 600; }

/* ---------- Buttons, pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border-radius: 10px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border: 0; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-soft { background: var(--accent-bg); border: 1px solid var(--accent-line); color: var(--accent-dark); font-size: 14px; }
.btn-soft:hover { background: #e0e7ff; }
.btn-ghost { background: #fff; border: 1px solid var(--line2); color: var(--body2); font-size: 14px; }
.btn-ghost:hover { background: #f6f7f9; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pill {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line2); border-radius: 999px; color: var(--body2);
}
.pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Dots ---------- */
.dot { flex: 0 0 auto; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; }
.dot-sm { width: 8px; height: 8px; margin-top: 8px; }
.dot-xs { width: 10px; height: 10px; margin: 0; }
.dot-lg { width: 14px; height: 14px; margin: 0; }
.dot-next { background: var(--next); }
.ring {
  flex: 0 0 auto; display: inline-block; width: 12px; height: 12px; margin-top: 6px;
  border-radius: 50%; border: 2.5px dashed; background: #fff;
}
.ring-lg { width: 14px; height: 14px; margin: 0; }
@keyframes nextpulse {
  0% { box-shadow: 0 0 0 0 rgba(214, 51, 108, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(214, 51, 108, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 51, 108, 0); }
}
.pulse { animation: nextpulse 2.2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none !important; } }

/* ---------- Hero ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding: 56px 0 40px; }
.hero-side { flex: 0 0 200px; display: flex; flex-direction: column; gap: 22px; }
.hero-photo { width: 200px; height: 200px; object-fit: cover; border-radius: 20px; display: block; }
.affils { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.affils a { display: flex; align-items: center; justify-content: center; width: 200px; min-height: 36px; border-radius: 6px; }
.affils img { max-width: 200px; height: 26px; width: auto; display: block; }
.affils a:focus-visible { outline-offset: 4px; }
.hero-text { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero-head { display: flex; flex-direction: column; gap: 6px; }
.hero h1 { font-size: 48px; line-height: 1.05; letter-spacing: -0.02em; }
.hero-role { margin: 0; font-size: 17px; color: var(--muted); }
.hero-bio { margin: 0; font-size: 17px; line-height: 1.65; max-width: 680px; }
.job-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 14px 18px; background: var(--accent-bg); border: 1px solid var(--accent-line);
  border-radius: 12px; max-width: 680px;
}
.job-box > span { font-size: 15px; line-height: 1.5; flex: 1 1 320px; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.section-last { padding-bottom: 56px; }
.section-intro { display: flex; flex-direction: column; gap: 6px; }
.lede { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 760px; }
.more { font-size: 15px; font-weight: 600; align-self: flex-start; }

/* ---------- Research map ---------- */
#map { gap: 18px; }
.map-noscript { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.rmap { display: flex; flex-direction: column; gap: 18px; }
.rmap-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line2); background: #fff;
  font: inherit; font-size: 14px; color: var(--body2); cursor: pointer;
}
.chip:hover { background: #f6f7f9; }
.chip.is-on { background: #f1f3f6; border-color: var(--chip-ink); }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip-count { color: var(--faint); }

.rmap-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.rmap-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rmap-canvas {
  position: relative; height: 500px; border: 1px solid var(--line); border-radius: 16px;
  background: #fafbfc; overflow: hidden;
}
.rmap-bg, #rmap-yearlabels, #rmap-themelabels, #rmap-points { position: absolute; inset: 0; }
#rmap-yearlabels, #rmap-themelabels { pointer-events: none; }
.bg-dot { position: absolute; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #b9c0cc; }
.rmap-halo {
  position: absolute; width: 136px; height: 136px; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(214, 51, 108, 0.07); border: 1.5px dashed rgba(214, 51, 108, 0.5);
  pointer-events: none;
}
.rmap-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rmap-svg polyline { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.traj-past { stroke: var(--faint); stroke-dasharray: 5 5; }
.traj-future { stroke: var(--next); stroke-dasharray: 2 6; stroke-linecap: round; }

.year-label {
  position: absolute; transform: translate(-50%, -150%);
  font-size: 11px; font-weight: 600; color: var(--authors); background: #fff;
  border: 1px solid var(--line2); border-radius: 6px; padding: 1px 5px; white-space: nowrap;
}
.year-label-now { color: var(--text); border-color: var(--soft); }
/* Drawn beside the 136px halo (right, or left near the edge) so it stays clear of the "Now" tag. */
.year-label-next { color: var(--next-ink); border-color: var(--next); transform: translate(72px, -50%); }
.year-label-next.on-left { transform: translate(calc(-100% - 72px), -50%); }

.theme-label {
  position: absolute; font-family: var(--head); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
  transform: translateY(-50%);
}
.theme-label.anchor-center { transform: translate(-50%, -50%); }
.theme-label.anchor-right { transform: translate(-100%, -50%); }

.pt {
  position: absolute; transform: translate(-50%, -50%);
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: opacity 0.3s;
}
.pt:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; border-radius: 50%; }
.pt-dot {
  display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(22, 24, 29, 0.25);
  transition: width 0.2s, height 0.2s;
}
.pt-selected .pt-dot { width: 17px; height: 17px; box-shadow: 0 0 0 3px var(--ring), 0 1px 3px rgba(22, 24, 29, 0.25); }
.pt-now .pt-dot { width: 16px; height: 16px; background: #fff; border: 2.5px dashed; }
.pt-next .pt-dot { width: 15px; height: 15px; background: var(--next); }
.pt.is-active { z-index: 2; }
.pt.is-active .pt-dot { width: 22px; height: 22px; box-shadow: 0 0 0 5px rgba(22, 24, 29, 0.22), 0 1px 3px rgba(22, 24, 29, 0.25); }
.pt-next.is-active .pt-dot { width: 20px; height: 20px; }
@media (prefers-reduced-motion: reduce) { .pt, .pt-dot { transition: none; } }

.rmap-time { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.rmap-time label { font-size: 14px; color: var(--soft); }
.rmap-time input[type=range] { flex: 1 1 220px; min-width: 160px; accent-color: var(--accent); min-height: 32px; }
.rmap-yearlabel { font-family: var(--head); font-weight: 600; font-size: 18px; min-width: 48px; }
.rmap-yearlabel.is-next { color: var(--next-ink); }
.rmap-count { font-size: 14px; color: var(--muted); }

.rmap-panel {
  flex: 1 1 280px; min-width: 0; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; display: flex; flex-direction: column; gap: 10px; background: #fff;
}
.panel-theme { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.panel-meta { font-size: 13px; color: var(--muted); }
.rmap-panel h3 { font-size: 20px; line-height: 1.3; }
.panel-authors { margin: 0; font-size: 14px; line-height: 1.5; color: var(--authors); }
.panel-authors strong, .sel-authors strong, .pub-authors strong { color: var(--text); }
.panel-blurb { margin: 0; font-size: 15px; line-height: 1.6; }
.panel-link { font-weight: 600; font-size: 15px; }
.panel-hint { margin-top: auto; font-size: 12px; color: var(--faint); }

/* ---------- Now & next ---------- */
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.card-next { background: var(--next-bg); border-color: var(--next-line); }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h3 { font-size: 20px; }
.item { display: flex; gap: 12px; align-items: flex-start; }
.item .dot { margin-top: 6px; }
.item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-body strong { font-size: 16px; }
.item-body span { font-size: 14px; line-height: 1.55; color: var(--soft); }
.next-cta { margin-top: auto; font-size: 15px; font-weight: 600; color: var(--next-ink); }
.next-cta:hover { color: #7d1238; }

/* ---------- Selected papers ---------- */
.selected { display: flex; flex-direction: column; gap: 26px; }
.sel { display: flex; gap: 16px; align-items: flex-start; }
.sel .dot { margin-top: 8px; }
.sel-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.venue { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; border: 1px solid; border-radius: 6px; padding: 2px 8px; }
.sel h3 { font-family: Inter, system-ui, sans-serif; font-size: 18px; line-height: 1.4; }
.sel h3 a { color: var(--text); }
.sel h3 a:hover { color: var(--accent); }
.sel-authors { margin: 0; font-size: 14px; line-height: 1.5; color: var(--authors); }
.sel-blurb { margin: 0; font-size: 15px; line-height: 1.6; color: var(--body2); }
.pub-links { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; font-weight: 500; }

/* ---------- Highlights ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.card-sm { border-radius: 14px; padding: 18px; gap: 6px; }
.card-sm strong { font-size: 17px; }
.card-sm strong a { color: var(--text); }
.card-sm > span { font-size: 14px; line-height: 1.55; color: var(--soft); }
.card-sm .card-meta { font-size: 13px; color: var(--muted); }

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.news li { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; line-height: 1.6; }
.news-date { flex: 0 0 90px; color: var(--muted); font-weight: 500; }
.news-text { flex: 1 1 420px; min-width: 0; }
.news-year { font-size: 20px; color: var(--soft); margin-top: 8px; }

/* ---------- Publications list ---------- */
.all-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#all .muted { margin: -8px 0 0; }
.pub-years { display: flex; flex-direction: column; gap: 28px; }
.pub-year h3 { font-size: 20px; color: var(--soft); margin-bottom: 12px; }
.pub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pub { display: flex; gap: 12px; align-items: flex-start; }
.pub-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; line-height: 1.5; }
.pub-title { font-weight: 600; color: var(--text); }
a.pub-title:hover { color: var(--accent); }
.pub-authors { font-size: 14px; color: var(--authors); }
.pub-venue { font-size: 14px; color: var(--muted); font-style: italic; }

/* ---------- Plain pages ---------- */
.page { padding: 48px 0 56px; display: flex; flex-direction: column; gap: 20px; max-width: 860px; }
.page-title { font-size: 40px; letter-spacing: -0.02em; line-height: 1.1; }
.page > p { margin: 0; font-size: 16px; line-height: 1.65; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  padding-top: 22px; padding-bottom: 22px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted);
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { gap: 24px; padding-top: 32px; }
  .hero-side { flex-basis: 100%; }
  .affils { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 10px 18px; }
  .affils a { width: auto; min-height: 32px; }
  .affils img { max-width: 165px; }
  .hero h1 { font-size: 38px; }
  .hero-bio { font-size: 16px; }
  h2 { font-size: 26px; }
  .rmap-canvas { height: 420px; }
  .theme-label { font-size: 11px; }
  .news-date { flex-basis: 100%; }
}
