/* ===================================================
   Base & Reset
=================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-pm:       #2563eb;
  --clr-pm-light: #dbeafe;
  --clr-accent:   #0f172a;
  --clr-bg:       #f8fafc;
  --clr-alt:      #f1f5f9;
  --clr-border:   #e2e8f0;
  --clr-text:     #1e293b;
  --clr-muted:    #64748b;
  --accent2:      #7c3aed;
  --accent3:      #059669;
  --radius:       0.75rem;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
  --max-w:        1100px;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:         'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--clr-text);
  background: var(--clr-bg);
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: var(--clr-pm); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: .85em;
  background: #e8edf2;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===================================================
   Hero
=================================================== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f2d4a 100%);
  color: #fff;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

.venue-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #93c5fd;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border-radius: 99px;
}

.hero-title {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1.3;
  max-width: 860px;
  color: #f0f9ff;
}

/* Author cards */
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.author-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  padding: .8rem 1.3rem;
  text-align: center;
  min-width: 160px;
}

.author-name  { font-weight: 700; font-size: 1rem; color: #e0f2fe; }
.author-info  { font-size: .83rem; color: #94a3b8; margin-top: .15rem; }
.author-email { font-size: .78rem; color: #60a5fa; margin-top: .2rem; }

/* Buttons */
.hero-buttons { display: flex; gap: .9rem; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.4rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  border: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary  { background: var(--clr-pm); color: #fff; }
.btn-primary:hover  { background: #1d4ed8; text-decoration: none; }
.btn-secondary { background: rgba(255,255,255,.12); color: #e2e8f0; border: 1px solid rgba(255,255,255,.25); }
.btn-secondary:hover { background: rgba(255,255,255,.22); color: #fff; text-decoration: none; }

/* Keyword pills */
.keyword-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.kw {
  background: rgba(255,255,255,.1);
  color: #bae6fd;
  font-size: .78rem;
  padding: .28rem .75rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.15);
}

/* ===================================================
   Sticky Nav
=================================================== */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.nav-inner {
  display: flex;
  gap: .1rem;
  overflow-x: auto;
  padding: .5rem 1.5rem;
  scrollbar-width: none;
  max-width: var(--max-w);
  margin: 0 auto;
}
.nav-inner::-webkit-scrollbar { display: none; }

.sticky-nav a {
  color: #94a3b8;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
  padding: .35rem .7rem;
  border-radius: 6px;
  transition: all .15s;
}
.sticky-nav a:hover, .sticky-nav a.active {
  color: #60a5fa;
  background: rgba(96,165,250,.1);
  text-decoration: none;
}

/* ===================================================
   Sections
=================================================== */
.section     { padding: 4rem 0; }
.section-alt { background: var(--clr-alt); }

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--clr-accent);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--clr-pm);
  margin-top: .35rem;
  border-radius: 2px;
}

.section-intro {
  font-size: 1rem;
  color: var(--clr-muted);
  margin-bottom: 2rem;
  max-width: 680px;
}

/* ===================================================
   Abstract
=================================================== */
.abstract-text {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 820px;
  color: #334155;
}

/* ===================================================
   Stats strip (between abstract and motivation)
=================================================== */
.stats-strip {
  background: var(--clr-accent);
  padding: 2rem 0;
}
.stats-inner {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-pill {
  text-align: center;
  min-width: 160px;
  padding: 1rem 1.5rem;
}
.stat-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: #a5b4fc;
  line-height: 1;
  margin-bottom: .4rem;
}
.stat-label {
  font-size: .78rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* ===================================================
   Motivation — two-column + issue cards
=================================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }
.col-text p { margin-bottom: 1rem; color: #334155; }

.issue-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.issue-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.issue-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.issue-icon.ring { background: var(--clr-pm); }
.issue-icon.nic  { background: var(--accent2); }
.issue-icon.cpu  { background: var(--accent3); }
.issue-card strong { font-size: .95rem; display: block; margin-bottom: .25rem; color: var(--clr-accent); }
.issue-card p { font-size: .85rem; color: var(--clr-muted); margin: 0; }

/* ===================================================
   Figures
=================================================== */
.col-figure figure, .figure-center figure { width: 100%; }
.figure-embed {
  background: #f8fafc;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.figure-embed img {
  width: 100%;
  height: auto;
  display: block;
}
figcaption {
  font-size: .8rem;
  color: var(--clr-muted);
  text-align: center;
  margin-top: .6rem;
  line-height: 1.5;
}
.figure-center { margin-top: 3rem; max-width: 860px; margin-left: auto; margin-right: auto; }

.figures-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 700px) { .figures-row { grid-template-columns: 1fr; } }
.result-figure { margin: 0; }

/* ===================================================
   Design Cards
=================================================== */
.design-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) { .design-grid { grid-template-columns: 1fr; } }

.design-card {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.design-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.design-icon { width: 52px; height: 52px; margin-bottom: 1rem; }
.design-icon svg { width: 100%; height: 100%; }
.design-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; color: var(--clr-accent); }
.design-card p  { font-size: .87rem; color: var(--clr-muted); line-height: 1.6; }

.design-steps { list-style: none; margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.design-steps li { font-size: .83rem; display: flex; align-items: center; gap: .6rem; }
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--clr-pm-light);
  color: var(--clr-pm);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.algo-list { list-style: none; margin-top: .75rem; display: flex; flex-direction: column; gap: .6rem; }
.algo-list li { font-size: .87rem; color: var(--clr-muted); }

/* ===================================================
   Systems
=================================================== */
.systems-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 600px) { .systems-grid { grid-template-columns: 1fr; } }

.system-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 2px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
}
.system-card.frontier  { border-color: #fbbf24; background: #fffbeb; }
.system-card.perlmutter { border-color: #34d399; background: #ecfdf5; }

.system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.system-name { font-size: 1.2rem; font-weight: 800; color: var(--clr-accent); }
.system-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.frontier-badge   { background: #fbbf24; color: #78350f; }
.perlmutter-badge { background: #34d399; color: #064e3b; }
.system-card ul { list-style: none; }
.system-card li {
  font-size: .87rem;
  color: var(--clr-muted);
  padding: .35rem 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.system-card li:last-child { border-bottom: none; }

/* ===================================================
   Results Tabs
=================================================== */
.tab-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--clr-border);
  padding-bottom: .5rem;
}
.tab-btn {
  padding: .45rem 1.1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  color: var(--clr-muted);
  cursor: pointer;
  transition: all .15s;
}
.tab-btn.active, .tab-btn:hover { color: var(--clr-pm); background: var(--clr-pm-light); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-desc {
  font-size: .95rem;
  color: var(--clr-muted);
  margin-bottom: 1.75rem;
  max-width: 700px;
}

/* Speedup bars */
.speedup-summary { display: flex; flex-direction: column; gap: .875rem; margin-top: 1.5rem; }
.speedup-item { display: flex; align-items: center; gap: 1rem; }
.speedup-label { font-size: .87rem; font-weight: 600; width: 220px; flex-shrink: 0; color: var(--clr-text); }
.speedup-bar-container {
  flex: 1;
  background: #e2e8f0;
  border-radius: 99px;
  height: 26px;
  overflow: hidden;
}
.speedup-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-pm), #3b82f6);
  border-radius: 99px;
  display: flex;
  align-items: center;
  padding-left: .6rem;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  min-width: 40px;
}
.speedup-bar.bar-2 { background: linear-gradient(90deg, var(--accent2), #8b5cf6); }
.speedup-bar.bar-3 { background: linear-gradient(90deg, var(--accent3), #10b981); }

/* E2E table */
.e2e-table-wrapper { overflow-x: auto; margin-top: 1rem; }
.e2e-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.e2e-table th, .e2e-table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--clr-border); }
.e2e-table th {
  background: var(--clr-alt);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-muted);
}
.e2e-table tbody tr:hover { background: var(--clr-alt); }
.speedup-cell { font-weight: 700; color: var(--clr-pm); font-size: 1rem; }

/* ===================================================
   Contributions
=================================================== */
.contrib-grid { display: flex; flex-direction: column; gap: 0; }
.contrib-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--clr-border);
}
.contrib-item:first-child { border-top: 1px solid var(--clr-border); }
.contrib-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-border);
  line-height: 1;
  flex-shrink: 0;
  width: 48px;
}
.contrib-body h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; color: var(--clr-accent); }
.contrib-body p  { font-size: .9rem; color: var(--clr-muted); line-height: 1.65; }

