/* =========================================================
   Margaret Kallus — modern / lightly feminine (sage)
   Fraunces (display) + Hanken Grotesk (body)
   ========================================================= */
:root {
  --bg:#faf5f1; --surface:#fffdfb; --ink:#2c2429; --muted:#8d7f83; --line:#ecdfda;
  --accent:#5f8a73; --accent-soft:#e6efe8;
  --disp:'Fraunces', serif; --body:'Hanken Grotesk', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body);
  line-height: 1.68; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  position: relative; overflow-x: hidden; min-height: 100vh;
}
body::before {
  content:""; position: fixed; top:-150px; right:-120px; width: 430px; height: 430px;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  filter: blur(14px); opacity: .8; z-index: 0; pointer-events: none;
}
body::after {
  content:""; position: fixed; bottom:-170px; left:-150px; width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(16px); opacity: .55; z-index: 0; pointer-events: none;
}

/* ---------- NAV ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,245,241,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  max-width: 900px; margin: 0 auto; padding: 16px 28px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.wordmark { font-family: var(--disp); font-size: 1.5rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.nav { display: flex; gap: 24px; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: .82rem; letter-spacing: .04em;
  font-weight: 500; transition: color .2s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--accent); font-weight: 600; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
main { padding: 54px 0 20px; }

.page-title { font-family: var(--disp); font-weight: 600; font-size: clamp(2.2rem, 5vw, 2.8rem); line-height: 1.05; letter-spacing: -.01em; }
.page-title::after { content:""; display:block; width: 46px; height: 3px; border-radius: 3px; background: var(--accent); margin-top: 16px; margin-bottom: 8px; }

/* ---------- HERO (home) ---------- */
.photo {
  width: 150px; height: 150px; border-radius: 50%; background: var(--surface); overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 0 0 6px var(--accent-soft);
  display: grid; place-items: center; color: var(--muted); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; text-align: center; line-height: 1.4;
  margin-bottom: 26px;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.name { font-family: var(--disp); font-weight: 500; font-size: clamp(2.7rem, 7vw, 4rem); line-height: 1.02; letter-spacing: -.01em; }
.role { color: var(--muted); margin-top: 14px; font-size: 1.06rem; }
.status {
  display: inline-block; margin-top: 18px; background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: .8rem; letter-spacing: .03em; padding: 7px 16px; border-radius: 999px;
}
.lede { margin-top: 24px; max-width: 58ch; font-size: 1.12rem; }
.lede + .lede { margin-top: 14px; }

/* ---------- SECTIONS ---------- */
.section { margin-top: 46px; }
.sec-title { font-family: var(--disp); font-weight: 600; font-size: 1.55rem; }
.sec-title::after { content:""; display:block; width: 38px; height: 3px; border-radius: 3px; background: var(--accent); margin-top: 12px; margin-bottom: 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { font-size: .9rem; font-weight: 500; padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.coming { color: var(--muted); font-size: 1.12rem; font-style: italic; }

/* ---------- RESEARCH ---------- */
.paper {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin-bottom: 16px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px;
  align-items: start; transition: box-shadow .2s ease, border-color .2s;
}
.paper-noimg { grid-template-columns: minmax(0, 1fr); }
.paper:hover { box-shadow: 0 8px 24px rgba(44,36,41,.06); border-color: var(--accent); }
.paper-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.paper-img img { width: 100%; height: auto; display: block; }
.paper-badge {
  display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 600;
  font-size: .72rem; letter-spacing: .04em; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px;
}
.paper-title { font-family: var(--disp); font-weight: 600; font-size: 1.15rem; line-height: 1.3; }
.paper-title a { color: var(--ink); text-decoration: none; }
.paper-title a:hover { color: var(--accent); }
.paper-authors { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.paper-link { margin-top: 8px; font-size: .9rem; }
.paper-link a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.paper details { margin-top: 10px; }
.wip details { margin-top: 6px; }
.paper summary, .wip summary {
  cursor: pointer; color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .03em;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.paper summary::-webkit-details-marker, .wip summary::-webkit-details-marker { display: none; }
.paper summary::before, .wip summary::before { content: "▸"; transition: transform .2s; }
.paper details[open] summary::before, .wip details[open] summary::before { transform: rotate(90deg); }
.paper details p, .wip details p { margin-top: 10px; font-size: .94rem; line-height: 1.62; }

.wip { list-style: none; }
.wip li { padding: 12px 0 12px 18px; border-bottom: 1px solid var(--line); position: relative; }
.wip li:last-child { border-bottom: 0; }
.wip li::before { content: ""; position: absolute; left: 0; top: 23px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wip-title { font-family: var(--disp); font-weight: 500; font-size: 1.05rem; }
.wip .paper-authors { display: block; margin-top: 2px; }
.paper-venue { display: block; color: var(--muted); font-size: .9rem; }

/* ---------- TEACHING ---------- */
.course {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  margin-bottom: 12px; transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
}
.course:hover, .course[open] { box-shadow: 0 8px 24px rgba(44,36,41,.06); border-color: var(--accent); }
.course-sum { display: block; cursor: pointer; list-style: none; padding: 18px 20px; }
.course-sum::-webkit-details-marker { display: none; }
.course-sum::marker { content: ""; }
.course-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.course .cname { font-family: var(--disp); font-weight: 600; font-size: 1.12rem; }
.course .cname::after { content: " ▸"; color: var(--accent); font-size: .8rem; display: inline-block; transition: transform .2s; margin-left: 4px; }
.course[open] .cname::after { transform: rotate(90deg); }
.course .cmeta { color: var(--muted); font-size: .92rem; margin-top: 3px; }
.course .cterm { color: var(--accent); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.quotes { padding: 0 20px 18px; border-top: 1px solid var(--line); }
.quotes-label { color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin: 14px 0 4px; }
.quotes blockquote {
  margin-top: 10px; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent-soft);
  font-size: .95rem; line-height: 1.6; font-style: italic;
}
.page-note { color: var(--muted); font-size: .95rem; margin-bottom: 18px; }
.muted-note { color: var(--muted); font-style: italic; margin-top: 20px; font-size: .92rem; }

/* ---------- CV ---------- */
.cv-card { background: var(--accent-soft); border-radius: 18px; padding: 28px 30px; font-size: 1.12rem; max-width: 60ch; }
.cv-card strong { color: var(--accent); }

/* ---------- FOOTER ---------- */
.site-footer { max-width: 720px; margin: 48px auto 0; padding: 24px 28px 56px; position: relative; z-index: 1; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.site-footer a { color: var(--accent); text-decoration: none; }

/* ---------- ANIMATION ---------- */
.reveal { opacity:0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity:1; transform:none; } }

@media (max-width: 560px) {
  .bar-inner { flex-direction: column; align-items: center; gap: 12px; }
  .nav { gap: 18px; }
  .course-head { flex-direction: column; gap: 4px; }
  .paper { grid-template-columns: minmax(0, 1fr); }
  .paper-img { max-width: 360px; }
}
