/* Top Builders, the 3D round (top-builders-3d.js, founder 2026-11-06).
   Every animation here runs ONCE on arrival, or is a decorative object turning on its own. Nothing
   follows the pointer: the founder's rule of 2026-10-12. */

.tb3 { display: flex; flex-direction: column; gap: 56px; }
.tb3-before { margin-bottom: 48px; }
.tb3-after { margin-top: 56px; }
.tb3-head { text-align: center; }
.tb3-eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold, #f5b82e); }
.tb3-head h2 { margin: 8px 0 8px; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.tb3-sub { margin: 0 auto; color: var(--text-muted); line-height: 1.6; font-size: .94rem; }
.tb3-flag { width: 18px; height: 13.5px; flex: none; }

/* ---------- 1. the numbers ---------- */
.tb3-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tb3-num { padding: 20px 16px; text-align: center; border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(56, 182, 255, .12), rgba(139, 92, 246, .06) 60%, transparent); }
.tb3-num strong { display: block; font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.1; }
.tb3-num span { font-size: .8rem; color: var(--text-muted); letter-spacing: .04em; }

/* ---------- 2. the podium ---------- */
.tb3-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; perspective: 1000px; }
.tb3-place { display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(26px) rotateX(16deg); transform-origin: 50% 100%;
  transition: opacity .6s ease calc(var(--o) * 130ms), transform .75s cubic-bezier(.2, .9, .25, 1) calc(var(--o) * 130ms); }
