/* ============================================================
   sasharonaghi.com — pastel academic
   Palette: light pink / green / purple / blue
   Display: Fraunces · Body: Karla
   ============================================================ */

:root {
  --pink:   #F7D6E0;
  --green:  #CDE5D2;
  --purple: #DCCFF0;
  --blue:   #CFE0F2;

  --rose:  #C15A82;   /* deeper pink, links on pink   */
  --leaf:  #4F8A67;   /* deeper green                  */
  --plum:  #7B5AA6;   /* deeper purple, primary accent */
  --sky:   #4C7FB0;   /* deeper blue                   */

  --ink:    #3A3242;
  --ink-2:  #6B6375;
  --paper:  #FDFBFC;
  --card:   #FFFFFF;
  --line:   #EFE7EE;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(193, 90, 130, 0.09);
  --maxw: 880px;
}

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

body {
  margin: 0;
  font-family: "Karla", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 560; line-height: 1.2; }
a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- header / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 251, 252, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.wordmark { font-family: "Fraunces", serif; font-size: 1.05rem; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
nav.mainnav { display: flex; gap: 20px; font-size: 0.95rem; }
nav.mainnav a { color: var(--ink-2); }
nav.mainnav a.active, nav.mainnav a:hover { color: var(--rose); text-decoration: none; }
nav.mainnav a.active { border-bottom: 2px solid var(--pink); padding-bottom: 2px; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(68% 135% at 8% 0%,   var(--pink)   0%, transparent 55%),
    radial-gradient(50% 100% at 92% 8%,  var(--blue)   0%, transparent 55%),
    radial-gradient(70% 130% at 25% 100%, var(--green) 0%, transparent 55%),
    radial-gradient(42% 85% at 85% 95%, var(--purple) 0%, transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  align-items: center;
  padding-top: 56px; padding-bottom: 56px;
}
.portrait {
  width: 260px; height: 260px; object-fit: cover;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 2.6rem; margin: 0 0 12px; }
.hero p.bio { margin: 0 0 16px; max-width: 50ch; }
.iconrow { display: flex; flex-wrap: wrap; gap: 10px; }
.iconrow a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink);
}
.iconrow a:hover { text-decoration: none; border-color: var(--rose); color: var(--rose); }
.iconrow svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- sections ---------- */
section.block { padding: 46px 0 8px; }
section.block h2 {
  font-size: 1.65rem;
  margin: 0 0 6px;
  display: inline-block;
}
.h2-underline {
  height: 8px; width: 88px; border-radius: 999px; margin: 0 0 26px;
  background: linear-gradient(90deg, var(--pink), var(--blue), var(--green), var(--purple));
}

/* ---------- publications ---------- */
.pubtabs { display: flex; gap: 8px; margin-bottom: 24px; }
.pubtabs button {
  font: inherit; cursor: pointer;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff; color: var(--ink-2);
}
.pubtabs button.active { background: var(--pink); border-color: var(--pink); color: var(--ink); font-weight: 700; }

.pub {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  padding: 18px;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--pink);
}
.pub:nth-child(4n+1) { border-left-color: var(--pink); }
.pub:nth-child(4n+2) { border-left-color: var(--green); }
.pub:nth-child(4n+3) { border-left-color: var(--blue); }
.pub:nth-child(4n+4) { border-left-color: var(--purple); }
/* a paper with no figure gets the full width instead of an empty column */
.pub.nofig { grid-template-columns: 1fr; }
.pub img {
  width: 200px; height: 140px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
  background: #fff;
}
.pub h3 { margin: 0 0 4px; font-size: 1.08rem; }
.pub .authors { margin: 0 0 2px; font-size: 0.92rem; color: var(--ink-2); }
.pub .authors .me { color: var(--ink); font-weight: 700; }
.pub .venue { margin: 0 0 6px; font-size: 0.9rem; color: var(--leaf); font-weight: 700; }
.pub .venue span { display: block; }
.pub .tldr { margin: 0 0 8px; font-size: 0.94rem; }
.pub .tldr b { color: var(--rose); }
.publinks { display: flex; gap: 8px; flex-wrap: wrap; }
.publinks a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
}
.publinks a svg { width: 15px; height: 15px; fill: currentColor; }
.publinks a:hover { text-decoration: none; background: var(--pink); border-color: var(--pink); color: var(--ink); }

