/* Scroll Reel Components for Vanilla JS */

.sr-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: #F8F5F0;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 10px 30px rgba(0,0,0,0.03);
}

@media (min-width: 768px) {
  .sr-wrapper {
    flex-direction: row;
    min-height: 320px;
  }
}

.sr-reel-section {
  position: relative;
  height: 224px;
  width: 100%;
  flex-shrink: 0;
  align-self: stretch;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%), linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%), linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

@media (min-width: 768px) {
  .sr-reel-section {
    height: auto;
    width: 380px;
  }
}

.sr-reel-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sr-col {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 8px;
  will-change: transform;
}

/* Blurred generic cell */
.sr-cell {
  flex-shrink: 0;
  width: 121.33px;
  height: 121.33px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(to bottom, rgba(0,0,0,0.02), rgba(0,0,0,0.06));
  filter: blur(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0 2px 0 rgba(255,255,255,1);
}

/* Featured cell */
.sr-featured {
  position: relative;
  flex-shrink: 0;
  width: 121.33px;
  height: 121.33px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #eee;
  box-shadow: 0 1.008px 0.705px -0.563px rgba(0,0,0,0.18), 0 2.389px 1.672px -1.125px rgba(0,0,0,0.17), 0 4.357px 3.05px -1.688px rgba(0,0,0,0.17), 0 7.244px 5.07px -2.25px rgba(0,0,0,0.16), 0 11.698px 8.188px -2.813px rgba(0,0,0,0.15), 0 19.148px 13.404px -3.375px rgba(0,0,0,0.13), 0 32.972px 23.08px -3.938px rgba(0,0,0,0.09), 0 60px 42px -4.5px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 0 rgba(0,0,0,0.6);
}

.sr-featured img {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.sr-featured-blend {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: white;
  mix-blend-mode: saturation;
  pointer-events: none;
}

.sr-featured-sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  filter: blur(6px);
  mix-blend-mode: overlay;
  background: linear-gradient(220.99deg, rgba(108,92,255,0) 32%, rgb(108,92,255) 41%, rgb(173,177,255) 47%, rgba(130,189,237,0.57) 54%, rgba(130,189,237,0) 65%);
  pointer-events: none;
}


/* Text Content Region */
.sr-content-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  padding: 28px 20px;
  min-width: 0;
}

@media (min-width: 768px) {
  .sr-content-section {
    padding: 40px;
  }
}

.sr-text-stage {
  position: relative;
  width: 100%;
  max-width: 390px;
  overflow: hidden;
}

.sr-ghost-text {
  visibility: hidden;
  display: flex;
  min-height: 140px;
  flex-direction: column;
  gap: 19px;
}

.sr-live-text {
  position: absolute;
  inset-x: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 19px;
  will-change: transform, opacity;
}

.sr-quote {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

@media (min-width: 640px) {
  .sr-quote {
    font-size: 22px;
  }
}

.sr-author {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  color: #666;
}

.inline-block { display: inline-block; }
.whitespace-nowrap { white-space: nowrap; }

/* Keyframes for Stagger Effect */
.scroll-reel-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px) rotateX(-90deg);
  transform-origin: bottom center;
  animation: scroll-reel-rise 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scroll-reel-rise {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

.scroll-reel-exit {
  animation: scroll-reel-fade-out 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scroll-reel-exit .scroll-reel-char {
  animation: none !important;
}

@keyframes scroll-reel-fade-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Controls */
.sr-controls {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (min-width: 768px) {
  .sr-controls {
    margin-top: 0;
  }
}

.sr-btn {
  display: grid;
  height: 32px;
  width: 32px;
  cursor: pointer;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  background: transparent;
  padding: 0;
  color: #1a1a1a;
  transition: opacity 0.2s cubic-bezier(0.22,1,0.36,1), transform 0.2s cubic-bezier(0.22,1,0.36,1);
}

.sr-btn:hover:enabled {
  transform: scale(1.08);
}
.sr-btn:active:enabled {
  transform: scale(0.94);
}
.sr-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.sr-btn svg {
  height: 14px;
  width: 14px;
  opacity: 0.7;
}
