/* --- Layout --- */
.link-carousel {
  position: relative;
  margin: 24px auto;
  max-width: 1100px;
  background: #0a0a0a;
  border-radius: 14px;
  padding: 16px 8px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  color: #fff;
}

.link-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 8px 12px;
}

.link-controls { display: flex; gap: 8px; }
.link-nav {
  border: none; border-radius: 10px; padding: 8px 12px; cursor: pointer;
  background: rgba(255,255,255,.08);
  transition: transform .15s ease, background .15s ease;
}
.link-nav:hover { transform: translateY(-1px); background: rgba(255,255,255,.14); }

/* Rail */
.link-rail {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 6px 8px 8px;
}

/* Hide default scrollbars (keeps scroll accessible) */
.link-rail::-webkit-scrollbar { height: 0; }
.link-rail { scrollbar-width: none; }

/* Card */
.link-card {
  scroll-snap-align: start;
  flex: 0 0 clamp(240px, 32vw, 320px);
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 160px auto;
  text-decoration: none;
  color: inherit;
}

/* Thumbnail */
.link-thumb {
  width: 100%; height: 100%; object-fit: cover;
  background: #222;
}

/* Body */
.link-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.link-meta { font-size: 12px; opacity: .75; display: flex; gap: 8px; flex-wrap: wrap; }
.link-title { font-size: 15px; line-height: 1.25; font-weight: 600; }
.link-desc  { font-size: 13px; opacity: .9; line-height: 1.35; max-height: 3.6em; overflow: hidden; }

/* Hover lift */
.link-card:hover { transform: translateY(-2px); border-color: #2a5bff44; box-shadow: 0 8px 20px rgba(0,0,0,.35); transition: .18s ease; }

/* Big, accessible focus ring (blue) */
.link-card:focus-visible, .link-nav:focus-visible, .link-rail:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px rgba(0, 110, 255, .45);
  border-radius: 12px;
}

/* Small screens */
@media (max-width: 640px) {
  .link-card { flex-basis: 78vw; }
  .link-carousel { border-radius: 10px; }
}









/* Container */
.papers-marquee {
  max-width: 1100px;
  margin: 16px auto;
  background: #0a0a0a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  padding: 8px 6px;
}

/* Viewport hides overflow; track slides left forever */
.pm-viewport {
  overflow: hidden;
  border-radius: 10px;
  outline: none;
}

/* ACADEMIC PAPERS ROTATION SPEED Track = a single row of items */
.pm-track {
  display: flex;
  gap: 12px;
  align-items: stretch;
  list-style: none;
  padding: 8px;
  margin: 0;
  /* Animation speed adjustable via --pm-speed (longer = slower) */
  --pm-speed: 15s;
  animation: pm-scroll var(--pm-speed) linear infinite;
}

/* Pause on hover/focus */
.pm-viewport:hover .pm-track,
.pm-viewport:focus-within .pm-track { animation-play-state: paused; }

/* Each item card */
.pm-item {
  flex: 0 0 clamp(280px, 42vw, 420px);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  padding: 10px;
}

/* Doc placeholder (swap per item later if you want) */
.pm-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: #0d1a2f; border: 1px solid #16345b;
}
.pm-thumb img { width: 26px; height: 26px; display: block; }

/* Text */
.pm-body { display: grid; gap: 4px; min-width: 0; }
.pm-title {
  font-weight: 600; font-size: 14px; line-height: 1.25;
  display: inline-flex; gap: 8px; align-items: baseline;
}
.pm-title a { color: #cfe3ff; text-decoration: none; }
.pm-title a:hover { text-decoration: underline; }
.pm-sub { font-size: 12px; opacity: .85; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-meta { font-size: 12px; opacity: .8; display: flex; gap: 8px; flex-wrap: wrap; }

/* Second link style */
.pm-article {
  color: #9ec8ff; text-decoration: none;
}
.pm-article:hover { text-decoration: underline; }

/* Big, friendly focus ring */
a:focus-visible, .pm-viewport:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px rgba(0,110,255,.45);
  border-radius: 8px;
}

/* Infinite loop: we duplicate items once and slide by 50% */
@keyframes pm-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pm-track { animation: none; }
}

/* Small screens: wider cards */
@media (max-width: 640px) {
  .pm-item { flex-basis: 85vw; }
}

  

  .yt-loop {
    aspect-ratio: 16 / 9;
    width: 100%;
    background:#000; 
    border-radius:12px;
    overflow:hidden;
  }