/* CSS Reset: http://meyerweb.com/eric/tools/css/reset */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

/**************************************************/

:root {
  --text: #150c21;
  --muted: #5f6b76;
  --link: #146ebe;
  --border: #d9dee3;
}

#body{
  font-family: 'Asap', roboto, sans-serif;
  font-size: 1em;
  line-height: 1.5em;
  color: var(--text);
}

#main {
  width: min(100%, 58em);
  margin: 0 auto;
  padding: 0 2em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

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

i {
  font-style: italic;
}

b {
  font-weight: 700;
}

h1 {
  font-size: 2.4em;
  line-height: 1.2;
  font-weight: 500;
  margin-bottom: 0.65em;
}

/**************************************************/
/* Profile image and description. */

#intro {
  padding-top: 6em;
  display: flex;
  gap: 2em;
}

#intro-text {
  flex: 1;
  min-width: 0;
}

#intro-image {
  flex: 0 0 12em;
  margin-top: 2em;
  width: 12em;
  height: 12em;
  overflow: hidden;
  border-radius: 0;
}

#intro-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#more-bio {
  margin-top: 1.25em;
}

#more-bio p + p {
  margin-top: 1em;
}

.profile-links,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.1em;
}

.profile-links {
  margin-top: 0.75em;
}

.profile-links a,
.contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.contact-links {
  column-gap: 0.6em;
}

.contact-label {
  color: var(--muted);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .profile-links {
    flex-wrap: nowrap;
    column-gap: 0.85em;
    white-space: nowrap;
  }
}

.bio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.18em 0.55em 0.2em;
  margin-left: 0.35em;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.82em;
  line-height: 1;
  vertical-align: 0.08em;
}

.bio-toggle::after {
  content: '';
  flex: 0 0 0.7em;
  width: 0.7em;
  height: 0.7em;
  color: var(--text);
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}

