/* ============================================================
   Influeri — Trending Creators · Motion Showcase
   Additive layer. Reuses .creator card + tokens from styles.css.
   All new classes are prefixed tcm- (trending-creators-motion).
   Variables:
     --card-w   fixed card width inside tracks
     --gap      spacing between cards (as margin, for seamless loop)
   ============================================================ */

.tcm {
  --card-w: 320px;
  --gap: 22px;
  /* clip-safe shadows: negative spread keeps reach tight so overflow:hidden
     containers never cut them. horizontal reach ≤16px, vertical ≤32px. */
  --shadow-card: 0 1px 2px rgba(11, 11, 11, 0.06), 0 10px 22px -12px rgba(11, 11, 11, 0.20);
  --shadow-hover: 0 2px 6px rgba(11, 11, 11, 0.07), 0 14px 26px -12px rgba(11, 11, 11, 0.15);
  --shadow-focus: 0 2px 8px rgba(11, 11, 11, 0.06), 0 16px 28px -12px rgba(11, 11, 11, 0.20);
  position: relative;
  min-height: 100vh;
  padding: 0 0 110px;
  overflow: hidden;            /* contain the top glow */
  background:
    radial-gradient(1100px 520px at 50% -160px, rgba(11, 11, 11, 0.035), transparent 70%),
    radial-gradient(900px 460px at 92% 4%, rgba(130, 130, 130, 0.12), transparent 70%),
    #fbfbfc;
}

/* faint grid texture for depth */
.tcm::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 11, 11, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 11, 11, 0.022) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(1200px 700px at 50% 0, #000, transparent 78%);
  mask-image: radial-gradient(1200px 700px at 50% 0, #000, transparent 78%);
  pointer-events: none;
}

.tcm__wrap {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------------- Page header ---------------- */
.tcm__head {
  text-align: center;
  padding: 84px 0 18px;
}
.tcm__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 20px 0 0;
}
.tcm__title em {
  font-style: normal;
  background: #0b0b0b;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tcm__sub {
  max-width: 620px;
  margin: 16px auto 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
}
.tcm__rule {
  width: 64px;
  height: 3px;
  margin: 30px auto 0;
  border-radius: 3px;
  background: #0b0b0b;
}

/* ---------------- Section / variant ---------------- */
.tcm-sec { padding: 56px 0 0; }

.tcm-eyebrow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
  flex-wrap: wrap;
}
.tcm-eyebrow__main { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.tcm-eyebrow__no {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  background: #0b0b0b;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tcm-eyebrow__txt h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 26px);
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.2;
}
.tcm-eyebrow__txt p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text);
}
.tcm-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--primary);
  white-space: nowrap;
}
.tcm-tag b { font-weight: 600; color: var(--text); }
.tcm-tag .arrow { font-size: 13px; color: #0b0b0b; }

/* ---------------- Rail (horizontal viewport) ---------------- */
.tcm-rail {
  position: relative;
  overflow: hidden;
  padding: 34px 0 42px;        /* vertical gutter so shadows clear the clip edge */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}

/* ---------------- Clip-safe card shadow for every trending lane ----------------
   The canonical .creator card (styles.css) ships a heavy, wide-reach shadow
   (0 23px 50px) that a tight overflow:hidden lane slices into a hard rectangle.
   Replace it with the clip-safe layered contact+ambient shadow (negative spread,
   horizontal reach ≤16px / vertical ≤32px) on every .creator that sits inside a
   trending lane — not only inside the .tcm showcase, but also when a lane class is
   used bare on a page (home.html marquee, home-spotlight depth stack, home-typewriter
   coverflow). The shadow tokens are re-declared on the lane containers so they resolve
   without a .tcm ancestor. Card markup is untouched — only the shadow + border. */
.tcm-rail,
.tcm-rail--v,
.tcm-rail--v1,
.tcm-rail--v2,
.tcm-rail--flow,
.tcm-podium,
.tcm-snap,
.tcm-vc,
.tcm-lb,
.tcm-pod {
  --shadow-card: 0 1px 2px rgba(11, 11, 11, 0.06), 0 10px 22px -12px rgba(11, 11, 11, 0.20);
  --shadow-hover: 0 2px 6px rgba(11, 11, 11, 0.07), 0 14px 26px -12px rgba(11, 11, 11, 0.15);
  --shadow-focus: 0 2px 8px rgba(11, 11, 11, 0.06), 0 16px 28px -12px rgba(11, 11, 11, 0.20);
}
.tcm .creator,
.tcm-rail .creator,
.tcm-rail--v .creator,
.tcm-rail--v1 .creator,
.tcm-rail--v2 .creator,
.tcm-rail--flow .creator,
.tcm-podium .creator,
.tcm-snap .creator,
.tcm-vc .creator,
.tcm-lb .creator,
.tcm-pod .creator {
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(11, 11, 11, 0.05);
}
.tcm .creator:hover,
.tcm-rail .creator:hover,
.tcm-rail--v .creator:hover,
.tcm-rail--v1 .creator:hover,
.tcm-rail--v2 .creator:hover,
.tcm-rail--flow .creator:hover,
.tcm-podium .creator:hover,
.tcm-snap .creator:hover,
.tcm-vc .creator:hover,
.tcm-lb .creator:hover,
.tcm-pod .creator:hover {
  box-shadow: var(--shadow-hover);
}
.tcm-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 0;
  will-change: transform;
}
/* fixed-width cards with margin-right on every card except the final item of
   the full track. This keeps the duplicated set exactly one set-width wide,
   so the second loop lands flush instead of vanishing behind the clip. */
