/* amin-tabrizian.github.io
   One stylesheet, no framework. Colors borrow from VFR sectional charts:
   chart blue for links, Class E magenta for highlights. */

:root {
  --paper: #fbfaf6;
  --ink: #1c1b19;
  --muted: #625d54;
  --rule: #d9d3c5;
  --tint: #f1ede3;
  --link: #0d4f8b;
  --accent: #a3195b;
  --thumb-bg: #ffffff;
  --busy-a: #e6e1d4;
  --busy-b: #efebe1;
  --busy-line: #cbc3b0;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151617;
    --ink: #e9e6df;
    --muted: #a39e94;
    --rule: #36362f;
    --tint: #1f2021;
    --link: #8fbbe8;
    --accent: #e687b3;
    --thumb-bg: #f4f2ec;
    --busy-a: #393a34;
    --busy-b: #2a2b27;
    --busy-line: #5c5c52;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--serif);
  font-optical-sizing: auto;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 24px 32px;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

p { margin: 0 0 1em; }

.mono { font-family: var(--mono); }

/* Header */

.top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: start;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(36px, 6vw, 50px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.role { margin: 0 0 18px; color: var(--muted); font-size: 18px; line-height: 1.4; }

.contact,
.links { margin: 0 0 4px; font-size: 13.5px; }
.contact { color: var(--muted); }

.photo {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.bio { margin-top: 30px; }

/* In-page nav */

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 30px 0 0;
  padding: 9px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  font: 13px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.jump a { color: var(--ink); }
.jump a:hover { color: var(--link); }

/* Sections */

section { margin-top: 52px; }

h2 {
  margin: 0 0 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; }

.note { color: var(--muted); font-size: 15.5px; }

/* Dated lists: news, talks */

.dated { list-style: none; margin: 0; padding: 0; }
.dated li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 5px 0;
}
.dated .when {
  padding-top: 3px;
  color: var(--muted);
  font: 13px/1.5 var(--mono);
  white-space: nowrap;
}

details { margin-top: 10px; }
summary {
  cursor: pointer;
  color: var(--link);
  font: 13px var(--mono);
}
details[open] summary { margin-bottom: 6px; }

.hl { color: var(--ink); font-weight: 600; }

/* Teaching and service rows */

.row { margin-bottom: 18px; }
.row-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
}
.row-head .when { color: var(--muted); font: 13px/1.9 var(--mono); }
.row p { margin: 2px 0 0; }
.row .sub { color: var(--muted); }

/* Papers */

.pub {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.pub:first-of-type { padding-top: 4px; }

.thumb {
  position: relative;
  display: block;
  width: 240px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--thumb-bg);
  border: 1px solid var(--rule);
}
.thumb img,
.thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb .alt { opacity: 0; transition: opacity 0.3s ease; }
.pub:hover .thumb .alt,
.thumb:focus-visible .alt { opacity: 1; }

.badge {
  position: absolute;
  left: 0;
  top: 0;
  padding: 1px 6px;
  background: var(--paper);
  color: var(--ink);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font: 11px/1.6 var(--mono);
  letter-spacing: 0.03em;
}

/* For papers without a figure yet */
.thumb-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  background: var(--tint);
  color: var(--ink);
}
.thumb-text:hover { text-decoration: none; }
.thumb-text .ph-title { font-size: 19px; line-height: 1.15; font-style: italic; }
.thumb-text .ph-sub { margin-top: 4px; color: var(--muted); font: 11.5px var(--mono); }

.pub h3 a { color: var(--ink); }
.pub h3 a:hover { color: var(--link); }
.pub p { margin: 3px 0 0; }
.authors { font-size: 16px; }
.venue { color: var(--muted); font-size: 16px; }
.award {
  color: var(--accent);
  font: 12.5px/1.6 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blurb { margin-top: 8px !important; font-size: 16px; line-height: 1.55; }

.plinks { margin-top: 8px !important; font: 13px var(--mono); }
.plinks a { margin-right: 10px; }
.plinks a::before { content: "["; color: var(--muted); }
.plinks a::after { content: "]"; color: var(--muted); }

.compact { margin: 0; padding-left: 20px; }
.compact li { margin-bottom: 10px; font-size: 16px; }
.compact .venue { font-size: inherit; }

/* Footer */

footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 24px 48px;
  color: var(--muted);
  font: 12.5px var(--mono);
}
footer p { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); }

/* Calendar page */

.back { font: 13px var(--mono); }

.week-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 10px;
  font: 13px var(--mono);
}
.week-nav button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
}
.week-nav button:hover { text-decoration: underline; text-underline-offset: 2px; }
.week-nav button:disabled { color: var(--rule); cursor: default; text-decoration: none; }

.cal-grid {
  --hour: 40px;
  display: grid;
  grid-template-columns: 52px repeat(5, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.cal-corner,
.cal-head { border-bottom: 1px solid var(--rule); }
.cal-head {
  padding: 6px 0;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font: 12px var(--mono);
  text-align: center;
}
.cal-head.today { color: var(--accent); }
.cal-hours,
.cal-day { position: relative; height: calc(var(--hour) * var(--hours)); }
.cal-hours span {
  position: absolute;
  right: 8px;
  margin-top: 3px;
  color: var(--muted);
  font: 11px var(--mono);
  white-space: nowrap;
}
.cal-day {
  border-left: 1px solid var(--rule);
  background: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px var(--hour));
}
.cal-day.past { opacity: 0.4; }
.busy {
  position: absolute;
  left: 3px;
  right: 3px;
  padding: 2px 5px;
  overflow: hidden;
  border: 1px solid var(--busy-line);
  background: repeating-linear-gradient(135deg, var(--busy-a) 0 5px, var(--busy-b) 5px 10px);
  color: var(--muted);
  font: 10.5px/1.3 var(--mono);
}
.now {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid var(--accent);
}

/* Small screens */

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  main { padding: 32px 16px 24px; }
  footer { padding: 16px 16px 36px; }
  .top { gap: 16px; }
  .photo { width: 96px; height: 96px; }
  .role { font-size: 16.5px; }
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .thumb { width: 100%; max-width: 420px; }
  .thumb-text { aspect-ratio: auto; min-height: 96px; }
  .contact { font-size: 12.5px; }
  .dated li { grid-template-columns: 74px 1fr; gap: 10px; }
  .cal-grid { --hour: 34px; grid-template-columns: 40px repeat(5, 1fr); }
  .cal-hours span { right: 4px; font-size: 10px; }
  .busy { left: 2px; right: 2px; padding: 1px 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .thumb .alt { transition: none; }
}
