/* Modern CSS Variables for consistent theming */
:root {
  --primary-color: #111827;
  --primary-hover: #374151;
  --secondary-color: #64748b;
  --accent-color: #6b7280;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #111827 0%, #4b5563 100%);
  --gradient-accent: linear-gradient(135deg, #111827 0%, #6b7280 100%);
  --gradient-subtle: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
  --border-radius: 8px;
  --border-radius-lg: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* Modern Button Styles */
.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}

.button.is-dark {
  background: var(--text-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}

.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-color) !important;
}

.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.footer .icon-link {
    font-size: 25px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer .icon-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.link-block a {
    margin: 8px 4px;
}

.dnerf {
  font-variant: small-caps;
}


/* Hero Section Modernization */
.hero {
  position: relative;
  overflow: hidden;
}

.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.hero-body {
  padding: 4rem 1.5rem;
}

/* Publication Content Styling */
.publication-title {
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin-bottom: 2rem !important;
    line-height: 1.1 !important;
}

.title-emoji {
  width: 1.25em;
  height: 1.25em;
  object-fit: contain;
  vertical-align: -0.24em;
  margin: 0 0.04em 0 0.1em;
}

.inline-emoji {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  vertical-align: -0.32em;
  margin: 0 0.08em;
}

.title-colon {
  margin-left: 0.02em;
}

.title-rest {
  display: block;
}

.publication-banner {
  max-height: 70vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 2rem 0;
}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.publication-header .hero-body {
  padding: 6rem 1.5rem 4rem;
}

.publication-authors {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500;
    max-width: 900px;
    margin: 0 auto 0.6rem;
    line-height: 1.6;
}

.publication-authors sup,
.publication-affiliations sup,
.publication-note sup {
    font-size: 0.7em;
    font-weight: 600;
    margin-left: 0.05em;
}

.publication-affiliations {
    max-width: 900px;
    margin: 0 auto 0.5rem;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.affiliation-block {
    display: inline-block;
    margin: 0 0.75rem 0.15rem 0;
    white-space: nowrap;
}

.publication-note {
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.publication-venue {
    color: var(--text-secondary);
    width: fit-content;
    font-weight: 600;
    background: var(--background-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    display: inline-block;
}

.publication-awards {
    color: var(--text-primary);
    width: fit-content;
    font-weight: 700;
    background: var(--background-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--text-primary);
    margin-top: 1rem;
}

.publication-authors a {
   color: var(--primary-color) !important;
   text-decoration: none;
   font-weight: 600;
   transition: var(--transition);
   position: relative;
}

.publication-authors a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--gradient-accent);
    transition: var(--transition);
}

.publication-authors a:hover::after {
    width: 100%;
}

.publication-authors a:hover {
    color: var(--primary-hover) !important;
}

.author-block {
  display: inline-block;
  margin-right: 0.5rem;
}

.publication-banner img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.publication-banner img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* Modern Video and Carousel Styling */
.publication-body img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.publication-body img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.results-carousel {
  overflow: hidden;
  padding: 1rem 0;
}

.results-carousel .item {
  margin: 1rem;
  overflow: hidden;
  padding: 1.5rem;
  font-size: 0;
  background: var(--background-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.results-carousel .item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.results-carousel .item img,
.results-carousel video {
  margin: 0;
  border-radius: var(--border-radius);
  width: 100%;
  height: auto;
}

.results-carousel .subtitle {
  font-size: 1rem !important;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-weight: 500;
}

/* Pagination and Misc Improvements */
.slider-pagination .slider-page {
  background: var(--primary-color);
  border-radius: 50%;
  transition: var(--transition);
}

.slider-pagination .slider-page.is-active {
  background: var(--primary-hover);
  transform: scale(1.2);
}

.eql-cntrb { 
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

/* Section Titles */
.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* Content Improvements */
.content.has-text-justified {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content.has-text-justified p {
  margin-bottom: 1.5rem;
}

/* PhysCaP project structure */
.publication-subtitle {
  max-width: 820px;
  margin: -0.75rem auto 1.75rem;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.6;
}

.page-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.page-nav a {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.page-nav a:hover,
.page-nav a:focus {
  color: var(--text-primary);
  background: var(--background-accent);
}

.project-section {
  scroll-margin-top: 4.5rem;
}

.media-placeholder,
.figure-placeholder,
.video-placeholder {
  min-height: 260px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--border-radius-lg);
  background: var(--gradient-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.media-placeholder-large {
  min-height: 420px;
  aspect-ratio: 16 / 9;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  background: var(--gradient-primary);
  font-size: 1.75rem;
}

.placeholder-title {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 800;
}

.placeholder-copy {
  max-width: 620px;
  margin: 0 auto 1rem;
}

.placeholder-path {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: var(--border-radius);
  background: rgb(255 255 255 / 0.7);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.85rem;
}

.main-figure-shell {
  max-width: 1000px;
  margin: 0 auto;
}

.figure-placeholder {
  min-height: 520px;
}

.figure-media {
  width: 100%;
  aspect-ratio: 2.2 / 1;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--background-primary);
  box-shadow: var(--shadow-md);
}

.figure-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eval-figure-shell {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background: var(--background-primary);
  box-shadow: var(--shadow-md);
  padding: 1rem;
}

.eval-figure-shell img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

.figure-caption,
.table-note {
  max-width: 880px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
}

.method-grid,
.task-grid,
.video-grid,
.metric-row {
  display: grid;
  gap: 1rem;
}

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

.main-figure-shell + .method-grid {
  margin-top: 1.5rem;
}

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

.metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.method-card,
.task-card,
.video-card,
.metric-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-primary);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.task-card {
  min-height: 260px;
}

.task-card--visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fbfdff;
  transition: var(--transition);
}

.task-card--visual::before,
.task-card--visual::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.task-card--visual::before {
  z-index: 0;
  background-image: var(--task-image);
  background-position: var(--task-position, center);
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.75;
  filter: saturate(0.85) contrast(0.92);
  mix-blend-mode: multiply;
  transition: opacity 0.25s ease, filter 0.25s ease, background-size 0.25s ease, background-position 0.25s ease;
}

.task-card--visual::after {
  z-index: 1;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.95) 0%, rgb(255 255 255 / 0.78) 46%, rgb(255 255 255 / 0.42) 100%),
    linear-gradient(180deg, rgb(255 255 255 / 0.82) 0%, rgb(255 255 255 / 0.28) 100%);
  transition: opacity 0.25s ease;
}

.task-card--visual > * {
  position: relative;
  z-index: 2;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.task-card--visual:hover,
.task-card--visual:focus {
  border-color: rgb(100 116 139 / 0.38);
  box-shadow: var(--shadow-lg);
}

.task-card--visual:hover::before,
.task-card--visual:focus::before {
  background-color: var(--background-primary);
  background-position: center;
  background-size: contain;
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
}

.task-card--visual:hover::after,
.task-card--visual:focus::after {
  opacity: 0;
}

.task-card--visual:hover > *,
.task-card--visual:focus > * {
  opacity: 0;
  transform: translateY(-4px);
}

.task-card--visual:focus-visible {
  outline: 3px solid rgb(37 99 235 / 0.28);
  outline-offset: 3px;
}

.task-card--blue-cubes {
  --task-image: url('../images/experiment-blue-cubes.png');
  --task-position: 54% 66%;
}

.task-card--empty-cans {
  --task-image: url('../images/experiment-empty-cans.png');
  --task-position: 50% 62%;
}

.task-card--avocado {
  --task-image: url('../images/experiment-avocado.png');
  --task-position: center 54%;
}

.task-card--simulation {
  --task-image: url('../images/experiment-simulation.png');
  --task-position: center 48%;
}

.method-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  color: white;
  background: var(--gradient-primary);
}

.method-card h3,
.task-card h3,
.video-card h3 {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
}

.method-card p,
.task-card p,
.video-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.task-kicker {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card {
  text-align: center;
  background: var(--background-secondary);
}

.metric-value {
  display: block;
  color: var(--text-primary);
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}

.metric-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  background: var(--background-primary);
}

.results-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: center;
  vertical-align: middle;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
  font-weight: 800;
}

.results-table th {
  background: var(--background-accent);
  color: var(--text-primary);
  font-weight: 800;
}

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

.results-table th:last-child,
.results-table td:last-child {
  border-right: 0;
}

.highlight-row td {
  background: #f3f4f6;
}

.video-card {
  padding: 0;
  overflow: hidden;
}

.video-card h3,
.video-card p {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.video-card h3 {
  padding-top: 1rem;
}

.video-card p {
  padding-bottom: 1.25rem;
}

.video-placeholder {
  min-height: 220px;
  border-width: 0 0 1px 0;
  border-style: solid;
  border-color: var(--border-color);
  border-radius: 0;
  gap: 0.85rem;
  font-weight: 700;
}

.video-placeholder i {
  color: var(--primary-color);
  font-size: 2rem;
}

.video-placeholder span {
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.demo-subsection {
  margin: 2rem 0 1rem;
  text-align: center;
}

.demo-subsection:first-of-type {
  margin-top: 0;
}

.demo-subsection h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 800;
}

.demo-subsection-note {
  max-width: 620px;
  margin: 0.55rem auto 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.demo-subsection--simulation {
  margin-top: 2.5rem;
}

.demo-task-grid {
  display: grid;
  gap: 1.25rem;
}

.demo-card,
.simulation-demo-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-primary);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.demo-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  grid-template-areas:
    "preview header"
    "preview footer";
}

.demo-card-header {
  grid-area: header;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
}

.demo-card-header h3,
.simulation-demo-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 800;
}

.demo-select-label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-select-label select {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-secondary);
  color: var(--text-primary);
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.demo-preview {
  grid-area: preview;
  position: relative;
  display: block;
  width: 100%;
  min-height: 280px;
  border: 0;
  border-right: 1px solid var(--border-color);
  padding: 0;
  background: #0f172a;
  overflow: hidden;
}

.demo-preview video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.demo-select-label select:focus-visible,
.demo-code-link:focus-visible,
.demo-modal-close:focus-visible {
  outline: 3px solid rgb(37 99 235 / 0.28);
  outline-offset: 3px;
}

.demo-card-footer {
  grid-area: footer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem;
}

.demo-card-footer p,
.simulation-demo-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.demo-code-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 800;
  text-decoration: none;
}

