/* Shared styles for the homepage and teaching pages. */
:root{
  --bg:#fcfbf8; --tint:#f3f0ea;
  --ink:#222; --muted:#5f5a55; --faint:#8a847d;
  --rule:#e2ded6;
  --link:#a6192e;
  --serif:"Newsreader",Georgia,"Times New Roman",serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  color-scheme:light;
}
html.dark{
  --bg:#1c2128; --tint:#242b33;
  --ink:#dcdfe3; --muted:#a2a9b1; --faint:#78818b;
  --rule:#333b45;
  --link:#ef6b6b;
  color-scheme:dark;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; background:var(--bg); }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--serif); font-size:18px; line-height:1.6;
}
a{ color:var(--link); text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:2px; text-decoration-color:color-mix(in srgb, var(--link) 40%, transparent); }
a:hover{ text-decoration-color:var(--link); }

.theme-toggle{
  background:none; border:0; color:var(--muted); padding:4px; cursor:pointer; display:grid; place-items:center;
}
.theme-toggle.corner{ position:fixed; top:14px; right:16px; z-index:10; }
.theme-toggle:hover{ color:var(--ink); }
.theme-toggle svg{ width:17px; height:17px; }
.theme-toggle .sun{ display:none; } html.dark .theme-toggle .sun{ display:block; } html.dark .theme-toggle .moon{ display:none; }

/* Two-column layout */
.layout{
  max-width:1080px; margin:0 auto; padding:2.5rem clamp(16px,4vw,2rem) 4rem;
  display:grid; grid-template-columns:240px minmax(0,1fr); gap:3.5rem;
}
.entity{ position:sticky; top:2.5rem; align-self:start; text-align:center; }
.entity img{
  width:190px; height:190px; border-radius:50%; object-fit:cover; object-position:center 15%;
  display:block; margin:0 auto 1rem;
}
.entity h1{ font-weight:500; font-size:1.45rem; line-height:1.2; margin:0 0 .3rem; }
.entity .role{ color:var(--muted); font-size:1rem; line-height:1.45; margin:0 0 1rem; }
.links{ display:flex; flex-wrap:wrap; justify-content:center; gap:.4rem; font-family:var(--sans); font-size:.85rem; }
.links a{
  color:var(--ink); text-decoration:none; border:1px solid var(--rule); border-radius:4px; padding:.2rem .6rem;
}
.links a:hover{ background:var(--tint); }

/* Right column */
.contents{ max-width:40rem; }
.contents p{ margin:0 0 1em; }

h2{
  font-weight:500; font-size:1.45rem; margin:2.4rem 0 .9rem; padding-bottom:.3rem;
  border-bottom:1px solid var(--rule); scroll-margin-top:1.5rem;
}
h2 small{ font-size:.85rem; color:var(--faint); font-weight:400; }

/* Papers: written like a citation, not a card */
.paper{ margin:0 0 1.3rem; }
.paper .cite{ margin:0; }
.paper .cite .t{ font-weight:600; }
.paper .note{ color:var(--muted); font-size:.95rem; }

.btn{
  font-family:var(--sans); font-size:.8rem; color:var(--ink); background:none;
  border:1px solid var(--muted); border-radius:4px; padding:.15rem .55rem; margin:.4rem .3rem 0 0;
  cursor:pointer; text-decoration:none; display:inline-block; line-height:1.5;
}
.btn:hover, .btn[aria-expanded="true"]{ background:var(--tint); }

.panel{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .3s ease; }
.panel.open{ grid-template-rows:1fr; }
.panel > div{ overflow:hidden; }
.panel blockquote{
  margin:.6rem 0 0; padding:.1rem 0 .1rem 1rem; border-left:3px solid var(--rule);
  color:var(--muted); font-size:.95rem; line-height:1.55;
}
.panel blockquote p{ margin:0; }

ul.plain{ margin:0; padding-left:1.2rem; }
ul.plain li{ margin:0 0 .45rem; }
ul.plain .with{ color:var(--muted); }

/* Teaching accordion, kept but plainer */
details.course{ border-bottom:1px solid var(--rule); }
details.course summary{ cursor:pointer; padding:.6rem 0; list-style:none; }
details.course summary::-webkit-details-marker{ display:none; }
details.course summary::before{ content:"▸"; display:inline-block; width:1.1rem; color:var(--faint); transition:transform .2s; }
details.course[open] summary::before{ transform:rotate(90deg); }
details.course summary .term{ color:var(--faint); }
details.course .body{ padding:0 0 .8rem 1.1rem; color:var(--muted); font-size:.95rem; }
details.course .body p{ margin:0; }

footer{ margin-top:3rem; padding-top:1rem; border-top:1px solid var(--rule); font-size:.85rem; color:var(--faint); }
footer a{ color:var(--muted); }

@media (max-width:820px){
  .layout{ grid-template-columns:1fr; gap:1.5rem; padding-top:1.5rem; }
  .entity{ position:static; }
  .entity img{ width:150px; height:150px; }
  body{ font-size:17px; }
}

/* ---------- Teaching pages (/gvpt622/, /slides/) ---------- */
.page{ max-width:42rem; margin:0 auto; padding:2.5rem 16px 4rem; }
.backlink{ font-family:var(--sans); font-size:.9rem; margin:0 0 1.6rem; }
.backlink a{ color:var(--muted); text-decoration:none; }
.backlink a:hover{ color:var(--ink); text-decoration:underline; }
.page h1{ font-weight:500; font-size:1.9rem; line-height:1.2; margin:0 0 .3rem; }
.page .sub{ color:var(--muted); margin:0 0 1.6rem; }
.session{ padding:.9rem 0; border-top:1px solid var(--rule); }
.session:last-of-type{ border-bottom:1px solid var(--rule); }
.session h2{ font-size:1.15rem; margin:0; padding:0; border:0; }
.session .date{ display:block; font-family:var(--sans); font-size:.8rem; color:var(--faint); font-weight:400; margin-bottom:.1rem; }
.session .mats{ margin:.15rem 0 0; }
.session .soon{ margin:.3rem 0 0; color:var(--faint); font-size:.95rem; font-style:italic; }
.session ul.plain{ margin-top:.4rem; }
.session ul.plain .kind{ color:var(--muted); }
.page .note{ margin-top:1.6rem; color:var(--muted); font-size:.95rem; }