.bio-toggle[aria-expanded="true"]::after {
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

.bio-toggle:hover {
  border-color: #aeb6bd;
  background: #f8f9fa;
  color: var(--text);
}

.reading-heatmap {
  margin-top: 0.6em;
  max-width: 640px;
}

.reading-heatmap svg {
  display: block;
  width: 100%;
  height: auto;
}

.reading-heatmap text {
  fill: var(--muted);
  font-size: 9px;
}

.reading-heatmap .level-0 { fill: #ebedf0; }
.reading-heatmap .level-1 { fill: #9be9a8; }
.reading-heatmap .level-2 { fill: #40c463; }
.reading-heatmap .level-3 { fill: #30a14e; }
.reading-heatmap .level-4 { fill: #216e39; }

.reading-heatmap-summary {
  margin-top: 0.3em;
  color: var(--muted);
  font-size: 0.85em;
}

/**************************************************/
/* Section buttons. */

#menu {
  display: flex;
}

.menu-item {
  float: left;
  margin-right: 2em;
}

h2 {
  font-size: 1.6em;
  line-height: 2.4em;
  margin-top: 0.5em;
  color: var(--muted);
}

.selected h2 {
  color: #150c21;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1em;
  line-height: 1.2;
  margin: 0;
  padding: 0.75em 0;
  border-bottom: 1px solid transparent;
}

.button:hover {
  color: #150c21;
}

.button:active,
.button.is-checked {
  color: #150c21;
  border-bottom-color: var(--text);
}

.button-group:after {
  content: '';
  display: block;
  clear: both;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5em;
  margin-top: 1.5em;
  border-bottom: 1px solid var(--border);
}

.filter-label,
.filter-count,
.older-work-count {
  color: var(--muted);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-label {
  margin-right: auto;
}

.filter-count {
  margin-left: 0.4em;
}

/**************************************************/
/* Isotope grid list of items. */

.grid {
  padding-bottom: 1em;
}

/* clear fix */
.grid:after {
  content: '';
  display: block;
  clear: both;
}

.description {
  margin-bottom: 1em;
}

.list-item {
  width: 100%;
  line-height: 1.5em;
  margin-top: 1em;
}

.list-item::after {
  content: '';
  display: block;
  clear: both;
}

.indexed-item {
  display: grid;
  grid-template-columns: 3.25em minmax(8em, 18%) minmax(0, 1fr);
  column-gap: 1em;
  align-items: start;
}

.indexed-item::before {
  content: attr(data-index) "\A" attr(data-meta);
  white-space: pre;
  padding-top: 0.1em;
  color: var(--muted);
  font-size: 0.78em;
  line-height: 1.55;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.indexed-item::after {
  display: none;
}

.list-item p.date {
  display: inline-block;
  width: 3em;
  color: var(--muted);
}

/**************************************************/
/* Gallery of 3 preview videos. */

.previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  height: 12.5em;
  margin-bottom: 2em;
}

.previews img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  aspect-ratio: 4/3;
}

.previews a {
  display: block;
  height: 100%;
}

.previews a:hover {
  border: none;
}

/* These classes ensure each image spans its grid column */
.preview1 { grid-column: 1; }
.preview2 { grid-column: 2; }
.preview3 { grid-column: 3; }

/**************************************************/
/* Buttons for showing more or less highlights. */

.toggle-button {
  margin-top: 2em;
}

.toggle-button a {
  color: var(--muted);
}

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

/**************************************************/
/* Publication details (thumbnail media, title, and description). */

.thumbnail {
  display: block;
  width: 18%;
  float: left;
  margin-right: 2%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 0;
  background: #eef1f3;
}

.thumbnail:hover {
  text-decoration: none;
}

.thumbnail img,
.thumbnail video {
  display: block;
  border-radius: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h3 {
  font-size: 1em;
  line-height: 1.5em;
}

h3 a {
  color: #150c21;
}

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

/* App branding in the Other index: each app's own logo, typeface, and color. */
.app-logo {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.4em;
  border-radius: 22%;
  vertical-align: -0.18em;
}

.app-logo-emoji {
  font-size: 1em;
  line-height: 1.1em;
  text-align: center;
}

.app-name-book-tracker {
  color: #294f52;
  font-family: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, sans-serif;
  font-weight: 700;
}

.app-name-threeggle {
  color: #276653;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.app-name-wherefore {
  color: #5b21b6;
  font-family: -apple-system, BlinkMacSystemFont, Inter, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 650;
}

.app-name-run-track {
  color: #2563eb;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.app-name-word-counter {
  color: #1d4ed8;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
}

.paper-title-name {
  color: #0f5a5a;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
}

.golf-flag {
  display: inline-block;
  vertical-align: -0.1em;
  margin-left: 3px;
}

.publication {
  margin-bottom: 0.5em;
}

.publication p {
  font-size: 1em;
  line-height: 1.5em;
  color: var(--muted);
}

.project-description {
  width: 80%;
  float: left;
}

.indexed-item .thumbnail {
  width: 100%;
  margin: 0;
  float: none;
}

.indexed-item .project-description {
  width: auto;
  float: none;
}

strong {
  font-weight: 700;
}

/**************************************************/
/* Older / non-robotics work drawer. */

.older-work-section {
  margin-bottom: 1em;
}

.older-work-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  min-height: 44px;
  padding: 0.75em 0;
  color: var(--muted);
  font-size: 1em;
  font-family: inherit;
  text-align: left;
  user-select: none;
}

.older-work-toggle:hover {
  color: #150c21;
}

.older-work-toggle .chevron {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 1.1em;
  line-height: 1;
}

.older-work-toggle.open .chevron {
  transform: rotate(180deg);
}

#older-work-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}

#older-work-items.open {
  max-height: 6000px;
}

/**************************************************/
/* Subtle footer at the bottom of the page. */

#footer {
  color: var(--muted);
  margin-top: auto;
  padding: 2em 0;
  display: flex;
  gap: 0.5em;
  line-height: 1.5em;
  text-align: left;
  border-top: 1px solid var(--border);
}

@media (max-width: 700px) {
  #main {
    padding: 0 1em;
  }

  #intro {
    flex-direction: column-reverse;
    gap: 1.25em;
    padding-top: 2em;
  }

  #intro-image {
    width: 8.5em;
    height: 8.5em;
    flex-basis: 8.5em;
    margin-top: 0;
  }

  h1 {
    font-size: 2em;
  }

  .profile-links {
    column-gap: 1em;
  }

  .contact-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-separator {
    display: none;
  }

  .button {
    font-size: 1em;
  }

  .thumbnail {
    float: none;
    width: 100%;
    max-width: 24em;
    margin: 0 0 0.75em;
  }

  .project-description {
    float: none;
    width: 100%;
  }

  .indexed-item {
    grid-template-columns: 2.75em minmax(0, 1fr);
    column-gap: 0.75em;
  }

  .indexed-item::before {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .indexed-item .thumbnail,
  .indexed-item .project-description {
    grid-column: 2;
  }

  .publication {
    margin-bottom: 1.25em;
    padding-bottom: 1.25em;
    border-bottom: 1px solid var(--border);
  }

  .list-item p.date {
    width: 3.5em;
  }

  #footer {
    line-height: 1.6em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
