 @font-face {
  font-family: 'blue_highway';
  src: url('/static/fonts/BlueHighwayRg.otf') format('opentype');
  font-weight: normal; /* Adjust if it's Bold, Light, etc. */
  font-style: normal;
  font-display: swap;  /* Shows fallback font while your local font loads */
}

:root {
  /* --bg:          #f5f3ef; */
  --bg:          #ffffff;
  --bg-alt:      #ede9e3;
  --ink:         #1a1814;
  --ink-mid:     #4a4640;
  --ink-light:   #8a847c;
  --accent:      #1a3a5c;
  --accent-warm: #1a80c4;
  --rule:        #d6d0c8;
  --mono-bg:     #1a1814;
  --mono-fg:     #e8e2d8;

  --font-display: 'blue_highway', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Fira Mono', monospace;

  --max-w: 860px;
  --gap:   2rem;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-warm); }
sup { font-size: 0.65em; vertical-align: super; }

/* ── LAYOUT HELPERS ──────────────────────────────────────────── */
.content-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-divider {
  max-width: var(--max-w);
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--rule);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::after {
  content: '';
  display: block;
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-intro {
  color: var(--ink-mid);
  margin-bottom: 2rem;
  max-width: 62ch;
}

/* ── SITE HEADER ─────────────────────────────────────────────── */
.site-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  display: flex;
  justify-content: flex-end;
}

.venue-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  border: 1px solid var(--rule);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.paper-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.75rem;
}
.paper-title em {
  font-style: italic;
  color: var(--accent);
}

/* Authors */
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
}
.author { color: var(--ink-mid); white-space: nowrap; }
.author a { color: inherit; }
.author a:hover { color: var(--accent); }

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 2.25rem;
}

/* Link buttons */
.link-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.25rem;
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-mid);
  text-decoration: none;
  background: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  cursor: pointer;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: #fff;
}

/* ── TEASER ──────────────────────────────────────────────────── */
.teaser {
  max-width: calc(var(--max-w) + 160px); /* slightly wider than body */
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  animation: fadeUp 0.8s 0.15s ease both;
}

.teaser-frame {
  width: 100%;
  background: var(--ink);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(26,24,20,0.14), 0 2px 8px rgba(26,24,20,0.08);
}

.teaser-img {
  width: 100%;
  height: auto;
  display: block;
  /* Remove the line below once you have a real image: */
  min-height: 340px;
  object-fit: cover;
  background: #0e1520;
}

/* Placeholder shimmer for missing image */
.teaser-img[src="images/teaser.gif"] {
  background: linear-gradient(
    110deg,
    #0e1520 30%,
    #162030 50%,
    #0e1520 70%
  );
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.teaser-caption {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-light);
  text-align: center;
  max-width: 72ch;
  margin-inline: auto;
  line-height: 1.6;
}
.teaser-caption strong {
  color: var(--ink-mid);
  font-weight: 500;
}

/* ── ABSTRACT ────────────────────────────────────────────────── */
.abstract-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-mid);
  max-width: 68ch;
}

/* ── KEY IDEAS GRID ──────────────────────────────────────────── */
.key-ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.idea-card {
  background: var(--bg);
  padding: 1.75rem;
  transition: background 0.15s;
}
.idea-card:hover { background: var(--bg-alt); }

.idea-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-warm);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.idea-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.idea-card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.65;
}

/* ── FIGURE GRID ─────────────────────────────────────────────── */
.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.fig-item {
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.fig-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--bg-alt);
  /* Placeholder look for missing images */
  min-height: 180px;
}

.fig-wide { grid-column: 1 / -1; }
.fig-wide img { height: 320px; }

figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.5;
  border-top: 1px solid var(--rule);
}
figcaption em { font-style: italic; }

/* ── VIDEO ───────────────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--ink);
  box-shadow: 0 4px 24px rgba(26,24,20,0.12);
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── CITATION ────────────────────────────────────────────────── */
.citation-block {
  position: relative;
  background: var(--mono-bg);
  border-radius: 5px;
  overflow: hidden;
}

#citation-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--mono-fg);
  line-height: 1.75;
  padding: 1.5rem 1.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  color: var(--mono-fg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s;
}
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn:hover { background: rgba(255,255,255,0.16); }
.copy-btn.copied { color: #7ecfa0; border-color: #7ecfa040; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--ink-light);
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.site-footer a { color: var(--ink-light); }
.site-footer a:hover { color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .paper-title { font-size: 2.2rem; }
  .key-ideas-grid { grid-template-columns: 1fr; }
  .figure-grid { grid-template-columns: 1fr; }
  .fig-wide { grid-column: auto; }
  .fig-wide img { height: 220px; }
}


/* Force everything into a single, un-wrapped row */
.figure-row-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 24px 0;
}

.subfloat-box {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Base proportions matching LaTeX columnwidths (0.195 * 2 = 39%, 0.195 = 19.5%) */
.uncorrected-box,
.corrected-box {
  flex: 0 0 40%; 
}

.reference-box {
  flex: 0 0 20%;
}

/* Inner layout for the image pairs */
.image-pair {
  display: flex;
  width: 100%;
  gap: 4px;
}

.subfloat-img {
  flex: 1;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Captions underneath */
.subfloat-box figcaption {
  font-size: 0.85rem;
  color: #555;
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}