/* ---------- experience lists ---------- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  display: flex; justify-content: space-between; gap: 16px;
}
ul.plain li:last-child { border-bottom: 0; }
ul.plain .when { color: var(--ink-2); font-size: 0.88rem; white-space: nowrap; }
.rolecard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 16px;
}
.rolecard h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--rose); }

/* ---------- footer / counters ---------- */
footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(247,214,224,.35), rgba(220,207,240,.35), rgba(207,224,242,.35), rgba(205,229,210,.35));
}
footer .wrap {
  padding: 26px 22px 34px;
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
  font-size: 0.9rem; color: var(--ink-2);
}

/* quote under the copyright — takes a full row of the footer's flex wrap */
.epigraph {
  flex: 0 0 100%;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.epigraph p { margin: 0; font-style: italic; }
.epigraph cite { font-style: normal; margin-left: 2px; }

.counters { display: flex; gap: 12px; flex-wrap: wrap; }
.counterchip {
  display: inline-block;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
  color: var(--ink);
}
.counterchip .num { color: var(--ink); font-variant-numeric: tabular-nums; }
button.moosebtn {
  font: inherit; cursor: pointer;
  color: var(--ink);        
  display: inline-block;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
  transition: transform .12s ease;
}
button.moosebtn:hover { border-color: var(--leaf); }
button.moosebtn:active { transform: scale(1.1); }
.moose-pop { display: inline-block; animation: moosepop .4s ease; }
@keyframes moosepop { 0% { transform: scale(1);} 50% { transform: scale(1.6) rotate(-10deg);} 100% { transform: scale(1);} }

/* ---------- map page ---------- */
/* the map fills the page below the header and is centered vertically */
body.page-map { min-height: 100vh; display: flex; flex-direction: column; }
main.mapmain {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 1240px;
  margin: 0 auto;
  padding: 12px 22px 24px;
}
.mapwrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  cursor: grab;
  touch-action: none;
}
.mapwrap.dragging { cursor: grabbing; }
.mapwrap svg { display: block; width: 100%; height: auto; }
.place-card {
  position: absolute;
  width: max-content;
  min-width: 190px;
  max-width: min(340px, 46%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(60,45,80,0.22);
  padding: 12px 14px 12px;
  z-index: 5;
}
/* whole photo, never cropped — the card sizes itself around it */
.place-card img {
  display: block;
  width: auto; height: auto;
  max-width: 100%; max-height: 58vh;
  border-radius: 8px;
  margin: 8px auto 6px;
}
.place-card .pname { font-weight: 700; font-family: "Fraunces", serif; font-size: 1rem; color: var(--leaf); padding-right: 18px; }
.place-card .pdate { color: var(--ink-2); font-size: 0.82rem; }
.place-card .ppark { color: var(--leaf); font-size: 0.8rem; font-weight: 700; }
.card-x {
  position: absolute; top: 6px; right: 8px;
  border: 0; background: none; cursor: pointer;
  font-size: 1.05rem; color: var(--ink-2); line-height: 1;
}
/* On a phone the map is only ~160px tall, so a card anchored beside its pin
   is taller than the map and gets clipped by .mapwrap's overflow — the photo
   ends up filling the map instead. Narrow screens get a fixed sheet at the
   bottom of the viewport instead; map.js adds .card-sheet and drops the
   inline left/top it would otherwise pin to the marker. */
@media (max-width: 720px) {
  .place-card.card-sheet {
    position: fixed;
    left: 50%; right: auto; top: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(86vw, 320px);
    min-width: 0; max-width: none;
    padding: 10px 12px;
  }
  .place-card.card-sheet img { max-height: 40vh; }
}


#worldmap .countries path {
  fill: none;
  stroke: #B3A79D;
  stroke-width: 0.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.mappin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  z-index: 4;
}
/* beats the display:flex above, which would otherwise defeat [hidden] */
.mappin[hidden] { display: none; }
/* pins pop in when the year slider reaches them */
@keyframes pinpop {
  0%   { transform: translate(-50%, -100%) scale(0.2); opacity: 0; }
  60%  { transform: translate(-50%, -100%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}
.mappin.pin-pop { animation: pinpop 280ms cubic-bezier(.34, 1.56, .64, 1); }
.mappin .pin-head {
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #F7C6D9, #C15A82 70%);
  box-shadow: inset -2px -3px 4px rgba(0,0,0,0.35), inset 2px 3px 4px rgba(255,255,255,0.7), 0 1px 3px rgba(0,0,0,0.35);
}
.mappin .pin-tree { display: none; font-size: 17px; line-height: 1; }
.mappin.is-park .pin-head { display: none; }
.mappin.is-park .pin-tree { display: block; }
.mappin .pin-stem {
  width: 1.5px; height: 8px;
  background: rgba(60,50,60,0.55);
  border-radius: 1px;
}
.mappin:hover .pin-head, .mappin:focus-visible .pin-head { filter: brightness(1.12); }

/* ---------- year slider under the map ---------- */
.yearbar {
  --thumb: 20px;          /* must match the slider thumb size below */
  width: 100%;
  max-width: 640px;
  margin: 6px auto 0;
  padding: 0 4px;
}
/* The input is deliberately taller than the visible bar: the thumb is 20px,
   so a 6px-tall input would leave most of the ball outside the clickable box.
   The pink bar is drawn by the track pseudo-element instead. */
.yearslider {
  --track: 6px;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%;
  height: 28px; margin: 0;
  background: transparent;
  cursor: pointer;
}
.yearslider::-webkit-slider-runnable-track {
  height: var(--track);
  border-radius: 999px;
  background: var(--pink);
}
.yearslider::-moz-range-track {
  height: var(--track);
  border-radius: 999px;
  background: var(--pink);
}
.yearslider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box;
  width: var(--thumb); height: var(--thumb); border-radius: 50%;
  margin-top: calc((var(--track) - var(--thumb)) / 2);   /* centre on the bar */
  background: radial-gradient(circle at 34% 30%, #F7C6D9, #C15A82 70%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  cursor: grab;
}
.yearslider::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--thumb); height: var(--thumb); border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #F7C6D9, #C15A82 70%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  cursor: grab;
}
.yearslider:active::-webkit-slider-thumb { cursor: grabbing; }
.yearslider:focus-visible { outline: 2px solid var(--plum); outline-offset: 4px; }
/* Ticks sit at the thumb's real stop positions: its centre travels from
   thumb/2 to width - thumb/2, so --f (0…1) is mapped across that span. */
