/* ============================================================
   style.css — GitHub Pages site for WSC2026 paper
   ============================================================ */

/* Google Fonts loaded via <link> in HTML for better performance */

/* ── Custom Properties ──────────────────────────────────── */
:root {
  --color-primary:    #1a1a2e;
  --color-accent:     #0077b6;
  --color-accent-2:   #48cae4;
  --color-bg:         #ffffff;
  --color-bg-alt:     #f8f9fa;
  --color-border:     #e0e0e0;
  --color-text:       #333333;
  --color-text-muted: #666666;
  --font-body:        'Inter', sans-serif;
  --font-mono:        'JetBrains Mono', monospace;
  --max-width:        1100px;
  --radius:           8px;
  --shadow:           0 2px 12px rgba(0,0,0,0.08);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout helpers ─────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
section { padding: 72px 0; }
section:nth-child(even) { background: var(--color-bg-alt); }
/* Skip layout/paint for off-screen sections — big scroll-perf win */
section:not(#hero):not(#abstract) {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 40px;
}
hr.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* ── Sticky Nav ─────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  will-change: transform;
}
nav {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  overflow-x: auto;
}
nav a {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
nav a:hover {
  color: var(--color-accent);
  background: rgba(0,119,182,0.07);
  text-decoration: none;
}

/* ── Hero ───────────────────────────────────────────────── */
#hero {
  padding: 80px 0 72px;
  text-align: center;
  background: linear-gradient(160deg, #f0f8ff 0%, var(--color-bg) 60%);
}
.venue-badge {
  display: inline-block;
  background: rgba(0,119,182,0.1);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0,119,182,0.25);
  margin-bottom: 20px;
}
#hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  max-width: 820px;
  margin: 0 auto 24px;
}
.authors {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.affiliations {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 36px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.1s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: #005f91; color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}
.btn-outline:hover { background: rgba(0,119,182,0.06); }
.btn-ghost {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { background: #e9ecef; }

/* ── Abstract ───────────────────────────────────────────── */
#abstract p {
  max-width: 750px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text);
}

/* ── Abstract (justified) ───────────────────────────────── */
#abstract p:not(.section-subtitle) {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* ── Policy Inputs ───────────────────────────────────────── */
.policy-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--color-bg);
}
.policy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--color-primary);
  flex-wrap: wrap;
}
.policy-tag {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
.policy-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.policy-lead {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
}
.policy-block {
  border-left: 3px solid var(--color-border);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--color-bg-alt);
}
.policy-block.inclusion { border-left-color: var(--color-accent); }
.policy-block.exclusion { border-left-color: #e63946; background: #fff5f5; }
.policy-block.guidance  { border-left-color: #2a9d8f; }
.policy-block h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.policy-block.inclusion h4 { color: var(--color-accent); }
.policy-block.exclusion h4 { color: #e63946; }
.policy-block.guidance  h4 { color: #2a9d8f; }
.policy-block p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 8px;
}
.policy-block p:last-child { margin-bottom: 0; }
.policy-block ul {
  margin: 6px 0 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.policy-block ul li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}
@media (max-width: 600px) {
  .policy-body { padding: 20px 16px; }
}

/* ── Architecture Figure ─────────────────────────────────── */
.arch-figure {
  margin: 8px auto 0;
  text-align: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 16px;
}
.arch-figure img {
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: inline-block;
}

/* ── Schema Table ────────────────────────────────────────── */
.schema-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--color-bg);
}
.schema-table thead tr {
  background: var(--color-primary);
  color: #fff;
}
.schema-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.schema-table tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}
.schema-table tbody tr:hover {
  background: rgba(0,119,182,0.05);
}
.schema-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.45;
}
.schema-table td:first-child {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.schema-table td:nth-child(2) { white-space: nowrap; }
.schema-table td:nth-child(3) {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.schema-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(0,119,182,0.08);
  color: var(--color-accent);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── BPMN viewer KPI strip ───────────────────────────────── */
.bpmn-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 16px;
  background: var(--color-bg);
}
.bpmn-kpi-metric {
  padding: 16px 20px;
  border-right: 1px solid var(--color-border);
}
.bpmn-kpi-metric:last-child { border-right: none; }
.bpmn-kpi-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}
.bpmn-kpi-key {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Method Pipeline ─────────────────────────────────────── */
.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 40px auto 0;
  max-width: 900px;
}
.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 130px;
  box-shadow: var(--shadow);
}
.pipeline-step .icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.pipeline-step .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.3;
}
.pipeline-step .sublabel {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 3px;
}
.pipeline-arrow {
  font-size: 1.4rem;
  color: var(--color-accent);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Video ──────────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.video-wrapper video {
  width: 100%;
  display: block;
}

/* ── Tabs ───────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--color-accent); }
.tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* inner sub-tabs (LLM selector) */
.subtab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.subtab-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.subtab-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.subtab-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

/* ── Chart Grid ─────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.chart-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: box-shadow 0.15s;
}
.chart-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
.chart-card img { width: 100%; }
.chart-card .chart-caption {
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* ── Lightbox ───────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
}

/* ── BPMN Viewer ─────────────────────────────────────────── */
.bpmn-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.bpmn-controls label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.bpmn-controls select {
  padding: 7px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}
.bpmn-controls select:focus { outline: 2px solid var(--color-accent); }

.bpmn-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
#bpmn-container {
  height: 480px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fafafa;
  position: relative;
}
#bpmn-container .bjs-powered-by { display: none; }

