/* The hero introduces the catalogue and highlights recent papers. */
/* Deep maroon radial gradient for the brand "stage" look.
   overflow: hidden clips the decorative starfield ::before below. */
.hero {
  background: radial-gradient(120% 140% at 15% 0%, var(--maroon-700), var(--maroon-950) 70%);
  color: var(--cream);
  position: relative;
  overflow: hidden;
  padding: 64px 0 0;
}

/* Decorative starfield — three tiny dots repeated via a small tile.
   pointer-events: none so it never blocks clicks on the hero content. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1px 1px at 20% 30%, rgba(249, 241, 228, .25) 1px, transparent 0),
    radial-gradient(1px 1px at 70% 60%, rgba(249, 241, 228, .18) 1px, transparent 0),
    radial-gradient(1px 1px at 90% 20%, rgba(249, 241, 228, .2) 1px, transparent 0);
  background-size: 340px 340px;
  pointer-events: none;
}

/* Two-column hero: copy on the left, paper spotlight on the right. */
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 64px;
  position: relative;   /* sits above the starfield ::before */
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}

/* Below 1024px the spotlight drops below the copy — one column. */
@media (max-width:1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 0 20px 40px;
    gap: 36px;
  }
}

.hero-left {
  max-width: 520px;
}

/* Slightly lighter gold on the dark hero for better contrast. */
.hero-left .eyebrow {
  color: var(--gold-light);
}

/* Fluid headline — scales from 34px to 52px with the viewport. */
.hero-left h1 {
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  font-weight: 700;
  margin-top: 14px;
  color: var(--white);
}

/* The italic "Research Hub" line below the main title. */
.hero-left h1 em {
  display: block;
  font-style: italic;
  font-weight: 600;
  color: var(--gold-light);
  margin-top: 4px;
}

.hero-left p {
  margin-top: 16px;
  color: rgba(249, 241, 228, .82);
  font-size: 15.5px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;   /* "Browse" + "Contact" stack on narrow screens */
}

/* Small "Visitors: N" pill under the CTAs. */
.hero-visitor-counter {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(249, 241, 228, 0.05);
  border: 1px solid rgba(249, 241, 228, 0.18);
  color: var(--cream);
}

.visitor-label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(249, 241, 228, .72);
  font-weight: 700;
}

/* The number itself — right-aligned and min-width so it doesn't jitter as digits load. */
.hero-visitor-counter strong {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
  min-width: 3ch;
  text-align: right;
}

/* Row of four stats ("1,200 papers", "18 partners", …). */
.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line-dark);
  flex-wrap: wrap;
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold-light);
  font-weight: 700;
}

.stat span {
  font-size: 12px;
  color: rgba(249, 241, 228, .7);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

/* Desktop layout for the paper spotlight in the hero section. */
/* 2×3 grid: one big "featured" card (spanning both rows in column 1)
   beside two smaller cards, plus a full-width scrolling ticker below. */
.hero-spotlight-desktop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 14px;
}

/* Skeleton placeholders shown while the spotlight is fetching. */
.hero-stat-skeleton {
  display: block;
  width: 54px;
  height: 28px;
  border-radius: 8px;
}

