/* Shared */
:root {
  --ink: #f2f4f7;
  --muted: #9aa5b3;
  --line: #2b323d;
  --card: #171c24;
  --accent: #99ccff;
  --bg: #0d1117;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 18px/1.6 system-ui, sans-serif; color: var(--ink); background: var(--bg); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.button {
  display: inline-block;
  padding: .6rem 1.1rem;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.button:hover { background: #fff; border-color: #fff; }
.button.secondary { background: transparent; color: var(--accent); }
.button.secondary:hover { color: #fff; }
.links { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Index */
body.index > * { max-width: 62rem; margin-inline: auto; padding-inline: 1.5rem; }
body.index header { padding-block: 6rem 2rem; }
body.index header .name { margin: 0 0 1rem; color: var(--accent); font-size: .9rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
body.index header h1 { margin: 0 0 2rem; font-size: clamp(2.6rem, 7vw, 4.5rem); line-height: 1.05; letter-spacing: -.02em; }
body.index header p { font-size: 1.15rem; color: var(--muted); }
body.index header p strong { color: var(--ink); }
body.index section { padding-block: 3rem; scroll-margin-top: 3rem; }

/* Stays pinned to the top of the window; nav.js sets aria-current on the link for the section in view. */
body.index nav {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
body.index nav a { padding-block: .9rem; color: var(--muted); text-decoration: none; }
body.index nav a:hover { color: var(--ink); }
body.index nav a[aria-current] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px var(--accent); }
body.index nav a:last-child { margin-left: auto; }

body.index h2 { margin: 0; font-size: 2rem; letter-spacing: -.01em; }
body.index h2 + p { margin: .5rem 0 2rem; color: var(--muted); }

.credit { margin: .75rem 0 0; font-size: .8rem; }

.tile {
  display: grid;
  grid-template-columns: 1fr auto; /* the image column is exactly as wide as the image, so it is never rescaled */
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.tile > div { padding: 2rem; display: grid; gap: 1rem; align-content: center; }
.tile h3 { margin: 0; font-size: 1.6rem; }
.tile p { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
  .tile { grid-template-columns: 1fr; }
  .tile img { width: 100%; height: 16rem; object-fit: cover; object-position: top; }
}

/* Two staggered columns either side of a center line, with a dot on the line for each map. */
.timeline { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 2rem 4rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline article {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.timeline article:nth-child(even) { margin-top: 6rem; }
.timeline article:hover { border-color: var(--accent); }
.timeline article::after {
  content: "";
  position: absolute;
  top: 2rem;
  right: calc(-2rem - 8px);
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
}
.timeline article:nth-child(even)::after { right: auto; left: calc(-2rem - 8px); }
.timeline a { color: inherit; text-decoration: none; }
.timeline img { background: #fff; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 7px 7px 0 0; }
.timeline div { padding: 1rem 1.25rem 1.25rem; }
.timeline h3 { margin: 0 0 .25rem; }
.timeline p { margin: 0; color: var(--muted); font-size: .95rem; }

.public {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.public + .public { margin-top: 1.5rem; }
.public h3 { margin-top: 0; }
.public p { color: var(--muted); }
.public img { border: 1px solid var(--line); border-radius: 8px; }
.public > img { width: 13rem; }
.public.stacked { grid-template-columns: 1fr; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.software { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
.software h3 { margin: 0 0 .5rem; font-size: 1.6rem; }
.software p { margin: 0 0 .75rem; color: var(--muted); }
.software .role { color: var(--ink); font-size: .9rem; font-weight: 600; }

.talks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.talks a { color: inherit; text-decoration: none; }
.talks img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.talks a:hover img { border-color: var(--accent); }
.talks h3 { margin: .75rem 0 .25rem; font-size: 1.05rem; }
.talks p { margin: 0; color: var(--muted); font-size: .9rem; }

.writing { margin-top: 3rem; color: var(--muted); }
.writing h3 { margin: 0 0 .5rem; color: var(--ink); font-size: 1.6rem; }
.writing p { margin: 0; }
.writing ul { margin: 1rem 0 1.5rem; padding-left: 1.25rem; }

.gallery-wrap { position: relative; margin-top: 1.25rem; }
.gallery { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; }
.gallery img {
  flex: none;
  height: 17rem;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  scroll-snap-align: start;
  cursor: zoom-in;
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .75);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.arrow.left { left: .5rem; }
.arrow.right { right: .5rem; }
.arrow[hidden] { display: none; }
@media (hover: none) and (pointer: coarse) { .arrow { display: none; } }

dialog.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 2rem; border: 0; background: rgba(0, 0, 0, .95); }
dialog.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 4rem); object-fit: contain; }
.lightbox .close {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

body.index footer { display: flex; gap: 1.5rem; padding-block: 2rem 4rem; font-size: .95rem; }
body.index footer a { display: flex; align-items: center; gap: .5rem; color: var(--muted); text-decoration: none; }
body.index footer a:hover { color: var(--accent); }
body.index footer svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

@media (max-width: 700px) {
  body.index header { padding-top: 3.5rem; }
  body.index nav { flex-wrap: nowrap; gap: 1.25rem; overflow-x: auto; white-space: nowrap; }
  .public, .shots, .timeline, .talks { grid-template-columns: 1fr; }
  .timeline::before { left: 6px; }
  .timeline article, .timeline article:nth-child(even) { margin: 0 0 0 2rem; }
  .timeline article::after, .timeline article:nth-child(even)::after { left: calc(-2rem - 1px); right: auto; }
}

/* Excerpt */
body.excerpt main { max-width: 56rem; margin: 0 auto; padding: 1.5rem; }
body.excerpt nav { margin-bottom: .5rem; }
body.excerpt .note { color: var(--muted); }
.note { color: var(--muted); font-size: .9rem; }
.paper {
  background: #fff;
  padding: 4rem 5rem;
  color: #000;
  font: 12pt/2 Arial, "Liberation Sans", Helvetica, sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.paper header { text-align: center; margin-bottom: 3rem; }
.paper h1 { font-size: 1.5rem; text-transform: uppercase; }
.paper h2 { margin: 2.5rem 0 1rem; font-size: 1.1rem; text-align: center; text-transform: uppercase; }
.paper h3 { margin: 1.5rem 0 0; font-size: 1rem; }
.paper p { margin: 0; text-indent: .5in; }
.paper header p { text-indent: 0; line-height: 1.6; }
.paper figure { margin: 1.5rem 0; text-align: center; }
.paper figcaption { font-size: 10pt; line-height: 1.4; text-align: left; margin-top: .5rem; }
.paper .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.paper a { color: #0b4f9c; }
.paper table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-size: 10pt; line-height: 1.4; }
.paper caption { margin-bottom: .5rem; text-align: left; }
.paper th, .paper td { padding: .3rem .5rem; border-bottom: 1px solid #ccc; text-align: left; }
.download { margin: 2rem 0 4rem; }
@media (max-width: 700px) {
  .paper { padding: 2rem 1.25rem; }
  .paper .pair { grid-template-columns: 1fr; }
}

/* Map pages */
body.map { height: 100vh; overflow: hidden; background: #fff; }
body.map object { position: fixed; inset: 0; width: 100%; height: 100%; }
.back {
  color: #1d2733;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  padding: .4rem .8rem;
  background: rgba(255, 255, 255, .9);
  border-radius: 4px;
  text-decoration: none;
  font-size: .9rem;
}
.info {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  max-width: min(32rem, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: #fff;
}
.info summary {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  background: rgba(0, 0, 0, .75);
  border-radius: 50%;
  font: italic bold 1.6rem Georgia, serif;
  cursor: pointer;
  list-style: none;
}
.info summary::-webkit-details-marker { display: none; }
.info[open] summary { order: 1; margin-top: .5rem; }
.info div {
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, .75);
  border-radius: 8px;
  max-height: min(60vh, calc(100vh - 7rem));
  overflow-y: auto;
  font-size: .95rem;
  line-height: 1.5;
}
.info h1 { margin: 0 0 .5rem; font-size: 1.3rem; }
.info p { margin: 0 0 .75rem; }
.info a { color: #9fd0ff; }
