/* =========================================================
   AGG academic project page v7
   ========================================================= */

:root {
  --cyan: #59d6dc;
  --teal: #28a9b4;
  --teal-dark: #176b7b;
  --teal-deep: #0d4351;
  --blue: #287aa3;
  --ink: #132026;
  --text: #34464d;
  --muted: #718188;
  --line: #cfe2e5;
  --content-width: 1160px;
  --reading-width: 860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(40, 169, 180, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 169, 180, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #eef8f9 0, #f8fbfb 520px, #f5f9fa 100%);
  background-size: 38px 38px, 38px 38px, auto;
  font-family: Inter, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.site-accent {
  height: 5px;
  background: linear-gradient(90deg, var(--teal-deep), var(--teal), var(--cyan), var(--blue));
}

/* ---------- top bar ---------- */

.topbar {
  width: min(calc(100% - 48px), var(--content-width));
  min-height: 100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(13, 67, 81, 0.12);
}

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.agg-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.identity-divider {
  width: 1px;
  height: 38px;
  background: rgba(13, 67, 81, 0.18);
}

.xjtu-seal {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.topbar-signature {
  min-width: 450px;
  padding: 10px 18px 10px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  border: 1px solid rgba(23, 107, 123, 0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
}

.signature-svg {
  width: 205px;
  height: 62px;
  flex: 0 0 auto;
  overflow: visible;
}

.agg-letter,
.sig-line-accent {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agg-letter {
  stroke: var(--teal-deep);
  stroke-width: 4.2;
}

.letter-a {
  stroke-dasharray: 110;
  stroke-dashoffset: 110;
  animation: draw-a 5s ease-in-out infinite;
}

.letter-g1 {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: draw-g1 5s ease-in-out infinite;
}

.letter-g2 {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: draw-g2 5s ease-in-out infinite;
}

.sig-line-accent {
  stroke: var(--teal);
  stroke-width: 2.2;
  opacity: 0.75;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: draw-accent 5s ease-in-out infinite;
}

@keyframes draw-a {
  0%, 8% { stroke-dashoffset: 110; opacity: 0.15; }
  18%, 80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

@keyframes draw-g1 {
  0%, 18% { stroke-dashoffset: 160; opacity: 0.15; }
  34%, 80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

@keyframes draw-g2 {
  0%, 28% { stroke-dashoffset: 160; opacity: 0.15; }
  50%, 80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

@keyframes draw-accent {
  0%, 42% { stroke-dashoffset: 220; opacity: 0.05; }
  58%, 82% { stroke-dashoffset: 0; opacity: 0.75; }
  100% { stroke-dashoffset: 0; opacity: 0.12; }
}

.signature-copy {
  display: flex;
  align-items: center;
}

.signature-copy span {
  color: var(--teal-deep);
  font-size: 20px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* ---------- page frame ---------- */

main {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 0 auto;
}

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

.project-header {
  position: relative;
  max-width: 1080px;
  margin: 70px auto 46px;
  padding: 62px 64px 58px;
  overflow: hidden;
  border: 1px solid rgba(40, 169, 180, 0.17);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 8%, rgba(89, 214, 220, 0.34), transparent 28%),
    radial-gradient(circle at 12% 95%, rgba(40, 122, 163, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.97), rgba(239,250,251,0.96));
  box-shadow: 0 28px 70px rgba(30, 101, 113, 0.08);
  text-align: center;
}

.project-header::before,
.project-header::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.project-header::before {
  width: 250px;
  height: 250px;
  right: -95px;
  top: -115px;
  border: 1px solid rgba(40, 169, 180, 0.22);
  transform: rotate(45deg);
}

.project-header::after {
  width: 180px;
  height: 180px;
  left: -100px;
  bottom: -120px;
  border: 1px solid rgba(40, 122, 163, 0.20);
  transform: rotate(45deg);
}

.project-header h1 {
  max-width: 950px;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(42px, 5.2vw, 66px);
  font-weight: 700;
  line-height: 1.035;
  letter-spacing: -0.05em;
}

.project-header h1 span {
  display: block;
  color: var(--teal-deep);
}

.authors {
  margin: 30px 0 5px;
  color: #1b5d69;
  font-size: 19px;
  font-weight: 580;
}

.authors span {
  padding: 0 8px;
  color: #90aeb3;
}

.affiliation {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.authors a {
  color: inherit;
  border-bottom: 1px solid rgba(40, 169, 180, 0.38);
  transition: color 160ms ease, border-color 160ms ease;
}

.authors a:hover {
  color: var(--teal-deep);
  border-bottom-color: var(--teal);
}

.publication-note {
  max-width: 830px;
  margin: 28px auto 0;
  padding: 22px 24px;
  border: 1px solid rgba(40, 169, 180, 0.20);
  border-radius: 14px;
  background: rgba(255,255,255,0.64);
  text-align: left;
}

.publication-note p {
  margin: 0;
  color: #40535a;
  font-size: 14px;
  line-height: 1.7;
}

.publication-note p + p { margin-top: 8px; }

.publication-note a {
  color: var(--teal-dark);
  font-weight: 700;
  border-bottom: 1px solid rgba(40, 169, 180, 0.38);
}

.publication-note a:hover {
  color: var(--teal-deep);
  border-bottom-color: var(--teal-deep);
}

.palm-tree { margin: 0 2px; }

.doi-link {
  width: fit-content;
  margin: 18px auto 0;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(23, 107, 123, 0.28);
  color: var(--teal-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.doi-link:hover {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.doi-arrow {
  font-family: Arial, sans-serif;
  font-size: 13px;
}

/* ---------- publication badges ---------- */

.publication-badges {
  max-width: 830px;
  margin: 26px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.venue-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.venue-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 46px;
}

.venue-logo {
  display: block;
}

.venue-logo-siggraph {
  height: 50px;
  width: auto;
}

.venue-acm {
  display: flex;
  align-items: center;
  gap: 11px;
}

.venue-logo-acm {
  height: 44px;
  width: auto;
}

.venue-acm-caption {
  color: #40535a;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.35;
  white-space: nowrap;
}

.venue-logo-fallback {
  color: var(--teal-deep);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.venue-line {
  margin: 0;
  color: var(--teal-deep);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.venue-line-secondary {
  color: #40535a;
  font-weight: 520;
}

/* ---------- icon resource cards ---------- */

.hero-links {
  max-width: 900px;
  margin: 32px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.hero-resource {
  flex: 1 1 150px;
  max-width: 190px;
  min-height: 124px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(23, 107, 123, 0.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(240,249,250,0.86));
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.hero-resource:hover {
  transform: translateY(-4px);
  border-color: rgba(40,169,180,0.45);
  background: white;
  box-shadow: 0 12px 26px rgba(27, 100, 112, 0.10);
}

.resource-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(89,214,220,0.18), rgba(40,169,180,0.12));
  transition: transform 180ms ease, background 180ms ease;
}

.hero-resource:hover .resource-icon {
  transform: scale(1.06);
  background: linear-gradient(180deg, rgba(89,214,220,0.25), rgba(40,169,180,0.18));
}

.resource-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--teal-deep);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resource-title {
  color: var(--teal-deep);
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.resource-kicker { display: none; }

/* ---------- teaser ---------- */

.teaser-section {
  margin: 54px 0 0;
}

.teaser-frame {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(40, 169, 180, 0.20);
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 20px 52px rgba(24, 89, 99, 0.07);
}

.teaser-frame::before {
  content: "";
  position: absolute;
  left: 28px;
  top: -2px;
  width: 130px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
}

.teaser-image {
  width: 100%;
  max-height: 760px;
  display: block;
  object-fit: contain;
  border-radius: 11px;
  background: white;
}

/* ---------- section titles ---------- */

.content-section {
  margin-top: 96px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 34px;
  display: flex;
  justify-content: center;
}

.section-heading h2 {
  margin: 0;
  color: var(--teal);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.reading-column {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.reading-column p {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.82;
}

/* ---------- videos ---------- */

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.video-card {
  padding: 22px;
  border: 1px solid rgba(40, 169, 180, 0.18);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(235,248,249,0.90));
  box-shadow: 0 18px 46px rgba(28, 96, 106, 0.065);
}

.video-card-main {
  background:
    radial-gradient(circle at 92% 0%, rgba(89,214,220,0.14), transparent 24%),
    linear-gradient(145deg, rgba(255,255,255,0.97), rgba(235,248,249,0.92));
}

.video-card-header { margin-bottom: 15px; }

.video-card h3 {
  margin: 0;
  color: var(--teal-deep);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.video-shell {
  padding: 10px;
  border: 1px solid #d6e8ea;
  border-radius: 12px;
  background: #eaf5f6;
}

.video-shell video {
  width: min(100%, 1000px);
  height: auto;
  display: block;
  margin: 0 auto;
  /* keeps the player box stable before the poster/metadata has loaded */
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 12px 32px rgba(8, 49, 56, 0.13);
}

/* ---------- acknowledgments ---------- */

.acknowledgments-copy {
  padding: 28px 30px;
  border-left: 3px solid var(--teal);
  border-radius: 0 12px 12px 0;
  background: rgba(238,248,249,0.72);
}

/* ---------- footer ---------- */

footer {
  margin-top: 110px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(236,248,249,0.95), rgba(226,242,244,0.96));
}

.footer-inner {
  width: min(calc(100% - 48px), var(--content-width));
  min-height: 125px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 26px;
}

.footer-agg {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.footer-xjtu-seal {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .topbar-signature {
    min-width: 360px;
    gap: 12px;
  }
  .signature-svg {
    width: 160px;
  }
  .signature-copy span {
    font-size: 17px;
  }
  .hero-resource {
    flex: 0 1 calc(25% - 11px);
  }
  .project-header {
    padding: 50px 28px 46px;
  }
}

@media (max-width: 720px) {
  .topbar, main, .footer-inner {
    width: min(calc(100% - 28px), var(--content-width));
  }

  .topbar {
    min-height: 86px;
    justify-content: center;
  }

  .topbar-signature {
    display: none;
  }

  .agg-logo {
    width: 42px;
    height: 42px;
  }

  .xjtu-seal {
    width: 56px;
    height: 56px;
  }

  .project-header {
    margin-top: 42px;
    padding: 42px 20px 40px;
    border-radius: 18px;
  }

  .project-header h1 { font-size: 40px; }
  .authors { font-size: 17px; }
  .publication-note { padding: 18px; }
  .publication-note p { font-size: 13px; }

  .publication-badges {
    margin: 20px auto 0;
    gap: 14px;
  }

  .venue-lines { gap: 3px; }

  .venue-logos {
    gap: 20px;
  }

  .venue-logo-siggraph { height: 42px; }

  /* on narrow screens the caption drops under the ACM logo to keep the row compact */
  .venue-acm {
    flex-direction: column;
    gap: 6px;
  }

  .venue-logo-acm { height: 36px; }

  .venue-acm-caption {
    white-space: normal;
    font-size: 10.5px;
  }

  .venue-logo-fallback { font-size: 13.5px; }
  .venue-line { font-size: 13px; }

  .hero-links {
    gap: 10px;
  }

  .hero-resource {
    flex: 0 1 calc(50% - 5px);
    min-height: 110px;
    padding: 14px;
  }

  .resource-icon {
    width: 52px;
    height: 52px;
  }

  .resource-icon svg {
    width: 30px;
    height: 30px;
  }

  .resource-title { font-size: 17px; }
  .content-section { margin-top: 72px; }
  .section-heading h2 { font-size: 29px; }

  .reading-column p {
    font-size: 16.5px;
    line-height: 1.75;
  }

  .video-card {
    padding: 12px;
    border-radius: 14px;
  }

  .video-shell { padding: 5px; }
  .acknowledgments-copy { padding: 22px 20px; }

  .footer-inner { min-height: 110px; }
  .footer-logos { gap: 16px; }
  .footer-agg { width: 46px; height: 46px; }
  .footer-xjtu-seal { width: 56px; height: 56px; }
}
