.bb-story-section {
  position: relative;
  z-index: 24;
  overflow: hidden;
  padding: 36px 0 32px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: #050505;
}

.bb-story-section::before {
  content: "";
  position: absolute;
  inset: -55% 35% auto -20%;
  height: 230px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(226,255,0,.075), transparent 68%);
}

.bb-story-wrap {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 0 3rem;
}

.bb-story-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.bb-story-heading span {
  color: #e2ff00;
  font-size: .64rem;
  letter-spacing: .23em;
  text-transform: uppercase;
}

.bb-story-heading h2 {
  margin: 0;
  color: #fff;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(1.55rem, 3vw, 3.1rem);
  line-height: 1;
  letter-spacing: -.05em;
}

.bb-story-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 3px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(226,255,0,.42) transparent;
  -webkit-overflow-scrolling: touch;
}

.bb-story-circle {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
  flex: 0 0 84px;
  scroll-snap-align: start;
  border: 0;
  background: none;
  color: #fff;
  padding: 0;
  cursor: pointer;
  text-align: center;
  opacity: 0;
  transform: translateY(20px) scale(.88);
  transition: opacity .5s ease, transform .65s cubic-bezier(.2,.8,.2,1);
  -webkit-tap-highlight-color: transparent;
}

.bb-story-section.is-visible .bb-story-circle {
  opacity: 1;
  transform: none;
}

.bb-story-section.is-visible .bb-story-circle:nth-child(2) { transition-delay: .06s; }
.bb-story-section.is-visible .bb-story-circle:nth-child(3) { transition-delay: .12s; }
.bb-story-section.is-visible .bb-story-circle:nth-child(4) { transition-delay: .18s; }
.bb-story-section.is-visible .bb-story-circle:nth-child(5) { transition-delay: .24s; }
.bb-story-section.is-visible .bb-story-circle:nth-child(n+6) { transition-delay: .3s; }

.bb-story-ring {
  position: relative;
  display: block;
  width: 74px;
  height: 74px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  padding: 2px;
  background: #e2ff00;
  box-shadow: 0 9px 24px rgba(0,0,0,.34), 0 0 16px rgba(226,255,0,.075);
  transition: transform .3s ease, box-shadow .3s ease;
}

.bb-story-ring img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
  filter: saturate(.94) contrast(1.025);
  transition: transform .48s ease, filter .35s ease;
}

.bb-story-pulse {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(226,255,0,.55);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.bb-story-circle:hover .bb-story-ring,
.bb-story-circle:focus-visible .bb-story-ring {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 13px 28px rgba(0,0,0,.42), 0 0 21px rgba(226,255,0,.14);
}

.bb-story-circle:hover img,
.bb-story-circle:focus-visible img {
  transform: scale(1.055);
  filter: saturate(1.08);
}

.bb-story-circle:focus-visible {
  outline: 2px solid rgba(226,255,0,.75);
  outline-offset: 5px;
  border-radius: 10px;
}

.bb-story-section.is-visible .bb-story-circle:first-child .bb-story-pulse {
  animation: bbStoryPulse 2.5s ease-out 1 .65s;
}

.bb-story-title {
  display: block;
  width: 100%;
  margin-top: 9px;
  overflow: hidden;
  color: rgba(255,255,255,.9);
  font-size: .69rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .25s ease;
}

.bb-story-circle:hover .bb-story-title,
.bb-story-circle:focus-visible .bb-story-title {
  color: #e2ff00;
}

.bb-story-section.is-visible .bb-story-title {
  animation: bbTitleDemo 3.1s ease both;
}

.bb-story-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  isolation: isolate;
  overscroll-behavior: contain;
}

.bb-story-modal.is-open { display: flex; }

.bb-story-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.9);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
  animation: bbFade .22s ease;
}

