/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.65;
  margin: 0;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

h1, h2, h3 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 1rem;
}

p { margin: 0 0 1rem; }

a { color: #1558d6; text-decoration: none; }
a:hover { text-decoration: underline; }

hr {
  border: 0;
  border-top: 1px solid #e5e5e5;
  margin: 3rem 0;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.hero .venue {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.hero .title {
  font-size: 2.4rem;
  margin: 0.25rem auto 1.5rem;
  max-width: 780px;
}

.hero .authors {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.hero .affiliations {
  color: #444;
  margin-bottom: 0.4rem;
}

.hero .note {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.hero .links {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hero .links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: #1a1a1a;
  color: #fff;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.hero .links a:hover {
  background: #000;
  text-decoration: none;
}

.hero .code-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #c0392b;
}

.hero .code-note a {
  color: #c0392b;
  text-decoration: underline;
}

/* ---------- Sections ---------- */
section h2 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

section p {
  font-size: 1rem;
}

/* ---------- Figures ---------- */
figure {
  margin: 0 0 1rem;
}

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

figcaption,
p.caption {
  text-align: center;
  font-size: 0.92rem;
  color: #555;
  margin-top: 0.75rem;
}

/* ---------- 2-column grid for result tiles ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero .title { font-size: 1.8rem; }
  main { padding: 2rem 1rem 3rem; }
}

/* ---------- Field Visualization Grid ---------- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
}

.field-tile { margin: 0; }

.field-tile video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  object-fit: cover;
}

.field-tile figcaption {
  text-align: center;
  margin-top: 0.5rem;
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

/* ---------- Triple Viewer (Results) ---------- */
.triple-viewer {
  position: relative;
  width: 100%;
  margin-bottom: 0.75rem;
}

.viewer-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  --left: 33.333%;
  --right: 66.667%;
}

.vlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.v-render { clip-path: inset(0 calc(100% - var(--left)) 0 0); }
.v-gt     { clip-path: inset(0 calc(100% - var(--right)) 0 var(--left)); }
.v-error  { clip-path: inset(0 0 0 var(--right)); }

.pane-label {
  position: absolute;
  top: 0.6rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.8rem;
  font-family: 'Google Sans', sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  pointer-events: none;
  letter-spacing: 0.04em;
  z-index: 3;
}

.label-render { left: 0.6rem; }
.label-gt     { left: calc(var(--left) + 0.6rem); }
.label-error  { left: calc(var(--right) + 0.6rem); }

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  margin-left: -14px;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
  z-index: 4;
}

.divider::before {
  /* thin visible line in the middle of the hit area */
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.divider::after {
  /* round knob with a drag icon */
  content: '\2194';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 26px;
  text-align: center;
  transition: box-shadow 0.12s ease;
}

.divider.active::after,
.divider:hover::after {
  box-shadow: 0 0 0 2px #1558d6, 0 1px 6px rgba(0, 0, 0, 0.5);
}

.divider-left  { left: var(--left); }
.divider-right { left: var(--right); }

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.nav-btn:hover  { background: rgba(0, 0, 0, 0.85); }
.nav-btn:active { transform: translateY(-50%) scale(0.96); }

.nav-prev { left: 0.75rem; }
.nav-next { right: 0.75rem; }

@media (max-width: 640px) {
  .nav-btn { width: 36px; height: 36px; }
  .pane-label { font-size: 0.72rem; padding: 0.18rem 0.45rem; }
}

/* ---------- Video ---------- */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}
.video-wrap video,
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Table ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

th, td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e5e5e5;
  text-align: center;
}

th:first-child, td:first-child { text-align: left; }

thead th {
  border-bottom: 2px solid #1a1a1a;
  font-weight: 600;
}

/* ---------- Code / BibTeX ---------- */
pre {
  background: #f6f6f6;
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.88rem;
}

pre code {
  font-family: 'Castoro', Menlo, Consolas, monospace;
  color: #1a1a1a;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

footer .small { font-size: 0.82rem; color: #888; }