.yearticks {
  position: relative;
  height: 1.2em;
  margin-top: 6px;
  font-size: 0.74rem; color: var(--ink-2);
  user-select: none;      /* dragging the slider shouldn't select the years */
}
.yearticks span {
  position: absolute; top: 0;
  left: calc(var(--thumb) / 2 + var(--f) * (100% - var(--thumb)));
  transform: translateX(-50%);
  white-space: nowrap;
}
.yearticks span.is-now { color: var(--rose); font-weight: 700; }

/* mini link pill (e.g. Snowflake patent) */
.minilink {
  font-size: 0.78rem; font-weight: 700;
  padding: 2px 10px; margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  vertical-align: 1px;
}
.minilink:hover { text-decoration: none; background: var(--pink); border-color: var(--pink); color: var(--ink); }


/* ---------- moose modal ---------- */
.moose-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(40,32,50,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.moose-modal[hidden] { display: none; }
.moose-modal-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(60,45,80,0.28);
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
}
.moose-modal-card h2 { margin: 0 0 16px; font-size: 1.3rem; }
.moose-modal-close {
  position: absolute; top: 14px; right: 16px;
  border: 0; background: none; cursor: pointer;
  font-size: 1.4rem; color: var(--ink-2); line-height: 1;
}
.moose-grid { columns: 2 220px; column-gap: 14px; }
.moose-grid figure {
  position: relative;
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.moose-grid img { width: 100%; display: block; }
.moose-num {
  position: absolute; top: 8px; left: 8px;
  background: rgba(58,50,66,0.75);
  color: #fff;
  font-weight: 800; font-size: 0.78rem;
  padding: 2px 9px;
  border-radius: 999px;
}
.moose-grid figcaption { padding: 8px 10px 10px; font-size: 0.84rem; }
.moose-grid figcaption .cap { font-weight: 700; }
.moose-grid figcaption .capdate { color: var(--ink-2); display: block; font-size: 0.78rem; }
.moose-empty { color: var(--ink-2); text-align: center; padding: 20px 0; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; justify-items: center; padding-top: 40px; padding-bottom: 40px; }
  .hero h1 { font-size: 2.1rem; }
  .iconrow { justify-content: center; }
  .pub { grid-template-columns: 1fr; }
  /* stacked on mobile there's room for the whole figure, so show it
     uncropped instead of cover-cropping the edges off wide diagrams */
  .pub img { width: 100%; height: auto; max-height: 260px; object-fit: contain; padding: 6px; }
  nav.mainnav { gap: 12px; font-size: 0.88rem; }
}

.pub h3 a.pubtitle { color: inherit; }
.pub h3 a.pubtitle:hover { color: inherit; text-decoration: underline; text-underline-offset: 3px; }