@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Fira+Code:wght@400;500&display=swap');

@font-face {
  font-family: 'Beaufort';
  src: url('../fonts/Beaufort-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Beaufort';
  src: url('../fonts/Beaufort-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --text: #e0ddd5;
  --text-muted: #a8a49a;
  --text-light: #7a766e;
  --bg: #141414;
  --bg-alt: #1c1c1c;
  --rule: #2e2e2e;
  --max-width: 650px;

  /* Method colors */
  --c-wide: #8b6e5a;
  --c-pertable: #5a7e8b;
  --c-mst: #7e8b5a;
  --c-pe-vanilla: #8b5a7e;
  --c-pe-cond: #5a8b6e;
  --heading: 'Beaufort', Georgia, serif;
  --body: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Fira Code', Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}

/* --- Navigation --- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
}

nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .nav-title {
  font-family: var(--heading);
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}

nav .nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav .nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

nav .nav-links a:hover {
  color: var(--text);
}

/* --- Wrapper / Main --- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 5rem;
}

/* --- Header --- */

.header {
  text-align: center;
  padding: 3rem 0 2rem;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-family: var(--heading);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 auto 1rem;
  color: var(--text);
  /* text-transform: uppercase; */
  letter-spacing: 0.04em;
}

.header .authors {
  font-size: 16px;
  margin-bottom: 0.2rem;
}

.header .authors a {
  color: var(--text);
  text-decoration: none;
}

.header .authors a:hover {
  text-decoration: underline;
}

.header .emails {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.header .affiliation {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
}

.header .links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header .links a {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--rule);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.header .links a:hover {
  background: var(--text);
  color: var(--bg);
}

/* --- Abstract --- */

.abstract {
  margin: 0 0 2.5rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--rule);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

.abstract p {
  margin: 0;
}

/* --- Typography --- */

p {
  margin: 0 0 1rem;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--text-light);
}

a:hover {
  text-decoration-color: var(--text);
}

/* --- Headings --- */

h2 {
  font-family: var(--heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin: 2.5rem 0 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h3 {
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 1.8rem 0 0.6rem;
}

h4 {
  font-family: var(--heading);
  font-size: 16px;
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  margin: 1.3rem 0 0.4rem;
}

/* --- Figures --- */

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
}

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

/* --- Tables --- */

.table-wrapper {
  overflow-x: auto;
  margin: 1.2rem 0;
}

/* Wide table breakout (for large tables that need more room) */
.table-wide {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.table-wide .table-wrapper {
  max-width: 1100px;
  margin: 1.2rem auto;
  padding: 0 40px;
}

/* Fixed-layout tables with equal method columns */
.table-wide table.fixed-cols {
  table-layout: fixed;
}

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

thead {
  border-top: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
}

th {
  font-weight: 500;
  text-align: left;
  padding: 0.45rem 0.6rem;
  color: var(--text-muted);
}

td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

tbody tr:last-child {
  border-bottom: 1px solid var(--text-muted);
}

/* Score cells (functional colors, dark-adapted) */
.cell-pass    { background: #1a2e22; color: #6fcf97; }
.cell-fail    { background: #2e1a1a; color: #eb8080; }
.cell-partial { background: #2e2a1a; color: #d4b85c; }
.cell-na      { background: var(--bg-alt); color: var(--text-light); }

/* --- Code --- */

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-alt);
  padding: 0.15em 0.3em;
  color: var(--text);
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
}

/* --- Lists --- */

ul, ol {
  padding-left: 1.4em;
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.25rem;
}

/* --- Blockquote / Callout --- */

blockquote,
.callout {
  margin: 1rem 0;
  padding: 0.7rem 1.2rem;
  border-left: 3px solid var(--rule);
  color: var(--text-muted);
  background: var(--bg-alt);
}

blockquote {
  font-style: italic;
}

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

/* --- Details/dropdown --- */

details {
  margin: 1rem 0;
  border: 1px solid var(--rule);
  padding: 0.6rem 1rem;
}

summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
}

details[open] summary {
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

/* --- Horizontal rule --- */

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

/* --- Results summary cards --- */

.results-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.score-card {
  text-align: center;
  padding: 1rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  border-top: 3px solid var(--text-light);
}

.score-card[data-method="pertable"]  { border-top-color: var(--c-pertable); }
.score-card[data-method="mst"]       { border-top-color: var(--c-mst); }
.score-card[data-method="wide"]      { border-top-color: var(--c-wide); }
.score-card[data-method="pe-cond"]   { border-top-color: var(--c-pe-cond); }

.score-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 0.3rem;
  border: none;
  padding: 0;
}

.score-card .score {
  font-size: 1.6rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.2;
}

.score-card .small {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

/* --- Chart containers --- */

.chart-container {
  margin: 1.5rem 0;
}

.chart-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* --- Small text --- */

.small {
  font-size: 13px;
  color: var(--text-muted);
}

.caption {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Scroll sections (two-column sticky layout) --- */

.scroll-break {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.scroll-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 40px;
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

.scroll-section.reverse {
  flex-direction: row-reverse;
}

.scroll-text {
  flex: 1 1 0;
  min-width: 0;
}

.scroll-text h3:first-child,
.scroll-text h4:first-child {
  margin-top: 0;
}

.scroll-figure {
  flex: 0 0 380px;
  position: sticky;
  top: 70px;
  align-self: flex-start;
}

/* --- Method spec cards --- */

.method-spec {
  border-left: 3px solid var(--rule);
  padding: 1.2rem 1.5rem;
  background: var(--bg-alt);
  margin-bottom: 1rem;
}

.method-spec:last-child {
  margin-bottom: 0;
}

.method-spec[data-method="wide"]       { border-left-color: var(--c-wide); }
.method-spec[data-method="pertable"]   { border-left-color: var(--c-pertable); }
.method-spec[data-method="mst"]        { border-left-color: var(--c-mst); }
.method-spec[data-method="pe-vanilla"] { border-left-color: var(--c-pe-vanilla); }
.method-spec[data-method="pe-cond"]    { border-left-color: var(--c-pe-cond); }

.spec-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.spec-name {
  font-family: var(--heading);
  font-size: 15px;
  font-weight: 500;
}

.spec-score {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  font-family: var(--heading);
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.8rem;
  font-size: 13px;
  margin: 0;
  padding: 0;
}

.spec-list dt {
  color: var(--text-light);
  font-weight: 500;
}

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

/* --- Footer --- */

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem 20px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

/* --- Responsive --- */

@media (max-width: 900px) {
  .scroll-section,
  .scroll-section.reverse {
    flex-direction: column;
    padding: 1rem 20px;
    gap: 1.5rem;
  }

  .scroll-figure {
    position: static;
    flex: none;
    width: 100%;
  }

  .table-wide .table-wrapper {
    padding: 0 20px;
  }
}

@media (max-width: 700px) {
  main {
    padding: 0 16px 3rem;
  }

  .header h1 {
    font-size: 22px;
  }

  .abstract {
    padding: 0.8rem 1rem;
  }

  h2 { font-size: 20px; }
  h3 { font-size: 16px; }

  nav .nav-inner {
    padding: 0 16px;
  }

  nav .nav-links {
    gap: 0.7rem;
    font-size: 12px;
  }

  .results-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .results-summary {
    grid-template-columns: 1fr;
  }

  nav .nav-links {
    display: none;
  }
}