.tcm-track .creator {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  margin-right: var(--gap);
}
.tcm-track .creator:last-child { margin-right: 0; }

/* continuous carousels */
.tcm-track--ltr { animation: tcm-x var(--dur, 46s) linear infinite; }
.tcm-track--rtl { animation: tcm-x var(--dur, 50s) linear infinite reverse; }
.tcm-rail:hover .tcm-track--ltr,
.tcm-rail:hover .tcm-track--rtl { animation-play-state: paused; }

@keyframes tcm-x {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ---------------- Step slider ---------------- */
.tcm-rail--step .tcm-track { will-change: transform; }
.tcm-rail--step .creator {
  opacity: 0.86;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.5s ease, opacity 0.5s ease;
}
.tcm-rail--step .creator.is-focus {
  opacity: 1;
  transform: translateY(-4px) scale(1.04);
  box-shadow: var(--shadow-focus);
}
.tcm-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.tcm-pager i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(11, 11, 11, 0.16);
  transition: width 0.4s ease, background 0.4s ease;
}
.tcm-pager i.is-on {
  width: 22px;
  background: #0b0b0b;
}

/* ---------------- Vertical column rail (variant 04, refined) ---------------- */
.tcm-rail--v {
  position: relative;
  height: 540px;
  padding: 0 14px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)) ,
    radial-gradient(120% 100% at 50% 0, rgba(11, 11, 11, 0.05), transparent 60%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
}
.tcm-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: start;
  height: 100%;
}
.tcm-col { overflow: hidden; padding: 26px 14px; }
.tcm-vtrack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  will-change: transform;
  animation: tcm-y var(--dur, 26s) linear infinite;
}
.tcm-cols .tcm-col:nth-child(2) .tcm-vtrack { animation-duration: 34s; }
.tcm-cols .tcm-col:nth-child(3) .tcm-vtrack { animation-duration: 29s; }
.tcm-rail--v:hover .tcm-vtrack { animation-play-state: paused; }
.tcm-vtrack .creator { width: 100%; }

@keyframes tcm-y {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* hint chip under each rail */
.tcm-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 12.5px;
  color: #8a8a8a;
}
.tcm-hint::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0b0b0b;
}

/* ---------------- Footer CTA ---------------- */
.tcm-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 80px;
  flex-wrap: wrap;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .tcm { --card-w: 280px; }
  .tcm__wrap { padding: 0 22px; }
  .tcm-cols { grid-template-columns: 1fr 1fr; }
  .tcm-col:nth-child(3) { display: none; }
}
@media (max-width: 560px) {
  .tcm { --card-w: 248px; }
  .tcm-cols { grid-template-columns: 1fr; }
  .tcm-col:nth-child(2) { display: none; }
  .tcm-rail--v { height: 420px; }
}

