/* ================================================================
   IMPACT — Paper Website Stylesheet
   ================================================================ */

:root {
  --clr-blue: #2f5fa8;
  --clr-blue-dark: #23477f;
  --clr-blue-soft: #dce8ff;
  --clr-red: #c84652;
  --clr-red-dark: #a93440;
  --clr-red-soft: #ffe0df;
  --bg-page: #fbf7f8;
  --bg-white: #ffffff;
  --text-base: #172033;
  --text-muted: #5f6b7f;
  --border: rgba(72, 83, 111, .16);
  --shadow-sm: 0 1px 4px rgba(34, 45, 75, .07);
  --shadow-md: 0 12px 34px rgba(34, 45, 75, .10);
  --r-sm: 6px;
  --r-md: 8px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --t: .25s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-base);
  background:
    linear-gradient(120deg, rgba(47, 95, 168, .08), transparent 32%),
    linear-gradient(240deg, rgba(200, 70, 82, .09), transparent 36%),
    linear-gradient(180deg, #fffafa 0%, #f7f9ff 47%, #fff6f5 100%);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-blue);
  text-decoration: none;
  transition: color var(--t);
}

a:hover {
  color: var(--clr-red);
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}

sup {
  font-size: .65em;
  vertical-align: super;
}

.container {
  width: min(1280px, 94vw);
  margin-inline: auto;
}

.container--narrow {
  width: min(980px, 94vw);
  margin-inline: auto;
}

.section {
  padding-block: 70px;
}

.bg-offwhite {
  background:
    linear-gradient(135deg, rgba(220, 232, 255, .58), rgba(255, 224, 223, .52)),
    #fbf7f8;
}

.section-heading {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 700;
  color: var(--text-base);
  text-align: center;
  margin-bottom: .8rem;
  letter-spacing: 0;
}

.section-lead {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 2.2rem;
  line-height: 1.65;
}

.hero {
  position: relative;
  overflow: hidden;
  background: #fffafa;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, rgba(47, 95, 168, .18) 0%, rgba(47, 95, 168, .06) 28%, transparent 52%),
    linear-gradient(238deg, rgba(200, 70, 82, .16) 0%, rgba(200, 70, 82, .07) 31%, transparent 58%),
    linear-gradient(180deg, #fffefe 0%, #f8f6fb 55%, #fff3f2 100%);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 32, 51, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, .032) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,.12));
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-block: 48px 64px;
}

.acceptance-note {
  color: var(--clr-red-dark);
  font-family: var(--font-head);
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 700;
  margin-bottom: 1.1rem;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 3.1vw, 2.9rem);
  font-weight: 700;
  color: var(--text-base);
  line-height: 1.16;
  max-width: 1280px;
  margin-inline: auto;
  margin-bottom: 1.55rem;
  letter-spacing: 0;
}

.title-line {
  display: block;
}

