:root {
  color-scheme: dark;
  --bg: #181816;
  --paper: #24221f;
  --panel: #2b2824;
  --ink: #f4efe7;
  --muted: #c7bdb0;
  --line: #48423a;
  --line-dark: #8a8174;
  --accent: #83b9b4;
  --accent-strong: #4f8f8a;
  --accent-soft: #203634;
  --max: 1060px;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 4%, rgba(131, 185, 180, .13), transparent 26rem),
    linear-gradient(180deg, #1d1c1a 0%, var(--bg) 32rem);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.48;
  overflow-x: hidden;
}

.suite-topbar {
  position: static !important;
  background: rgba(24, 24, 22, .96) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
}

.suite-app-name,
.suite-topbar-actions a {
  color: var(--ink) !important;
}

.suite-topbar-actions a {
  border-color: var(--line) !important;
  background: rgba(255, 255, 255, .03) !important;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin: 0;
  overflow-wrap: break-word;
}

img,
video,
iframe {
  max-width: 100%;
}

main,
footer {
  width: min(calc(100vw - 36px), var(--max));
  margin: 0 auto;
}

main {
  padding: 34px 0 42px;
}

.paper-header,
.intro-panel,
.summary-grid,
.section-block,
.paper-panel,
.pdf-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.paper-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: clamp(22px, 4vw, 34px);
  border-top: 4px solid var(--accent);
}

.kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

h1 {
  max-width: 900px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(29px, 3.4vw, 40px);
  font-weight: 780;
  line-height: 1.14;
  letter-spacing: 0;
}

.authors {
  max-width: 850px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.primary-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: #312d28;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.button-link.primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fffdf7;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 0;
  margin-top: 18px;
}

.intro-panel {
  margin-top: 18px;
  padding: 24px;
}

.intro-copy {
  max-width: 900px;
}

.institution-logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: center;
  justify-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.institution-logos img {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.institution-logos .logo-sandia {
  width: min(100%, 260px);
  max-height: none;
}

.institution-logos .logo-unm {
  width: min(100%, 250px);
  max-height: 56px;
}

.institution-logos .logo-nomad {
  width: min(100%, 230px);
  max-height: none;
}

.fact-line {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
}

.summary-text {
  padding: 24px;
  border-right: 1px solid var(--line);
}

h2 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.summary-text p,
.section-block p,
.download-list p,
.paper-panel p,
footer {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.summary-text p,
.section-block p,
.download-list p {
  margin-top: 10px;
}

.facts-table {
  display: grid;
  grid-template-columns: 1fr;
}

.facts-table div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.facts-table div:last-child {
  border-bottom: 0;
}

.facts-table dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.facts-table dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .82fr);
  gap: 24px;
  align-items: start;
}

.context-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.context-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.context-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.context-list dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 620;
}

.life-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.life-grid figure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.life-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.photo-collage {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.photo-collage img {
  display: block;
  width: 100%;
}

.section-block {
  margin-top: 18px;
  padding: 24px;
}

table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td:first-child {
  width: 22%;
  font-weight: 750;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  gap: 24px;
  align-items: start;
}

.figure-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.figure-card img {
  display: block;
  width: 100%;
  background: #f4f2ec;
}

figcaption {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.results-table {
  margin-top: 18px;
}

.results-table td:not(:first-child) {
  width: 26%;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.status.good {
  border-color: #8ab16d;
  background: rgba(118, 159, 91, .18);
  color: #c7e6b4;
}

.status.bad {
  border-color: #c98287;
  background: rgba(173, 70, 80, .2);
  color: #f0b9bd;
}

.result-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.result-notes article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.animation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.animation-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.animation-grid figure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.animation-grid img.loop-gif {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #161514;
  object-fit: contain;
}

.animation-grid video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #161514;
  object-fit: contain;
}

.result-matrix {
  margin-top: 16px;
}

.download-list {
  display: grid;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.download-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

footer {
  padding: 0 0 32px;
}

footer p + p {
  margin-top: 6px;
}

.paper-page {
  width: min(calc(100vw - 36px), 1120px);
}

.paper-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: clamp(22px, 4vw, 32px);
  border-top: 4px solid var(--accent);
}

.paper-panel h1 {
  font-size: clamp(27px, 3.2vw, 42px);
}

.pdf-frame {
  height: min(78vh, 900px);
  min-height: 620px;
  margin-top: 18px;
  overflow: hidden;
}

.pdf-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.paper-preview {
  display: block;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.paper-preview img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 840px) {
  .paper-header,
  .summary-grid,
  .two-column,
  .context-grid,
  .paper-panel {
    grid-template-columns: 1fr;
  }

  .summary-text {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .primary-actions,
  .download-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  main,
  footer,
  .paper-page {
    width: min(calc(100vw - 24px), var(--max));
  }

  main {
    padding-top: 22px;
  }

  .paper-header,
  .intro-panel,
  .summary-text,
  .section-block,
  .paper-panel {
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .paper-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .primary-actions {
    justify-content: stretch;
  }

  .facts-table div,
  .download-list article {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .result-notes,
  .animation-grid,
  .animation-grid.compact,
  .life-grid,
  .institution-logos {
    grid-template-columns: 1fr;
  }

  .institution-logos {
    justify-items: start;
    gap: 14px;
  }

  .institution-logos .logo-sandia,
  .institution-logos .logo-unm,
  .institution-logos .logo-nomad {
    justify-self: center;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .button-link {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }

  td {
    width: 100%;
    padding: 3px 0;
    border-top: 0;
  }

  td:first-child {
    width: 100%;
  }

  td:nth-child(2),
  td:nth-child(3) {
    color: var(--muted);
    font-size: 13px;
  }

  .results-table td:nth-child(n+2)::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .results-table td:nth-child(2)::before {
    content: "Pin-spring-pawl";
  }

  .results-table td:nth-child(3)::before {
    content: "Pin-pawl";
  }

  .results-table td:nth-child(4)::before {
    content: "Pawl-gear";
  }

  .download-actions {
    display: grid;
    width: 100%;
  }

  .pdf-frame {
    height: 72vh;
    min-height: 460px;
  }
}
