:root {
  --text: #111111;
  --muted: #555555;
  --line: #e5e5e5;
  --soft: #f8f9fa;
  --accent: #1f6f9f;
  --accent-dark: #174f72;
  --nav-height: 57px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: var(--text);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

a:hover,
a:focus {
  color: var(--accent);
  text-decoration: underline;
}

.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: min(930px, calc(100vw - 32px));
  height: var(--nav-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 40px;
  color: var(--text);
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
}

.home .brand {
  visibility: hidden;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 13px;
  color: #222222;
  font-size: 16px;
  text-transform: lowercase;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  color: var(--accent);
}

.container {
  width: min(930px, calc(100vw - 32px));
  margin: 105px auto 0;
  padding: 0 15px;
}

.page-header {
  margin-bottom: 16px;
}

h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.2;
  font-weight: 300;
  letter-spacing: 0;
}

h1 .font-weight-bold {
  font-weight: 700;
}

h2 {
  margin: 32px 0 12px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 300;
  letter-spacing: 0;
  text-transform: lowercase;
}

h3 {
  margin: 24px 0 8px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 400;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

p {
  margin: 0 0 16px;
}

p,
li,
.subtitle,
.pub-title,
.project-title,
.authors,
.venue,
.project-meta,
.muted {
  overflow-wrap: anywhere;
}

ul {
  margin: 0 0 16px 18px;
  padding: 0;
}

li {
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  color: #333333;
  font-size: 18px;
}

.intro {
  display: flow-root;
  margin-top: 8px;
}

.profile-photo {
  float: left;
  width: 270px;
  height: 270px;
  object-fit: cover;
  margin: 0 24px 16px 0;
  border-radius: 2px;
}

.muted {
  color: var(--muted);
}

.news-list {
  margin-top: 8px;
}

.contact-line {
  margin-top: 24px;
}

.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  clear: both;
  margin: 34px 0 8px;
}

.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 56px;
  color: #000000;
  line-height: 1;
}

.social-icons svg {
  display: block;
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.social-icons a:hover,
.social-icons a:focus {
  color: var(--accent);
  text-decoration: none;
}

.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;
}

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

.pub-year {
  margin-top: 16px;
  margin-bottom: 16px;
}

.pub-item {
  margin: 0 0 20px;
}

.pub-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.abbr {
  display: flex;
  justify-content: center;
}

.badge {
  display: inline-block;
  width: 100%;
  max-width: 88px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.pub-title,
.project-title {
  font-weight: 600;
}

.authors,
.venue,
.project-meta {
  color: #333333;
}

.authors strong {
  font-weight: 700;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 14px;
  border: 1px solid #111111;
  border-radius: 3px;
  color: #111111;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.btn:hover,
.btn:focus {
  background: #111111;
  color: #ffffff;
  text-decoration: none;
}

details.abstract {
  margin-top: 8px;
}

details.abstract summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 14px;
}

details.abstract p {
  margin-top: 8px;
  color: #333333;
}

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

.project-item {
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.project-item:last-child {
  border-bottom: 0;
}

.project-links {
  margin-top: 8px;
}

.listing-page {
  margin-top: 4px;
}

.section-lede {
  max-width: 760px;
  margin-bottom: 28px;
  color: #222222;
}

.section-note {
  max-width: 760px;
  margin: -10px 0 18px;
  color: var(--muted);
}

.project-section {
  margin-top: 34px;
}

.project-card-grid,
.post-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.project-card,
.post-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.project-card {
  flex-direction: column;
}

.project-card-visual,
.post-card-visual {
  display: block;
  margin: 0;
  background: var(--soft);
}

.project-card-visual {
  border-bottom: 1px solid var(--line);
}

.project-card-visual img,
.post-card-visual img {
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--soft);
}

.project-card-visual img {
  padding: 10px;
}

.external-card-grid .project-card-visual img {
  padding: 0;
  object-fit: cover;
}

.external-card-grid .project-card-visual img[src^="/images/projects/"] {
  padding: 10px;
  object-fit: contain;
}

.project-card-body,
.post-card-body {
  min-width: 0;
  padding: 16px;
}

.project-card-body p,
.post-card-body p {
  margin-top: 8px;
}

.proof-list {
  margin-top: 10px;
  color: #333333;
}

.external-writing-list {
  margin-top: 8px;
}

.external-writing-list li {
  margin-bottom: 8px;
}

.post-card-grid {
  grid-template-columns: 1fr;
}

.post-card {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
}

.post-card-visual {
  border-right: 1px solid var(--line);
}

.post-card-visual:hover,
.post-card-visual:focus {
  background: #eef7fb;
}

.post-card-visual img[src*="/images/papers/"][src*="/cover"],
.project-card-visual img[src$="/cover.png"],
.project-card-visual img[src*="mwb-linux-cover"] {
  height: auto;
  object-fit: contain;
  padding: 10px;
  background: #fbfbf7;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(240px, 0.75fr);
  gap: 22px;
  align-items: start;
  margin: 0 0 30px;
}

.diagram-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.diagram-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-figure a {
  display: block;
}

.diagram-figure figcaption {
  margin: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
}

.diagram-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 18px 0 26px;
}

