:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #5a636d;
  --line: #d9dee6;
  --accent: #1b6fe0;
  --accent-strong: #c92d4b;
  --page-width: min(1140px, calc(100vw - 20px));
  --content-width: 960px;
}

@font-face {
  font-family: "Berkeley Mono";
  font-style: normal;
  font-weight: 400;
  src: url("assets/BerkeleyMonoTrial-Regular.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Berkeley Mono", monospace;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

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

.site {
  min-height: 100vh;
}

.page,
.footer {
  width: var(--page-width);
  margin: 0 auto;
}

.page {
  padding: 12px 0 20px;
}

.hero,
.paper-section {
  max-width: var(--content-width);
  margin: 0 auto;
}

.hero {
  display: grid;
  gap: 14px;
  padding: 10px 0 22px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

h1 {
  max-width: 30ch;
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.authors-line {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.authors-line a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.authors-line a:hover,
.authors-line a:focus-visible {
  border-bottom-color: currentColor;
}

.author-equal {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}

.authors-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.hero-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.paper-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0;
  font-size: 0.84rem;
}

.paper-link:hover,
.paper-link:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
}

.paper-link-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
  transition-delay: var(--fade-delay, 0ms);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.abstract {
  margin: 0;
  color: #000;
  line-height: 1.75;
  max-width: 64ch;
}

.abstract-box {
  padding: 12px 14px;
  background: #eef5ff;
  border: 1px solid #d8e6fb;
}

.hero-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: min(100%, 860px);
  margin-top: 8px;
  justify-self: center;
}

.hero-media-item {
  margin: 0;
}

.hero-media-item img {
  width: 100%;
  height: auto;
}

.hero-media-item figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.highlight-wrap {
  margin: 0 0 24px;
}

.highlight {
  margin: 0;
  padding: 12px 14px;
  background: #fff5cc;
  color: var(--ink);
  line-height: 1.7;
}

.notice {
  margin: 0;
  color: var(--accent);
  line-height: 1.7;
}

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

.paper-section {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 14px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Berkeley Mono", monospace;
  font-weight: 700;
  line-height: 1.1;
}

.sections {
  display: grid;
  gap: 0;
}

h2 {
  font-size: 1.18rem;
}

.section-body {
  display: grid;
  gap: 14px;
}

.prose-block p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.75;
}

.prose-block p:last-child {
  margin-bottom: 0;
}

.bullet-block ul,
.note-list {
  margin: 0;
  padding-left: 18px;
}

.bullet-block li,
.note-list li {
  margin-bottom: 8px;
  color: var(--muted);
}

.equation-block,
.callout,
.code-block,
.figure-block {
  margin: 0;
}

.callout {
  padding: 12px 14px;
  color: var(--muted);
}

.callout.blue {
  background: #eef5ff;
}

.callout.yellow {
  background: #ffefad;
  border: 1px solid #d9be4f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  color: var(--ink);
}

.code-block {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.55;
  font-size: 0.9rem;
}

.code-block code {
  font-family: "Berkeley Mono", monospace;
}

.code-keyword {
  color: #1658c7;
}

.code-func {
  color: #0f766e;
}

.code-string {
  color: #9b3f1f;
}

.code-number {
  color: #b14c00;
}

.code-comment {
  color: #7c7f87;
}

.equation-display {
  overflow-x: auto;
}

.equation-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.figure-block img {
  width: 100%;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.figure-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.figure-grid.columns-2 {
  grid-template-columns: 1fr;
}

.figure-grid.columns-3 {
  grid-template-columns: 1fr;
}

.figure-grid .figure-block {
  margin: 0;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 0 24px;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.footer code,
.prose-block code {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: "Berkeley Mono", monospace;
  font-size: 0.92em;
}

@media (min-width: 620px) {
  .hero-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paper-link {
    width: auto;
  }

  h1 {
    font-size: 2.15rem;
  }

  h2 {
    font-size: 1.26rem;
  }
}

@media (min-width: 900px) {
  .hero-links {
    display: flex;
    flex-wrap: wrap;
    width: auto;
  }

  .paper-link {
    width: auto;
  }

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

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

  .footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