.bb-story-stage {
  position: relative;
  z-index: 1;
  width: min(470px, 94vw);
  height: min(835px, calc(100vh - 30px));
  height: min(835px, calc(100dvh - 30px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background: #050505;
  box-shadow: 0 30px 100px rgba(0,0,0,.78);
  animation: bbStageIn .32s cubic-bezier(.2,.85,.2,1);
  touch-action: pan-y;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.bb-story-media {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050505;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.bb-story-media::before {
  content: "";
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #e2ff00;
  border-radius: 50%;
  animation: bbStorySpin .8s linear infinite;
  transition: opacity .2s ease;
}

.bb-story-media.is-ready::before,
.bb-story-media.has-error::before {
  opacity: 0;
  pointer-events: none;
}

.bb-story-media img,
.bb-story-media video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  object-fit: contain;
  background: #050505;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.bb-story-media.is-ready img,
.bb-story-media.is-ready video {
  opacity: 1;
  visibility: visible;
}

.bb-story-video-play {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 50%;
  display: none;
  width: 62px;
  height: 62px;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(226,255,0,.75);
  border-radius: 50%;
  background: rgba(5,5,5,.74);
  color: #e2ff00;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.bb-story-video-play.is-visible { display: grid; place-items: center; }

.bb-story-sound {
  position: absolute;
  z-index: 14;
  top: max(68px, calc(env(safe-area-inset-top) + 58px));
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  background: rgba(5,5,5,.62);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  transition: border-color .2s ease, color .2s ease, transform .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.bb-story-sound:hover,
.bb-story-sound:focus-visible {
  border-color: rgba(226,255,0,.82);
  color: #e2ff00;
  background: rgba(5,5,5,.82);
  transform: scale(1.05);
}

.bb-story-sound.is-muted {
  border-color: rgba(226,255,0,.7);
  color: #e2ff00;
}

.bb-story-sound:focus-visible {
  outline: 2px solid rgba(226,255,0,.6);
  outline-offset: 3px;
}

.bb-story-progress {
  position: absolute;
  z-index: 12;
  left: 11px;
  right: 11px;
  top: max(10px, env(safe-area-inset-top));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}

.bb-story-progress span {
  height: 3px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255,255,255,.28);
}

.bb-story-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.bb-story-progress span.done i { width: 100%; }

.bb-story-topbar {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: max(25px, calc(env(safe-area-inset-top) + 20px)) 18px 55px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.82), transparent);
}

.bb-story-topbar > div { min-width: 0; }

.bb-story-topbar strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: .92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-story-topbar small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: rgba(255,255,255,.72);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bb-story-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  background: rgba(0,0,0,.36);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.bb-story-edge {
  position: absolute;
  z-index: 7;
  top: 70px;
  bottom: 0;
  width: 33%;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bb-story-edge-prev { left: 0; }
.bb-story-edge-next { right: 0; }

.bb-story-cta {
  position: absolute;
  z-index: 13;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 13px));
  transform: translateX(-50%);
  padding: 10px 15px;
  border: 1px solid rgba(226,255,0,.55);
  border-radius: 999px;
  background: rgba(7,7,7,.76);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bb-story-cta:hover { background: #e2ff00; color: #070707; }

.bb-story-modal.is-paused .bb-story-stage::after {
  content: "Paused";
  position: absolute;
  z-index: 14;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: .7rem;
  pointer-events: none;
}

.bb-story-modal[dir="rtl"] .bb-story-topbar { text-align: right; }

@keyframes bbStoryPulse {
  0% { opacity: .85; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.2); }
}

@keyframes bbTitleDemo {
  0%,12% { opacity: 0; transform: translateY(4px); }
  25%,76% { opacity: 1; transform: none; }
  100% { opacity: .9; }
}

@keyframes bbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bbStageIn { from { opacity: 0; transform: translateY(15px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bbStorySpin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
  .bb-story-section { padding: 28px 0 23px; }
  .bb-story-wrap { padding: 0 16px; }
  .bb-story-heading { margin-bottom: 17px; }
  .bb-story-heading h2 { font-size: clamp(1.4rem, 7vw, 2.2rem); }

  .bb-story-rail {
    gap: 11px;
    margin-right: -16px;
    padding-right: 16px;
    padding-bottom: 10px;
  }

  .bb-story-circle {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    flex-basis: 70px;
  }

  .bb-story-ring {
    width: 62px;
    height: 62px;
    padding: 2px;
    box-shadow: 0 7px 18px rgba(0,0,0,.32), 0 0 12px rgba(226,255,0,.07);
  }

  .bb-story-title {
    margin-top: 8px;
    font-size: .63rem;
  }

  .bb-story-modal { padding: 0; }
  .bb-story-backdrop { display: none; }

  .bb-story-stage {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .bb-story-topbar {
    padding-left: 16px;
    padding-right: 14px;
  }

  .bb-story-close {
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,.48);
  }
}

@media (max-width: 380px) {
  .bb-story-circle {
    width: 65px;
    min-width: 65px;
    max-width: 65px;
    flex-basis: 65px;
  }

  .bb-story-ring { width: 58px; height: 58px; }
  .bb-story-rail { gap: 9px; }
}


/* Light-theme support for the landing Story rail and the identity section directly below it. */
html[data-theme="light"] .bb-story-section {
  background:
    radial-gradient(circle at 10% 0%, rgba(111,143,0,.10), transparent 32%),
    linear-gradient(180deg, #f8faf5 0%, #eef3ec 100%) !important;
  border-bottom-color: rgba(15,23,42,.09) !important;
}

html[data-theme="light"] .bb-story-section::before {
  background: radial-gradient(circle, rgba(111,143,0,.10), transparent 68%);
}

html[data-theme="light"] .bb-story-heading h2,
html[data-theme="light"] #bb-story-heading {
  color: #111316 !important;
}

html[data-theme="light"] .bb-story-heading span {
  color: #587600 !important;
}

html[data-theme="light"] .bb-story-circle {
  color: #111316 !important;
}

html[data-theme="light"] .bb-story-title {
  color: #445164 !important;
}

html[data-theme="light"] .bb-story-circle:hover .bb-story-title,
html[data-theme="light"] .bb-story-circle:focus-visible .bb-story-title {
  color: #587600 !important;
}

html[data-theme="light"] .bb-story-ring {
  box-shadow: 0 9px 24px rgba(15,23,42,.13), 0 0 16px rgba(111,143,0,.09);
}

html[data-theme="light"] .bb-story-ring img {
  background: #e8ede5;
}

html[data-theme="light"] .bb-story-rail {
  scrollbar-color: rgba(88,118,0,.48) transparent;
}

/* The randomized “about me / artist” block is the section immediately after Stories. */
html[data-theme="light"] .bb-story-section + section {
  background:
    radial-gradient(circle at 86% 18%, rgba(111,143,0,.08), transparent 28%),
    linear-gradient(180deg, #eef3ec 0%, #f8faf6 100%) !important;
  color: #111316 !important;
}

html[data-theme="light"] .bb-story-section + section h2 {
  color: #111316 !important;
}

html[data-theme="light"] .bb-story-section + section h2 span:first-of-type {
  color: #718199 !important;
}

html[data-theme="light"] .bb-story-section + section h2 span:last-child {
  color: #587600 !important;
}

html[data-theme="light"] .bb-story-section + section .text-gray-300,
html[data-theme="light"] .bb-story-section + section .space-y-6,
html[data-theme="light"] .bb-story-section + section p {
  color: #4e5c6c !important;
}

html[data-theme="light"] .bb-story-section + section strong {
  color: #111316 !important;
}

html[data-theme="light"] .bb-story-section + section .bg-\[\#E2FF00\] {
  background-color: #6f8f00 !important;
}

@media (prefers-reduced-motion: reduce) {
  .bb-story-circle,
  .bb-story-stage,
  .bb-story-backdrop,
  .bb-story-media::before {
    transition: none !important;
    animation: none !important;
  }

  .bb-story-section .bb-story-circle { opacity: 1; transform: none; }
}
