/* River Computer — migrated from Cargo, 2026 */

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 10.97px;
}

body {
  font-family: "Diatype Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0em;
  color: rgba(0, 0, 0, 0.85);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
  padding: 4rem 4rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

a {
  color: rgba(0, 0, 0, 0.85);
  text-decoration: underline;
}

a:hover {
  opacity: 0.7;
}

a:active {
  opacity: 0.7;
}

p {
  margin: 0;
}

hr {
  background: rgba(0, 0, 0, 0.6);
  border: 0;
  height: 1px;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

img {
  max-width: 100%;
  display: block;
}

/* Header */
.header {
  text-align: center;
  margin: 4rem auto 7rem;
  max-width: 72rem;
}

.header h1 {
  font-family: "Diatype Variable", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.85);
  margin-bottom: 2.4rem;
}

.header h1 b {
  font-weight: 500;
}

.header-cta {
  font-size: 1.2rem;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
  font-variation-settings: 'slnt' -10;
}

/* Title pill */
.title {
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.2;
  display: inline-block;
  border: 0.1rem solid #95c8de;
  border-radius: 10rem;
  padding: 0.5rem 2rem 0.4rem;
  background: #95c8de;
}

/* Description text (italic, slanted) */
.description {
  font-size: 1.2rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
  line-height: 1.2;
  display: block;
  font-variation-settings: 'slnt' -10;
}

/* Dots separator */
.dots {
  display: block;
  color: rgba(0, 0, 0, 0.85);
  letter-spacing: 0.2em;
}

/* Spacers */
.spacer {
  height: 2.4rem;
}

.spacer-sm {
  height: 1.2rem;
}

/* Icons */
.icon {
  display: inline;
}

/* =========================================================
   Home — 5-project grid
   ========================================================= */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem 3rem;
  max-width: 130rem;
  margin: 0 auto;
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  gap: 1.1rem;
}

.project-card:hover {
  opacity: 1;
}

.project-card:hover .project-thumb img {
  transform: scale(1.02);
}

.project-card:hover .title {
  background: #7fb8d2;
  border-color: #7fb8d2;
}

.project-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.04);
  border: 0.1rem solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-thumb.empty::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
}

/* =========================================================
   Project detail pages
   ========================================================= */

.project-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.project-nav .back-link {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.6);
}

.project-nav .back-link:hover {
  color: rgba(0, 0, 0, 0.85);
  opacity: 1;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4rem;
  row-gap: 2.4rem;
  align-items: start;
}

.project-hero {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.04);
  border: 0.1rem solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-hero.contain img {
  object-fit: contain;
}

.project-copy {
  grid-column: 2;
  grid-row: 1;
}

.project-copy .topic-sentence {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

.topic-link {
  color: hotpink;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3rem;
}

.topic-link:hover {
  opacity: 1;
  color: #ff3ea5;
}

.endorsement {
  margin: 1.6rem 0;
  padding-left: 1.4rem;
  border-left: 0.2rem solid rgba(0, 0, 0, 0.12);
  font-style: italic;
  font-variation-settings: 'slnt' -8;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.45;
}

.endorsement p {
  margin-bottom: 0.8rem;
}

.endorsement cite {
  display: block;
  font-style: normal;
  font-variation-settings: 'slnt' 0;
  color: rgba(0, 0, 0, 0.5);
  font-size: 1.1rem;
}

.project-copy p {
  margin-bottom: 1rem;
  line-height: 1.4;
}

.project-copy em {
  font-style: italic;
  font-variation-settings: 'slnt' -10;
}

/* Resource thumbnails grid */
.resources-section {
  grid-column: 2;
  grid-row: 2;
  margin-top: 0;
}

.resources-section .section-label {
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
  font-variation-settings: 'slnt' -10;
  margin-bottom: 1.2rem;
  display: block;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 2rem;
}

.resource-thumb {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  gap: 0.8rem;
}

.resource-thumb:hover {
  opacity: 1;
}

.resource-thumb:hover .resource-image img {
  transform: scale(1.02);
}

.resource-thumb:hover .resource-label {
  text-decoration: underline;
}

.resource-image {
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: rgba(0, 0, 0, 0.04);
  border: 0.1rem solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

.resource-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  opacity: 0;
}

.resource-image img.loaded {
  opacity: 1;
}

.resource-image.placeholder::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.3);
  font-style: italic;
  font-variation-settings: 'slnt' -10;
  padding: 1rem;
  text-align: center;
}

.resource-label {
  font-size: 1.2rem;
}

/* Fill-the-card variant — images that should fill the resource-card box
   edge-to-edge with no frame, no margin. Keeps the card sized identically
   to neighboring cards (1200x630) so the grid stays aligned. */
.resource-thumb.fill .resource-image {
  background: transparent;
  border: none;
  overflow: hidden;
}

.resource-thumb.fill .resource-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  display: block;
}

/* Inline video resources — preload first frame as poster, play in place. */
.resource-thumb.video-card .resource-image {
  background: #000;
}

.resource-thumb.video-card .resource-image video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.resource-sublabel {
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
  font-variation-settings: 'slnt' -10;
}

/* =========================================================
   Publications & Lectures — chronological list
   ========================================================= */

.pubs-list {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 10rem 1fr;
  column-gap: 3rem;
  row-gap: 1.8rem;
  padding: 2rem 0 4rem;
}

.pub-entry {
  display: contents;
}

.pub-entry + .pub-entry::before {
  content: "";
  grid-column: 1 / -1;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pub-date {
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
  font-variation-settings: 'slnt' -10;
  font-size: 1.2rem;
  padding-top: 0.1rem;
  white-space: nowrap;
}

.pub-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pub-title {
  font-size: 1.4rem;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.85);
}

a.pub-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3rem;
}

a.pub-title:hover {
  opacity: 1;
  color: #ff3ea5;
}

.pub-venue {
  font-size: 1.15rem;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
  font-variation-settings: 'slnt' -10;
  line-height: 1.35;
}

.pub-venue em {
  font-style: italic;
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
  margin-top: 8rem;
  flex-shrink: 0;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.footer-col {
  text-align: left;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  body {
    padding: 2rem 2rem 1.5rem;
  }

  .header {
    margin: 2rem auto 4rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.4rem 2rem;
  }

  .project-layout {
    grid-template-columns: 1fr;
    row-gap: 2rem;
  }

  .project-hero,
  .project-copy,
  .resources-section {
    grid-column: 1;
    grid-row: auto;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pubs-list {
    grid-template-columns: 1fr;
    row-gap: 1.4rem;
  }

  .pub-entry + .pub-entry::before {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
  }
}

@media (max-width: 500px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
