html {
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto Mono", monospace;
  background-color: rgb(253, 250, 244);
  color: #222;
  font-size: 17px;
  font-weight: 400;
}

body::selection {
  background: rgba(0, 0, 0, 0.12);
}

@font-face {
  font-family: "Signifier";
  src: url("https://www.pi.website/_next/static/media/dcb532816ecc2c68-s.p.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(253, 250, 244, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1344px;
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
}

.nav-brand {
  color: #111;
  text-decoration: none;
}

.nav-brand {
  font-family: "Apple Chancery", "Brush Script MT", cursive;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.page-toc {
  position: fixed;
  top: 5.75rem;
  right: clamp(0.45rem, 1.1vw, 1.35rem);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 158px;
  min-width: 150px;
  padding: 0.72rem 0.78rem;
  background: rgba(253, 250, 244, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 28, 38, 0.08);
  backdrop-filter: blur(14px);
}

.toc-title {
  color: rgba(0, 0, 0, 0.46);
  font-size: 0.72rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.toc-link {
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.8rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: normal;
  transition: color 160ms ease, transform 160ms ease;
}

.toc-link:hover,
.toc-link.is-active {
  color: #000;
}

.toc-link.is-active {
  transform: translateX(4px);
}

.hero-body {
  background-color: rgb(253, 250, 244) !important;
  padding: 4.5rem 1.5rem 3rem;
}

.container.is-max-desktop {
  max-width: 1180px !important;
}

.container.is-max-widescreen {
  max-width: 1120px !important;
}

.hero-copy {
  max-width: 980px;
}

.publication-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: "Signifier", Georgia, serif !important;
  font-weight: 400;
  font-size: clamp(2.1rem, 4vw, 3.35rem) !important;
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 0.75rem;
  text-align: left;
  color: #111;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.title-line {
  display: block;
}

.project-name-line {
  display: block !important;
  width: max-content;
  max-width: none;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  hyphens: none !important;
}

.title-subline {
  margin-top: 0.3rem;
  display: inline-block !important;
  width: max-content;
  max-width: none;
  font-size: clamp(1.22rem, 2.08vw, 2.18rem);
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  hyphens: none !important;
}

.project-name {
  display: inline-block;
  color: #111;
  font-weight: 900;
  -webkit-text-stroke: 0.55px currentColor;
  text-shadow: 0.026em 0 0 currentColor;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  hyphens: none !important;
}

.author-placeholder,
.publication-links {
  min-height: 0;
}

.publication-links {
  margin-top: 1.35rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #111;
  font-family: "Roboto Mono", monospace;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.project-link:hover {
  background: #111;
  color: rgb(253, 250, 244);
}

.section {
  background-color: rgb(253, 250, 244);
  padding: 2.75rem 1.5rem;
  scroll-margin-top: 5rem;
}

.overview-section {
  padding-top: 1.25rem;
}

.overview-copy {
  max-width: 100%;
  color: rgba(0, 0, 0, 0.78);
  font-size: 1rem;
  line-height: 1.72;
}

.overview-copy p {
  margin: 0;
}

.overview-copy p + p {
  margin-top: 1.35rem;
}

.pipeline-section {
  padding-top: 1.25rem;
}

.pipeline-description {
  max-width: 100%;
  color: rgba(0, 0, 0, 0.78);
  font-size: 1rem;
  line-height: 1.72;
  margin: 1.15rem 0 0;
}

.pipeline-frame {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 18px;
  overflow: visible;
  box-shadow: none;
}

.pipeline-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: contain;
}

/*
.section-title-dark {
  text-align: left;
  background-color: #000;
  color: #fff;
  padding: 10px 20px;
  margin-bottom: 1.5rem;
  border-radius: 5px;
  display: inline-block;
  width: auto;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  font-family: "Roboto Mono", monospace;
  letter-spacing: 0;
}
*/

.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: "Roboto Mono", monospace;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 1.15rem;
  color: #111;
  letter-spacing: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 160ms ease;
  cursor: default;
}

.section-heading::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  background: #111;
  flex: 0 0 auto;
}

.section-heading:hover {
  text-decoration-color: currentColor;
}

.demo-description {
  max-width: 100%;
  color: rgba(0, 0, 0, 0.78);
  font-size: 1rem;
  line-height: 1.72;
  margin: 0;
}

