/* Recently built - one thin line of small dots in the hero, next to the buttons.
   Hover a dot for its card. On a phone a tap opens a swipeable sheet instead. */

.hero-actions { align-items: center; flex-wrap: wrap; }
.hero-built { margin-left: var(--space-6); }

.rb-built { position: relative; }
.rb-line { position: relative; display: flex; align-items: center; gap: var(--space-4); }
.rb-line-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

/* the line itself: a hairline with the dots resting on it */
.rb-dots {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 12px 6px;
  list-style: none;
}
.rb-dots::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border) 14%, var(--color-border) 86%, transparent);
}

.rb-dot {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rb-color);
  box-shadow: 0 0 0 3px var(--color-bg); /* cuts the hairline around the dot */
  cursor: pointer;
  /* `backwards`, not `both`: an end-fill would keep overriding the hover transform */
  animation: rb-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: calc(var(--rb-i) * 80ms);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rb-dot::before { content: ''; position: absolute; inset: -10px; } /* bigger hit area for touch */
/* soft glow: only opacity and transform change, so it stays on the compositor */
.rb-dot::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rb-color) 55%, transparent), transparent 68%);
  opacity: 0.45;
  animation: rb-glow 4.8s ease-in-out infinite;
  animation-delay: calc(var(--rb-i) * -0.8s);
  pointer-events: none;
}
.rb-dot:focus-visible { transform: scale(1.7); outline: 2px solid var(--rb-color); outline-offset: 4px; }

@keyframes rb-glow {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 0.7; transform: scale(1.15); }
}
@keyframes rb-in {
  from { opacity: 0; transform: translateY(6px) scale(0.3); }
  to { opacity: 1; transform: none; }
}
@keyframes rb-card-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes rb-card-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* hover only where a pointer can really hover: phones keep :hover on the last tapped dot */
@media (hover: hover) {
  .rb-dot:hover { transform: scale(1.7); }
  .rb-dot:hover::after { animation: none; opacity: 1; }
}

/* Card under the line (mounted only while a dot is hovered or focused) */
.rb-card {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 300px;
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: rb-card-in 0.18s ease-out;
}
/* bridges the gap so the card stays open while the pointer moves onto it */
.rb-card::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 20px; }
/* opens upward when the window has no room below the line */
.rb-card.is-up { top: auto; bottom: calc(100% + 12px); animation-name: rb-card-up; }
.rb-card.is-up::before { bottom: auto; top: 100%; }

/* Card contents, shared by the hover card and the carousel slides */
.rb-media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.rb-media img,
.rb-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.rb-media.is-contain { background: #fff; }
.rb-media.is-contain img { object-fit: contain; }
.rb-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-subtle); }
.rb-title { font-size: var(--text-base); line-height: var(--leading-tight); color: var(--color-text); }
.rb-blurb { font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--color-text-muted); }
.rb-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.rb-tags span {
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
}
.rb-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.rb-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--rb-color);
  text-decoration: none;
  cursor: pointer;
}
.rb-link:hover { text-decoration: underline; }

/* The sheet is for touch only: swipe through the cards, with the tapped dot highlighted */
.rb-sheet { display: none; }
.rb-carousel {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-1) 9% var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 9%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.rb-carousel::-webkit-scrollbar { display: none; }
.rb-slide {
  flex: 0 0 min(82%, 320px);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  scroll-snap-align: center;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.rb-close {
  position: absolute;
  top: -8px;
  right: 0;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-bg-elevated);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}

@media (hover: none) {
  .rb-card { display: none; }
  .rb-sheet.is-open { position: relative; display: block; margin-top: var(--space-3); }
  .rb-dot.is-active { transform: scale(1.7); }
  .rb-dot.is-active::after { animation: none; opacity: 1; }
}

@media (max-width: 768px) {
  .hero-built { width: 100%; margin-left: 0; }
  .rb-line { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .rb-dot, .rb-dot::after, .rb-card { animation: none; }
  .rb-dot::after { opacity: 0.55; }
  .rb-dot { transition: none; }
}