.diagram-grid .diagram-figure img {
  object-fit: contain;
  background: var(--soft);
}

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

.protocol-diagram-grid .diagram-figure img {
  height: 520px;
  object-fit: contain;
}

.project-cover {
  margin: 0;
  overflow: hidden;
  background: transparent;
}

.project-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.project-cover figcaption {
  margin: 0;
  padding: 9px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.project-facts {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 16px;
}

.project-facts h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.project-facts dl {
  margin: 0;
}

.project-facts div {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.project-facts div:first-child {
  border-top: 0;
}

.project-facts dt {
  margin-bottom: 3px;
  font-weight: 700;
}

.project-facts dd {
  margin: 0;
  color: #333333;
}

.cv-section {
  margin-bottom: 24px;
}

.cv-item {
  margin-bottom: 16px;
}

.cv-item header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2px;
}

.cv-item time {
  color: var(--muted);
  white-space: nowrap;
}

.footer {
  margin-top: 48px;
  min-height: 35px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  width: min(930px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 8px 15px;
}

@media (max-width: 700px) {
  body {
    padding-bottom: 0;
    font-size: 15px;
  }

  .navbar,
  .nav-inner {
    height: auto;
    min-height: var(--nav-height);
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }

  .brand {
    height: 28px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nav-links a {
    height: 30px;
    padding: 0 16px 0 0;
  }

  .container {
    margin-top: 116px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 28px;
  }

  .profile-photo {
    float: none;
    display: block;
    width: 156px;
    height: 156px;
    margin: 0 0 16px;
  }

  .pub-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-card-grid,
  .project-card-grid-compact,
  .post-card-grid,
  .detail-hero,
  .diagram-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card-visual {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-card-body,
  .post-card-body {
    padding: 14px;
  }

  .abbr {
    justify-content: flex-start;
  }

  .badge {
    width: auto;
    min-width: 72px;
  }

  .cv-item header {
    display: block;
  }

  .cv-item time {
    display: block;
    margin-top: 2px;
  }

  .footer {
    margin-top: 40px;
  }
}

.breadcrumb {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}

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

.post-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.paper-hero {
  max-width: 840px;
  margin: 0 auto 26px;
  text-align: center;
}

.paper-hero h1 {
  margin-bottom: 10px;
  font-weight: 400;
}

.paper-authors {
  margin: 0 0 6px;
  color: #222222;
  font-size: 18px;
}

.paper-hero .post-meta {
  margin-bottom: 12px;
}

.paper-links {
  justify-content: center;
  margin: 0;
}

.paper-abstract {
  margin: 18px 0 24px;
}

.paper-abstract h2 {
  margin-top: 0;
  font-size: 22px;
}

.paper-abstract p {
  max-width: 780px;
}

.tldr {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 16px 0 24px;
}

.tldr p {
  margin: 0;
}

.article-cover {
  margin: 8px 0 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.article-cover figcaption {
  margin: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
}

.key-points,
.proof-panel {
  margin: 18px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.key-points h2,
.proof-panel h2 {
  margin-top: 0;
  font-size: 22px;
}

.key-points ul,
.proof-panel ul {
  margin-bottom: 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 24px;
}

.related-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.related-card strong {
  display: block;
  margin-bottom: 6px;
}

.related-card p {
  margin: 0;
  color: #333333;
}

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

.post-figure {
  margin: 24px 0;
}

.post-figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: block;
}

.post-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.faq-item {
  margin: 0 0 16px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-item p {
  margin-top: 8px;
  color: #333333;
}

.byline {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.citation-block pre {
  overflow-x: auto;
  margin: 8px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.citation-block code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.paper-index .container,
.paper-page .container {
  width: min(1080px, calc(100vw - 32px));
  padding: 0;
}

.paper-index .page-header,
.paper-index .section-lede {
  text-align: center;
}

.paper-index .page-header {
  margin-bottom: 12px;
}

.paper-index .page-header h1 {
  font-size: 44px;
  text-transform: none;
}

.paper-index .section-lede {
  max-width: 760px;
  margin: 0 auto 34px;
  line-height: 1.6;
}

.paper-index .post-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.paper-index .post-card {
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.paper-index .post-card-visual {
  border: 0;
  background: transparent;
}

.paper-index .post-card-visual img {
  aspect-ratio: 1200 / 630;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf7;
  object-fit: cover;
}

.paper-index .post-card-body {
  padding: 12px 0 0;
}

.paper-index .post-meta {
  margin: 0 0 8px;
}

.paper-index .pub-title {
  font-size: 18px;
  line-height: 1.35;
}

.paper-index .post-card-body p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.paper-index .project-links {
  margin-top: 12px;
}

.paper-index .project-links .btn {
  min-height: 30px;
  padding: 0 11px;
  font-size: 10.5px;
  font-weight: 500;
}

.paper-page .breadcrumb {
  max-width: 900px;
  margin: 0 auto 10px;
}

.paper-page .paper-hero {
  max-width: 980px;
  margin-bottom: 22px;
}

.paper-page .paper-hero h1 {
  max-width: 980px;
  margin: 0 auto 12px;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 400;
  text-transform: none;
}

.paper-page .paper-authors {
  margin-bottom: 5px;
}

.paper-page .paper-hero .post-meta {
  margin-bottom: 16px;
}

.paper-page .paper-links {
  gap: 8px;
}

.paper-page .paper-links .btn {
  min-height: 34px;
  padding: 0 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.paper-page article {
  max-width: 900px;
  margin: 0 auto;
}

.paper-page article h2 {
  margin: 36px 0 12px;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 400;
  text-transform: none;
}

.paper-page article p,
.paper-page article li {
  line-height: 1.62;
}

.paper-page .article-cover {
  width: min(1040px, calc(100vw - 32px));
  margin: 22px 0 34px 50%;
  overflow: visible;
  transform: translateX(-50%);
  border: 0;
  border-radius: 0;
  background: transparent;
}

.paper-page .article-cover img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf7;
  object-fit: contain;
}

.paper-page .article-cover figcaption {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 0 0;
  border: 0;
  background: transparent;
  text-align: center;
}

.paper-page .paper-abstract {
  max-width: 760px;
  margin: 0 auto 28px;
}

.paper-page .paper-abstract h2 {
  margin-top: 0;
  text-align: center;
}

.paper-page .paper-abstract p {
  max-width: none;
}

.paper-page .tldr {
  max-width: 860px;
  margin: 0 auto 28px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfd;
}

.paper-page .key-points,
.paper-page .proof-panel {
  max-width: 860px;
  margin: 24px auto 30px;
  padding: 16px 0;
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
}

.paper-page .key-points h2,
.paper-page .proof-panel h2 {
  font-size: 24px;
}

.paper-page .post-figure {
  margin: 34px auto;
}

.paper-page .post-figure.figure-wide {
  width: min(1040px, calc(100vw - 32px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.paper-page .post-figure.figure-portrait {
  max-width: 620px;
}

.paper-page .post-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.paper-page .post-figure figcaption {
  max-width: 760px;
  margin: 10px auto 0;
  text-align: center;
}

.paper-page .citation-block pre {
  max-width: 100%;
}

@media (max-width: 900px) {
  .paper-index .post-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paper-page .paper-hero h1 {
    font-size: 40px;
  }
}

@media (max-width: 700px) {
  .paper-index .container,
  .paper-page .container {
    width: min(100vw - 28px, 620px);
  }

  .paper-index .page-header,
  .paper-index .section-lede {
    text-align: left;
  }

  .paper-index .page-header h1 {
    font-size: 34px;
  }

  .paper-index .section-lede {
    margin-bottom: 24px;
  }

  .paper-index .post-card-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .paper-page .breadcrumb {
    margin-bottom: 12px;
  }

  .paper-page .paper-hero {
    margin-bottom: 18px;
  }

  .paper-page .paper-hero h1 {
    font-size: 30px;
    line-height: 1.13;
  }

  .paper-page .paper-authors {
    font-size: 16px;
  }

  .paper-page .paper-links .btn {
    min-height: 32px;
    padding: 0 12px;
    font-size: 11px;
  }

  .paper-page article h2 {
    margin-top: 30px;
    font-size: 24px;
  }

  .paper-page .article-cover,
  .paper-page .post-figure.figure-wide {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .paper-page .article-cover figcaption,
  .paper-page .post-figure figcaption {
    text-align: left;
  }

  .paper-page .post-figure.figure-portrait img {
    width: min(100%, 420px);
    margin: 0 auto;
  }

  .paper-page .tldr,
  .paper-page .key-points,
  .paper-page .proof-panel {
    max-width: none;
  }
}

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

.post-item {
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.post-item:last-child {
  border-bottom: 0;
}
