/* Head Anything project page: additions on top of the Face Anything / Nerfies style (bulma + index.css). */

.ha-wide {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.ha-section-title {
  font-size: 28px;
  text-align: center;
}

.ha-section-sub {
  text-align: center;
  max-width: 980px;
  margin: 0.25rem auto 1.25rem auto;
}

.ha-video {
  width: 100%;
  display: block;
  border-radius: 6px;
  background: #fff;
}

/* labels placed under / above a wide video or image at the column centres used in the talk slides */
.ha-label-row {
  position: relative;
  height: 1.8em;
  margin: 2px 0 6px 0;
}

.ha-label-row span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: clamp(10px, 1.05vw, 16px);
  color: #363636;
}

.ha-label-row span.ha-ours {
  font-weight: 700;
}

.ha-colorbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 18px 0;
  font-size: clamp(10px, 1.0vw, 15px);
}

.ha-colorbar img {
  width: 25%;
  height: 12px;
  image-rendering: auto;
}

.ha-block {
  margin-bottom: 2.5rem;
}

.ha-block-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.4rem;
}

/* image with row labels on the left (dataset slides, back-of-head) */
.ha-rowlabel-figure {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.ha-rowlabels {
  position: relative;
  flex: 0 0 auto;
}

.ha-rowlabels span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  text-align: right;
  white-space: nowrap;
  font-size: clamp(11px, 1.1vw, 16px);
  line-height: 1.25;
}

.ha-rowlabel-figure img {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: auto;
  display: block;
}

/* ------------------------------------------------------------------ interactive mesh viewer */
.ha-example-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0.5rem 0 1rem 0;
}

.ha-tab {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ha-tab img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.ha-tab span {
  display: block;
  font-size: 12px;
  color: #4a4a4a;
  margin-top: 2px;
}

.ha-tab:hover {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.ha-tab.is-active {
  border-color: #3273dc;
}

.ha-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 1rem;
}

.ha-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media screen and (max-width: 768px) {
  .ha-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ha-cell img.ha-input {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #fff;
}

.ha-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-top: 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #ececec;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.ha-viewer:active {
  cursor: grabbing;
}

.ha-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.ha-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  pointer-events: none;
}

.ha-hint {
  text-align: center;
  color: #7a7a7a;
  font-size: 14px;
  margin-top: 0.75rem;
}

.ha-placeholder-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 18px;
}

.link-block a.is-placeholder {
  opacity: 0.85;
}

/* title on two lines: wider header column, font scales down a little on narrower screens */
.ha-title-container {
  max-width: 1200px;
  margin: 0 auto;
}

.ha-title {
  font-size: clamp(2rem, 3.2vw, 3rem) !important;
  line-height: 1.2;
}

/* teaser sentence on two lines: may be wider than the teaser video */
.hero.teaser .hero-body {
  overflow: visible;
}

.ha-teaser-text {
  font-size: clamp(1rem, 1.3vw, 1.25rem) !important;
  width: min(1150px, calc(100vw - 3rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* second comparison row (AVA-256 / CelebV-HQ): clear gap between the two rows, as on the talk slides */
.ha-video.ha-row2 {
  margin-top: clamp(16px, 3.5vw, 52px);
}

/* first + results videos: as wide as the comparison sections (.ha-wide), but never taller than the screen (--ar = video width / height) */
.ha-wide-video {
  display: block;
  width: min(100%, calc((100vh - 40px) * var(--ar)));
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}
