:root {
  --ink: #1f2530;
  --text: #3c4656;
  --muted: #667282;
  --line: #dbe4ef;
  --paper: #ffffff;
  --wash: #f5f7fb;
  --tint: #edf4fb;
  --green: #275f9f;
  --green-dark: #17365f;
  --blue: #6b88b0;
  --gold: #8a6b22;
  --coral: #a95656;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: "Ubuntu Mono", "Roboto Mono", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", monospace;
  line-height: 1.65;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 40;
  transform: translateY(-150%);
  background: var(--green-dark);
  color: var(--paper);
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1rem, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-name {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.site-header nav a {
  padding: 0.45rem 0.55rem;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus,
.site-header nav a.is-active {
  color: var(--green);
}

.banner {
  position: relative;
  height: 12rem;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-dark), var(--blue));
}

.banner::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(23, 54, 95, 0.84), rgba(23, 54, 95, 0.24)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(23, 54, 95, 0.68));
}

.banner-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.86) contrast(1.02);
}

.page-shell {
  display: grid;
  gap: 2rem;
  width: min(1180px, calc(100% - 2rem));
  margin: -2.25rem auto 0;
  position: relative;
  z-index: 2;
}

.profile-sidebar,
.content-column {
  min-width: 0;
}

.profile-sidebar {
  align-self: start;
  padding: 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.avatar-wrap {
  width: min(11.5rem, 54vw);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  overflow: hidden;
  border: 6px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 24%;
}

.profile-sidebar h1 {
  margin-bottom: 0.3rem;
  text-align: center;
  font-size: 1.55rem;
  line-height: 1.2;
}

.role,
.affiliation,
.tagline {
  text-align: center;
}

.role {
  margin-bottom: 0.25rem;
  color: var(--green);
  font-weight: 800;
}

.affiliation {
  margin-bottom: 0.85rem;
  color: var(--muted);
}

.tagline {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 0.92rem;
}

.theme-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.theme-button:hover,
.theme-button:focus {
  background: var(--green);
  color: var(--paper);
}

.sidebar-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sidebar-links a {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}

.social-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--green);
  fill: currentColor;
}

.sidebar-links a:hover strong,
.sidebar-links a:focus strong {
  color: var(--green);
}

.sidebar-links span,
.contact-grid span {
  display: grid;
  min-width: 0;
}

.sidebar-links em,
.contact-grid em {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  font-style: normal;
}

.sidebar-links strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.content-column {
  background: var(--paper);
  border: 1px solid var(--line);
}

.content-section {
  padding: 1.4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 8rem;
  content-visibility: auto;
  contain-intrinsic-size: 760px;
}

.content-section:last-child {
  border-bottom: 0;
}

