:root {
  --ink: #1a1a1a;
  --muted: #5b6470;
  --rule: #e3e6ea;
  --link: #1f6feb;
  --accent: #b31b1b;
  --bg: #ffffff;
  --panel: #f7f8fa;
  --max: 980px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

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

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

/* ---------- hero ---------- */

.hero {
  padding: 72px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.venue {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 22px;
}

h1 {
  font-size: 38px;
  line-height: 1.24;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}

h1 .short { display: block; font-size: 44px; margin-bottom: 4px; }

.authors {
  margin: 26px auto 10px;
  max-width: 900px;
  font-size: 18px;
}

.authors a { color: var(--ink); }
.authors sup { color: var(--muted); font-size: 12px; }

.affil {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 4px;
}

.affil sup { font-size: 11px; }

.note { color: var(--muted); font-size: 14px; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #22272e;
  color: #fff;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.btn:hover { background: #000; text-decoration: none; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- sections ---------- */

section { padding: 56px 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }

h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 22px;
  text-align: center;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 34px 0 10px;
}

.lead { max-width: 900px; margin: 0 auto; }

figure { margin: 0 0 8px; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

figure.framed img { border: 1px solid var(--rule); }

figure.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }

figcaption {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin-top: 12px;
  text-align: left;
}

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

.callout {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 15.5px;
}

/* ---------- bibtex ---------- */

pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

footer {
  padding: 34px 0 56px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 32px; }
  h1 { font-size: 27px; }
  h1 br { display: none; }
  h1 .short { font-size: 32px; }
  .authors { font-size: 16px; }
  h2 { font-size: 22px; }
}

/* ---------- mosaic wall ---------- */

.wide-wrap { max-width: 1280px; }

.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 8px;
}

.mosaic button {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  cursor: zoom-in;
}

.mosaic button.wide { grid-column: span 2; grid-row: span 2; }

.mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.mosaic button:hover img { transform: scale(1.04); }

.mosaic span {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mosaic button:hover span,
.mosaic button:focus-visible span { opacity: 1; }

.note-line {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14.5px;
  text-align: center;
}

/* ---------- 100% detail pairs ---------- */

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair img { display: block; width: 100%; height: auto; border-radius: 5px; }
#detail figure { margin-bottom: 36px; }

/* ---------- lightbox ---------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(12, 14, 17, 0.94);
  cursor: zoom-out;
}

#lightbox.open { display: flex; }
#lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; }

#lightbox p {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  margin: 0;
  padding: 0 40px;
  color: #cfd4da;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 720px) {
  .mosaic { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .pair { grid-template-columns: 1fr; }
}

/* ---------- wipe comparison ---------- */

.compare { margin-bottom: 28px; }

.compare .viewport {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 820px;
  margin: 0 auto;
  border-radius: 6px;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.compare .viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}

.compare .lo { clip-path: inset(0 calc(100% - var(--split)) 0 0); }

.compare .grip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.compare .grip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
}

.compare .tag {
  position: absolute;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.compare .tag.left { left: 12px; }
.compare .tag.right { right: 12px; }

.authors a { border-bottom: 1px solid transparent; }
.authors a:hover { border-bottom-color: var(--muted); text-decoration: none; }

.btn .emoji { font-size: 15px; line-height: 1; }