.demo-code-link {
  width: fit-content;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-secondary);
  padding: 0.55rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.demo-code-link:hover {
  color: var(--primary-hover);
}

.simulation-demo-grid {
  display: grid;
  gap: 1rem;
}

.simulation-demo-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) 1fr;
  align-items: center;
}

.simulation-demo-card video,
.simulation-baseline-card video {
  display: block;
  width: 100%;
  background: #0f172a;
}

.simulation-demo-card video {
  height: 100%;
  min-height: 220px;
  border-right: 1px solid var(--border-color);
  object-fit: cover;
}

.simulation-demo-card > div:last-child {
  padding: 1.25rem;
}

.simulation-baseline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.simulation-baseline-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-primary);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.simulation-baseline-card video {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.simulation-baseline-card > div {
  padding: 1rem;
}

.simulation-baseline-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
}

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.demo-modal[hidden] {
  display: none;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.68);
}

.demo-modal-dialog {
  position: relative;
  width: min(1180px, calc(100vw - 2rem));
  height: min(780px, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  border-radius: var(--border-radius);
  background: var(--background-primary);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.demo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
}

.demo-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
}

.demo-modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

.demo-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  flex: 1;
  min-height: 0;
}

.demo-modal-video {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  object-fit: contain;
}

.demo-code-pane {
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--border-color);
  background: var(--background-secondary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.demo-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-weight: 800;
}

