/* Mughees Ur Rehman — personal site
   Palette: warm off-white, charcoal ink, Purdue gold accent */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f4f0;
  --rule: #e6e3db;
  --text: #1c1c1c;
  --muted: #5a5750;
  --faint: #7c776b;
  --accent: #7a5a22;
  --accent-line: #cfb991;
  --award: #8a1c1c;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --measure: 860px;
}

:root[data-theme="dark"] {
  --bg: #161514;
  --bg-soft: #201f1d;
  --rule: #33312d;
  --text: #ebe8e1;
  --muted: #b3aea4;
  --faint: #8f8a80;
  --accent: #dcc48f;
  --accent-line: #8e6f3e;
  --award: #f0948a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Nav ---------- */
nav {
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 56px; }
nav .brand { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--text); text-decoration: none; }
nav ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; overflow-x: auto; }
nav ul a { color: var(--muted); text-decoration: none; font-size: 0.93rem; white-space: nowrap; }
nav ul a:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.theme-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid var(--rule); color: var(--muted); font-size: 0.95rem;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); }
.theme-toggle .fa-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .fa-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

/* ---------- Type ---------- */
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 {
  font-size: 1.55rem;
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 72px;
}

a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 220px 1fr; gap: 2.25rem; align-items: center; margin-top: 2.5rem; }
.hero img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 1px solid var(--rule); }
.role { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--muted); margin: 0.2rem 0 0.9rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0 0 0.5rem; padding: 0; list-style: none; font-size: 0.95rem; }
.links a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.links a:hover { color: var(--accent); }
.links i { font-size: 1.05rem; }
.contact { color: var(--faint); font-size: 0.92rem; margin: 0; }

.bio { margin-top: 1.75rem; }
.bio p { margin: 0 0 1rem; }

/* ---------- Lists ---------- */
ul.plain { list-style: none; padding: 0; margin: 0; }

/* News timeline: vertical line with a dot per item */
ul.news { position: relative; padding-left: 1.75rem; }
.news::before {
  content: ""; position: absolute; left: 5px; top: 0.85rem; bottom: 0.85rem;
  width: 1.5px; background: var(--rule);
}
.news li { position: relative; display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; padding: 0.45rem 0; }
.news li::before {
  content: ""; position: absolute; left: calc(-1.75rem + 0.75px); top: 0.88rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--faint); box-shadow: 0 0 0 4px var(--bg);
}
.news li:first-child::before { background: var(--accent); }
.date { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 0.93rem; padding-top: 0.08rem; }

.pubs li { padding: 0.85rem 0; border-bottom: 1px dashed var(--rule); }
.pubs li:last-child { border-bottom: 0; }
.pub-title { font-weight: 600; }
.pub-title a { color: var(--text); text-decoration-color: var(--rule); }
.pub-title a:hover { color: var(--accent); text-decoration-color: var(--accent-line); }
.authors { color: var(--muted); font-size: 0.95rem; }
.authors strong { color: var(--text); font-weight: 600; }
.venue { font-size: 0.95rem; }
.venue em { font-style: italic; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.05rem 0.45rem; border-radius: 3px; margin-right: 0.5rem; vertical-align: 1px;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--rule);
}
.award { color: var(--award); font-weight: 600; }
.award i { margin-right: 0.25rem; }

.pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.45rem; }
.pub-links a, .cite-btn {
  font: inherit; font-size: 0.8rem; color: var(--muted); text-decoration: none; cursor: pointer;
  background: transparent; border: 1px solid var(--rule); border-radius: 4px; padding: 0.1rem 0.55rem;
}
.pub-links a:hover, .cite-btn:hover, .cite-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent-line); }
.bib {
  margin: 0.6rem 0 0; padding: 0.8rem 1rem; overflow-x: auto;
  background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 4px;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; color: var(--text);
}

.bullets { margin: 0; padding-left: 1.25rem; }
.bullets li { padding: 0.25rem 0 0.25rem 0.25rem; }
.bullets li::marker { color: var(--accent-line); }
.bullets .when { color: var(--faint); font-size: 0.92rem; }

nav ul a.active { color: var(--text); font-weight: 600; }

/* ---------- Teaching page ---------- */
.page-head { margin-top: 2.5rem; }
.page-head .role { margin-bottom: 0; }
.inst h2 { margin-bottom: 0.3rem; }
.inst-meta { color: var(--muted); font-size: 0.93rem; margin: 0 0 0.9rem; }
.inst-meta .sep { color: var(--faint); margin: 0 0.3rem; }
.courses li {
  display: grid; grid-template-columns: 6rem 1fr auto; gap: 0.25rem 1rem; align-items: baseline;
  padding: 0.6rem 0; border-bottom: 1px dashed var(--rule);
}
.courses li:last-child { border-bottom: 0; }
.courses .code { font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.courses .term { color: var(--faint); font-size: 0.92rem; white-space: nowrap; }

footer { margin: 3.5rem 0 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--faint); font-size: 0.85rem; }

/* ---------- Mobile ---------- */
@media (max-width: 680px) {
  body { font-size: 16px; }
  nav .wrap { justify-content: flex-end; }
  nav ul { gap: 0.7rem; }
  nav ul a { font-size: 0.86rem; }
  .nav-right { gap: 0.7rem; }
  nav .brand { display: none; }
  .hero { grid-template-columns: 1fr; text-align: center; gap: 1.25rem; margin-top: 1.75rem; }
  .hero img { max-width: 170px; margin: 0 auto; }
  .links { justify-content: center; }
  h1 { font-size: 2rem; }
  .news li { grid-template-columns: 1fr; gap: 0; }
  .courses li { grid-template-columns: 5rem 1fr; }
  .courses .term { grid-column: 2; }
}
