/* Salman Khalid site. Modern minimal. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6474;
  --faint: #8a93a3;
  --line: #e5e8ee;
  --accent: #2448d8;
  --accent-soft: #eef2ff;
  --accent-ink: #1a36a8;
  --tag: #f1f3f7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --bg-soft: #111723; --surface: #121926; --text: #e7ebf3; --muted: #a2abbb; --faint: #6f7a8c;
    --line: #222b3a; --accent: #7c9cff; --accent-soft: #18213a; --accent-ink: #a9bcff; --tag: #1a2232;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --bg-soft: #111723; --surface: #121926; --text: #e7ebf3; --muted: #a2abbb; --faint: #6f7a8c;
  --line: #222b3a; --accent: #7c9cff; --accent-soft: #18213a; --accent-ink: #a9bcff; --tag: #1a2232;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .8rem; font-weight: 800; letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { white-space: nowrap; color: var(--muted); font-size: .94rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.theme-toggle, .menu-toggle { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; }
.theme-toggle:hover, .menu-toggle:hover { color: var(--text); background: var(--bg-soft); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .menu-toggle { display: grid; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .theme-toggle { align-self: flex-start; }
}

/* Sections */
main { min-height: 60vh; }
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.more { font-size: .92rem; font-weight: 600; white-space: nowrap; }
.page-head { padding: 64px 0 24px; }
.page-head p.lede { font-size: 1.15rem; color: var(--muted); max-width: 680px; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1fr 280px; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 12px; }
.hero .role { font-size: 1.15rem; color: var(--muted); margin-bottom: 20px; }
.hero .bio { font-size: 1.06rem; max-width: 620px; }
.hero-photo { width: 280px; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: var(--bg-soft); box-shadow: var(--shadow); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: .94rem; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.btn:hover { text-decoration: none; border-color: var(--faint); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { opacity: .9; }
@media (max-width: 820px) {
  .hero { padding: 40px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { width: 160px; order: -1; border-radius: 18px; }
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li, .chip { font-size: .85rem; font-weight: 500; color: var(--muted); background: var(--tag); padding: 5px 11px; border-radius: 999px; }

/* Cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.card .meta { margin-top: auto; font-size: .82rem; color: var(--faint); }
.card .code { font-family: var(--mono); font-size: .78rem; color: var(--accent); margin-bottom: 8px; font-weight: 500; }

/* Lists of papers, posts, items */
.list { list-style: none; margin: 0; padding: 0; }
.item { padding: 22px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 4px; }
.item h3 { margin-bottom: 4px; }
.item h3 a { color: var(--text); }
.item h3 a:hover { color: var(--accent); text-decoration: none; }
.item .authors { color: var(--muted); font-size: .95rem; margin-bottom: 6px; }
.item .status { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .02em; padding: 3px 9px; border-radius: 6px; background: var(--tag); color: var(--muted); margin-right: 6px; }
.item .status.sub { background: var(--accent-soft); color: var(--accent-ink); }
.item .links { display: flex; flex-wrap: wrap; gap: 14px; font-size: .9rem; font-weight: 500; margin-top: 8px; }
.item p.abstract { color: var(--muted); font-size: .96rem; margin: 8px 0 0; }
.date { font-size: .85rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.post-row { display: grid; grid-template-columns: 130px 1fr; gap: 24px; }
@media (max-width: 640px) { .post-row { grid-template-columns: 1fr; gap: 4px; } }

/* Course materials table */
.materials { width: 100%; border-collapse: collapse; font-size: .96rem; }
.materials th { text-align: left; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.materials td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.materials td.n { width: 48px; color: var(--faint); font-variant-numeric: tabular-nums; }
.materials .desc { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.materials .files { white-space: nowrap; text-align: right; }
.file { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .76rem; font-weight: 500; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); margin-left: 6px; }
.file:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.empty { color: var(--faint); font-style: italic; }
@media (max-width: 640px) {
  .materials thead { display: none; }
  .materials td { display: block; border: 0; padding: 4px 0; }
  .materials td.n { width: auto; padding-top: 16px; }
  .materials tr { display: block; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .materials .files { text-align: left; white-space: normal; }
  .file { margin: 6px 6px 0 0; }
}

/* Prose */
.prose { font-size: 1.06rem; line-height: 1.75; }
.prose h2 { margin-top: 2em; font-size: 1.45rem; }
.prose h3 { margin-top: 1.6em; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--tag); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 10px; margin: 1.5em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1.5em 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.post-head { padding: 64px 0 28px; }
.post-head .date { display: block; margin-bottom: 14px; }
.post-head .lede { font-size: 1.2rem; color: var(--muted); }
.post-foot { margin: 48px 0 0; padding: 24px 0 72px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .95rem; }

/* Two column info blocks */
.split { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.split:first-of-type { border-top: 0; }
.split h2 { font-size: 1.05rem; font-weight: 650; color: var(--muted); letter-spacing: -0.01em; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; gap: 8px; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 6px 0; }
.timeline li span:last-child { color: var(--faint); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline small { display: block; color: var(--muted); font-size: .9rem; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 0; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 40px 0 28px; margin-top: 40px; font-size: .92rem; color: var(--muted); }
.site-footer strong { color: var(--text); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.footer-links a { color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--text); }
.copyright { margin-top: 24px; font-size: .82rem; color: var(--faint); }
