/* =====================================================================
   parsaghazvinian.com
   Layout: a colour strip and a sticky bar of tabs on top, profile column
   on the left, content on the right.
   Colour: four accents. Indigo, apricot and rose come from the ACM summit
   photo; teal is added for contrast. A block gets one of them from a class:
   c-indigo, c-apricot, c-teal or c-rose. Each research area keeps one
   colour on every page (set in _data/research.yml).
   Type: Bricolage Grotesque for headings, Source Sans 3 for text, both
   served from this repository.
   To restyle the site, start with the variables in :root below.
   ===================================================================== */

@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); }

:root {
  /* Page */
  --bg: #f8f7fc;
  --card: #ffffff;
  --tint: #f0eef9;
  --ink: #1b1642;
  --text: #3b3950;
  --muted: #6b6883;
  --line: #e2dfee;
  --mast: rgba(248, 247, 252, .9);

  /* The four accents. For each: the colour, a soft tint of it, a deep shade for text on the tint,
     and the text colour that reads on the colour itself. */
  --indigo: #4a3fd6;  --indigo-soft: #e5e3fb;  --indigo-deep: #3a2fc0;  --indigo-on: #ffffff;
  --apricot: #e9903f; --apricot-soft: #fde8d4; --apricot-deep: #a44f0b; --apricot-on: #3b1d00;
  --teal: #1c9a85;    --teal-soft: #d6f1ec;    --teal-deep: #0e6a5b;    --teal-on: #06231e;
  --rose: #e06a8b;    --rose-soft: #fce3ea;    --rose-deep: #ab2f58;    --rose-on: #40101f;

  --link: #3a2fc0;
  --link-hover: #251c8f;

  /* Brand colours of the profile links */
  --scholar: #4285f4;
  --github: #1b1642;
  --linkedin: #0a66c2;
  --researchgate: #00ccbb;
  --pdf: #d8453b;

  --code-k: #7a3e9d; --code-s: #0e6a5b; --code-n: #3a2fc0; --code-m: #a44f0b; --code-c: #6b6883;

  --display: "Bricolage Grotesque", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --wide: 1220px;

  /* The accent in use; c-* classes change it for a block. */
  --c: var(--indigo); --c-soft: var(--indigo-soft); --c-deep: var(--indigo-deep); --c-on: var(--indigo-on);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100e22; --card: #18152f; --tint: #201c3d; --ink: #f2f1fb; --text: #cdcbe0; --muted: #9b98b6; --line: #2c2850;
    --mast: rgba(16, 14, 34, .88);
    --indigo: #8f87ff;  --indigo-soft: #25215c;  --indigo-deep: #c1bcff;  --indigo-on: #0f0b33;
    --apricot: #f0a35f; --apricot-soft: #3c2815; --apricot-deep: #f6c394; --apricot-on: #2e1700;
    --teal: #45c4ad;    --teal-soft: #10352e;    --teal-deep: #86dfcd;    --teal-on: #04211c;
    --rose: #ee86a6;    --rose-soft: #401a29;    --rose-deep: #f6b0c6;    --rose-on: #3a0c1c;
    --link: #b3adff; --link-hover: #d6d3ff;
    --scholar: #6ea4ff; --github: #f2f1fb; --linkedin: #4d9fea; --researchgate: #2fd9c9; --pdf: #f0776d;
    --code-k: #cda4e6; --code-s: #86dfcd; --code-n: #b3adff; --code-m: #f6c394; --code-c: #9b98b6;
  }
}
:root[data-theme="dark"] {
  --bg: #100e22; --card: #18152f; --tint: #201c3d; --ink: #f2f1fb; --text: #cdcbe0; --muted: #9b98b6; --line: #2c2850;
  --mast: rgba(16, 14, 34, .88);
  --indigo: #8f87ff;  --indigo-soft: #25215c;  --indigo-deep: #c1bcff;  --indigo-on: #0f0b33;
  --apricot: #f0a35f; --apricot-soft: #3c2815; --apricot-deep: #f6c394; --apricot-on: #2e1700;
  --teal: #45c4ad;    --teal-soft: #10352e;    --teal-deep: #86dfcd;    --teal-on: #04211c;
  --rose: #ee86a6;    --rose-soft: #401a29;    --rose-deep: #f6b0c6;    --rose-on: #3a0c1c;
  --link: #b3adff; --link-hover: #d6d3ff;
  --scholar: #6ea4ff; --github: #f2f1fb; --linkedin: #4d9fea; --researchgate: #2fd9c9; --pdf: #f0776d;
  --code-k: #cda4e6; --code-s: #86dfcd; --code-n: #b3adff; --code-m: #f6c394; --code-c: #9b98b6;
}

