:root {
  color-scheme: dark;
  --night-950: #070a0b;
  --night-900: #0c1012;
  --night-800: #12181b;
  --night-fg: #d8dee9;
  --night-muted: #8d99a6;
  --accent: #88c0d0;
  --accent-strong: #9ad9e8;
  --border: rgba(136, 192, 208, 0.22);
  --border-strong: rgba(136, 192, 208, 0.5);
  --font-display: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night-950);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 8%, rgba(136, 192, 208, 0.08), transparent 30rem),
    linear-gradient(180deg, var(--night-950), var(--night-900));
  color: var(--night-fg);
  font-family: var(--font-display);
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: #ffffff;
}

a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent-strong);
  outline-offset: 4px;
}

.site-header,
main,
footer {
  width: min(calc(100% - 40px), 980px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(136, 192, 208, 0.65);
}

.back-link {
  color: var(--night-muted);
  text-decoration: none;
}

.paper {
  padding-block: clamp(4rem, 10vw, 8rem) 6rem;
}

.paper-header {
  padding-bottom: clamp(4rem, 8vw, 6rem);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 1.4rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow span {
  margin-inline: 0.55rem;
  color: var(--night-muted);
}

h1 {
  max-width: 18ch;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.35rem, 6.7vw, 5.4rem);
  font-weight: 650;
  letter-spacing: -0.052em;
  line-height: 0.98;
  text-wrap: balance;
}

.paper-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 2rem;
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.paper-byline p {
  margin: 0;
}

.citation_author {
  color: var(--night-fg);
  font-weight: 700;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  min-width: 13rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--night-fg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover {
  border-color: var(--accent);
  background: rgba(136, 192, 208, 0.07);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--night-950);
  font-weight: 700;
}

.button-primary:hover {
  background: var(--accent-strong);
  color: var(--night-950);
}

section {
  display: grid;
  grid-template-columns: minmax(10rem, 0.36fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--border);
}

h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 span {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.abstract,
.recommended-citation {
  max-width: 70ch;
  margin: 0;
  color: var(--night-fg);
  font-size: clamp(1rem, 1.45vw, 1.1rem);
  line-height: 1.8;
}

.abstract::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  color: #ffffff;
  font-size: 3.2em;
  line-height: 0.85;
}

.resource-list {
  margin: 0;
}

.resource-list > div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.28fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid rgba(136, 192, 208, 0.12);
}

.resource-list > div:last-child {
  border-bottom: 1px solid rgba(136, 192, 208, 0.12);
}

dt {
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

dd {
  min-width: 0;
  margin: 0;
}

dd a {
  overflow-wrap: anywhere;
}

dd span {
  display: block;
  margin-top: 0.25rem;
  color: var(--night-muted);
  font-size: 0.78rem;
}

.recommended-citation {
  margin-bottom: 2rem;
}

.bibtex {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.code-label {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

pre {
  max-width: 100%;
  margin: 0;
  padding: 1.1rem;
  overflow-x: auto;
  color: #c9d3dc;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  white-space: pre;
}

footer {
  display: flex;
  justify-content: space-between;
  padding-block: 0 2.5rem;
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--night-muted);
  text-decoration: none;
}

@media (max-width: 680px) {
  .site-header {
    min-height: 72px;
  }

  .paper {
    padding-top: 3.5rem;
  }

  h1 {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
    line-height: 1.02;
  }

  .paper-actions,
  .button {
    width: 100%;
  }

  section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .resource-list > div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  footer {
    gap: 1rem;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .site-header,
  .paper-actions,
  footer {
    display: none;
  }

  .paper {
    padding: 0;
  }

  h1,
  h2,
  .citation_author,
  .abstract,
  .recommended-citation,
  .bibtex,
  pre {
    color: #000000;
  }

  section,
  .paper-header,
  .bibtex {
    border-color: #cccccc;
  }
}