.trace-panel {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  overflow: hidden;
  height: 480px;
  display: flex;
  flex-direction: column;
}
.trace-panel-header {
  padding: 12px 16px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.trace-panel-header label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.trace-panel-header select {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
}
#trace-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  list-style: none;
}
#trace-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8rem;
}
#trace-list li:last-child { border-bottom: none; }
.trace-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trace-step-info { flex: 1; }
.trace-step-name { font-weight: 500; color: var(--color-text); }
.trace-step-type {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.bpmn-download-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

/* Highlight styles for bpmn-js */
.highlight:not(.djs-connection) .djs-visual > :nth-child(1) {
  fill: #cce5ff !important;
  stroke: #0077b6 !important;
  stroke-width: 2px !important;
}
.highlight.djs-connection .djs-visual > :nth-child(1) {
  stroke: #0077b6 !important;
  stroke-width: 3px !important;
}

/* ── Downloads ──────────────────────────────────────────── */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.download-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
  text-decoration: none;
  color: var(--color-text);
}
.download-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); text-decoration: none; }
.download-icon { font-size: 2rem; flex-shrink: 0; }
.download-info .download-title { font-weight: 600; font-size: 0.9rem; }
.download-info .download-desc { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 2px; }

/* ── BibTeX ─────────────────────────────────────────────── */
.bibtex-wrapper {
  position: relative;
  max-width: 720px;
}
.bibtex-block {
  background: #1e2030;
  color: #a9b1d6;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 24px 28px;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}
#copy-bibtex {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}
#copy-bibtex:hover { background: rgba(255,255,255,0.2); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 32px 24px;
  font-size: 0.85rem;
}
footer a { color: rgba(255,255,255,0.8); }
footer a:hover { color: #fff; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  section { padding: 52px 0; }

  .bpmn-layout {
    grid-template-columns: 1fr;
  }
  #bpmn-container { height: 360px; }
  .trace-panel { height: 320px; }

  .pipeline { gap: 8px 0; }
  .pipeline-arrow { display: none; }
  .pipeline-step { min-width: 100px; }
}

@media (max-width: 480px) {
  .btn-row { flex-direction: column; align-items: center; }
  .chart-grid { grid-template-columns: 1fr; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  header, nav { display: none; }
  #bpmn-container { display: none; }
  .trace-panel { display: none; }
}