.c-indigo  { --c: var(--indigo);  --c-soft: var(--indigo-soft);  --c-deep: var(--indigo-deep);  --c-on: var(--indigo-on); }
.c-apricot { --c: var(--apricot); --c-soft: var(--apricot-soft); --c-deep: var(--apricot-deep); --c-on: var(--apricot-on); }
.c-teal    { --c: var(--teal);    --c-soft: var(--teal-soft);    --c-deep: var(--teal-deep);    --c-on: var(--teal-on); }
.c-rose    { --c: var(--rose);    --c-soft: var(--rose-soft);    --c-deep: var(--rose-deep);    --c-on: var(--rose-on); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 3px; }
b, strong { font-weight: 650; color: var(--ink); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem .9rem; z-index: 20; }
.skip:focus { left: .5rem; top: .5rem; }
.ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.note { font-family: var(--sans); font-size: .92rem; color: var(--muted); font-weight: 400; }

/* ---------- Colour strip ---------- */
.strip { display: flex; height: 6px; }
.strip span { transform-origin: left; }
.strip span:nth-child(1) { flex: 3; background: var(--indigo); }
.strip span:nth-child(2) { flex: 2; background: var(--apricot); }
.strip span:nth-child(3) { flex: 2; background: var(--teal); }
.strip span:nth-child(4) { flex: 1; background: var(--rose); }
.strip-foot { flex-direction: row-reverse; }

/* ---------- Top bar with tabs ---------- */
.masthead { position: sticky; top: 0; z-index: 10; background: var(--mast); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.masthead-inner { max-width: var(--wide); margin: 0 auto; padding: 11px 24px; display: flex; align-items: center; gap: 20px; }
.site-title { font-family: var(--display); font-weight: 700; font-size: 1.22rem; color: var(--ink); white-space: nowrap; }
.site-title:hover { color: var(--indigo-deep); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; margin-left: auto; }
.nav a { position: relative; color: var(--text); font-size: .98rem; padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .18s ease; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.nav a[aria-current] { color: var(--ink); }
.nav .nav-cv { color: var(--bg); background: var(--ink); border-radius: 999px; padding: 3px 15px; font-weight: 650; transition: background-color .15s ease; }
.nav .nav-cv::after { display: none; }
.nav .nav-cv:hover { color: var(--indigo-on); background: var(--indigo); }
.theme-btn, .menu-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px; cursor: pointer; line-height: 0; }
.theme-btn:hover, .menu-btn:hover { color: var(--ink); border-color: var(--muted); }
.theme-btn .ico, .menu-btn .ico { width: 18px; height: 18px; vertical-align: middle; }
.menu-btn { display: none; margin-left: auto; }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: inline-block; }
:root[data-theme="dark"] .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { display: inline-block; }
  :root:not([data-theme="light"]) .ico-moon { display: none; }
}
html:not(.js) .theme-btn, html:not(.js) .filter { display: none; }