.demo-block {
  margin-top: 1.25rem;
  padding: 1.15rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 32px rgba(20, 28, 38, 0.05);
}

.demo-block + .demo-block {
  margin-top: 1.35rem;
}

.demo-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.demo-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Roboto Mono", monospace;
  font-size: clamp(1.1rem, 1.45vw, 1.35rem);
  font-weight: 600;
  line-height: 1.2;
  color: #111;
  margin: 0;
}

.demo-title::before {
  content: "";
  width: 3px;
  height: 1.35rem;
  border-radius: 2px;
  background: #111;
}

.task-controls {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.task-strip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow-x: auto;
  min-height: 2.55rem;
  padding: 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.task-strip::-webkit-scrollbar {
  display: none;
}

.task-button,
.task-scroll {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.38);
  color: #111;
  font-family: "Roboto Mono", monospace;
}

.task-button {
  flex: 0 0 auto;
  max-width: min(34rem, 82vw);
  min-height: 2.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.task-button:hover,
.task-button.is-active {
  border-color: #111;
  background: #111;
  color: rgb(253, 250, 244);
}

.task-scroll {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.task-scroll:hover {
  border-color: #111;
}

.video-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.video-card {
  margin: 0;
}

.video-card figcaption {
  color: rgba(0, 0, 0, 0.62);
  font-family: "Roboto Mono", monospace;
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 14px 36px rgba(20, 28, 38, 0.1);
}

.demo-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1.12rem auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.34rem;
  min-height: 1.2rem;
  padding: 0.1rem 0.28rem;
  border-radius: 0;
  background: rgba(198, 226, 255, 0.38);
  box-shadow: none;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.video-shell:hover .video-controls,
.video-shell:focus-within .video-controls {
  opacity: 1;
  transform: translateY(0);
}

.video-play-toggle {
  position: relative;
  width: 1.12rem;
  height: 1.12rem;
  border: 0;
  border-radius: 2px;
  background: rgba(225, 242, 255, 0.78);
  cursor: pointer;
  box-shadow: none;
}

.video-play-toggle::before,
.video-play-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #111;
}

.video-play-toggle.is-playing::before,
.video-play-toggle.is-playing::after {
  width: 0.13rem;
  height: 0.42rem;
  border-radius: 1px;
}

.video-play-toggle.is-playing::before {
  left: 0.4rem;
}

.video-play-toggle.is-playing::after {
  right: 0.4rem;
}

.video-play-toggle:not(.is-playing)::before {
  left: 0.44rem;
  width: 0;
  height: 0;
  background: transparent;
  border-top: 0.22rem solid transparent;
  border-bottom: 0.22rem solid transparent;
  border-left: 0.34rem solid #111;
}

.video-play-toggle:not(.is-playing)::after {
  display: none;
}

.video-time {
  color: #111;
  font-family: "Roboto Mono", monospace;
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
}

.video-progress {
  position: relative;
  height: 0.9rem;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.video-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.16rem;
  border-radius: 999px;
  background: rgba(22, 64, 112, 0.22);
  transform: translateY(-50%);
  transition: height 160ms ease, background 160ms ease;
}

.video-progress:hover::before,
.video-progress:focus-visible::before,
.video-progress.is-dragging::before {
  height: 0.24rem;
  background: rgba(22, 64, 112, 0.28);
}

.video-progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0%;
  height: 0.16rem;
  border-radius: inherit;
  background: rgba(42, 132, 220, 0.9);
  transform: translateY(-50%);
  transition: height 160ms ease;
  z-index: 1;
}

.video-progress:hover .video-progress-fill,
.video-progress:focus-visible .video-progress-fill,
.video-progress.is-dragging .video-progress-fill {
  height: 0.24rem;
}

.bibtex-box {
  min-height: 150px;
  padding: 1rem;
  border-radius: 8px;
  background: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #222;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-body {
    padding-top: 3rem;
  }

  .publication-title {
    font-size: clamp(1.65rem, 12vw, 2.15rem) !important;
  }

  .title-subline {
    font-size: clamp(0.74rem, 3.45vw, 1.05rem);
  }

  .demo-block {
    padding: 0.85rem;
  }

  .task-controls {
    grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem;
  }

  .video-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1240px) {
  .page-toc {
    display: none;
  }
}
