/* daisywdai.com: one stylesheet for the whole site. Plain HTML, no scripts. */

@font-face {
  font-family: "Merriweather";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/merriweather-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Merriweather";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/merriweather-variable-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-variable.woff2") format("woff2");
}

/* To change the text size everywhere, change --size (14px or 15px). */
:root {
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --size: 14px;
  --bg: #fff;
  --rule: rgba(0, 0, 0, 0.12);
  --text: #111;
  --muted: #5a5a5a;
  --heading: #222;
  --link: #03117c;
  --link-hover: #2f6db5;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--size);
  line-height: 1.8;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

strong { font-weight: 700; }

p { margin: 0 0 1.6em; }
p, dd { text-wrap: pretty; }

.nowrap { white-space: nowrap; }

/* One centered column holds every page */
.page { max-width: 800px; margin: 0 auto; padding: 56px 30px 96px; }

/* Header: name on the left, navigation on the right, one thin rule below */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.site-name a, .site-name a:hover { color: var(--heading); }

nav { font-family: var(--sans); font-size: 15px; line-height: 1.6; letter-spacing: 0.3px; }

nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }

nav a {
  display: inline-block;
  color: rgba(0, 0, 0, 0.62);
  border-bottom: 2px solid transparent;
}

nav a:hover { color: #000; }
nav a[aria-current="page"] { color: #000; border-bottom-color: rgba(0, 0, 0, 0.35); }

main { margin-top: 44px; }

/* Headings inside pages */
h1, h2 {
  margin: 2.2em 0 0.7em;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.3em;
  line-height: 1.5;
  letter-spacing: 0.3px;
  color: var(--heading);
  text-wrap: balance;
}

main > h1:first-child, main > h2:first-child { margin-top: 0; }
main > .visually-hidden:first-child + h2 { margin-top: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Home: text on the left, photo on the right */
.home { display: grid; grid-template-columns: 1fr 230px; column-gap: 52px; align-items: start; }
.home .side img { display: block; width: 230px; max-width: 100%; height: auto; }
.contact a { white-space: nowrap; }
.contact a[href^="mailto"] { font-kerning: none; }
.contact .sep { margin: 0 0.45em; color: var(--muted); }

/* Research: one block per paper, with an abstract that opens on click */
.paper { margin: 0 0 1.5em; }
.paper p { margin: 0; }

details.abstract { margin-top: 0.3em; }

details.abstract summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--muted);
}

details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::before { content: "+"; display: inline-block; width: 0.95em; }
details.abstract[open] summary::before { content: "\2212"; }
details.abstract summary:hover { color: var(--link); }
details.abstract summary:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

details.abstract p {
  margin: 0.55em 0 0.5em;
  padding-left: 15px;
  border-left: 2px solid var(--rule);
  color: #333;
}

/* Teaching: one list per school, course number on the left, offerings on the right */
.courses { display: grid; grid-template-columns: 8.5em 1fr; row-gap: 0.9em; margin: 0; }
.courses dt, .courses dd { margin: 0; }
.courses .offering { display: block; padding-left: 1.1em; text-indent: -1.1em; }

@media (max-width: 720px) {
  .home { grid-template-columns: 1fr; row-gap: 26px; }
  .home .side img { width: 190px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .page { padding: 28px 20px 56px; }
  .site-name { font-size: 23px; }
  nav ul { gap: 22px; }
  main { margin-top: 30px; }
  .courses { grid-template-columns: 6.2em 1fr; }
}
