:root {
  color-scheme: dark light;
  --bg: #121212;
  --fg: #e3e1dc;
  --muted: #9a9790;
  --faint: #5b5853;
  --rule: #2a2927;
  --link: #e3e1dc;
  --underline: #5b5853;
  --accent: #ff6fa8;
  --fluff: 227, 225, 220;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fafaf9;
    --fg: #1d1c1a;
    --muted: #6b6862;
    --faint: #a9a59e;
    --rule: #e4e2de;
    --link: #1d1c1a;
    --underline: #bdb9b2;
    --accent: #e0306f;
    --fluff: 29, 28, 26;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#fluff {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* header */
.top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem clamp(1rem, 3vw, 2.25rem);
}
.name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 2rem;
  padding: 0 1.25rem 0.55rem;
  border-bottom: 1px solid var(--rule);
}
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.icons { display: flex; justify-content: flex-end; gap: 1.15rem; }
.icons a { color: var(--muted); display: inline-flex; text-decoration: none; }
.icons a:hover { color: var(--fg); }
.icons svg { width: 19px; height: 19px; fill: currentColor; }

/* column */
main {
  position: relative;
  z-index: 1;
  max-width: 41rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}
p { margin: 0 0 1.15rem; }
h1 {
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
h1 a { color: var(--accent); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.meta { color: var(--muted); font-size: 1rem; line-height: 1.55; margin: 0 0 2.25rem; }
.meta a { color: var(--muted); }
.meta a:hover { color: var(--fg); }
h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  margin: 3rem 0 1rem;
}

ul, ol { margin: 0 0 1.15rem; padding-left: 1.25rem; }
li { margin-bottom: 0.45rem; padding-left: 0.2rem; }
ul li::marker { color: var(--faint); }

.photos {
  display: flex;
  gap: 0.9rem;
  margin: 2.5rem 0 0.5rem;
}
.photos figure { margin: 0; flex: var(--r) 1 0; min-width: 0; }
.photos img {
  display: block;
  width: 100%;
  aspect-ratio: var(--r);
  height: auto;
  object-fit: cover;
  border-radius: 3px;
}
figcaption { font-size: 0.8rem; line-height: 1.4; color: var(--muted); margin-top: 0.5rem; }

.papers { list-style: none; padding: 0; counter-reset: paper 9; }
.papers li { counter-increment: paper -1; position: relative; padding-left: 2rem; margin-bottom: 1.25rem; }
.papers li::before {
  content: counter(paper);
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.papers .t { display: block; line-height: 1.45; }
.papers .a, .papers .v { display: block; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
.papers .a b { font-weight: 500; color: var(--fg); }
.papers .v { font-style: italic; }
.papers .v a { color: var(--muted); }

.sections { margin: 2.75rem 0 1.5rem; border-top: 1px solid var(--rule); }
details { border-bottom: 1px solid var(--rule); }
summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0;
  color: var(--muted);
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  width: 0.42em;
  height: 0.42em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  flex: none;
}
details[open] > summary::before { transform: rotate(45deg) translate(-0.1em, -0.1em); }
summary:hover, details[open] > summary { color: var(--fg); }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
details > :last-child { margin-bottom: 1.4rem; }
.log { list-style: none; padding: 0; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0; margin-bottom: 0.5rem; }
.log b { font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }

.contact { margin-top: 2.5rem; }

/* pictures page */
.wide { max-width: 72rem; }
.wall { columns: 4 15rem; column-gap: 1rem; }
.wall > * { break-inside: avoid; margin: 0 0 1rem; display: block; width: 100%; border-radius: 3px; }
.wall img { height: auto; }
.video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
button.video { padding: 0 0 56.25%; border: 0; background: #000; cursor: pointer; }
button.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.15s; }
button.video:hover img { opacity: 1; }
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
}
.play::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 17px;
  border-style: solid;
  border-width: 11px 0 11px 17px;
  border-color: transparent transparent transparent #fff;
}
button.video:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 720px) {
  body { font-size: 17.5px; }
  .top { grid-template-columns: 1fr auto; row-gap: 1.1rem; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  h1 { font-size: 1.9rem; }
  .photos { gap: 0.6rem; }
  figcaption { font-size: 0.72rem; }
  .log li { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  a, summary::before { transition: none; }
}