.hero-spot-skeleton-card {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.hero-spot-skeleton-card .sk-title {
  width: 86%;
}

.hero-spot-skeleton-card .sk-line {
  width: 58%;
}

.spot-skeleton-tags {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.hero-ticker-skeleton {
  width: 80%;
  height: 12px;
}

.hero-rolling-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 118px;
}

.hero-rolling-skeleton .sk-title {
  width: 94%;
}

.hero-rolling-skeleton .sk-line {
  width: 72%;
}

.hero-dot-skeleton {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

/* Fallback text shown if the spotlight fails to load entirely. */
.hero-fallback-text {
  grid-column: 1 / -1;
  color: rgba(249, 241, 228, .7);
  font-size: 13.5px;
  margin: 0;
}

.hero-fallback-mobile {
  margin-top: 0;
  color: rgba(249, 241, 228, .7);
}

/* Hide the desktop spotlight on tablet/mobile — the rolling card takes over. */
@media (max-width:1024px) {
  .hero-spotlight-desktop {
    display: none;
  }
}

/* Small uppercase "Spotlight" label spanning the whole grid row. */
.spotlight-label {
  grid-column: 1/-1;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(249, 241, 228, .65);
  margin-bottom: 2px;
}

/* Single paper card in the spotlight.
   Styled as a <button> (whole card clickable) but looks like a card. */
.spot-card {
  background: rgba(249, 241, 228, .06);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-m);
  padding: 18px;
  backdrop-filter: blur(6px);    /* frosted-glass effect against the starfield */
  transition: background .18s, transform .18s;
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}

.spot-card:hover {
  background: rgba(249, 241, 228, .11);
  transform: translateY(-3px);
}

.spot-card .rank {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-size: 14px;
}

/* Title clamped to 3 lines; the featured card below bumps this to 4. */
.spot-card h4 {
  font-size: 15.5px;
  line-height: 1.35;
  margin-top: 8px;
  color: var(--white);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spot-card .meta {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(249, 241, 228, .6);
}

/* The featured card spans both grid rows, so it's taller than the two beside it. */
.spot-card.spot-main {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spot-card.spot-main h4 {
  font-size: 19px;
  -webkit-line-clamp: 4;
}

.spot-card.spot-main .tags {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Small gold tag chips attached to the featured paper. */
.tag-chip {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(212, 169, 55, .16);
  color: var(--gold-light);
  font-weight: 600;
  border: 1px solid rgba(212, 169, 55, .3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

/* Inner span handles truncation when a tag is very long. */
.tag-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bottom ticker strip — headlines scrolling horizontally. */
.spot-ticker {
  grid-column: 1/-1;
  margin-top: 4px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-dark);
  background: rgba(0, 0, 0, .14);
  overflow: hidden;
  padding: 13px 0;
}

/* The track is translated by -50% over the loop, so the markup must
   contain the same items duplicated once (so the seam is invisible). */
.ticker-track {
  display: flex;
  gap: 44px;
  white-space: nowrap;
  width: max-content;
  animation: ticker 90s linear infinite;
}

/* Pause on hover so visitors can read a headline. */
.spot-ticker:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Single headline in the ticker — reset <button> styles so it reads as text. */
.ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(249, 241, 228, .78);
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

/* Gold dot separator injected before each item. */
.ticker-item::before {
  content: "●";
  color: var(--gold);
  font-size: 8px;
}

.ticker-item:hover {
  color: var(--gold-light);
}

/* Mobile layout for the one-paper-at-a-time spotlight. */
/* Hidden by default; the desktop version takes over above 1024px. */
.hero-spotlight-mobile {
  display: none;
}

@media (max-width:1024px) {
  .hero-spotlight-mobile {
    display: block;
    margin-top: 8px;
    padding-bottom: 36px;
  }
}

/* Card that auto-rotates through the newest papers on mobile. */
.rolling-card {
  background: rgba(249, 241, 228, .07);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-m);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.rolling-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(249, 241, 228, .6);
}

/* Slides are absolutely positioned on top of each other and cross-fade. */
.rolling-slides {
  position: relative;
  min-height: 118px;
  margin-top: 12px;
}

.rolling-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(14px);   /* slide-in from the right */
  transition: opacity .4s ease, transform .4s ease;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

/* The active slide becomes the "in-flow" one so it sizes the container. */
.rolling-slide.is-active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

/* Title clamped to 2 lines on mobile. */
.rolling-slide h4 {
  color: var(--white);
  font-size: 16.5px;
  line-height: 1.4;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rolling-slide .meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: rgba(249, 241, 228, .65);
}

.rolling-slide .tags {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Pagination dots under the rolling card. */
.rolling-dots {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

.rolling-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(249, 241, 228, .3);
  border: none;
  padding: 0;
  transition: background .2s, width .2s;
}

/* Active dot stretches into a small pill. */
.rolling-dots button.is-active {
  background: var(--gold);
  width: 20px;
  border-radius: 99px;
}