/* ---------------- Reduced motion: freeze + allow manual scroll ---------------- */
@media (prefers-reduced-motion: reduce) {
  .tcm-track--ltr,
  .tcm-track--rtl,
  .tcm-vtrack { animation: none !important; }

  .tcm-rail {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
    scroll-snap-type: x mandatory;
  }
  .tcm-rail .creator { scroll-snap-align: center; }

  .tcm-rail--v { height: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .tcm-col { overflow: visible; }

  .tcm-rail--step .creator { opacity: 1; transform: none; }
  .tcm-pager { display: none; }
}

/* ============================================================
   05 · One-column vertical ticker
   ============================================================ */
.tcm-rail--v1 {
  position: relative;
  height: 480px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
}
.tcm-onecol {
  max-width: 420px;
  height: 100%;
  margin: 0 auto;
  padding: 0 14px;
  overflow: hidden;
}
.tcm-onecol .tcm-vtrack { gap: 16px; }
.tcm-onecol .creator { width: 100%; }

/* ============================================================
   06 · Two-column vertical counter-flow
   ============================================================ */
.tcm-rail--v2 {
  position: relative;
  height: 500px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.tcm-cols2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  height: 100%;
}
.tcm-cols2 .creator { width: 100%; }
.tcm-vtrack--down { animation-direction: reverse; }

/* ============================================================
   07 · Vertical leaderboard — ranked rows, count-up, bars, live reshuffle
   ============================================================ */
.tcm-lb { display: flex; flex-direction: column; gap: 12px; }
.tcm-lb-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) clamp(150px, 24vw, 220px);
  align-items: center;
  gap: 18px;
  will-change: transform;
}
.tcm-lb-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.4s ease;
}
.tcm-lb-row.rank-1 .tcm-lb-rank { color: #fff; background: #0b0b0b; border-color: transparent; box-shadow: 0 6px 16px rgba(11, 11, 11, 0.32); }
.tcm-lb-row.rank-2 .tcm-lb-rank { background: #fff5f8; border-color: #f6d6e3; }
.tcm-lb-row.rank-3 .tcm-lb-rank { background: #fff8f0; border-color: #f3e2c6; }
.tcm-lb-row .creator { width: 100%; }
.tcm-lb-meter { display: flex; align-items: center; gap: 12px; }
.tcm-lb-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 11, 11, 0.08);
  overflow: hidden;
}
.tcm-lb-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #0b0b0b;
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.tcm-lb-score {
  flex: none;
  width: 34px;
  text-align: right;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

/* ============================================================
   08 · Horizontal leaderboard — podium of growing bars + medals
   ============================================================ */
.tcm-podium {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 14px 14px;       /* room for medals (top:-10) + card shadow */
  scrollbar-width: none;
}
.tcm-podium::-webkit-scrollbar { display: none; }
.tcm-pod {
  flex: 1 0 210px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  position: relative;
}
.tcm-pod-medal {
  position: absolute;
  top: -10px;
  left: -8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}
.tcm-pod:nth-child(1) .tcm-pod-medal { color: #fff; background: #0b0b0b; border-color: transparent; box-shadow: 0 6px 16px rgba(11, 11, 11, 0.34); }
.tcm-pod .creator { width: 100%; }
.tcm-pod-bar {
  position: relative;
  height: 150px;
  border-radius: 16px;
  background: rgba(11, 11, 11, 0.045);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.tcm-pod-fill {
  width: 100%;
  height: 0;
  border-radius: 16px 16px 0 0;
  background: #0b0b0b;
  transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.tcm-pod-score {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   09 · Focus coverflow — centred card sharp, neighbours recede
   ============================================================ */
.tcm-rail--flow {
  position: relative;
  overflow: hidden;
  padding: 44px 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.tcm-flow {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}
.tcm-flow .creator {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  margin-right: var(--gap);
  opacity: 0.5;
  transform: scale(0.8);
}
.tcm-flow .creator.is-active {
  box-shadow: var(--shadow-focus);
}

/* ============================================================
   10 · Drag / scroll-snap strip — user-controlled
   ============================================================ */
.tcm-snap {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 22px 0 40px;
  scrollbar-width: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.tcm-snap::-webkit-scrollbar { display: none; }
.tcm-snap.is-drag { cursor: grabbing; scroll-snap-type: none; }
.tcm-snap.is-drag .creator { pointer-events: none; }
.tcm-snap .creator {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  scroll-snap-align: center;
}

/* ---------------- Responsive (new variants) ---------------- */
@media (max-width: 860px) {
  .tcm-cols2 { gap: 14px; }
  .tcm-lb-row { grid-template-columns: 34px minmax(0, 1fr); }
  .tcm-lb-meter { grid-column: 1 / -1; }
  .tcm-pod { flex-basis: 180px; }
}
@media (max-width: 560px) {
  .tcm-rail--v2 .tcm-cols2 { grid-template-columns: 1fr; }
  .tcm-rail--v2 .tcm-col:nth-child(2) { display: none; }
}

/* ---------------- Reduced motion (new variants) ---------------- */
@media (prefers-reduced-motion: reduce) {
  .tcm-rail--v1,
  .tcm-rail--v2 { height: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .tcm-rail--v1 .tcm-col, .tcm-rail--v2 .tcm-col, .tcm-onecol { overflow: visible; }
  .tcm-rail--flow { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .tcm-flow .creator { opacity: 1; transform: none; }
}

/* ============================================================
   11–15 · VERTICAL FOCUS-COVERFLOW FAMILY  (vertical columns only)
   A shared engine centres one card per column and recedes the rest by
   distance. Modes: scale (11–13), 3D wheel (14), depth-blur (15).
   ============================================================ */
.tcm-vcgrid { display: grid; gap: 22px; }
.tcm-vcgrid--2 { grid-template-columns: repeat(2, 1fr); }
.tcm-vcgrid--3 { grid-template-columns: repeat(3, 1fr); }

.tcm-vc {
  position: relative;
  height: 480px;
  padding: 0 20px;              /* horizontal gutter so focal-card shadow clears the clip edge */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.tcm-vc--tall { height: 540px; }
.tcm-vc--solo { max-width: 440px; margin: 0 auto; }
.tcm-vc--3d { perspective: 840px; }

.tcm-vctrack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  will-change: transform;
  transform-style: preserve-3d;
}
.tcm-vctrack .creator { width: 100%; opacity: 0.5; backface-visibility: hidden; }
.tcm-vctrack .creator.is-active {
  box-shadow: var(--shadow-focus);
}

@media (max-width: 860px) {
  .tcm-vcgrid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .tcm-vcgrid--2, .tcm-vcgrid--3 { grid-template-columns: 1fr; }
  .tcm-vcgrid--2 .tcm-vc:nth-child(n+2),
  .tcm-vcgrid--3 .tcm-vc:nth-child(n+2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tcm-vc { height: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; perspective: none; }
  .tcm-vctrack .creator { opacity: 1 !important; transform: none !important; filter: none !important; }
}