/* ---------- Page: profile column and content ---------- */
.page { max-width: var(--wide); margin: 0 auto; padding: 42px 24px 8px; display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 52px; }
main { min-width: 0; }
.sidebar { position: sticky; top: 92px; align-self: start; }
.avatar { display: block; width: 210px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; background: var(--indigo-soft); box-shadow: 11px 11px 0 var(--indigo); }
.avatar-empty { display: flex; align-items: center; justify-content: center; color: var(--indigo-deep); font-family: var(--display); font-size: 3.6rem; font-weight: 700; }
.author-name { font-family: var(--display); font-size: 1.62rem; line-height: 1.2; font-weight: 700; color: var(--ink); margin: 34px 0 5px; }
.author-bio { color: var(--muted); font-size: .98rem; line-height: 1.45; margin-bottom: 16px; }
.author-links { list-style: none; padding: 0; font-size: .98rem; }
.author-links li { margin: 8px 0; }
.author-links .ico { width: 18px; height: 18px; margin-right: 11px; vertical-align: -3.5px; transition: transform .15s ease; }
.author-links a { color: var(--text); }
.author-links a:hover { color: var(--ink); text-decoration: none; }
.author-links a:hover .ico { transform: scale(1.18); }
.author-links .email { font-size: .93rem; overflow-wrap: anywhere; }
.ico-pin { color: var(--rose); }
.ico-mail { color: var(--apricot); }
.ico-scholar { color: var(--scholar); }
.ico-github { color: var(--github); }
.ico-linkedin { color: var(--linkedin); }
.ico-researchgate { color: var(--researchgate); }
.ico-cv { color: var(--pdf); }

/* ---------- Sections ---------- */
main h2 { font-family: var(--display); font-size: 1.5rem; line-height: 1.25; color: var(--ink); font-weight: 700; margin: 44px 0 16px; }
main h3 { font-size: 1.12rem; line-height: 1.35; color: var(--ink); font-weight: 650; }
main p { margin-bottom: 14px; }
main > section { margin-top: 54px; }
main > section:first-child { margin-top: 0; }
.sec-title { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec-title::before { content: ""; flex: none; width: 13px; height: 13px; border-radius: 3px; background: var(--c); }
.sec-note { margin-top: -6px; }

.notice { display: flex; align-items: baseline; gap: 11px; background: var(--c-soft); color: var(--ink); border-radius: 12px; padding: 10px 16px; margin-bottom: 18px; }
.notice::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); position: relative; top: -1px; }
.notice a { color: var(--c-deep); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }

.about { display: grid; grid-template-columns: minmax(0, 1fr) 214px; gap: 40px; align-items: start; }
.about-text > p:last-child { margin-bottom: 0; }
.about-photo { margin: 5px 11px 0 0; }
.about-photo a { display: block; border-radius: 14px; cursor: zoom-in; }
.about-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; box-shadow: 11px 11px 0 var(--c); transition: transform .16s ease, box-shadow .16s ease; }
.about-photo a:hover img { transform: translate(-3px, -3px); box-shadow: 14px 14px 0 var(--c); }
.about-photo figcaption { margin-top: 22px; font-size: .9rem; line-height: 1.4; color: var(--muted); }

.chip { display: inline-block; background: var(--c-soft); color: var(--c-deep); padding: 2px 11px; border-radius: 999px; font-size: .88rem; font-weight: 600; }

/* Research areas: numbered rows */
.areas { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.area-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.area-row + .area-row { border-top: 1px solid var(--line); }
.area-side { display: flex; justify-content: center; padding-top: 17px; background: var(--c-soft); }
.area-num { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font-family: var(--display); font-size: .92rem; font-weight: 700; color: var(--c-on); background: var(--c); transition: transform .16s ease; }
.area-row:hover .area-num { transform: scale(1.12); }
.area-body { padding: 15px 22px 17px; }
.area-body h3 { font-family: var(--display); }
.area-body p { margin: 3px 0 11px; }
.area-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 8px; }
.area-more { margin-left: auto; font-size: .93rem; font-weight: 650; color: var(--c-deep); }
.area-more:hover { color: var(--c-deep); }

