*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  font-size: 18px;
}

@media (min-width: 50rem) {
  html {
    font-size: 20px;
  }
}

:root {
  --bg: #f4f1ea;
  --text: #1c1b18;
  --muted: #5c5850;
  --link: #1d4f8a;
  --ring: #f4f1ea;
  --side: 12.5rem;
  --gap: 3.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b18;
    --text: #f0ece4;
    --muted: #b3ada2;
    --link: #8cb6e8;
    --ring: #1c1b18;
  }
}

@font-face {
  font-family: "Iowan Old Style";
  src: url("fonts/iowan-old-style-roman.woff") format("woff"),
       url("fonts/iowan-old-style-roman.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Iowan Old Style";
  src: url("fonts/iowan-old-style-italic.woff") format("woff"),
       url("fonts/iowan-old-style-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Iowan Old Style";
  src: url("fonts/iowan-old-style-bold.woff") format("woff"),
       url("fonts/iowan-old-style-bold.ttf") format("truetype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  line-height: 1.7;
}

/* Banner up top */
.banner {
  width: 100%;
  height: 8.5rem;
  background-color: #8a9aa8;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.wrap {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 65ch);
  justify-content: center;
  align-items: start;
  column-gap: var(--gap);
  padding: 2.5rem clamp(1.15rem, 4vw, 2.5rem) 3rem;
}

/* Left sidebar */
.identity {
  text-align: center;
}

.headshot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
}

.identity h1 {
  margin: 0.85rem 0 0;
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.rule {
  border: 0;
  height: 0;
  width: 100%;
  margin: 0.8rem 0 1rem;
  border-top: 1.5px solid var(--text);
}

.links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: flex;
  color: var(--text);
  border-radius: 4px;
}

.links a:hover {
  color: var(--link);
}

.links svg {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  fill: currentColor;
}

.links svg text {
  fill: var(--bg);
  font-size: 7.6px;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.links svg .fold {
  fill: var(--bg);
  fill-opacity: 0.32;
}

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

main {
  max-width: 65ch;
  font-size: 1.06rem;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 2;
  text-wrap: pretty;
}

main p {
  margin: 0 0 1.15em;
}

main p.small {
  font-size: 0.88em;
}

main h2 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.85rem;
  hyphens: none;
}

main h3 {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 1.35rem 0 0.55rem;
  hyphens: none;
}

.video {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0.65rem 0 1.35rem;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

main .section-rule {
  border: 0;
  height: 0;
  width: 80%;
  margin: 2rem auto 1.2rem;
  border-top: 2px solid var(--text);
}

main .section-rule + h2 {
  margin-top: 0;
}

main h2 ~ p {
  margin-bottom: 0.75em;
}

main h2:last-child {
  margin-bottom: 0.25rem;
}

/* Publications section */
.work {
  position: relative;
  margin: 0 0 1.4em;
}

.work-title {
  margin: 0 0 0.35em;
}

.sidenote {
  font-size: 0.78em;
  line-height: 1.45;
  color: var(--muted);
}

.sidenote p {
  margin: 0 0 0.45em;
}

.sidenote p:last-child {
  margin-bottom: 0;
}

.sidenote img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 0.4em;
}

.abstract {
  max-width: none;
  margin: 0.15em 0 0.55em;
  font-size: 0.8em;
  line-height: 1.5;
  text-align: left;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
}

.abstract p {
  margin: 0 0 0.6em;
}

.abstract p:last-child {
  margin-bottom: 0;
}

.work-notes {
  margin: 0.15em 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82em;
  line-height: 1.45;
  color: var(--muted);
}

.work-notes li {
  margin: 0.25em 0;
}

main em {
  font-style: italic;
}

main strong {
  font-weight: 600;
}

a {
  color: var(--link);
  text-underline-offset: 0.14em;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

/* One-column layout for mobile */
@media (max-width: 51rem) {
  .banner {
    height: 12rem;
  }

  .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
  }

  .identity {
    width: min(11.5rem, 68vw);
    margin-top: -8.2rem;
    margin-bottom: 1.35rem;
  }

  .headshot {
    outline: 5px solid var(--ring);
  }

  .identity h1 {
    font-size: 1.35rem;
  }

  main {
    width: 100%;
  }

  .sidenote {
    width: min(20rem, 100%);
    margin: 0 0 1em;
  }
}

/* Two-column layout for desktop */
@media (min-width: 51.01rem) {
  .banner {
    height: 10.25rem;
  }

  .sidenote {
    position: absolute;
    top: 0;
    right: 100%;
    width: var(--side);
    margin-right: var(--gap);
  }
}
