/* ============================================================
   components.css — reusable UI primitives across templates
   ============================================================ */

/* ============================================================
   Buttons / CTAs
   ============================================================ */
.cta {
  display: inline-block;
  background: var(--crimson);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
  padding: 18px 36px;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  border: 0;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.cta:hover { background-color: var(--crimson-dark); transform: translateY(-1px); }
.cta:active { transform: translateY(0); }
.cta--full {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.cta-sub {
  display: block;
  margin-top: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

/* ============================================================
   Audio Player — cover-flow + tabs
   ============================================================ */
.sb-player {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.sb-player[data-theme="dark"] {
  background: #1C1C1E;
  border-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Tabs */
.sb-player__tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: -4px -4px 0;
  padding: 4px;
}
.sb-player__tabs::-webkit-scrollbar { display: none; }
.sb-player__tab {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.sb-player__tab:hover { color: var(--ink); border-color: rgba(26, 26, 26, 0.18); }
.sb-player__tab.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.sb-player__tab.is-active .sb-player__tab-count {
  color: rgba(255, 255, 255, 0.6);
}
.sb-player[data-theme="dark"] .sb-player__tab {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}
.sb-player[data-theme="dark"] .sb-player__tab.is-active {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #fff;
}
.sb-player__tab-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Carousel */
.sb-player__carousel {
  position: relative;
  width: 100%;
  height: 220px;
  touch-action: pan-y;
}
.sb-player__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.35s ease;
  will-change: transform, opacity;
}
.sb-player__card:focus { outline: none; }
.sb-player__card-cover {
  aspect-ratio: 1000 / 1333;
  border-radius: 12px;
  overflow: hidden;
  background: #2A2A2C;
  box-shadow: var(--shadow-lg);
}
.sb-player__card-cover img,
.sb-player__card-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Title (current playing) */
.sb-player__title {
  font-family: 'Source Serif 4', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.sb-player[data-theme="dark"] .sb-player__title { color: #fff; }

/* Progress */
.sb-player__progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sb-player__time-current,
.sb-player__time-total {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-faint);
  min-width: 34px;
  font-variant-numeric: tabular-nums;
}
.sb-player__time-total { text-align: right; }
.sb-player[data-theme="dark"] .sb-player__time-current,
.sb-player[data-theme="dark"] .sb-player__time-total { color: rgba(255, 255, 255, 0.5); }
.sb-player__bar {
  flex: 1;
  height: 5px;
  background: rgba(26, 26, 26, 0.12);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.sb-player[data-theme="dark"] .sb-player__bar { background: rgba(255, 255, 255, 0.15); }
.sb-player__bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--crimson);
  width: 0;
  border-radius: 999px;
  transition: width 0.1s linear;
}

/* Controls */
.sb-player__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.sb-player__ctrl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.05);
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}
.sb-player__ctrl:hover { background: rgba(26, 26, 26, 0.08); }
.sb-player__ctrl svg { width: 28px; height: 28px; display: block; }
.sb-player[data-theme="dark"] .sb-player__ctrl {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.sb-player[data-theme="dark"] .sb-player__ctrl:hover { background: rgba(255, 255, 255, 0.12); }
.sb-player__play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--crimson);
  color: #fff;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(255, 14, 77, 0.35);
  transition: background 0.15s ease, transform 0.1s ease;
}
.sb-player__play:hover { background: var(--crimson-dark); transform: scale(1.05); }
.sb-player__play svg { width: 22px; height: 22px; display: block; margin-left: -1px; }
.sb-player__play.is-playing svg { margin-left: 0; }

/* ============================================================
   Mobile sticky CTA bar
   ============================================================ */
.mobile-stickybar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(253, 242, 242, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 100;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.mobile-stickybar .cta {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  margin: 0;
}
.mobile-stickybar-caption {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mobile-stickybar-caption svg {
  width: 12px; height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .mobile-stickybar { display: flex; }
  .mobile-stickybar.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  body.has-sticky-bar { padding-bottom: 82px; padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   Cover board — Vestaboard-style split-flap grid
   Static grid; periodically a card's flaps fall forward to reveal a new cover.
   ============================================================ */
.bp-hero__ticker-stack {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  /* Hard-cap visible rows at 3 — any rows beyond get auto-sized to 0 and
     clipped by overflow:hidden, so even if extra cards land in the data
     pool, the board always reads as a clean 3-row grid. */
  grid-template-rows: repeat(3, auto);
  grid-auto-rows: 0;
  overflow: hidden;
  gap: 4px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 18px;
  padding: 8px 16px;
}
/* On mobile, hide the Vestaboard and show the 3-row ticker instead.
   The Vestaboard code stays intact for desktop and future re-use. */
.bp-hero__rowticker { display: none; }
@media (max-width: 640px) {
  .bp-hero__ticker-stack { display: none; }
  .bp-hero__rowticker { display: block; }
}

/* ============================================================
   Hero rowticker — 3 full-width scrolling rows of covers (mobile only).
   Top + bottom rows go right-to-left, middle goes left-to-right.
   Bottom row 2x the speed of top so the rhythm reads as alive.
   ============================================================ */
.bp-hero__rowticker {
  width: 100vw;
  margin-left: calc(50% - 50vw); /* break out of any narrow shell */
  margin-right: calc(50% - 50vw);
  margin-top: 10px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.bp-hero__rowticker__row {
  width: 100%;
  overflow: hidden;
}
.bp-hero__rowticker__track {
  display: flex;
  gap: 4px;
  width: max-content;
  will-change: transform;
}
.bp-hero__rowticker__cover {
  flex: 0 0 auto;
  width: 48px;
  aspect-ratio: 1000 / 1333;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
/* Top row — right-to-left, slow (40s) */
.bp-hero__rowticker__row--rtl.bp-hero__rowticker__row--slow .bp-hero__rowticker__track {
  animation: bp-rowticker-rtl 40s linear infinite;
}
/* Middle row — left-to-right, medium (50s) */
.bp-hero__rowticker__row--ltr.bp-hero__rowticker__row--medium .bp-hero__rowticker__track {
  animation: bp-rowticker-ltr 50s linear infinite;
}
/* Bottom row — right-to-left, fast (20s, 2x top speed) */
.bp-hero__rowticker__row--rtl.bp-hero__rowticker__row--fast .bp-hero__rowticker__track {
  animation: bp-rowticker-rtl 20s linear infinite;
}
@keyframes bp-rowticker-rtl {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes bp-rowticker-ltr {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .bp-hero__rowticker__track { animation: none !important; }
}

/* Individual flap card */
.flap-card {
  position: relative;
  aspect-ratio: 1000 / 1333;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  perspective: 600px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.flap-card__base {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Temporary flaps — appended on flip, removed when animation ends */
.flap-card__flap {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background-size: 100% 200%;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 4;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.flap-card__flap--top {
  top: 0;
  transform-origin: top center;
  background-position: center top;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
.flap-card__flap--bottom {
  top: 50%;
  transform-origin: top center;
  background-position: center bottom;
  border-top: 1px solid rgba(0, 0, 0, 0.3);
}
.flap-card__flap--top.is-falling {
  animation: flap-fall 0.5s cubic-bezier(0.55, 0, 0.4, 1) forwards;
}
.flap-card__flap--bottom.is-falling {
  animation: flap-fall 0.5s cubic-bezier(0.55, 0, 0.4, 1) 0.16s forwards;
}
@keyframes flap-fall {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-180deg); }
}

/* Card-flip spinner — alternative to the flap-fall mechanic.
   Whole card rotates Y to reveal the new cover on its back face. */
.flap-card__spinner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.55, 0, 0.4, 1);
  z-index: 5;
  border-radius: inherit;
}
.flap-card__spinner.is-spinning {
  transform: rotateY(180deg);
}
.flap-card__face {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
}
.flap-card__face--back {
  transform: rotateY(180deg);
}

/* Hide the legacy ticker — we're not using it anymore on the board approach */
.cover-ticker, .cover-ticker__flyover { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .flap-card__flap,
  .flap-card__spinner { display: none; }
}
.cover-ticker {
  width: 100%;
  position: relative;
  padding: 0;
  /* Clip horizontally at the row edges (so the track doesn't bleed out the sides),
     but extend the visible area vertically so rotated/wobbling covers aren't clipped. */
  clip-path: inset(-200px 0 -200px 0);
}
.cover-ticker--row-2,
.cover-ticker--row-3,
.cover-ticker--row-4 { margin-top: 1px; }

.cover-ticker__track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.cover-ticker__row {
  display: flex;
}

/* DISTINCT scroll speeds + directions per row — wide spread so the layering reads obviously */
.cover-ticker--row-1 .cover-ticker__track {
  animation: ticker-scroll-left   38s linear infinite;   /* moderate */
}
.cover-ticker--row-2 .cover-ticker__track {
  animation: ticker-scroll-right  70s linear infinite;   /* medium-slow, reverse */
}
.cover-ticker--row-3 .cover-ticker__track {
  animation: ticker-scroll-left  120s linear infinite;   /* very slow */
}
.cover-ticker--row-4 .cover-ticker__track {
  animation: ticker-scroll-right  45s linear infinite;   /* medium, reverse */
}


/* Cover cells — small, consistent spacing, drop shadow, wobble while scrolling */
.cover-ticker__cover {
  flex: 0 0 auto;
  width: 60px;
  aspect-ratio: 1000 / 1333;
  border-radius: 4px;
  overflow: hidden;
  background: #EFE7D4;
  margin-right: 4px;           /* 4px gap between covers in a row */
}

/* Base rotations + wobble timings cycled across covers */
.cover-ticker__cover:nth-child(7n+1) { --base-rot: -3deg;   animation-duration: 2.8s; animation-delay: -0.5s; }
.cover-ticker__cover:nth-child(7n+2) { --base-rot: 2deg;    animation-duration: 3.6s; animation-delay: -1.4s; }
.cover-ticker__cover:nth-child(7n+3) { --base-rot: -1.5deg; animation-duration: 3.1s; animation-delay: -2.2s; }
.cover-ticker__cover:nth-child(7n+4) { --base-rot: 3deg;    animation-duration: 3.4s; animation-delay: -0.3s; }
.cover-ticker__cover:nth-child(7n+5) { --base-rot: -3.5deg; animation-duration: 2.6s; animation-delay: -1.8s; }
.cover-ticker__cover:nth-child(7n+6) { --base-rot: 1deg;    animation-duration: 3.3s; animation-delay: -1.0s; }
.cover-ticker__cover:nth-child(7n+7) { --base-rot: -2deg;   animation-duration: 2.9s; animation-delay: -0.7s; }

.cover-ticker__cover img,
.cover-ticker__cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  /* Mobile: slightly smaller than desktop but bigger than the previous trim */
  .cover-ticker__cover { width: 52px; }
}

@keyframes ticker-scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes ticker-scroll-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* Wobble — rocks each cover ±3deg around its random base rotation, with a small float */
@keyframes cover-wobble {
  0%, 100% { transform: rotate(calc(var(--base-rot) - 3deg)) translateY(0); }
  50%      { transform: rotate(calc(var(--base-rot) + 3deg)) translateY(-3px); }
}

/* Flyover — covers tumble horizontally across the ticker, same size as ticker covers */
.cover-ticker__flyover {
  position: absolute;
  top: 50%;
  left: 0;
  width: 60px;
  aspect-ratio: 1000 / 1333;
  border-radius: 8px;
  overflow: hidden;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 4px 10px rgba(0, 0, 0, 0.16);
  animation: cover-flyover-from-left 7s linear forwards;
}
.cover-ticker__flyover--from-left   { animation-name: cover-flyover-from-left; }
.cover-ticker__flyover--from-right  { animation-name: cover-flyover-from-right; }
.cover-ticker__flyover--from-top    { animation-name: cover-flyover-from-top; left: 0; top: 0; }
.cover-ticker__flyover--from-bottom { animation-name: cover-flyover-from-bottom; left: 0; top: auto; bottom: 0; }
.cover-ticker__flyover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@keyframes cover-flyover-from-left {
  0%   { transform: translate(-200px, calc(-50% + var(--y, 0px))) rotate(0deg) scale(var(--scale, 1)); opacity: 0; }
  6%, 94% { opacity: 1; }
  100% { transform: translate(calc(100vw + 200px), calc(-50% + var(--y, 0px))) rotate(var(--spin, 720deg)) scale(var(--scale, 1)); opacity: 0; }
}
@keyframes cover-flyover-from-right {
  0%   { transform: translate(calc(100vw + 200px), calc(-50% + var(--y, 0px))) rotate(0deg) scale(var(--scale, 1)); opacity: 0; }
  6%, 94% { opacity: 1; }
  100% { transform: translate(-200px, calc(-50% + var(--y, 0px))) rotate(var(--spin, 720deg)) scale(var(--scale, 1)); opacity: 0; }
}
@keyframes cover-flyover-from-top {
  0%   { transform: translate(calc(var(--x, 50vw) - 50%), -200px) rotate(0deg) scale(var(--scale, 1)); opacity: 0; }
  6%, 94% { opacity: 1; }
  100% { transform: translate(calc(var(--x, 50vw) - 50%), calc(100% + 200px)) rotate(var(--spin, 720deg)) scale(var(--scale, 1)); opacity: 0; }
}
@keyframes cover-flyover-from-bottom {
  0%   { transform: translate(calc(var(--x, 50vw) - 50%), 200px) rotate(0deg) scale(var(--scale, 1)); opacity: 0; }
  6%, 94% { opacity: 1; }
  100% { transform: translate(calc(var(--x, 50vw) - 50%), calc(-100% - 200px)) rotate(var(--spin, 720deg)) scale(var(--scale, 1)); opacity: 0; }
}
@media (max-width: 640px) {
  .cover-ticker__flyover { width: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-ticker__flyover { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-ticker__cover {
    animation: none !important;
    transform: rotate(var(--base-rot, 0deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-ticker__track { animation: none; }
}

/* ============================================================
   FAQ
   ============================================================ */
.faq { margin: 56px 0; }
.faq-item {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--ink);
  cursor: pointer;
}
.faq-a {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   Trust badges row
   ============================================================ */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.trust-row__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trust-row__icon {
  width: 14px;
  height: 14px;
  fill: var(--ink-faint);
}