/* News */
.news-box { padding: 6px 8px 6px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.news { max-height: 330px; overflow-y: auto; padding-right: 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.news ul { list-style: none; padding: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; }
.news li { grid-column: 1 / -1; display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); column-gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
@supports (grid-template-columns: subgrid) {
  .news li { grid-template-columns: subgrid; }   /* the date column is as wide as the longest date */
}
.news li:last-child { border-bottom: 0; }
.news .date { justify-self: start; align-self: start; margin-top: 2px; padding: 0 11px; border-radius: 999px; font-size: .86rem; font-weight: 700; white-space: nowrap; color: var(--c-deep); background: var(--c-soft); }

/* ---------- Publications ---------- */
.pub { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: start; }
.pub:last-of-type { border-bottom: 0; }
.pub[hidden] { display: none; }
.pub:target { background: var(--tint); box-shadow: -14px 0 0 var(--tint), 14px 0 0 var(--tint); }
.pub-thumb { position: relative; margin: 2px 10px 10px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; line-height: 0; box-shadow: 7px 7px 0 var(--c); transition: transform .16s ease, box-shadow .16s ease; }
.pub:hover .pub-thumb { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--c); }
.pub-thumb a { display: block; cursor: zoom-in; }
.pub-thumb img { display: block; width: 100%; height: auto; }
.pub-thumb-empty { aspect-ratio: 16 / 10; background: var(--c-soft); border-color: var(--c-soft); display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; line-height: 1.25; }
.pub-thumb-empty::before { content: ""; position: absolute; inset: 0; opacity: .34; background-image: radial-gradient(circle, var(--c) 1.4px, transparent 1.7px); background-size: 15px 15px; background-position: 4px 4px;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 38%, #000 100%); mask-image: radial-gradient(ellipse at center, transparent 38%, #000 100%); }
.pub-thumb-empty span { position: relative; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--c-deep); }
.pub-title { font-weight: 650; font-size: 1.07rem; color: var(--ink); margin-bottom: 5px; line-height: 1.38; }
.pub-authors { font-size: .96rem; color: var(--muted); margin-bottom: 11px; }
.pub-authors b { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 11px; }
.venue, .status, .award { display: inline-block; font-size: .88rem; font-weight: 700; padding: 1px 12px; border-radius: 999px; }
.venue { color: var(--c-deep); background: var(--c-soft); }
.status { border: 1.5px dashed var(--muted); color: var(--muted); padding: 0 11px; font-weight: 600; }
.award { background: var(--rose-soft); color: var(--rose-deep); }
.pub-area { font-size: .88rem; color: var(--muted); margin-left: 4px; }
.pub-area::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.pub-area:hover { color: var(--ink); }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-links a { font-size: .86rem; font-weight: 650; border: 1.5px solid var(--c); padding: 1px 13px; border-radius: 999px; color: var(--ink); transition: background-color .15s ease, color .15s ease; }
.pub-links a:hover { background: var(--c); color: var(--c-on); text-decoration: none; }
.pub-compact { grid-template-columns: minmax(0, 1fr); padding: 14px 0; }
.year { display: flex; align-items: center; gap: 16px; font-size: 1.25rem; color: var(--muted); margin: 34px 0 0; }
.year::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--line); }
.year-group[hidden] { display: none; }
.after-list { margin-top: 18px; }
.filter, .jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.filter button { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 14px; cursor: pointer; font-size: .92rem; font-weight: 600; color: var(--text); transition: border-color .15s ease; }
.filter button[class*="c-"]::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.filter button:hover { border-color: var(--c); }
.filter button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--c-on); }
.filter button[aria-pressed="true"]::before { background: var(--c-on); }
.filter .all { --c: var(--ink); --c-on: var(--bg); }
.jump a { background: var(--c-soft); color: var(--c-deep); padding: 3px 13px; border-radius: 999px; font-size: .92rem; font-weight: 650; transition: background-color .15s ease, color .15s ease; }
.jump a:hover { background: var(--c); color: var(--c-on); text-decoration: none; }

