/* Shared styles for erfanili.dev — no build step, no framework. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5d636e;
  --faint: #8a909b;
  --border: #e4e4e0;
  --accent: #3b4fd8;
  --accent-soft: #eef0fd;
  --highlight: #fff6d6;
  --radius: 12px;
  --maxw: 960px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #181b21;
    --text: #e7e9ee;
    --muted: #a3a9b5;
    --faint: #737a87;
    --border: #2a2e36;
    --accent: #8d9cff;
    --accent-soft: #1e2340;
    --highlight: #3a3216;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 20px; font-size: 14px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--muted); white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
@media (max-width: 720px) { .site-nav .opt { display: none; } }

/* ---------- Sections ---------- */
section { padding: 44px 0 8px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; }
h2 {
  font-size: 22px; margin: 0 0 20px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 17px; margin: 0; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding-top: 48px; }
.hero-grid { display: grid; grid-template-columns: 1fr 240px; gap: 40px; align-items: start; }
.hero h1 { font-size: 38px; margin: 0 0 6px; }
.hero .role { font-size: 17px; color: var(--muted); margin-bottom: 20px; }
.hero .role a { color: inherit; border-bottom: 1px solid var(--border); }
.hero .role a:hover { text-decoration: none; border-color: var(--muted); }
.hero-photo {
  width: 240px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 15%;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius); padding: 12px 14px; margin: 20px 0; font-size: 15px;
}
.callout .dot {
  flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%;
  background: #22a35a; box-shadow: 0 0 0 4px color-mix(in srgb, #22a35a 20%, transparent);
}
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { opacity: .88; }
.btn svg { width: 15px; height: 15px; }

@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-photo { width: 160px; order: -1; }
  .hero h1 { font-size: 30px; }
}

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 6px 0; }
.news time { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 1px; }

/* ---------- Research themes ---------- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.theme { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.theme h3 { font-size: 15px; margin-bottom: 8px; }
.theme p { font-size: 14px; color: var(--muted); margin: 0; }
.theme .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
@media (max-width: 820px) { .themes { grid-template-columns: 1fr; } }

/* ---------- Publications ---------- */
.pub { display: grid; grid-template-columns: 220px 1fr; gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.pub:last-child { border-bottom: 0; }
.pub-thumb {
  border-radius: 10px; border: 1px solid var(--border); background: #fff; overflow: hidden;
  aspect-ratio: 16 / 11; display: flex; align-items: center; justify-content: center;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pub-thumb.text {
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px;
  text-align: center; padding: 16px; line-height: 1.4;
}
.pub h3 { font-size: 16px; line-height: 1.4; }
.pub .authors { font-size: 14px; color: var(--muted); margin: 6px 0 2px; }
.pub .authors b { color: var(--text); font-weight: 600; }
.pub .venue { font-size: 14px; margin-bottom: 8px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px;
  background: var(--highlight); color: var(--text); margin-right: 6px;
}
.pub .tldr { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.pub-links summary { color: var(--accent); cursor: pointer; list-style: none; }
.pub-links summary::-webkit-details-marker { display: none; }
.pub-links details { width: 100%; }
.pub-links details[open] summary { margin-bottom: 6px; }
pre.bib {
  margin: 0; padding: 12px; font-size: 12px; line-height: 1.5; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
@media (max-width: 720px) {
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .pub-thumb { max-width: 360px; }
}

/* ---------- Generic entries (projects, experience) ---------- */
.entry { padding: 12px 0; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.entry-head .when { color: var(--faint); font-size: 14px; white-space: nowrap; }
.entry .sub { color: var(--muted); font-size: 14px; margin: 2px 0 6px; }
.entry p { font-size: 15px; margin: 0 0 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.card p { font-size: 14px; color: var(--muted); margin: 0 0 8px; flex: 1; }
.card .card-links { font-size: 14px; display: flex; gap: 14px; margin-top: 8px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.skills { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 15px; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; gap: 2px; } .skills dd { margin-bottom: 8px; } }

/* ---------- Notes pages (TIL, reading) ---------- */
.page-intro { padding: 48px 0 8px; }
.page-intro h1 { font-size: 32px; margin: 0 0 8px; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.note h3 { margin-bottom: 6px; }
.note p { font-size: 15px; color: var(--muted); margin: 0; }
.note time { display: block; margin-top: 10px; font-size: 13px; color: var(--faint); }
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .note-grid { grid-template-columns: 1fr; } }
.book { display: flex; gap: 16px; }
.book img { width: 84px; height: 124px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex: none; }
.book .by { font-size: 14px; font-style: italic; color: var(--faint); margin: 0 0 6px; }

code { font-size: .92em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; padding: 24px 0 40px; border-top: 1px solid var(--border); font-size: 13px; color: var(--faint); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--muted); }
