/* Shared by every page. Edit once, changes everywhere. */

@font-face {
  font-family: 'Newsreader';
  src: url('newsreader.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #fbfaf7;
  --ink: #191713;
  --muted: #56514a;
  --faint: #736d63;
  --rule: #e4dfd4;
  --accent: #9c4221;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  max-width: 44rem;
  background: var(--paper);
  color: var(--ink);
  font-family: Newsreader, 'Iowan Old Style', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- navigation --------------------------------------------------- */

nav.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.35rem 1.25rem;
  font-size: 0.9375rem;
  margin: 1.75rem 0 2.75rem;
}

/* Home link sits left, tabs follow. */
nav.tabs .home {
  margin-right: 0;
}

nav.tabs a {
  color: var(--muted);
  text-decoration: none;
}

nav.tabs a:hover {
  color: var(--accent);
}

nav.tabs a[aria-current='page'] {
  color: var(--ink);
}

/* ---- home page ---------------------------------------------------- */

/* Compact identity block: small square photo, name and role beside it. */
.intro {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
}

img.portrait {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.role-line {
  margin: 0.15rem 0 0;
  color: var(--faint);
  font-size: 1rem;
}

.bio {
  margin-top: 0;
}

.bio p {
  margin: 0 0 1.05rem;
  text-wrap: pretty;
}

.bio .greeting {
  margin-bottom: 1.25rem;
}

/* Hairline after the opening paragraph, as on the reference. */
.bio hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.75rem 0;
}

/* ---- contact block + link cards ------------------------------------- */

/* Soft warm wash, layered radial gradients rather than an image file — keeps
   the page dependency-free and scales to any width. */
.cta {
  position: relative;
  overflow: hidden;
  margin-top: 2.75rem;
  padding: 1.9rem 1.75rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background:
    radial-gradient(90% 130% at 88% 6%, rgba(196, 122, 74, 0.2) 0%, transparent 58%),
    radial-gradient(80% 120% at 12% 96%, rgba(156, 66, 33, 0.13) 0%, transparent 62%),
    radial-gradient(60% 90% at 55% 40%, rgba(232, 214, 190, 0.5) 0%, transparent 70%),
    #f8f6f1;
}

.cta p {
  position: relative;
  margin: 0 0 1.3rem;
  color: var(--ink);
  font-size: 1.0625rem;
  max-width: 30rem;
  text-wrap: pretty;
}

.button {
  position: relative;
  display: inline-block;
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  text-decoration: none;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.button:hover {
  background: var(--accent);
  color: var(--paper);
  transform: translateY(-1px);
}

ul.cards {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

ul.cards a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9375rem;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

ul.cards a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

ul.cards svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
  flex-shrink: 0;
}

ul.cards .arrow {
  margin-left: auto;
  color: var(--faint);
  font-size: 0.8em;
}

/* An unverified profile stays faded until you give it a real href. */
ul.cards a[href='#'] {
  opacity: 0.45;
}

@media (max-width: 30rem) {
  ul.cards {
    grid-template-columns: 1fr;
  }
}

/* ---- inner pages --------------------------------------------------- */

h1.page-title {
  margin: 0 0 1.75rem;
  font-size: 2rem;
}

.lede {
  margin: -1.25rem 0 1.75rem;
  color: var(--faint);
  text-wrap: pretty;
}

.group {
  margin-bottom: 1.75rem;
}

.group h2 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  font-style: italic;
  color: var(--faint);
}

ul.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.entries li {
  margin-bottom: 0.6rem;
  font-size: 1.0625rem;
  text-wrap: pretty;
}

ul.entries .src {
  color: var(--faint);
}

/* ---- papers, with a first-page thumbnail ---------------------------- */

ul.papers {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.papers li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
  align-items: start;
}

/* The thumbnail slot keeps its shape even before you add an image, so the
   layout doesn't jump when the PDFs go in. */
ul.papers .thumb {
  display: block;
  aspect-ratio: 1 / 1.294; /* US Letter */
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
  object-fit: cover;
  object-position: top center;
  width: 100%;
  transition: border-color 0.15s ease;
}

ul.papers a:hover .thumb {
  border-color: var(--accent);
}

ul.papers .empty-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--faint);
  text-align: center;
  background: #f7f5f0;
}