.demo-code-toolbar a {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.demo-code-toolbar a:hover,
.demo-code-toolbar a:focus {
  color: var(--text-primary);
}

.demo-code-block {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre;
  overscroll-behavior: contain;
}

.demo-code-block code {
  display: block;
  min-width: max-content;
  color: inherit;
  background: transparent;
  font: inherit;
}

body.demo-modal-open {
  overflow: hidden;
}

/* Footer Improvements */
.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
}

.footer .content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
}

.scroll-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}


/* More Works Dropdown */
.more-works-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
}

.more-works-btn {
  background: var(--background-primary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
}

.more-works-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--background-secondary);
  border-color: var(--primary-color);
}

.more-works-btn .dropdown-arrow {
  transition: var(--transition);
  font-size: 0.8rem;
}

.more-works-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.more-works-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  max-height: 70vh;
  overflow-y: auto;
}

.more-works-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--background-accent);
  color: var(--text-primary);
}

.works-list {
  padding: 1rem;
}

.work-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.work-item:hover {
  background: var(--background-accent);
  transform: translateX(4px);
}

.work-info h5 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.work-info p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.work-venue {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.work-item .fas {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}


/* Mobile Responsive Improvements */
@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }
  
  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }
  
  .publication-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }

  .title-emoji {
    width: 1.16em;
    height: 1.16em;
    vertical-align: -0.22em;
  }
  
  .publication-authors {
    font-size: 1rem !important;
  }

  .publication-affiliations {
    font-size: 0.875rem !important;
  }

  .affiliation-block {
    margin-right: 0.6rem;
    white-space: normal;
  }

  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }
  
  .more-works-container {
    bottom: 2rem;
    right: 1rem;
    top: auto;
  }
  
  .more-works-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
  
  .more-works-dropdown {
    width: calc(100vw - 2rem);
    right: -1rem;
    bottom: calc(100% + 0.5rem);
    top: auto;
  }
  
  .results-carousel .item {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .content.has-text-justified {
    font-size: 1rem;
  }

  .page-nav {
    gap: 0.35rem;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .page-nav a {
    white-space: nowrap;
  }

  .media-placeholder,
  .figure-placeholder {
    padding: 1.25rem;
    min-height: 300px;
  }

  .media-placeholder-large {
    min-height: 300px;
    aspect-ratio: auto;
  }

  .figure-placeholder {
    min-height: 340px;
  }

  .figure-media {
    min-height: 260px;
    aspect-ratio: 1.4 / 1;
  }

  .method-grid,
  .task-grid,
  .video-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .demo-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "preview"
      "footer";
  }

  .demo-card-header {
    padding: 1.25rem 1.25rem 0;
  }

  .demo-preview {
    border-right: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    min-height: 220px;
  }

  .demo-preview video {
    min-height: 220px;
  }

  .simulation-demo-card {
    grid-template-columns: 1fr;
  }

  .simulation-demo-card video {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    min-height: 0;
    aspect-ratio: 800 / 512;
  }

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

  .demo-modal-dialog {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    max-height: calc(100vh - 1rem);
    margin: 0.5rem auto;
  }

  .demo-modal-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 38vh) minmax(0, 1fr);
    overflow: hidden;
  }

  .demo-modal-video {
    min-height: 0;
    height: 100%;
    aspect-ratio: 720 / 486;
  }

  .demo-code-pane {
    border-left: 0;
    border-top: 1px solid var(--border-color);
    min-height: 0;
  }

  .results-table {
    font-size: 0.82rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.6rem;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 2rem !important;
  }
  
  .hero-body {
    padding: 1.5rem 0.75rem;
  }
  
  .more-works-container {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 1000;
  }
  
  .more-works-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .more-works-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0;
    width: calc(100vw - 2rem);
    max-width: 90vw;
  }
  
  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .button {
    width: 100%;
    justify-content: center;
  }

  .publication-subtitle {
    font-size: 1rem;
  }

  .placeholder-title {
    font-size: 1.1rem;
  }

  .placeholder-path,
  .video-placeholder span {
    font-size: 0.74rem;
  }

  .metric-value {
    font-size: 1.65rem;
  }

  .simulation-baseline-grid {
    grid-template-columns: 1fr;
  }
}

/* Tablet Responsive */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .hero-body {
    padding: 3rem 2rem;
  }
  
  .publication-header .hero-body {
    padding: 4rem 2rem 3rem;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero, .section {
  animation: fadeInUp 0.6s ease-out;
}

/* Improved focus states for accessibility */
.button:focus,
.related-works-btn:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}


/* Print styles */
@media print {
  .more-works-container {
    display: none;
  }
  
  .hero, .section {
    animation: none;
  }
  
  .button {
    background: transparent !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
  }
}
