:root {
  color-scheme: light;
  --paper: #f5f3ed;
  --surface: #ffffff;
  --ink: #172127;
  --muted: #5d686e;
  --line: #d7d5cd;
  --soft: #eaf1f3;
  --accent: #175b78;
  --accent-dark: #0e435b;
  --local: #28769a;
  --external: #a8642b;
  --reference: #65558b;
  --success: #166a4b;
  --shadow: 0 14px 36px rgba(29, 38, 42, 0.08);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-dark);
}

button,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(23, 91, 120, 0.35);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 237, 0.96);
  backdrop-filter: blur(12px);
}

.header-inner,
.page,
.footer-inner {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.015em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 650;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #46545b;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.site-nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.site-nav a[aria-current="page"]:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.service-link::before {
  content: "";
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.42em;
  background-image: var(--service-icon);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  vertical-align: -0.12em;
}

.service-github {
  --service-icon: url("https://github.githubassets.com/favicons/favicon.svg");
}

.service-huggingface {
  --service-icon: url("https://huggingface.co/front/assets/huggingface_logo-noborder.svg");
}

.service-orcid {
  --service-icon: url("https://info.orcid.org/wp-content/uploads/2020/01/orcid-logo-52-px.png");
}

.service-linkedin {
  --service-icon: url("https://www.linkedin.com/favicon.ico");
}

.site-nav .service-link,
.author-links.service-link,
.resource-title.service-link {
  display: inline-flex;
  align-items: center;
}

.site-nav .service-link::before,
.author-links.service-link::before,
.resource-title.service-link::before {
  flex: 0 0 1.15em;
  vertical-align: 0;
}

.resource-title.service-link::before {
  width: 1.35em;
  height: 1.35em;
  flex-basis: 1.35em;
}

.author-links.service-link::before {
  width: 1.45em;
  height: 1.45em;
  flex-basis: 1.45em;
}

.page {
  padding: 72px 0 92px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(2.6rem, 6vw, 5.3rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 760px;
  margin-bottom: 16px;
  color: #344147;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.45;
}

.intro {
  max-width: 760px;
  color: var(--muted);
}

.landing-hero {
  padding-bottom: 62px;
  border-bottom: 1px solid var(--line);
}

.primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 900px;
  margin-top: 36px;
}

.action-card {
  display: block;
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

.action-card:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-2px);
}

.action-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.action-card span {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
}

.action-card .arrow {
  margin-top: 18px;
  color: var(--accent);
  font-weight: 700;
}

.landing-section {
  padding: 50px 0;
  border-bottom: 1px solid var(--line);
}

.brief-list {
  display: grid;
  gap: 18px;
}

.brief-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brief-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.brief-item strong {
  color: var(--ink);
}

.brief-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.attack-coverage {
  color: var(--ink);
}

.attack-coverage summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  cursor: pointer;
  list-style: none;
}

.attack-coverage summary::-webkit-details-marker {
  display: none;
}

.attack-coverage summary strong {
  color: var(--ink);
}

.attack-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.attack-summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}

.attack-coverage[open] .attack-summary::after {
  content: "−";
}

.attack-coverage summary:hover strong {
  color: var(--accent);
}

.attack-body {
  margin-left: 170px;
}

.attack-note {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.attack-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
  margin: 0;
}

.attack-list > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.4;
}

.attack-list dt {
  color: var(--ink);
  font-weight: 700;
}

.attack-list dd {
  margin: 0;
  color: var(--muted);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.8fr);
  gap: 56px;
}

.section-grid > h2 {
  font-size: 1.65rem;
}

.resource-list,
.author-list,
.license-list {
  display: grid;
  gap: 16px;
}

.resource-link {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.resource-link:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.resource-link strong {
  display: block;
}

.resource-link .resource-title,
.action-card .resource-title {
  display: flex;
}

.resource-link span {
  color: var(--muted);
  font-size: 0.9rem;
}

.author {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.author:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.author p,
.license-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.author .author-contact {
  margin-bottom: 9px;
  font-size: 0.88rem;
}

.author-contact a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
}

.author-contact a:hover {
  color: var(--accent);
}

.email-icon {
  position: relative;
  display: inline-block;
  width: 1.45rem;
  height: 1.05rem;
  flex: 0 0 1.45rem;
  border: 2px solid currentColor;
  border-radius: 2px;
  color: var(--accent);
  font-size: 0;
}

.email-icon::before,
.email-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 0.78rem;
  height: 2px;
  background: currentColor;
}

.email-icon::before {
  left: 1px;
  transform: rotate(34deg);
  transform-origin: left center;
}

.email-icon::after {
  right: 1px;
  transform: rotate(-34deg);
  transform-origin: right center;
}

