/* ==========================================================================
   COMMON — technical note
   A fixed white, print-like paper layer on top of the shared site tokens.
   Loaded after styles.css; there is no theme layer, so the document stays
   light and page-like rather than following the site's dark/seasonal modes.
   ========================================================================== */

.paper-page {
  --paper: #fff;
  --paper-raised: #fff;
  --paper-sunk: #f6f6f4;
  --ink: #111;
  --ink-soft: #222;
  --muted: #555;
  --faint: #777;
  --line: #d9d9d9;
  --line-strong: #9a9a9a;
  --cobalt: #1a3f8f;
  --cobalt-deep: #102a63;
  color-scheme: light;
  background: #fff;
  color: #111;
}

.paper-page .site-header {
  background: rgba(255, 255, 255, 0.94);
}

#paper-main {
  scroll-margin-top: 88px;
}

.paper {
  max-width: 1080px;
  padding-top: clamp(32px, 6vw, 72px);
}

.paper-masthead {
  padding-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 2px solid var(--ink);
}

.paper-journal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  margin: 0 0 clamp(24px, 4vw, 44px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.paper-title {
  max-width: 24ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.6vw, 4.8rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.paper-title em {
  font-style: italic;
}

.paper-subtitle {
  max-width: 54ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  font-style: italic;
  line-height: 1.4;
}

.paper-author {
  margin: 26px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.paper-author sup {
  font-size: 0.55em;
}

.paper-affiliation {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.6;
}

.paper-affiliation a {
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.paper-meta div {
  display: flex;
  gap: 6px;
}

.paper-meta dt {
  color: var(--muted);
}

.paper-meta dd {
  margin: 0;
}

.paper-abstract {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.paper-abstract h2,
.paper-keywords h2,
.paper-highlights h2 {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.paper-abstract p {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  text-align: justify;
}

.paper-keywords {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-strong);
}

.paper-keywords p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.6;
}

.paper-citation {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-left: 2px solid var(--cobalt);
  background: var(--paper-sunk);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.6;
}

.paper-citation strong {
  font-weight: 600;
}

.paper-citation-note {
  margin: 8px 0 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
}

.paper-highlights {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-strong);
}

.paper-highlights ul {
  margin: 0;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
}

.paper-highlights li {
  margin-bottom: 4px;
}

.paper-highlights li:last-child {
  margin-bottom: 0;
}

.paper-figure {
  margin: clamp(28px, 4vw, 44px) 0;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  background: var(--paper-raised);
}

.paper-figure svg {
  width: 100%;
  height: auto;
}

.paper-figure .fig-tall {
  display: none;
}

.paper-figure figcaption {
  max-width: 78ch;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}

.paper-figure figcaption strong {
  color: var(--ink);
  font-weight: 600;
}

.fig-frame {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}

.fig-index {
  fill: var(--cobalt);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.fig-title {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
}

.fig-value {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
}

.fig-sub {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
}

.fig-arrow {
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 1.2;
}

.fig-arrow-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.paper-body {
  margin-top: clamp(28px, 4vw, 44px);
  column-count: 2;
  column-gap: clamp(32px, 5vw, 64px);
  column-rule: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.72;
  text-align: justify;
  hyphens: auto;
}

.paper-body h2 {
  margin: 26px 0 10px;
  break-after: avoid;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.paper-body > section:first-child > h2 {
  margin-top: 0;
}

.paper-body h2 span {
  margin-right: 8px;
  color: var(--cobalt);
}

.paper-body h3 {
  margin: 18px 0 8px;
  break-after: avoid;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
}

.paper-body p {
  margin: 0 0 10px;
}

.paper-body p + p {
  text-indent: 1.4em;
}

.paper-body h2 + p,
.paper-body h3 + p,
.paper-body .equation + p,
.paper-body .proof + p,
.paper-body .paper-table + p,
.paper-body p.no-indent {
  text-indent: 0;
}

.paper-body a {
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.paper-body strong {
  font-weight: 600;
}

.paper-body em {
  font-style: italic;
}

.paper-body sup,
.paper-body sub {
  font-size: 0.7em;
  line-height: 0;
}

.equation {
  display: flex;
  align-items: center;
  gap: 12px;
  break-inside: avoid;
  margin: 16px 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.equation .eq-body {
  flex: 1;
  min-width: 0;
}

.equation .eq-number {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 0.15em;
  vertical-align: middle;
  font-size: 0.88em;
  line-height: 1.1;
  text-align: center;
}

.frac .num {
  padding: 0 0.3em 1px;
  border-bottom: 1px solid currentColor;
}

.frac .den {
  padding: 1px 0.3em 0;
}

.proof {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
  font-size: 14px;
  line-height: 1.65;
}

.proof .proof-label {
  font-style: italic;
}

.qed {
  display: inline-block;
  margin-left: 4px;
  color: var(--cobalt);
  font-family: var(--sans);
  font-size: 12px;
}

.paper-table {
  width: 100%;
  margin: 16px 0 20px;
  border-collapse: collapse;
  break-inside: avoid;
  font-family: var(--sans);
  font-size: 10.5px;
  line-height: 1.45;
  text-align: left;
}

.paper-table caption {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: left;
}

.paper-table caption strong {
  color: var(--ink);
}

.paper-table th {
  padding: 5px 8px 5px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-weight: 600;
}

.paper-table td {
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.paper-table tr:last-child td {
  border-bottom: 1px solid var(--ink);
}

.paper-table th:last-child,
.paper-table td:last-child {
  padding-right: 0;
}

.paper-references {
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.6;
}

.paper-references h2 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.paper-references ol {
  margin: 0;
  padding-left: 18px;
}

.paper-references li {
  margin-bottom: 7px;
  padding-left: 4px;
}

.paper-appendix {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.65;
}

.paper-appendix h2 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.paper-appendix p {
  margin: 0 0 8px;
}

.paper-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1080px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 18px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  line-height: 1.6;
  text-transform: uppercase;
}

.paper-foot p {
  margin: 0;
}

.paper-foot .paper-disclaimer {
  flex-basis: 100%;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.paper-foot a {
  color: var(--ink-soft);
}

.paper-foot a:hover {
  color: var(--cobalt);
}

@media (max-width: 860px) {
  .paper-body {
    column-count: 1;
    column-rule: 0;
  }

  .paper-abstract,
  .paper-keywords,
  .paper-highlights {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .paper-figure .fig-wide {
    display: none;
  }

  .paper-figure .fig-tall {
    display: block;
  }
}

@media (max-width: 640px) {
  #paper-main {
    scroll-margin-top: 112px;
  }

  .paper-title {
    max-width: none;
  }

  .paper-journal,
  .paper-meta {
    display: block;
  }

  .paper-journal span,
  .paper-meta div {
    display: block;
    margin-top: 4px;
  }

  .paper-meta dt {
    display: inline;
    margin-right: 6px;
  }

  .paper-meta dd {
    display: inline;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .paper-foot {
    display: none;
  }

  /* Print on white paper even when the screen theme is dark or seasonal. */
  html {
    background: #fff !important;
  }

  .paper-page {
    --paper: #fff;
    --paper-raised: #fff;
    --ink: #000;
    --ink-soft: #111;
    --muted: #444;
    --line: #bbb;
    --line-strong: #777;
    --cobalt: #123f8a;
    background: #fff !important;
    color: #000;
  }

  .paper {
    max-width: none;
    padding: 0;
  }

  .paper-body {
    column-count: 2;
  }

  .paper-figure {
    background: transparent;
  }
}
