*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /*outline: 1px solid red;*/
}

:root {
  --max-width: 1100px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 3rem;
  --header-height: 125px;
  --color-text: #e5e5e5;
  --color-muted: #999;
  --color-bg: #121212;
  --color-accent: #60a5fa;
  --color-indian-red: #cd5c5c;
  --color-amaranth: #9f2b68;
  --pub-lead-width: 180px;
}

html {
  font-size: 18px;
  scrollbar-gutter: stable;
}

body {
  padding: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.container {
  width: 100%;
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  /*padding: 0 var(--space-md);*/
}

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: white;
  padding: 0.75rem;
  max-width: 100%;
  border-bottom-style: double;
}

.page-title {
  text-align: center;
}

.about-profile {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
}

.profile-pic {
  width: 200px;
  height: auto;
  display: block;
  margin: auto;
}

.about-links {
  font-size: clamp(0.85rem, 2vw, 1rem);
}

.lead {
  font-size: 1.25rem;
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-accent);
}

.tagline {
  font-size: 1.25rem;
  font-style: italic;
  color: blue;
  text-align: center;
}

.accent {
  color: var(--color-accent);
  font-weight: 500;
}

.pub {
  display: grid;
  grid-template-columns: var(--pub-lead-width) 1fr; /* fixed left, flexible right */
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  align-items: start;
}

.pub-info {
  align-items: center;
}

.pub-venue-lead {
  width: var(--pub-lead-width);
  border: 1px solid black;
  text-align: center;
  border-radius: 5px;
}

.pub-paper-page-title,
.pub-title {
  color: var(--color-accent);
}

.pub-venue {
  font-style: italic;
  margin: 0;
}

.pub-info > .pub-venue {
  color: var(--color-amaranth);
}

.pub-details h3 {
  margin-top: 0; /* align with top of the box */
  font-size: 1.1rem;
}

.pub-authors {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}

.pub-author-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 2rem;
  row-gap: 0.5rem;
  max-width: 800px;
  margin-inline: auto;
  text-align: center;
}

.pub-info-affiliations {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  color: #555;
}

.pub-info-affiliations-grid {
  text-align: center;
}

.pub-info-affiliation-entry {
  display: inline-block;
  vertical-align: top;
  max-width: 100%;
  margin: 0.5rem 1.25rem;
  text-align: center;

  color: var(--color-indian-red);
}

.pub-author-notes {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
}

.pub-author-grid-author,
.pub-info-affiliations > span,
.pub-author-notes > span {
  white-space: nowrap;
}

.my-name {
  text-decoration: underline;
  color: black;
}

.pub-links {
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.paper-abstract {
  text-align: justify;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) 0;
  border-top: 1px solid #e5e7eb;
  color: var(--color-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

@keyframes colorChange {
  0% {
    color: white;
    background-color: green;
  }
  50% {
    color: green;
    background-color: white;
  }
  100% {
    color: white;
    background-color: green;
  }
}

.flashing-text {
  padding: var(--space-xs);
  border-radius: 5px;
  font-weight: bold;
  animation: colorChange 1.5s linear infinite;
}

.plain-link {
  text-decoration: none;
  color: inherit;
}

.center-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-inline: auto;
  text-align: center;
  width: 100%;
  max-width: var(--max-width);
}

.center-items > * {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.video {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
}

.video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
}

.citation {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
}

.citation-hint {
  font-size: 0.9rem;
  color: #666;
}

.bibtex {
  text-align: left;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  user-select: all;
  cursor: pointer;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

h2.pub-paper-page-title {
  margin-top: var(--space-md);
}

h3 {
  font-size: 1.2rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  font-style: italic;
  color: grey;
}

p {
  margin: var(--space-md) 0;
}

a {
  cursor: pointer !important;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
}

section {
  margin-bottom: var(--space-sm);
}

table {
  width: 100%;
}

td,
th {
  padding: 0.25rem 0.5rem;
  text-align: left;
}

section[id] {
  scroll-margin-top: var(--header-height);
}

/* Stack utility — even spacing between direct children */
.stack > * + * {
  margin-top: var(--space-lg);
}

/* Responsive type scale */
@media (max-width: 600px) {
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  .pub {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .pub-info-affiliations {
    font-size: 0.85rem;
  }

  .bibtex {
    font-size: 0.75rem;
  }
}

@media (max-width: 425px) {
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    text-align: center;
  }

  tr {
    margin-bottom: var(--space-sm);
  }

  td,
  th {
    padding: 0;
  }

  .pub-info-affiliations {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flashing-text {
    animation: none;
  }
}