/* ===================================================
   BibTeX
=================================================== */
.bibtex-wrap {
  position: relative;
  margin-top: 1.25rem;
  max-width: 700px;
}
.bibtex-block {
  background: #0f172a;
  color: #93c5fd;
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.7;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: rgba(255,255,255,.1);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  padding: .3rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font);
}
.copy-btn:hover { background: rgba(255,255,255,.2); }

/* ===================================================
   Footer
=================================================== */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2.5rem 0;
  text-align: center;
}
.footer-affil { margin-bottom: .5rem; }
.umd-badge { display: inline-flex; flex-direction: column; gap: .2rem; }
.umd-text { font-size: 1rem; font-weight: 700; color: #e2e8f0; }
.umd-sub  { font-size: .82rem; color: #64748b; }

/* ===================================================
   Auto-generated badge
=================================================== */
.autogen-badge {
  position: fixed;
  top: 0.75rem;
  right: 1rem;
  z-index: 200;
  background: rgba(15,23,42,0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 99px;
  padding: .3rem .75rem;
  font-size: .72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.autogen-badge svg { width: 13px; height: 13px; opacity: .7; flex-shrink: 0; }
.autogen-badge a { color: #60a5fa; text-decoration: none; }
.autogen-badge a:hover { text-decoration: underline; }

/* ===================================================
   Responsive
=================================================== */
@media (max-width: 600px) {
  .section { padding: 2.5rem 0; }
  .section-title { font-size: 1.4rem; }
  .hero-title { font-size: 1.35rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .design-grid { grid-template-columns: 1fr; }
  .speedup-label { width: 140px; }
}