.title-acronym {
  background: linear-gradient(105deg, var(--clr-blue) 0%, var(--clr-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.author-list {
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  color: #2f3b50;
  margin-bottom: .45rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  row-gap: .2rem;
}

.author-link {
  color: #2f3b50;
  font-weight: 600;
}

a.author-link {
  border-bottom: 1px solid rgba(47, 95, 168, .26);
}

a.author-link:hover {
  color: var(--clr-blue);
  border-bottom-color: rgba(200, 70, 82, .45);
}

.affil-list {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

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

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 600;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(72, 83, 111, .18);
  color: #2f3b50;
  box-shadow: var(--shadow-sm);
  transition: background var(--t), border-color var(--t), transform var(--t), color var(--t), box-shadow var(--t);
}

.hero-btn:hover {
  background: #ffffff;
  border-color: rgba(47, 95, 168, .35);
  color: var(--clr-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hero-btn--primary {
  background: linear-gradient(105deg, var(--clr-blue), var(--clr-red));
  border-color: transparent;
  color: #fff;
}

.hero-btn--primary:hover {
  color: #fff;
  border-color: transparent;
}

.arxiv-mark {
  font-family: var(--font-head);
  font-size: .86em;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.hero-btn--disabled {
  color: rgba(47, 59, 80, .7);
  cursor: default;
}

.hero-btn--disabled:hover {
  color: rgba(47, 59, 80, .7);
  border-color: rgba(72, 83, 111, .18);
  box-shadow: var(--shadow-sm);
  transform: none;
}

.hero-abstract {
  max-width: 1080px;
  margin-inline: auto;
  text-align: left;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(72, 83, 111, .14);
  border-radius: var(--r-md);
  box-shadow: 0 16px 46px rgba(76, 63, 93, .10);
  padding: clamp(1.2rem, 3vw, 2rem);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-abstract h2 {
  font-family: var(--font-head);
  font-size: 1.18rem;
  color: var(--clr-red-dark);
  margin-bottom: .85rem;
  letter-spacing: 0;
}

.hero-abstract p {
  font-size: 1rem;
  line-height: 1.82;
  color: #273248;
}

.hero-abstract p + p {
  margin-top: 1rem;
}

.smallcaps {
  font-variant-caps: small-caps;
  font-weight: 700;
}

.teaser-section {
  background: linear-gradient(180deg, rgba(255, 250, 250, .9), rgba(247, 249, 255, .72));
  padding-block: 48px 64px;
}

.teaser-video-wrap,
.extra-video-wrap {
  max-width: 1080px;
  margin-inline: auto;
}

.video-section-title {
  font-family: var(--font-head);
  font-size: clamp(1.14rem, 1.6vw, 1.3rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-base);
  text-align: center;
  letter-spacing: 0;
  margin: 2.85rem auto .45rem;
}

.video-section-title:first-of-type {
  margin-top: 0;
}

.paper-video,
.three-video-item video {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  background: #ffffff;
  border: 1px solid rgba(72, 83, 111, .14);
  box-shadow: var(--shadow-md);
}

.allegro-mobile-animation {
  display: none;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .allegro-video-mount {
    display: none;
  }

  .allegro-mobile-animation {
    display: block;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

.teaser-caption {
  text-align: center;
  font-size: .92rem;
  color: var(--text-muted);
  margin-top: .8rem;
  max-width: 700px;
  margin-inline: auto;
  line-height: 1.55;
}

.three-video-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 0;
}

.three-video-item {
  width: 100%;
}

.three-video-caption {
  margin-top: .6rem;
  text-align: center;
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.bibtex-box {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(72, 83, 111, .16);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.bibtex-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: linear-gradient(105deg, rgba(220, 232, 255, .78), rgba(255, 224, 223, .74));
  border-bottom: 1px solid rgba(72, 83, 111, .14);
}

.bibtex-label-pill {
  font-size: .75rem;
  font-weight: 700;
  color: var(--clr-blue-dark);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-white);
  border: 1px solid rgba(72, 83, 111, .18);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: .82rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--t);
}

.copy-btn:hover {
  color: var(--clr-blue);
  border-color: rgba(47, 95, 168, .34);
}

.copy-btn.copied {
  color: #147a45;
  border-color: rgba(20, 122, 69, .28);
}

#bibtex-code {
  font-family: var(--font-mono);
  font-size: .875rem;
  line-height: 1.7;
  color: var(--text-base);
  background: #ffffff;
  padding: 1.4rem 1.6rem;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.logo-footer {
  background:
    linear-gradient(180deg, rgba(251, 247, 248, .82), rgba(255, 255, 255, .96)),
    #ffffff;
  border-top: 1px solid rgba(72, 83, 111, .12);
  padding-block: 42px 48px;
}

.logo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 4vw, 3.6rem);
  flex-wrap: wrap;
}

.footer-logo {
  display: block;
  width: auto;
  max-width: min(210px, 42vw);
  height: 54px;
  object-fit: contain;
  border-radius: 0;
  filter: saturate(.95);
}

.footer-logo--pearl {
  height: 70px;
}

.footer-logo--wide {
  max-width: min(260px, 52vw);
}

.footer-logo--rig {
  height: 48px;
  max-width: min(180px, 42vw);
}

.footer-logo--funding {
  height: 66px;
  max-width: min(230px, 52vw);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s ease, transform .65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (min-width: 1180px) {
  .title-line {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .hero-inner {
    padding-block: 34px 44px;
  }

  .author-sep {
    display: none;
  }

  .author-list {
    flex-direction: column;
  }

  .hero-links {
    gap: .5rem;
  }

  .hero-btn {
    flex: 1 1 calc(50% - .5rem);
    justify-content: center;
    min-width: 140px;
  }

  .three-video-row {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 58px;
  }

  .logo-footer {
    padding-block: 34px 40px;
  }

  .footer-logo,
  .footer-logo--funding {
    height: 46px;
  }

  .footer-logo--pearl {
    height: 58px;
  }
}

@media (max-width: 480px) {
  .container,
  .container--narrow {
    width: min(94vw, 1280px);
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-btn {
    flex-basis: 100%;
  }

  #bibtex-code {
    font-size: .78rem;
    padding: 1rem;
  }
}