ul.papers .title {
  font-size: 1.0625rem;
  display: block;
  margin-bottom: 0.3rem;
}

ul.papers .cite {
  display: block;
  color: var(--faint);
  font-size: 0.9375rem;
}

/* ---- video grid ------------------------------------------------------ */

ul.videos {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1.25rem;
}

ul.videos a {
  display: block;
  text-decoration: none;
  color: var(--ink);
}

.frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-sunk, #f2efe8);
  transition: border-color 0.15s ease;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Play triangle, drawn in CSS so no extra asset loads. */
.frame::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.95rem;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s ease;
}

ul.videos a:hover .frame {
  border-color: var(--accent);
}

ul.videos a:hover .frame::after {
  transform: translate(-50%, -50%) scale(1.12);
}

ul.videos .v-title {
  display: block;
  margin-top: 0.6rem;
  font-size: 1rem;
  line-height: 1.4;
  text-wrap: pretty;
}

ul.videos a:hover .v-title {
  color: var(--accent);
}

ul.videos .v-src {
  display: block;
  margin-top: 0.15rem;
  color: var(--faint);
  font-size: 0.875rem;
}

/* Audio-only or offsite items sit in the same grid without a thumbnail. */
.frame.audio {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f1ea;
  color: var(--faint);
  font-size: 0.8125rem;
  font-style: italic;
}

.frame.audio::after {
  display: none;
}

@media (max-width: 34rem) {
  ul.videos {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }
}

/* Award badge */
.award {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
  white-space: nowrap;
}

@media (max-width: 30rem) {
  ul.papers li {
    grid-template-columns: 4.5rem 1fr;
    gap: 0.9rem;
  }
}

p.body {
  margin: 0 0 1.05rem;
  text-wrap: pretty;
}

/* ---- links --------------------------------------------------------- */

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

/* An unfilled link shows up dotted and grey, so a placeholder can't
   quietly ship. Give it a real href and it styles itself normally. */
a[href='#'] {
  color: var(--faint);
  text-decoration-style: dotted;
}

.ext {
  font-size: 0.75em;
  color: var(--faint);
  margin-left: 0.1em;
}

/* ---- footer -------------------------------------------------------- */

footer {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 1.0625rem;
}

::selection {
  background: rgba(156, 66, 33, 0.16);
}

@media (max-width: 34rem) {
  body {
    padding-top: 3rem;
    font-size: 1.0625rem;
  }

  nav.tabs {
    margin-bottom: 2rem;
    gap: 0.3rem 1.1rem;
  }


  h1 {
    font-size: 1.25rem;
  }

  h1.page-title {
    font-size: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---- screenshots & post pages --------------------------------------- */

a.shot {
  display: block;
  margin-bottom: 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  transition: border-color 0.15s ease;
}

a.shot:hover {
  border-color: var(--accent);
}

a.shot img {
  width: 100%;
  height: auto;
  display: block;
}

li.showcase {
  margin-bottom: 2rem;
}

article.post p {
  margin: 0 0 1.05rem;
  text-wrap: pretty;
}

article.post .post-meta {
  margin: -1.25rem 0 1.75rem;
  color: var(--faint);
  font-size: 0.9375rem;
}

article.post figure {
  margin: 1.75rem 0;
}

article.post figcaption {
  margin-top: 0.5rem;
  color: var(--faint);
  font-size: 0.875rem;
}

/* Typeset cover for papers with no open-access first page. Reads as a
   deliberate spine label rather than a missing asset. */
ul.papers .cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.4rem;
  background: linear-gradient(170deg, #f7f5ef 0%, #f2efe6 100%);
  text-align: center;
}

ul.papers .cover-venue {
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--muted);
}

ul.papers .cover-rule {
  width: 1.5rem;
  height: 1px;
  background: var(--rule);
}

ul.papers .cover-year {
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--faint);
}
