/* ==========================================================================
   recognition.css — awards, service, skills, publication-record chart
   (.recog*). A 2x2 grid of glass blocks; stacks on mobile.
   Colors come from tokens only; chart segments read the --venue-* tokens
   through classes so theme switches need no redraw.
   ========================================================================== */

.recog {
  --rgap: clamp(16px, 2.2vw, 24px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--rgap);
}
/* two independent columns on desktop, so short cards never stretch to their neighbor's height */
.recog__col {
  display: flex;
  flex-direction: column;
  gap: var(--rgap);
  min-width: 0;
}
/* desktop: the last card of the shorter column stretches, so both columns end on one baseline (content stays top-aligned) */
@media (min-width: 900px) {
  .recog__col > .recog__cell:last-child {
    display: flex;
    flex: 1;
  }
  .recog__col > .recog__cell:last-child > .recog__block {
    flex: 1;
  }
}
@media (max-width: 899px) {
  .recog {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .recog__col {
    display: contents;
  }
  .recog__cell {
    order: var(--o, 0); /* awards, publications, reviewer, skills */
  }
}
.recog__cell {
  min-width: 0;
}

/* -------------------------------------------------------------- block frame */
.recog__block {
  --tone: var(--accent-rgb);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(20px, 2.8vw, 32px);
}
.recog__block--awards {
  --tone: var(--accent-3-rgb);
}
.recog__block--pubs {
  --tone: var(--accent-2-rgb);
}
.recog__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.recog__ico {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(var(--tone), 0.38);
  border-radius: var(--r-sm);
  background: rgba(var(--tone), 0.1);
  color: rgb(var(--tone));
}
.recog__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
}
.recog__meta {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ awards */
.recog__plates {
  display: flex;
  flex-direction: column;
  --yr-w: clamp(76px, 12vw, 104px);
}
.recog__plate {
  position: relative;
  display: grid;
  grid-template-columns: var(--yr-w) minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 18px;
  margin-inline: -12px;
  padding: 16px 12px;
  border-radius: var(--r-sm);
  transition: background var(--dur-2) var(--ease);
}
.recog__plate + .recog__plate::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--line);
}
.recog__year {
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-2) var(--ease);
}
.recog__plate.is-latest .recog__year {
  color: rgb(var(--accent-3-rgb));
}
.recog__plate-title {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: var(--lh-snug);
}
.recog__plate-org {
  margin: 3px 0 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.recog__plate-ico {
  display: inline-flex;
  color: rgb(var(--accent-3-rgb));
  opacity: 0.4;
  transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out);
}
.recog__plate.is-latest .recog__plate-ico {
  opacity: 0.85;
}
@media (hover: hover) and (pointer: fine) {
  .recog__plate:hover {
    background: rgba(var(--accent-3-rgb), 0.07);
  }
  .recog__plate:hover .recog__year {
    color: rgb(var(--accent-3-rgb));
  }
  .recog__plate:hover .recog__plate-ico {
    opacity: 1;
    transform: rotate(-8deg) scale(1.12);
  }
}