/* ---------- Education, experience, honors, service ---------- */
.entries { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.entry { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 20px; padding: 19px 22px; align-items: start; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry-plain { grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 15px 22px; align-items: center; }
.entry-plain .logo { width: 40px; height: 40px; border-radius: 50%; }
.entry-plain .logo .ico { width: 20px; height: 20px; }
.logo { width: 62px; height: 62px; border-radius: 12px; background: var(--c-soft); color: var(--c-deep); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: .98rem; overflow: hidden; transition: transform .16s ease; }
.logo-img { background: #fff; border: 1px solid var(--line); }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.entry:hover .logo { transform: rotate(-4deg) scale(1.05); }
.entry p { margin: 0; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; }
.entry-title { font-size: 1.06rem; }
.entry-title span { font-weight: 400; color: var(--text); }
.entry-date { padding: 0 12px; border-radius: 999px; font-size: .86rem; font-weight: 700; white-space: nowrap; color: var(--c-deep); background: var(--c-soft); }
.entry .entry-sub { margin-top: 1px; }
.entry .entry-notes { font-size: .96rem; color: var(--muted); margin-top: 5px; }
.entry-plain .entry-notes { margin-top: 1px; }
.dots { list-style: none; padding: 0; }
.dots li { position: relative; padding-left: 18px; margin: 6px 0; }
.dots li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.entry-points { margin-top: 9px; font-size: .98rem; }

/* ---------- Pages: Research, Publications, Blog ---------- */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-family: var(--display); font-size: 2.2rem; line-height: 1.15; color: var(--ink); font-weight: 700; }
.page-head h1::after { content: ""; display: block; width: 76px; height: 6px; margin-top: 13px; border-radius: 3px;
  background: linear-gradient(90deg, var(--indigo) 0 37.5%, var(--apricot) 0 62.5%, var(--teal) 0 87.5%, var(--rose) 0); }
.lead { font-size: 1.1rem; margin: 14px 0 !important; max-width: 46rem; }
.area { margin-top: 46px; }
.area > p { max-width: 48rem; }
.projects { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.project { padding: 18px 22px 14px; }
.project + .project { border-top: 1px solid var(--line); }
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin-bottom: 9px; }
.project-head h3 { font-family: var(--display); }
.project-status { margin: 0 !important; padding: 0 12px; border-radius: 999px; font-size: .86rem; font-weight: 700; color: var(--c-deep); background: var(--c-soft); }
.rows > div { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 14px; padding: 4px 0; }
.rows dt { font-weight: 700; color: var(--c-deep); font-size: .95rem; padding-top: .06rem; }
.rows dd { max-width: 44rem; }
.area-papers { margin: 26px 0 0; font-size: 1rem; color: var(--muted); }

.empty { color: var(--muted); }
.post-list { list-style: none; padding: 0; }
.post-list > li { padding: 16px 0; border-bottom: 1px solid var(--line); max-width: 46rem; }
.post-list > li[hidden] { display: none; }
.post-list time, .post-meta, .post-back { font-size: .93rem; color: var(--muted); }
.post-list h2 { margin: 2px 0 4px; font-size: 1.32rem; }
.post-list h2 a { color: var(--ink); }
.post-list h2 a:hover { color: var(--link); }
.post-list p { margin: 0; }
.post-head { margin-bottom: 26px; max-width: 46rem; }
.post-head h1 { font-family: var(--display); font-size: 2.2rem; line-height: 1.16; color: var(--ink); font-weight: 700; margin: 6px 0 9px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 0 !important; }
.post-back { margin: 0 !important; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.tags a { background: var(--indigo-soft); color: var(--indigo-deep); padding: 1px 11px; border-radius: 999px; font-size: .86rem; font-weight: 600; }
.tags a:hover { background: var(--indigo); color: var(--indigo-on); text-decoration: none; }
.post-body { max-width: 46rem; font-size: 1.08rem; line-height: 1.68; }
.post-body > * + * { margin-top: 1rem; }
.post-body p { margin-bottom: 0; }
.post-body h2 { margin: 2.2rem 0 0; }
.post-body h3 { margin-top: 1.7rem; }
.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body li + li { margin-top: .3rem; }
.post-body li::marker { color: var(--indigo); }
.post-body blockquote { margin: 1.3rem 0; padding: .7rem 1.1rem; border-radius: 12px; background: var(--apricot-soft); color: var(--ink); }
.post-body img { display: block; height: auto; border-radius: 10px; cursor: zoom-in; }
.post-body figcaption { font-size: .92rem; color: var(--muted); margin-top: .5rem; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.post-body table { border-collapse: collapse; font-size: .96rem; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; max-width: 100%; }
.post-body th, .post-body td { text-align: left; padding: .4rem .9rem .4rem 0; border-bottom: 1px solid var(--line); }
.post-body th { color: var(--ink); border-bottom-color: var(--muted); }
.post-body code { font-family: var(--mono); font-size: .86em; background: var(--tint); border-radius: 5px; padding: .1em .35em; }
.post-body pre { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; overflow-x: auto; line-height: 1.5; font-size: .94rem; tab-size: 2; }
.post-body pre code { background: none; padding: 0; font-size: .9em; }
.post-body .footnotes { font-size: .95rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.4rem; padding-top: 1rem; }
.post-body .katex { font-size: 1.06em; }
.post-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .ch, .highlight .cd { color: var(--code-c); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kc, .highlight .kp, .highlight .ow { color: var(--code-k); font-weight: 600; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr { color: var(--code-s); }
.highlight .nf, .highlight .nc, .highlight .nn, .highlight .nd, .highlight .fm, .highlight .kt, .highlight .nb, .highlight .bp { color: var(--code-n); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: var(--code-m); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 46rem; }
.post-nav a { color: var(--ink); font-weight: 650; line-height: 1.35; }
.post-nav span { display: block; font-size: .9rem; font-weight: 400; color: var(--muted); }
.post-next { grid-column: 2; text-align: right; }
.comments { margin-top: 40px; max-width: 46rem; }

/* ---------- Footer, image viewer ---------- */
.foot { margin-top: 60px; border-top: 1px solid var(--line); }
.foot-inner { max-width: var(--wide); margin: 0 auto; padding: 20px 24px; font-size: .9rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: inherit; }
.foot .ico { margin-right: 6px; }
.viewer { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 96vh; }
.viewer::backdrop { background: rgba(12, 9, 34, .9); }
.viewer img { display: block; max-width: 100%; max-height: 84vh; border-radius: 10px; background: #fff; }
.viewer-close { display: block; margin: 0 0 10px auto; background: #fff; color: #1b1642; border: 0; border-radius: 999px; padding: 4px 16px; font-size: .95rem; font-weight: 600; cursor: pointer; }

/* ---------- Motion: smooth jumps, and the strip draws itself once when a page opens ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .strip-top span { animation: strip-in .7s cubic-bezier(.2, .7, .2, 1) both; }
  .strip-top span:nth-child(2) { animation-delay: .09s; }
  .strip-top span:nth-child(3) { animation-delay: .18s; }
  .strip-top span:nth-child(4) { animation-delay: .27s; }
}
@keyframes strip-in { from { transform: scaleX(0); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .nav { gap: 2px 15px; }
  .nav a { font-size: .95rem; }
  .page { gap: 44px; }
  .about { grid-template-columns: minmax(0, 1fr) 186px; gap: 30px; }
}
/* Short windows: a smaller portrait keeps the whole profile column in view; very short ones let it scroll away. */
@media (min-width: 901px) and (max-height: 800px) {
  .avatar { width: 164px; }
  .author-name { margin-top: 28px; }
}
@media (min-width: 901px) and (max-height: 690px) {
  .sidebar { position: static; }
}
@media (max-width: 1000px) {
  .page { grid-template-columns: 226px minmax(0, 1fr); gap: 36px; }
  .avatar { width: 190px; }
  .author-name { font-size: 1.48rem; }
  .author-bio { font-size: .93rem; }
  .about { grid-template-columns: minmax(0, 1fr) 168px; gap: 28px; }
}
@media (max-width: 900px) {
  html { scroll-padding-top: 64px; }
  .masthead-inner { padding: 9px 16px; flex-wrap: wrap; gap: 10px; }
  .menu-btn { display: block; }
  html:not(.js) .menu-btn { display: none; }
  .nav { display: none; order: 3; width: 100%; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; padding: 4px 0 8px; }
  .nav.open, html:not(.js) .nav { display: flex; }
  .nav a { padding: 6px 0; font-size: 1.02rem; }
  .nav .nav-cv { margin-top: 8px; padding: 4px 16px; }
  .page { grid-template-columns: minmax(0, 1fr); gap: 34px; padding: 26px 16px 4px; }
  .sidebar { position: static; display: grid; grid-template-columns: 126px minmax(0, 1fr); column-gap: 22px; align-items: center; }
  .avatar { width: 118px; border-radius: 12px; box-shadow: 7px 7px 0 var(--indigo); }
  .avatar-empty { font-size: 2.2rem; }
  .author-name { margin-top: 0; font-size: 1.5rem; }
  .author-bio { margin-bottom: 0; font-size: .98rem; }
  .about { grid-template-columns: minmax(0, 1fr) 186px; gap: 30px; }
  .author-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; }
  .author-links li { margin: 0; }
  .author-links .ico { margin-right: 8px; }
  main > section { margin-top: 44px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pub-thumb { max-width: 420px; }
  .foot-inner { padding: 16px; }
}
@media (max-width: 640px) {
  .sidebar { grid-template-columns: 112px minmax(0, 1fr); column-gap: 18px; }
  .avatar { width: 104px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .about-photo { max-width: 250px; }
  .pub-thumb-empty { display: none; }   /* no figure yet: the venue label below the title is enough on a phone */
  .area-row { grid-template-columns: 46px minmax(0, 1fr); }
  .area-side { padding-top: 15px; }
  .area-num { width: 30px; height: 30px; font-size: .82rem; }
  .area-body { padding: 13px 15px 15px; }
  .area-more { margin-left: 0; width: 100%; }
  .news-box { padding: 4px 6px 4px 14px; }
  .news li { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .entry { display: block; padding: 15px; }   /* the tile sits beside the title and dates; everything else uses the full width below */
  .entry::after { content: ""; display: block; clear: both; }
  .entry > .logo { float: left; margin: 2px 14px 4px 0; }
  .entry-head { min-height: 50px; align-content: center; }
  .entry .entry-sub { clear: left; padding-top: 6px; }
  .entry-plain { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 13px 15px; align-items: start; }
  .entry-plain::after { display: none; }
  .entry-plain > .logo { float: none; width: 34px; height: 34px; margin: 2px 0 0; }
  .entry-plain .entry-head { min-height: 0; }
  .entry-plain .entry-sub { clear: none; padding-top: 0; }
  .entry-plain .logo .ico { width: 17px; height: 17px; }
  .logo { width: 46px; height: 46px; border-radius: 10px; font-size: .8rem; }
  .project { padding: 15px 15px 11px; }
  .rows > div { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 5px 0; }
  .post-nav { grid-template-columns: 1fr; }
  .post-next { grid-column: 1; text-align: left; }
  .page-head h1, .post-head h1 { font-size: 1.9rem; }
}

@media print {
  .strip, .masthead, .skip, .filter, .jump, .viewer, .theme-btn { display: none !important; }
  .page { display: block; }
  .sidebar { position: static; margin-bottom: 20px; }
  .avatar, .about-photo img, .pub-thumb { box-shadow: none; }
  a { color: inherit; }
}
