/* Homepage impact strip under the hero (.tb2, script trust.js). The big
   "students across all platforms" number sits inside an orbit of the
   platforms it counts; six tiles carry the other numbers, the live ones
   marked with a pulsing dot; a slow ribbon lists the countries students
   registered from. Scoped to .tb2: .trust-grid/.trust-item are also used in /admin. */
.tb2 { position: relative; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-elevated); overflow: hidden; }
.tb2-inner { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.6fr); gap: 22px; padding: 44px 0 26px; align-items: stretch; }

/* ---------- The big number in its orbit ---------- */
.tb2-hero {
  position: relative; display: grid; place-items: center; text-align: center; min-height: 362px; padding: 28px 18px;
  border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); isolation: isolate; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 20%, var(--surface)), var(--surface) 70%);
}
.tb2-orbit { position: absolute; z-index: -1; width: min(298px, 84%); aspect-ratio: 1; left: 50%; top: 50%; translate: -50% -50%; }
.tb2-orbit::before, .tb2-orbit::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent-2) 30%, transparent); }
.tb2-orbit::after { inset: 18%; border-style: solid; border-color: color-mix(in srgb, var(--accent) 16%, transparent); }
.tb2-orbit-spin { position: absolute; inset: 0; animation: tb2-spin 36s linear infinite; }
.tb2-planet {
  position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 18px -6px var(--pc, var(--accent));
  background: var(--pc, var(--accent));
  animation: tb2-spin 36s linear infinite reverse; /* the icons stay upright while the ring turns */
}
.tb2-planet svg { width: 19px; height: 19px; }
.tb2-planet:nth-child(1) { left: 50%; top: 0; --pc: #229ed9; }
.tb2-planet:nth-child(2) { left: 93.3%; top: 75%; --pc: #1877f2; }
.tb2-planet:nth-child(3) { left: 6.7%; top: 75%; --pc: #ff0033; }
.tb2-hero .trust-num { font-size: clamp(2.6rem, 2rem + 2.4vw, 3.6rem); line-height: 1; letter-spacing: -0.02em; }
.tb2-hero-label { margin: 10px 0 4px; font: 600 1.02rem/1.3 var(--font-head); color: var(--text); }
.tb2-hero-sub { margin: 0; font-size: 0.82rem; color: var(--text-muted); max-width: 24ch; }

/* The text always sits inside the ring (founder request): the ring is sized from the card
   (container units) and the number, label and line below are sized from the ring. */
.tb2-hero { container-type: inline-size; min-height: 400px; }
.tb2-orbit { width: min(360px, 92cqi); }
.tb2-hero > div:last-child { max-width: min(250px, 64cqi); }
.tb2-hero .trust-num { font-size: min(3.3rem, 13.6cqi); }
.tb2-hero-label { font-size: min(1rem, 4.3cqi); margin: 8px 0 4px; }
.tb2-hero-sub { font-size: min(0.8rem, 3.6cqi); max-width: 22ch; margin: 0 auto; }
/* The inner ring is drawn wider (84% of the orbit instead of 64%) so every line of text sits inside it. */
.tb2-orbit::after { inset: 8%; }

/* ---------- Tiles ---------- */
.tb2-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.tb2-tile {
  --tc: var(--accent);
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 18px 18px 16px; min-height: 138px;
  border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), border-color 0.35s ease, box-shadow 0.35s ease;
}
.tb2-tile::before { /* a thin bar in the tile's colour that grows in when the strip is first seen */
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--tc);
  transform: scaleX(0); transform-origin: left; transition: transform 0.9s cubic-bezier(.2,.8,.2,1) var(--d, 0s);
}
.tb2.is-seen .tb2-tile::before { transform: scaleX(1); }
.tb2-tile:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tc) 45%, var(--border)); box-shadow: 0 18px 30px -22px var(--tc); }
.tb2-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb2-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, transparent); }
.tb2-ic svg { width: 19px; height: 19px; }
.tb2-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 600; color: var(--success); }
.tb2-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: tb2-pulse 2s ease-out infinite; }
.tb2-tile .trust-num, .tb2-big { font: 700 clamp(1.5rem, 1.1rem + 1vw, 1.95rem)/1.05 var(--font-head); color: var(--text); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tb2-tile .trust-num { -webkit-text-fill-color: currentColor; background: none; }
.tb2-tile-label { display: block; margin-top: 4px; font-size: 0.84rem; color: var(--text-muted); }
.tb2-tile.is-bump .trust-num { animation: tb2-bump 0.6s ease; }

/* ---------- Countries ribbon ---------- */
.tb2-ribbon { position: relative; padding: 0 0 30px; }
.tb2-ribbon[hidden] { display: none; }
.tb2-ribbon-mask { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.tb2-ribbon-track { display: flex; gap: 10px; width: max-content; animation: tb2-ribbon var(--ribbon-dur, 60s) linear infinite; }
.tb2-ribbon:hover .tb2-ribbon-track, .tb2-ribbon:focus-within .tb2-ribbon-track { animation-play-state: paused; }
.tb2-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; white-space: nowrap; font-size: 0.84rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.tb2-chip b { font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.tb2-ribbon-title { margin: 0 0 10px; font-size: 0.82rem; color: var(--text-muted); text-align: center; }

@keyframes tb2-spin { to { transform: rotate(360deg); } }
@keyframes tb2-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes tb2-bump { 40% { transform: translateY(-3px); color: var(--success); } }
@keyframes tb2-ribbon { to { transform: translateX(-50%); } }

/* ---------- Smaller screens ---------- */
@media (max-width: 979px) {
  .tb2-inner { grid-template-columns: 1fr; }
  .tb2-hero { min-height: 340px; }
}
@media (max-width: 640px) {
  .tb2-inner { padding-top: 32px; gap: 14px; }
  .tb2-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tb2-tile { min-height: 124px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .tb2-orbit-spin, .tb2-planet, .tb2-live::before { animation: none; }
  .tb2-tile::before { transition: none; }
  .tb2-tile:hover { transform: none; }
  .tb2-ribbon-mask { -webkit-mask-image: none; mask-image: none; }
  .tb2-ribbon-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .tb2-ribbon-track [aria-hidden="true"] { display: none; }
}
html.lite .tb2-orbit-spin, html.lite .tb2-planet { animation: none; }