/* ----------------------------------------------------------------- service */
/* seven chips read best as a tidy 4 + 3 grid at every width (a flex-wrap left TVCG alone on row two at 768) */
.recog__venues {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.recog__venue {
  justify-content: center;
  gap: 0.55em;
  padding: 0.85em 0.6em;
  white-space: nowrap;
  border-radius: var(--r-sm);
  border-color: rgba(var(--badge), 0.62);
  background: rgba(var(--badge), 0.18);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: none; /* real casing: CVPR ICCV NeurIPS ICLR AAAI ACM MM TVCG */
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), background var(--dur-2);
}
:root[data-theme="light"] .recog__venue {
  border-color: rgba(var(--badge), 0.55);
  background: rgba(var(--badge), 0.14);
}
.recog__venue::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--badge));
  box-shadow: 0 0 8px rgb(var(--badge));
}
@media (max-width: 479.98px) {
  .recog__venues {
    gap: 6px;
  }
  .recog__venue {
    padding-inline: 0.3em;
  }
  .recog__venue::before {
    display: none; /* the badge tint already carries the kind; the dot would not fit four across */
  }
}
@media (hover: hover) and (pointer: fine) {
  /* non-interactive chip: a border tint only (no lift, no glow, no extra fill that would cost contrast) */
  .recog__venue:hover {
    border-color: rgba(var(--badge), 0.7);
  }
}
.recog__foot {
  margin: auto 0 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* ------------------------------------------------------------------ skills */
.recog__skillgroup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recog__block--skills .recog__skillgroup + .recog__skillgroup {
  margin-top: 4px;
}
.recog__skill-label {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.recog__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recog__pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 0.95em;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(var(--accent-rgb), 0.05);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.2;
  transition: border-color var(--dur-2), background var(--dur-2), box-shadow var(--dur-2), transform var(--dur-3) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  /* non-interactive pill: a border tint only */
  .recog__pill:hover {
    border-color: var(--line-accent);
  }
}

/* --------------------------------------------------- publication record */
.recog__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.recog__total {
  font-size: clamp(2.8rem, 2rem + 2.6vw, 3.8rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.recog__total-unit {
  color: var(--text-2);
  font-size: var(--fs-md);
}
.recog__span {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
}
.recog__chart {
  margin: 0;
}
.recog__plot {
  position: relative;
  min-height: 250px;
}
.recog__svg {
  display: block;
  max-width: none;
  overflow: visible;
}
.recog__grid {
  stroke: var(--line);
  stroke-dasharray: 2 5;
  stroke-width: 1;
}
.recog__base {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.recog__ylab,
.recog__xlab,
.recog__cnt {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.recog__ylab {
  fill: var(--text-3);
  font-size: var(--fs-micro);
}
.recog__xlab {
  fill: var(--text-2);
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
}
.recog__cnt {
  fill: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.recog__cnt.is-zero {
  fill: var(--text-3);
  font-weight: 400;
}
.recog__bar.is-zero .recog__xlab {
  fill: var(--text-3);
}

/* segments — gradient stops + strokes read the venue tokens */
.recog__stop--neurips { stop-color: rgb(var(--venue-neurips)); }
.recog__stop--eccv { stop-color: rgb(var(--venue-eccv)); }
.recog__stop--cvpr { stop-color: rgb(var(--venue-cvpr)); }
.recog__stop--other { stop-color: rgb(var(--venue-preprint)); }
.recog__stop--journal { stop-color: rgb(var(--venue-journal)); }
.recog__stop--preprint { stop-color: rgb(var(--venue-preprint)); }
.recog__seg {
  stroke-width: 1;
  transition: opacity var(--dur-2) var(--ease);
}
.recog__seg--neurips { stroke: rgba(var(--venue-neurips), 0.8); }
.recog__seg--eccv { stroke: rgba(var(--venue-eccv), 0.8); }
.recog__seg--cvpr { stroke: rgba(var(--venue-cvpr), 0.8); }
.recog__seg--other { stroke: rgba(var(--venue-preprint), 0.8); }
.recog__seg--journal { stroke: rgba(var(--venue-journal), 0.8); }
.recog__seg--preprint { stroke: rgba(var(--venue-preprint), 0.8); }
.recog__seg.is-dim {
  opacity: 0.16;
}

/* bar interaction: full-height hit column with hover / focus ring */
.recog__bar {
  outline: none;
  cursor: default;
}
.recog__hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  transition: fill var(--dur-2), stroke var(--dur-2);
}
.recog__bar:focus-visible .recog__hit {
  fill: rgba(var(--accent-rgb), 0.07);
  stroke: var(--accent);
}
.recog__bar:focus-visible .recog__bar-fill {
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.4));
}
@media (hover: hover) and (pointer: fine) {
  .recog__bar:hover .recog__hit {
    fill: rgba(var(--accent-rgb), 0.05);
  }
  .recog__bar:hover .recog__bar-fill {
    filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.4));
  }
}

/* bars animate up when armed -> released by IntersectionObserver */
.recog__bar-fill {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.95s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.recog__cnt,
.recog__xlab {
  transition: opacity 0.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms + 420ms);
}
.recog__chart.is-armed .recog__bar-fill {
  transform: scaleY(0);
}
.recog__chart.is-armed .recog__cnt {
  opacity: 0;
}

/* tooltip */
.recog__tip {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  min-width: 160px;
  max-width: 240px;
  padding: 10px 12px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-1) var(--ease), visibility var(--dur-1);
}
.recog__tip.is-on {
  opacity: 1;
  visibility: visible;
}
.recog__tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.recog__tip-head strong {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.recog__tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: var(--fs-sm);
  line-height: 1.3;
}
.recog__tip-name {
  min-width: 0;
  color: var(--text);
  font-weight: 500;
}
.recog__tip-venue {
  margin-left: auto;
  padding-left: 10px;
  color: var(--text-3);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* legend swatches (shared by legend + tooltip) */
.recog__sw {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: rgb(var(--venue-preprint));
}
.recog__sw--neurips { background: rgb(var(--venue-neurips)); box-shadow: 0 0 8px rgba(var(--venue-neurips), 0.6); }
.recog__sw--eccv { background: rgb(var(--venue-eccv)); box-shadow: 0 0 8px rgba(var(--venue-eccv), 0.6); }
.recog__sw--cvpr { background: rgb(var(--venue-cvpr)); box-shadow: 0 0 8px rgba(var(--venue-cvpr), 0.6); }
.recog__sw--other { background: rgb(var(--venue-preprint)); }
.recog__sw--journal { background: rgb(var(--venue-journal)); box-shadow: 0 0 8px rgba(var(--venue-journal), 0.6); }
.recog__sw--preprint { background: rgb(var(--venue-preprint)); }

.recog__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recog__lg {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 32px;
  padding: 0.4em 0.85em;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  transition: color var(--dur-1), border-color var(--dur-2), background var(--dur-2);
}
.recog__lg-n {
  color: var(--text-3);
}
.recog__lg.is-hl {
  color: var(--text);
  border-color: var(--line-strong);
}
@media (hover: hover) and (pointer: fine) {
  .recog__lg:hover {
    color: var(--text);
    border-color: var(--line-strong);
  }
}
.recog__lg[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--line-accent);
  background: rgba(var(--accent-rgb), 0.1);
}
@media (pointer: coarse) {
  .recog__lg {
    min-height: 44px;
  }
}

