/* LIT project page — refined academic layout */
:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-hover: #1e40af;
  --glow: rgba(29, 78, 216, 0.12);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 920px;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.35rem;
}

/* Sticky top bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  min-height: 52px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.top-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.15rem 0;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav a {
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.top-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

/* Hero */
header.hero {
  position: relative;
  text-align: center;
  padding: 3rem 1rem 3.25rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--glow), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(99, 102, 241, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(14, 165, 233, 0.07), transparent 45%),
    linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.2vw, 2.35rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.65rem;
  max-width: min(100%, 38rem);
  margin-left: auto;
  margin-right: auto;
}

.title-accent {
  background: linear-gradient(120deg, var(--accent) 0%, #6366f1 45%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--muted);
  font-weight: 500;
  max-width: 36rem;
  margin: 0 auto 1.35rem;
  line-height: 1.5;
}

.authors {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.35rem;
}

.authors sup {
  font-size: 0.65em;
  font-weight: 600;
}

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  text-decoration: none;
  color: var(--ink);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #4338ca 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
}

.btn.primary:hover {
  color: #fff;
  filter: brightness(1.05);
}

/* Main sections */
main.wrap {
  padding-bottom: 3rem;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.6rem 1.85rem;
  margin-bottom: 1.35rem;
}

.section-card:first-of-type {
  margin-top: 0.5rem;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.75rem 0 0.65rem;
}

.results-h3 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 2rem;
}

.results-h3:first-of-type {
  margin-top: 0.25rem;
}

.results-h3 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--accent-soft);
  color: var(--accent);
}

p {
  margin: 0 0 1rem;
}

.abstract-box {
  margin: 0;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid var(--accent);
}

.abstract-box p:last-child {
  margin-bottom: 0;
}

.figure {
  margin: 1.35rem 0 1.5rem;
}

.figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}

.card .figure img {
  box-shadow: none;
  border-color: #e2e8f0;
}

.caption-link {
  font-weight: 600;
  margin-left: 0.35rem;
  white-space: nowrap;
}

.caption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.5;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 0.5rem;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-fallback {
  text-align: center;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}

.grid-robust {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.1rem;
  margin-top: 1rem;
}

.robust-right {
  display: grid;
  grid-template-rows: auto auto;
  gap: 1.1rem;
}

@media (max-width: 640px) {
  .grid-robust {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card .figure {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
}

th,
td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tbody tr:hover td {
  background: rgba(241, 245, 249, 0.65);
}

tr:last-child td {
  border-bottom: none;
}

td strong {
  color: var(--accent);
  font-weight: 700;
}

.section-paper .paper-lead {
  font-size: 1rem;
}

.inline-link {
  font-weight: 700;
}

.bib-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.btn-copy {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-sans);
  border-radius: 8px;
  border: 1px solid #334155;
  background: #334155;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-copy:hover {
  background: #475569;
}

pre.bib {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  padding: 1.1rem 1rem 1.1rem 1rem;
  padding-right: 4.5rem;
  overflow-x: auto;
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  margin: 0;
  border: 1px solid #334155;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

footer.site {
  background: var(--ink);
  color: #94a3b8;
  padding: 2.5rem 1rem;
  margin-top: 0.5rem;
}

.footer-inner {
  text-align: center;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 0.5rem;
}

.footer-meta {
  font-size: 0.88rem;
  margin: 0;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

footer.site code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #e2e8f0;
}

@media (max-width: 640px) {
  h1 {
    max-width: none;
  }

  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    width: 100%;
    padding-bottom: 0.15rem;
  }

  .section-card {
    padding: 1.35rem 1.1rem;
  }
}
