:root {
  --ink: #17202a;
  --muted: #5d6875;
  --line: #dfe4ea;
  --surface: #f2f4ea;
  --accent: #4bc1a0;
  --accent-dark: #d05657;
  --sage: #c9d1a5;
  --orange: #e1814c;
  --red: #d05657;
  --green: #167c3b;
  --joga: #4bc1a0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  color: var(--ink);
  font-family: 'Noto Sans', sans-serif;
  line-height: 1.65;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
video:focus-visible {
  border-radius: 3px;
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.skip-link {
  background: #fff;
  border-radius: 0 0 4px 0;
  color: #111;
  font-weight: 700;
  left: 0;
  padding: 0.75rem 1rem;
  position: fixed;
  top: 0;
  transform: translateY(-120%);
  transition: transform 0.15s ease;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

.section {
  padding: 6rem 1.5rem;
}

.section--compact {
  padding-bottom: 4rem;
  padding-top: 4rem;
}

.section--tinted {
  background: var(--surface);
}

.content-column {
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
}

.content-column > :last-child {
  margin-bottom: 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-family: 'Google Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.title {
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  letter-spacing: -0.025em;
}

.content-column > .title {
  line-height: 1.12;
  margin-bottom: 1.5rem;
}

.lead {
  color: #34404d;
  font-size: 1.3rem;
  line-height: 1.65;
}

.content p,
.content-column > p {
  color: #34404d;
}

.publication-hero {
  background: #101820;
  overflow: hidden;
  position: relative;
}

.publication-hero .hero-video {
  height: 100%;
  inset: 0;
  opacity: 1;
  position: absolute;
  width: 100%;
}

.publication-hero .hero-video video {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  transform: none;
  width: 100%;
}

.hero-mobile {
  display: none;
}

.overlay {
  background: linear-gradient(180deg, rgba(4, 10, 18, 0.34) 0%, rgba(4, 10, 18, 0.48) 55%, rgba(4, 10, 18, 0.62) 100%);
  inset: 0;
  position: absolute;
  z-index: 1;
}

.publication-hero .hero-body {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: absolute;
  width: 100%;
  z-index: 2;
}

.publication-hero .hero-head,
.publication-hero .hero-foot {
  position: relative;
  z-index: 3;
}

.publication-hero .navbar,
.publication-hero .navbar-menu {
  background: transparent;
}

.publication-hero .navbar-item {
  color: #fff;
}

.publication-hero .navbar-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.publication-hero-content {
  margin-left: auto;
  margin-right: auto;
  max-width: 1180px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  text-align: center;
  width: 100%;
}

.publication-title {
  color: #fff;
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(5rem, 12vw, 11rem);
  letter-spacing: 0.08em;
  line-height: 0.88;
  margin-bottom: 2rem !important;
  padding-left: 0.08em;
  text-shadow: 0 3px 30px rgba(0, 0, 0, 0.3);
}

.publication-venue {
  color: #fff;
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.55;
  margin: 2.75rem auto 1.5rem;
  max-width: none;
  padding-left: 0.06em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.publication-subtitle {
  color: #fff;
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.08;
  margin: 0 auto 1.5rem !important;
  max-width: none;
  padding-left: 0.06em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
}

.publication-subtitle-line {
  display: block;
  white-space: nowrap;
}

.publication-links {
  margin-top: 1.5rem;
}

.link-block a {
  margin: 0.25rem;
}

.publication-hero .tabs ul {
  border-bottom: 0;
}

.publication-hero .tabs a {
  background: rgba(8, 18, 30, 0.62);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}

.publication-hero .tabs a:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #17202a;
}

.team-section {
  border-bottom: 1px solid var(--line);
}

.team-grid {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.author-block {
  font-family: 'Google Sans', sans-serif;
  min-width: 0;
}

.author-block > a:last-of-type {
  display: inline;
  font-weight: 600;
}

.author-photo {
  display: block;
  margin: 0 auto 0.75rem;
  width: 112px;
}

.author-photo img {
  aspect-ratio: 1;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  width: 100%;
}

.equal-contribution {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1.25rem;
}

.affiliation-logos {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.affiliation-logos img {
  height: 55px;
  object-fit: contain;
  width: auto;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 3rem auto;
  max-width: 820px;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-top: 5px solid var(--accent);
  padding: 1.5rem;
}

.metric-value {
  color: var(--accent-dark);
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.metric-label {
  color: #45515e;
  font-size: 0.95rem;
  line-height: 1.4;
}

.abstract-block {
  border-left: 4px solid var(--accent);
  margin-top: 3.5rem;
  padding: 0.25rem 0 0.25rem 2rem;
}

.abstract-block p {
  line-height: 1.8;
  text-align: left;
}

.media-figure {
  margin: 2rem 0 0;
}

.media-figure video,
.paper-figure img,
.media-tile video {
  display: block;
  width: 100%;
}

.media-figure video,
.media-tile video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-figure--framed {
  background: #101820;
  border-radius: 8px;
  box-shadow: 0 15px 45px rgba(20, 35, 50, 0.14);
  overflow: hidden;
}

.full-bleed-media {
  background: #050708;
  display: grid;
  gap: 2px;
  margin-top: 3rem;
  width: 100%;
}

.two-up-media {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up-media {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-tile {
  background: #050708;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.media-tile figcaption {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.86));
  bottom: 0;
  color: #fff;
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(0.85rem, 1.6vw, 1.35rem);
  font-weight: 700;
  left: 0;
  line-height: 1.3;
  padding: 3rem 1rem 1rem;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

.question-band {
  background: #101820;
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}

.question-band p {
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.4;
  margin: 0 auto;
  max-width: 900px;
}

.method-steps {
  counter-reset: none;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 3rem 0;
  padding: 0;
}

.method-steps li {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  padding: 1.4rem;
}

.step-number {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 2rem;
  font-family: 'Google Sans', sans-serif;
  font-weight: 800;
  height: 2rem;
  justify-content: center;
}

.method-steps h3 {
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

.method-steps p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.paper-figure {
  margin: 3rem 0;
}

.paper-figure img {
  height: auto;
}

.paper-figure figcaption {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 1rem auto 0;
  max-width: 900px;
  text-align: center;
}

.paper-figure--plain {
  margin: 2.5rem 0 2rem;
}

.equation {
  background: var(--surface);
  border-radius: 6px;
  color: var(--ink) !important;
  font-family: 'Castoro', serif;
  font-size: 1.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  text-align: center;
}

.state-figure-grid {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 2.1fr) minmax(220px, 1fr);
}

.task-media-layout {
  align-items: stretch;
  background: #050708;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 2.3fr);
  margin-top: 3rem;
}

.task-media-grid {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-tile--tall video {
  aspect-ratio: 9 / 16;
  height: 100%;
  object-fit: cover;
}

.limitations-panel {
  align-items: start;
  border: 1px solid var(--sage);
  border-left: 6px solid var(--orange);
  border-radius: 8px;
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  padding: 2.5rem;
}

.limitations-panel .title {
  margin-bottom: 0;
}

.limitations-panel > p {
  color: #3e4955;
  font-size: 1.05rem;
}

.faq-list {
  border-bottom: 1px solid var(--line);
}

.faq-list details {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
}

.faq-list summary {
  color: var(--ink);
  cursor: pointer;
  font-family: 'Google Sans', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  list-style-position: outside;
  margin-left: 1.25rem;
  padding-left: 0.35rem;
}

.faq-list details[open] summary {
  color: var(--accent-dark);
  margin-bottom: 0.9rem;
}

.faq-list details p {
  color: #45515e;
  line-height: 1.7;
  margin-left: 1.25rem;
  max-width: 760px;
  padding-left: 0.35rem;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 3.5rem 1.5rem;
}

@media screen and (max-width: 1023px) {
  .section {
    padding-bottom: 5rem;
    padding-top: 5rem;
  }

  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 2rem;
  }

  .method-steps {
    grid-template-columns: 1fr;
  }

  .method-steps li {
    padding: 1.25rem;
  }
}

@media screen and (max-width: 768px) {
  .section,
  .section--compact {
    padding: 4rem 1.25rem;
  }

  .publication-hero .hero-body {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-desktop {
    display: none !important;
  }

  .hero-mobile {
    display: block !important;
  }

  .publication-title {
    font-size: clamp(3.6rem, 18vw, 5.5rem);
    letter-spacing: 0.06em;
    margin-bottom: 1.5rem !important;
    padding-left: 0.06em;
  }

  .publication-venue {
    font-size: clamp(1.05rem, 3.6vw, 1.3rem);
    letter-spacing: 0.045em;
    margin: 2rem auto 1.25rem;
    padding-left: 0.045em;
  }

  .publication-subtitle {
    font-size: clamp(1.15rem, 4.4vw, 1.55rem);
    letter-spacing: 0.045em;
    padding-left: 0.045em;
  }

  .publication-subtitle-line {
    white-space: normal;
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .author-photo {
    width: 96px;
  }

  .affiliation-logos {
    gap: 1.5rem;
  }

  .affiliation-logos img {
    height: 45px;
  }

  .lead {
    font-size: 1.12rem;
  }

  .metric-grid {
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 2rem 0;
  }

  .metric-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .metric-card {
    padding: 1.1rem;
  }

  .metric-label {
    font-size: 0.83rem;
  }

  .abstract-block {
    margin-top: 2.5rem;
    padding-left: 1.25rem;
  }

  .two-up-media,
  .three-up-media {
    grid-template-columns: 1fr;
  }

  .media-tile figcaption {
    font-size: 1rem;
  }

  .question-band {
    padding: 3rem 1.25rem;
  }

  .paper-figure {
    margin: 2rem 0;
  }

  .paper-figure figcaption {
    font-size: 0.8rem;
  }

  .state-figure-grid {
    grid-template-columns: 1fr;
  }

  .paper-figure--small {
    margin-left: auto;
    margin-right: auto;
    max-width: 360px;
    width: 74%;
  }

  .task-media-layout,
  .task-media-grid {
    grid-template-columns: 1fr;
  }

  .media-tile--tall video {
    aspect-ratio: 9 / 16;
    height: auto;
    object-fit: contain;
  }

  .limitations-panel {
    gap: 1.25rem;
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Figure placeholders (replace with real figures) */
.figure-placeholder {
  align-items: center;
  aspect-ratio: 16 / 7;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 0.95rem;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.state-figure-grid .figure-placeholder {
  aspect-ratio: 4 / 3;
}

/* Results tables */
.results-grid {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2.5rem 0;
}

.results-table {
  background: #fff;
  border: 1px solid var(--line);
  border-collapse: collapse;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 2rem auto;
  overflow: hidden;
  width: 100%;
}

.results-grid .results-table {
  margin: 0;
}

.results-table--wide {
  max-width: 720px;
}

.results-table--narrow {
  max-width: 560px;
}

.results-table caption {
  caption-side: top;
  color: var(--ink);
  font-weight: 600;
  padding: 0 0 0.5rem;
  text-align: left;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

.results-table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table tr.is-ours td {
  background: rgba(75, 193, 160, 0.16);
  font-weight: 700;
}

.results-table tr.is-muted td {
  color: var(--muted);
  font-style: italic;
}

@media screen and (max-width: 1023px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 768px) {
  .results-table {
    display: block;
    overflow-x: auto;
  }
}

/* Seven-author team row */
.team-grid--seven {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.team-grid--seven .author-photo {
  width: 96px;
}

@media screen and (max-width: 1023px) {
  .team-grid--seven {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

/* Full-frame videos (keep legends visible) */
.media-figure--natural video {
  aspect-ratio: auto;
  object-fit: contain;
}

.media-caption {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.75rem auto 2.5rem;
  max-width: 720px;
  text-align: center;
}

.full-bleed-media--joined {
  margin-top: 2px;
}

/* Clips cut from the technical summary are 960x444; show them uncropped */
.full-bleed-media .media-tile video {
  aspect-ratio: 960 / 444;
}

/* Paper figures */
.paper-figure--narrow {
  margin-left: auto;
  margin-right: auto;
  max-width: 640px;
}

.figure-pair {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: 2163fr 1573fr;
}

.figure-pair img {
  display: block;
  height: auto;
  width: 100%;
}

.neck-grid {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 120px;
  margin: 0 auto;
  max-width: 820px;
}

.neck-figure {
  margin: 0;
}

@media screen and (max-width: 768px) {
  .figure-pair,
  .neck-grid {
    grid-template-columns: 1fr;
  }

  .neck-figure {
    margin: 0 auto;
    max-width: 110px;
  }
}

.paper-figure--capped img {
  display: block;
  margin: 0 auto;
  max-width: 420px;
}

/* Joga brand color */
.hero.is-link .title.publication-title,
.joga-name {
  color: var(--joga);
}

/* Palette: teal #4BC1A0, sage #C9D1A5, orange #E1814C, red #D05657 */
a,
.content a {
  color: var(--red);
}

a:hover,
.content a:hover {
  color: var(--orange);
}

.hero a,
.hero a:hover,
.footer a:hover {
  color: inherit;
}

.step-number {
  color: var(--ink);
}

.section--tinted {
  border-bottom: 1px solid rgba(201, 209, 165, 0.6);
  border-top: 1px solid rgba(201, 209, 165, 0.6);
}