.recog__chart-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: auto;
}
.recog__hint {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.recog__chart-foot .btn {
  min-height: 44px;
}

/* ----------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .recog__chart.is-armed .recog__bar-fill {
    transform: none;
  }
  .recog__chart.is-armed .recog__cnt {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Calm dark: one accent hue for the block icons, no glows, softer venue colours.
   Venue hues survive only in the chart, its legend and the reviewer chips.
   -------------------------------------------------------------------------- */
:root:not([data-theme="light"]) .recog__block--awards,
:root:not([data-theme="light"]) .recog__block--pubs {
  --tone: var(--accent-rgb);
}
:root:not([data-theme="light"]) .recog__plate.is-latest .recog__year {
  color: var(--accent);
}
:root:not([data-theme="light"]) .recog__plate-ico {
  color: var(--text-3);
  opacity: 0.6;
}
:root:not([data-theme="light"]) .recog__plate.is-latest .recog__plate-ico {
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  :root:not([data-theme="light"]) .recog__plate:hover {
    background: rgba(var(--accent-rgb), 0.05);
  }
  :root:not([data-theme="light"]) .recog__plate:hover .recog__year {
    color: var(--accent);
  }
  :root:not([data-theme="light"]) .recog__plate:hover .recog__plate-ico {
    color: var(--text-2);
  }
  :root:not([data-theme="light"]) .recog__bar:hover .recog__bar-fill {
    filter: none;
  }
}
:root:not([data-theme="light"]) .recog__total.grad-text {
  background: none;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}
:root:not([data-theme="light"]) .recog__venue {
  border-color: rgba(var(--badge), 0.42);
  background: rgba(var(--badge), 0.13);
}
:root:not([data-theme="light"]) .recog__venue::before {
  box-shadow: none;
}
:root:not([data-theme="light"]) .recog__stop:first-child {
  stop-opacity: 0.72;
}
:root:not([data-theme="light"]) .recog__stop:last-child {
  stop-opacity: 0.36;
}
:root:not([data-theme="light"]) .recog__seg--neurips { stroke: rgba(var(--venue-neurips), 0.5); }
:root:not([data-theme="light"]) .recog__seg--eccv { stroke: rgba(var(--venue-eccv), 0.5); }
:root:not([data-theme="light"]) .recog__seg--cvpr { stroke: rgba(var(--venue-cvpr), 0.5); }
:root:not([data-theme="light"]) .recog__seg--other,
:root:not([data-theme="light"]) .recog__seg--preprint { stroke: rgba(var(--venue-preprint), 0.5); }
:root:not([data-theme="light"]) .recog__seg--journal { stroke: rgba(var(--venue-journal), 0.5); }
:root:not([data-theme="light"]) .recog__sw {
  box-shadow: none;
}
:root:not([data-theme="light"]) .recog__bar:focus-visible .recog__bar-fill {
  filter: none;
}