.author-links {
  margin-left: 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

.citation-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.citation-guidance,
.citation-entry {
  margin-bottom: 0;
}

.citation-guidance {
  color: var(--muted);
}

.citation-entry {
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.55;
}

.citation-entry a {
  overflow-wrap: anywhere;
}

.citation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.9rem;
  font-weight: 650;
}

.citation-links a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.citation-bibtex {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.citation-bibtex summary {
  width: fit-content;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.citation-bibtex pre {
  margin: 14px 0 0;
  overflow-x: auto;
  padding: 14px;
  border-radius: 5px;
  background: var(--paper);
  font-size: 0.8rem;
  line-height: 1.5;
}

.license-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
}

.license-item strong {
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 38px;
  color: var(--muted);
  font-size: 0.85rem;
}

.results-hero {
  max-width: 900px;
  margin-bottom: 48px;
}

.results-hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.7rem);
}

.context-note {
  max-width: 800px;
  color: var(--muted);
  font-size: 0.98rem;
}

.study-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.study-context article {
  padding: 20px;
}

.study-context article + article {
  border-left: 1px solid var(--line);
}

.study-context strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.94rem;
}

.study-context p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 72px;
}

.highlight {
  padding: 20px;
  border-top: 3px solid var(--accent);
  background: var(--surface);
}

.highlight strong {
  display: block;
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.highlight .throughput-value {
  font-size: 1.35rem;
  line-height: 1.3;
}

.highlight span {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.result-section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 88px;
}

.section-heading {
  max-width: 790px;
  margin-bottom: 30px;
}

.section-heading p {
  color: var(--muted);
}

.definition-grid,
.metric-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.definition,
.metric-guide > div {
  padding: 17px 18px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
}

.definition h3,
.metric-guide strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 1rem;
}

.definition p,
.metric-guide p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.explorer {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 20px;
  margin-bottom: 26px;
}

.control-group {
  display: grid;
  gap: 7px;
}

.control-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 8px 12px;
  background: #f7f7f4;
  color: var(--muted);
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 34px 0 11px;
  background: #fff;
  color: var(--ink);
}

.bar-list {
  display: grid;
  gap: 11px;
  margin-bottom: 30px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 270px) minmax(150px, 1fr) 58px;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e9e4;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--local);
}

.bar-fill.external {
  background: var(--external);
}

.bar-fill.reference {
  background: var(--reference);
}

.bar-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid #e5e3dc;
  text-align: right;
  white-space: nowrap;
}

th {
  background: #f0f0eb;
  color: #465158;
  font-size: 0.76rem;
  letter-spacing: 0.025em;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.group-row th {
  padding-top: 15px;
  background: var(--soft);
  color: var(--accent-dark);
  text-align: left;
  text-transform: uppercase;
}

.best {
  color: var(--success);
  font-weight: 800;
}

.second {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.table-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
}

.paper-figure {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.paper-figure.wide {
  grid-column: 1 / -1;
}

.figure-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.figure-button img {
  display: block;
  width: 100%;
  max-height: 660px;
  object-fit: contain;
  background: #fff;
}

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

figcaption strong {
  color: var(--ink);
}

.subsection {
  margin-top: 42px;
}

.subsection h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.resource-controls {
  margin-bottom: 18px;
}

.cost-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
  margin-top: 30px;
}

.plain-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.inline-link {
  font-weight: 700;
  text-decoration: none;
}

dialog {
  width: min(1200px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

dialog::backdrop {
  background: rgba(15, 23, 27, 0.72);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.dialog-header strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.dialog-close {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
}

#figure-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
}

@media (max-width: 900px) {
  .highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .study-context article:nth-child(3) {
    border-left: 0;
  }

  .study-context article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

@media (max-width: 680px) {
  .header-inner,
  .page,
  .footer-inner {
    width: min(100% - 28px, 1160px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0;
  }

  .site-nav {
    width: 100%;
    gap: 6px;
    overflow-x: auto;
  }

  .page {
    padding-top: 48px;
  }

  .primary-actions,
  .figure-grid,
  .highlights {
    grid-template-columns: 1fr;
  }

  .paper-figure.wide {
    grid-column: auto;
  }

  .license-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .brief-item,
  .definition-grid,
  .metric-guide,
  .study-context {
    grid-template-columns: 1fr;
  }

  .attack-list {
    grid-template-columns: 1fr;
  }

  .attack-coverage summary {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .attack-body {
    margin-left: 0;
  }

  .study-context article + article,
  .study-context article:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .bar-row {
    grid-template-columns: 1fr 48px;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bar-value {
    grid-column: 2;
    grid-row: 1;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .action-card {
    transition: none;
  }
}
