:root {
  color-scheme: dark;
  --background: #020604;
  --panel: rgba(4, 15, 10, 0.92);
  --panel-strong: #07130d;
  --line: rgba(95, 255, 170, 0.26);
  --line-strong: rgba(95, 255, 170, 0.58);
  --text: #eafff1;
  --muted: #9bb8a6;
  --accent: #66ffad;
  --accent-soft: rgba(102, 255, 173, 0.11);
  --warning: #ffd76b;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(102, 255, 173, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 255, 173, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, rgba(21, 88, 52, 0.34), transparent 38rem),
    var(--background);
  background-size: 44px 44px, 44px 44px, auto, auto;
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover,
a:focus-visible {
  color: #b9ffd6;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--accent);
  color: #001f0e;
  font-weight: 800;
  transform: translateY(-180%);
}

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

.site-header,
.site-footer {
  width: min(76rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-header nav a,
.site-footer nav a {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.paper-shell {
  width: min(76rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) 0 5rem;
}

.paper-shell--reading {
  width: min(54rem, calc(100% - 2rem));
}

.eyebrow,
.paper-card__category,
.article-meta,
.source-note strong {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 18ch;
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 8vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.paper-shell--reading h1 {
  max-width: 15ch;
  font-size: clamp(2.35rem, 7vw, 5.2rem);
}

h2 {
  margin-top: 3.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.lede {
  max-width: 60rem;
  color: #c9e8d5;
  font-size: clamp(1.08rem, 2.1vw, 1.4rem);
  line-height: 1.55;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.paper-card {
  display: flex;
  min-height: 25rem;
  flex-direction: column;
  padding: clamp(1.35rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--accent-soft), transparent 55%), var(--panel);
}

.paper-card h2 {
  margin: 1.4rem 0 1rem;
  padding: 0;
  border: 0;
}

.paper-card p {
  color: #b9d1c2;
}

.paper-card__excerpt > :last-child {
  margin-bottom: 0;
}

.paper-card__link {
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-bottom: 1.4rem;
}

.article-abstract,
.source-note,
.related-papers {
  margin: 2rem 0;
  padding: 1.2rem 1.35rem;
  border-left: 3px solid var(--accent);
  background: var(--panel);
}

.article-abstract p,
.source-note p,
.related-papers p {
  margin-bottom: 0;
}

.article-body > p,
.article-body section > p,
.article-body blockquote,
.article-body section > ul,
.article-body section > ol {
  max-width: 72ch;
  color: #d7eadf;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 1.8vw, 1.16rem);
}

.article-body {
  overflow-wrap: anywhere;
}

.article-body :where(p, li, dd, dt, figcaption, address) {
  max-width: 72ch;
  color: #d7eadf;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 1.8vw, 1.16rem);
}

.article-body :where(img) {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
}

.article-body :where(figure) {
  max-width: 100%;
  margin: 1.8rem 0;
}

.article-body :where(table) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.article-body :where(th, td) {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body :where(pre) {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.article-body :where(code) {
  font-family: Consolas, "Courier New", monospace;
}

.article-body section > ul,
.article-body section > ol {
  padding-left: 1.55rem;
}

.article-body section > ul li + li,
.article-body section > ol li + li {
  margin-top: 0.8rem;
}

.article-body section > ul li::marker,
.article-body section > ol li::marker {
  color: var(--accent);
  font-weight: 800;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--line-strong);
  background: rgba(102, 255, 173, 0.055);
}

blockquote p:last-child {
  margin-bottom: 0;
}

.definition {
  margin-block: 1.8rem;
  padding: 1.3rem;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 750;
}

.source-list {
  padding-left: 1.25rem;
}

.source-list li + li {
  margin-top: 0.65rem;
}

.verification-note {
  color: var(--warning);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

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

  .paper-grid {
    grid-template-columns: 1fr;
  }

  .paper-card {
    min-height: 0;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }

  .paper-shell,
  .paper-shell--reading {
    width: 100%;
    padding: 0;
  }

  .article-body > p,
  .article-body section > p,
  .article-body blockquote,
  .article-body section > ul,
  .article-body section > ol {
    color: black;
  }
}