.section-kicker {
  margin-bottom: 0.55rem;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-section h2 {
  margin-bottom: 0.85rem;
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1.22;
}

.lead {
  color: var(--text);
  font-size: 1.03rem;
}

.profile-copy {
  display: grid;
  gap: 0.9rem;
}

.profile-copy p,
.publication-header p,
.feature-panel p,
.updated-note {
  color: var(--text);
}

.publication-header {
  display: grid;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.publication-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0.55rem;
}

.publication-stat {
  min-width: 0;
  padding: 0.75rem;
  background: var(--tint);
  border-left: 4px solid var(--green);
}

.publication-stat strong {
  display: block;
  color: var(--green-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.publication-stat span {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stats-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.paper-search {
  display: grid;
  gap: 0.35rem;
}

.paper-search span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.paper-search input {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.78rem;
  background: var(--paper);
  color: var(--ink);
}

.paper-search input:focus {
  outline: 3px solid rgba(39, 95, 159, 0.14);
  border-color: var(--green);
}

.publication-list {
  display: grid;
  gap: 1.6rem;
}

.publication-card {
  display: grid;
  gap: 1rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.publication-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.publication-card[hidden] {
  display: none;
}

.publication-thumb {
  display: block;
  align-self: start;
  aspect-ratio: 4 / 3;
  min-height: 8rem;
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--line);
  text-decoration: none;
}

.publication-thumb picture,
.publication-thumb img {
  width: 100%;
  height: 100%;
}

.publication-thumb img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.publication-thumb span {
  display: grid;
  min-height: 8rem;
  place-items: center;
  color: var(--green);
  font-weight: 850;
}

.publication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.publication-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.publication-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 0.4rem;
  color: var(--line);
}

.publication-meta span:last-child:nth-child(4) {
  color: var(--coral);
}

.publication-body h3 {
  margin-bottom: 0.55rem;
  font-size: 1.18rem;
  line-height: 1.35;
}

.publication-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.publication-body h3 a:hover,
.publication-body h3 a:focus {
  color: var(--green);
}

.authors {
  margin-bottom: 0.7rem;
  color: var(--text);
  font-size: 0.93rem;
}

.publication-actions,
.feature-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.theme-button {
  padding: 0.34rem 0.6rem;
}

.theme-button-code {
  border-color: var(--gold);
  color: var(--gold);
}

.theme-button-code:hover,
.theme-button-code:focus {
  background: var(--gold);
  color: var(--paper);
}

.publication-details {
  color: var(--text);
}

.publication-details summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 850;
}

.publication-details p {
  margin: 0.75rem 0 0;
}

.code-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.code-links a {
  display: grid;
  gap: 0.08rem;
  padding: 0.78rem;
  background: var(--wash);
  border-left: 4px solid var(--gold);
  color: var(--ink);
  text-decoration: none;
}

.code-links span {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
}

.code-links small {
  color: var(--muted);
}

.figure-carousel {
  margin-top: 1rem;
}

.figure-stage {
  display: grid;
}

.paper-figure {
  display: none;
  margin: 0;
}

.paper-figure.is-active {
  display: block;
}

.paper-figure img {
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
  padding: 0.45rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

figcaption {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.figure-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.figure-controls button {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--green);
  cursor: pointer;
  font-weight: 850;
}

.figure-controls button:hover,
.figure-controls button:focus {
  background: var(--green);
  color: var(--paper);
}

.figure-controls span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.interest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0;
  margin: 1rem 0 1.4rem;
  list-style: none;
}

.interest-list li {
  padding: 0.62rem 0.72rem;
  background: var(--wash);
  border-left: 4px solid var(--green);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.feature-panel {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.feature-panel h2 {
  font-size: 1.35rem;
}

.feature-panel figure {
  margin: 0;
}

.feature-panel img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.contact-grid a {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem;
  background: var(--wash);
  border-left: 4px solid var(--green);
  color: var(--ink);
  text-decoration: none;
}

.contact-grid a:hover,
.contact-grid a:focus {
  background: var(--tint);
}

.contact-grid strong {
  overflow-wrap: anywhere;
}

.tutorial-card-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

.tutorial-card {
  display: grid;
  overflow: hidden;
  background: var(--wash);
  border: 1px solid var(--line);
}

.tutorial-card-media {
  display: block;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}

.tutorial-card-media picture,
.tutorial-card-media img {
  width: 100%;
  height: 100%;
}

.tutorial-card-media img {
  object-fit: cover;
}

.tutorial-card-body {
  padding: 1rem;
}

.tutorial-card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.tutorial-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.tutorial-card h3 a:hover,
.tutorial-card h3 a:focus {
  color: var(--green);
}

.tutorial-card p {
  color: var(--text);
}

.tutorial-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.9rem 0;
}

.tutorial-meta-grid span {
  min-width: 0;
  padding: 0.65rem;
  background: var(--paper);
  border-left: 4px solid var(--green);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tutorial-meta-grid strong {
  display: block;
  color: var(--green-dark);
  font-size: 1.1rem;
  line-height: 1;
}

.tutorial-figure {
  margin: 1.15rem 0;
}

.tutorial-figure img {
  width: 100%;
  max-height: 34rem;
  object-fit: contain;
  padding: 0.45rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.tutorial-figure-planck img {
  aspect-ratio: 2 / 1;
  padding: 0;
  object-fit: cover;
}

.tutorial-chapter-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.tutorial-chapter-nav a {
  display: grid;
  min-height: 3rem;
  align-items: center;
  padding: 0.62rem 0.72rem;
  background: var(--wash);
  border-left: 4px solid var(--green);
  color: var(--ink);
  text-decoration: none;
}

.tutorial-chapter-nav a:hover,
.tutorial-chapter-nav a:focus {
  background: var(--tint);
}

.tutorial-chapter-nav span {
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.25;
}

.tutorial-chapter-nav small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.tutorial-reader {
  display: grid;
  gap: 2.4rem;
}

.tutorial-chapter {
  min-width: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 8rem;
}

.tutorial-chapter:first-child {
  padding-top: 0;
  border-top: 0;
}

.tutorial-chapter-page .tutorial-chapter {
  padding-top: 0;
  border-top: 0;
}

.tutorial-chapter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.tutorial-chapter-heading span {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tutorial-chapter-heading a,
.tutorial-xref {
  color: var(--green);
  font-weight: 850;
  text-decoration: none;
}

.tutorial-chapter-heading a:hover,
.tutorial-chapter-heading a:focus,
.tutorial-xref:hover,
.tutorial-xref:focus {
  text-decoration: underline;
}

.tutorial-chapter h2 {
  margin-top: 1.2rem;
  font-size: 1.55rem;
}

.tutorial-chapter h2:first-of-type {
  margin-top: 0;
}

.tutorial-chapter h3 {
  margin: 1.45rem 0 0.55rem;
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.35;
}

.tutorial-chapter h4 {
  margin: 1rem 0 0.35rem;
  color: var(--green-dark);
  font-size: 1rem;
  line-height: 1.4;
}

.tutorial-chapter p,
.tutorial-list-block,
.tutorial-description-list dd,
.tutorial-download-panel p {
  color: var(--text);
}

.tutorial-list-block {
  margin: 0.8rem 0 1rem;
  padding-left: 1.35rem;
}

.tutorial-list-block li + li {
  margin-top: 0.55rem;
}

.tutorial-description-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.9rem 0 1.1rem;
}

.tutorial-description-list dt {
  color: var(--green-dark);
  font-weight: 850;
}

.tutorial-description-list dd {
  margin: -0.45rem 0 0;
  padding-left: 0.8rem;
  border-left: 3px solid var(--line);
}

.tutorial-callout {
  margin: 1.05rem 0;
  padding: 0.95rem 1rem;
  background: var(--tint);
  border-left: 4px solid var(--green);
}

.tutorial-callout-physinsight {
  background: #fff8ed;
  border-left-color: var(--gold);
}

.tutorial-callout > strong {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--green-dark);
}

.tutorial-callout-physinsight > strong {
  color: var(--gold);
}

.tutorial-code {
  margin: 1.05rem 0;
  overflow: hidden;
  background: #101823;
  border: 1px solid #24364f;
}

.tutorial-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.45rem;
  padding: 0.4rem 0.55rem 0.4rem 0.8rem;
  background: #17243a;
  color: #e8edf7;
}

.tutorial-code-header span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 850;
}

.tutorial-code-header button {
  flex: 0 0 auto;
  min-height: 1.8rem;
  border: 1px solid rgba(232, 237, 247, 0.38);
  border-radius: 4px;
  padding: 0 0.55rem;
  background: transparent;
  color: #e8edf7;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.tutorial-code-header button:hover,
.tutorial-code-header button:focus {
  background: #e8edf7;
  color: #17243a;
}

.tutorial-code pre {
  margin: 0;
  overflow-x: auto;
  padding: 0.95rem;
}

.tutorial-code code {
  font-family: inherit;
}

.tutorial-code pre code {
  display: block;
  color: #eef4ff;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
}

.tutorial-math {
  margin: 1rem 0;
  overflow-x: auto;
  padding: 0.75rem;
  background: var(--wash);
  border-left: 4px solid var(--blue);
}

.tutorial-anchor {
  display: block;
  position: relative;
  top: -8rem;
}

.tutorial-rule {
  height: 1px;
  margin: 1.3rem 0;
  border: 0;
  background: var(--line);
}

.tutorial-download-panel {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
  padding: 1rem;
  background: var(--wash);
  border: 1px solid var(--line);
}

.tutorial-download-panel h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
}

.tutorial-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tutorial-pager {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.tutorial-pager a {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.8rem;
  background: var(--wash);
  border-left: 4px solid var(--green);
  color: var(--ink);
  text-decoration: none;
}

.tutorial-pager a:hover,
.tutorial-pager a:focus {
  background: var(--tint);
}

.tutorial-pager span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tutorial-pager strong {
  font-size: 0.95rem;
}

.updated-note {
  margin: 1rem 0 0;
  font-size: 0.88rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 720px) {
  .site-header nav {
    display: flex;
  }

  .banner,
  .banner-image {
    height: 16rem;
  }

  .page-shell {
    grid-template-columns: minmax(15rem, 0.32fr) minmax(0, 0.68fr);
    align-items: start;
  }

  .profile-sidebar {
    position: sticky;
    top: 5.25rem;
  }

  .content-section {
    padding: 1.8rem;
  }

  .publication-header {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.34fr);
  }

  .publication-card {
    grid-template-columns: minmax(10rem, 0.32fr) minmax(0, 0.68fr);
  }

  .publication-thumb {
    height: 10.75rem;
  }

  .feature-panel {
    grid-template-columns: minmax(0, 0.9fr) minmax(16rem, 0.7fr);
    align-items: start;
  }

  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tutorial-card {
    grid-template-columns: minmax(14rem, 0.42fr) minmax(0, 0.58fr);
  }

  .tutorial-card-media {
    aspect-ratio: auto;
    min-height: 16rem;
    height: 100%;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .tutorial-download-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .tutorial-pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .page-shell {
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: 2.2rem;
  }

  .content-section {
    padding: 2rem 2.2rem;
  }
}

@media (max-width: 719px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .page-shell {
    width: min(100% - 1rem, 44rem);
  }

  .content-section {
    padding: 1.1rem;
  }

  .content-section h2 {
    font-size: 1.55rem;
  }

  .interest-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