.tb3-podium.is-in .tb3-place { opacity: 1; transform: none; }
.tb3-pwho { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; min-width: 0; }
.tb3-pface { width: 64px; height: 64px; border-radius: 50% !important; object-fit: cover; border: 2px solid rgba(255, 255, 255, .25); }
.tb3-pface.is-letters { display: grid; place-items: center; font-size: 1.1rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #38b6ff, #8b5cf6); }
.tb3-pwho strong { font-size: .98rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb3-pmeta { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--text-muted); }
.tb3-block { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
  padding: 14px 10px 16px; border: 1px solid var(--border); border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.tb3-pnum { font-size: 1.5rem; font-weight: 800; line-height: 1; opacity: .5; }
.tb3-ppts { font-size: 1.15rem; }
.tb3-plab { font-size: .72rem; color: var(--text-muted); letter-spacing: .05em; }
.is-gold .tb3-block { height: 168px; background: linear-gradient(180deg, rgba(245, 184, 46, .4), rgba(245, 184, 46, .08)); border-color: rgba(245, 184, 46, .5); }
.is-silver .tb3-block { height: 126px; background: linear-gradient(180deg, rgba(203, 213, 225, .32), rgba(203, 213, 225, .06)); border-color: rgba(203, 213, 225, .4); }
.is-bronze .tb3-block { height: 104px; background: linear-gradient(180deg, rgba(205, 127, 50, .34), rgba(205, 127, 50, .06)); border-color: rgba(205, 127, 50, .45); }

/* ---------- 3. the carousel ---------- */
.tb3-stage { position: relative; margin-top: 22px; height: 420px; perspective: 1400px; }
.tb3-track { position: absolute; inset: 0; transform-style: preserve-3d; }
/* the ring uses the room it has now that the container does (founder 2026-11-06) */
.tb3-slide { position: absolute; top: 0; left: 50%; width: min(620px, 52%); height: 380px; margin-left: calc(min(620px, 52%) / -2);
  display: block; overflow: hidden; border: 1px solid var(--border); background: #0a1026; text-decoration: none; color: inherit;
  transform: translate3d(calc(var(--d) * 56%), 0, calc(var(--d) * var(--d) * -170px)) rotateY(calc(var(--d) * -22deg));
  opacity: calc(1 - (var(--d) * var(--d)) * 0.3);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .7s, box-shadow .4s;
  z-index: 1; }
.tb3-slide.is-on { z-index: 3; box-shadow: 0 30px 60px -30px rgba(2, 8, 28, .95); }
.tb3-slide[aria-hidden="true"] { pointer-events: none; }
.tb3-cover { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.tb3-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  background: linear-gradient(0deg, rgba(3, 9, 26, .96), rgba(3, 9, 26, .75) 60%, transparent); }
.tb3-cap strong { font-size: .98rem; }
.tb3-by { font-size: .8rem; color: var(--text-muted); }
.tb3-tag { position: absolute; top: -32px; right: 14px; padding: 4px 10px; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #04101f; background: var(--gold, #f5b82e); }
.tb3-arrow { position: absolute; top: 50%; z-index: 5; display: grid; place-items: center; width: 42px; height: 42px; margin-top: -21px;
  color: var(--text); background: rgba(6, 14, 36, .85); border: 1px solid var(--border); cursor: pointer; transition: background .25s, border-color .25s; }
.tb3-arrow:hover { background: rgba(14, 30, 64, .95); border-color: rgba(125, 184, 255, .6); }
.tb3-arrow svg { width: 20px; height: 20px; }
.tb3-arrow.is-prev { left: 0; }
.tb3-arrow.is-next { right: 0; }

/* ---------- 4. the rungs ---------- */
.tb3-rungs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 22px; perspective: 900px; }
.tb3-rung { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 18px 12px; text-align: center;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .035);
  opacity: 0; transform: rotateX(32deg) translateY(14px); transform-origin: 50% 0;
  transition: opacity .5s ease calc(var(--i) * 70ms), transform .7s cubic-bezier(.2, .9, .25, 1) calc(var(--i) * 70ms); }
.tb3-rungs.is-in .tb3-rung { opacity: 1; transform: none; }
.tb3-rung.is-empty { opacity: .55; }
.tb3-rungs.is-in .tb3-rung.is-empty { opacity: .55; }
.tb3-badge { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50% !important;
  background: conic-gradient(from 210deg, rgba(56, 182, 255, .55), rgba(139, 92, 246, .55), rgba(245, 184, 46, .55), rgba(56, 182, 255, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.tb3-badge-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50% !important;
  font-size: .92rem; font-weight: 800; color: var(--text); background: #0a1228; }
.tb3-rung strong { font-size: .92rem; }
.tb3-rung-at { font-size: .76rem; color: var(--text-muted); }

/* ---------- 5. the globe ---------- */
.tb3-world { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: center;
  padding: 30px; border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(56, 182, 255, .08), rgba(139, 92, 246, .05) 60%, transparent); }
.tb3-world-tx { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tb3-world-tx .tb3-sub { margin: 0; text-align: left; }
.tb3-wtop { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tb3-cbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font: inherit; font-size: .84rem; font-weight: 600;
  color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid var(--border); cursor: pointer;
  transition: background .25s, border-color .25s, transform .25s; }
.tb3-cbtn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(125, 184, 255, .6); transform: translateY(-2px); }
.tb3-cbtn b { font-size: .76rem; color: var(--text-muted); }
.tb3-globe { position: relative; min-height: 440px; }
.tb3-globe .sa-globe { position: absolute; inset: 0; cursor: grab; touch-action: pan-y; }
.tb3-globe .sa-globe.is-drag { cursor: grabbing; }
.tb3-hint { position: absolute; right: 10px; bottom: 8px; font-size: .74rem; color: var(--text-muted); pointer-events: none; }
.tb3-globe .sa-gtip { position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 12px)); padding: 6px 10px; font-size: .78rem;
  font-weight: 600; white-space: nowrap; color: #fff; background: rgba(4, 11, 31, .92); border: 1px solid rgba(255, 255, 255, .14); pointer-events: none; }

@media (max-width: 900px) {
  /* The globe engine will not draw itself below 200 CSS px across (site-analytics-globe.js clamps),
     and the page is drawn at zoom 1.25 - so on a 390px phone the card's padding has to leave the
     holder at least 250 real pixels, or the sphere is wider than its box. 14px each side does. */
  .tb3-world { grid-template-columns: minmax(0, 1fr); padding: 18px 14px; }
  .tb3-globe { min-height: 320px; }
  .tb3-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tb3-num { padding: 14px 8px; }
  .tb3-stage { height: 290px; }
  .tb3-slide { width: 86%; height: 250px; margin-left: -43%; }
  .tb3-pface { width: 52px; height: 52px; }
  .is-gold .tb3-block { height: 130px; }
  .is-silver .tb3-block { height: 100px; }
  .is-bronze .tb3-block { height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .tb3-place, .tb3-rung { opacity: 1; transform: none; transition: none; }
  .tb3-slide { transition: none; }
}
