:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper: #ffffff;
  --paper-soft: #f6f7f9;
  --line: #e3e5e9;
  --accent: #1971c2;
  --accent-soft: #cfe8ff;
  --accent-ink: #0b2545;
  --radius: 10px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

h1, h2, h3 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.25; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, #fbfcff 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  margin: 0 auto 18px;
  max-width: 880px;
}
.venue-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 18px;
  text-transform: uppercase;
}
.authors {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.affiliations {
  font-size: 14px;
  color: #8a8f98;
  margin: 0 0 28px;
  font-style: italic;
}
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s ease, transform .15s ease;
}
.link-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.link-btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.link-btn.primary:hover { background: #000; }
.link-btn .icon { font-size: 15px; line-height: 1; }
.link-btn[aria-disabled="true"] { cursor: default; opacity: 0.6; transform: none; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--paper-soft); }
section h2 {
  font-size: 24px;
  margin: 0 0 22px;
  text-align: center;
}
section .kicker {
  display: block;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}

.abstract p {
  max-width: 760px;
  margin: 0 auto;
  font-size: 16.5px;
  color: var(--ink-soft);
}

/* ---------- Architecture ---------- */
.arch-figure {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--paper);
}
.arch-figure img { width: 100%; height: auto; display: block; border-radius: 4px; }
.arch-caption {
  max-width: 820px;
  margin: 16px auto 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  text-align: center;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.component-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.component-card .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.component-card h3 { font-size: 16px; margin: 0 0 8px; }
.component-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* ---------- Results grid ---------- */
.results-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.result-card h3 { font-size: 15px; margin: 0 0 12px; }
.result-card img { width: 100%; height: auto; border-radius: 6px; margin-top: auto; }
.result-card p.note { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.gallery-pair { margin: 0; }
.gallery-pair-imgs {
  display: flex;
  gap: 4px;
}
.gallery-strip img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}
.gallery-pair-imgs img { flex: 1 1 50%; min-width: 0; }
.gallery-strip figcaption {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 6px;
  text-align: center;
}

/* ---------- Video gallery ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.video-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-card .video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0c0f;
}
.video-card video, .video-card .video-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.video-card video { object-fit: cover; display: block; }
.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: #9aa1ab;
  font-size: 12.5px;
  text-align: center;
  padding: 16px;
  border: 1px dashed #454a54;
  margin: 8px;
  border-radius: 8px;
}
/* .video-placeholder's own `display: flex` above has the same specificity as
   the UA stylesheet's `[hidden]{display:none}` and, being an author rule,
   wins the cascade regardless of source order -- so [hidden] alone does
   nothing here. Restate it explicitly. */
.video-placeholder[hidden] { display: none; }
.video-placeholder code {
  background: #1c1e24;
  color: #cfe8ff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}
.video-meta {
  padding: 12px 16px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
}
.video-meta h3 { font-size: 15px; margin: 0; }
.view-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.view-toggle button {
  border: none;
  background: var(--paper);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
}
.view-toggle button.active { background: var(--ink); color: var(--paper); }

/* ---------- BibTeX ---------- */
.bibtex-box {
  max-width: 820px;
  margin: 0 auto;
  background: #14161a;
  color: #d7dbe2;
  border-radius: var(--radius);
  padding: 22px 24px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre;
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #262a33;
  color: #d7dbe2;
  border: 1px solid #3a3f4b;
  border-radius: 6px;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}
.copy-btn:hover { background: #303643; }

/* ---------- Footer ---------- */
footer {
  padding: 32px 0 48px;
  text-align: center;
  font-size: 12.5px;
  color: #9aa1ab;
}
footer a { color: #9aa1ab; }

@media (max-width: 820px) {
  .component-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .gallery-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .gallery-strip { grid-template-columns: 1fr; }
  .gallery-pair-imgs { flex-direction: column; }
}
