/* ==========================================================
 TECH PARTNERS WHEEL
 Desktop: wheel left, heading + card right (focus on the right of the wheel)
 Tablet (< 992px): heading on top, wheel + card side by side
 Mobile (< 768px): stacked, focus at the bottom of the wheel, top of the wheel cropped
 Wheel geometry is set by js/tech_partners_v2.js, which reads --tp-mode.
 ========================================================== */
.tech-partners {
  --tp-green-deep: #0f3d22;
  --tp-green-mid: #1f6f43;
  --tp-green-bright: #3faf68;
  --tp-mint-2: #d9f2e2;
  --tp-mint-3: #e9f7ea;
  --tp-shadow-sm: 0 10px 20px rgba(31, 111, 67, 0.1);
  --tp-shadow-md: 0 16px 40px rgba(31, 111, 67, 0.14);
  --tp-chip: 64px;
  --tp-hub-logo: 96px;
  position: relative;
  overflow: hidden;
}
.section-container.tech-partners {
  padding-bottom: 1rem;
  padding-top: 0.5rem;
}

.tp-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "stage head"
    "stage panel";
  column-gap: 3.5rem;
  row-gap: 1.4rem;
}
.tp-grid::before {
  content: "";
  position: absolute;
  left: -10%;
  top: -10%;
  width: 70%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(126, 223, 166, 0.16), transparent 70%);
  pointer-events: none;
}
.tp-head {
  grid-area: head;
  align-self: end;
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}
.tp-head .eyebrow {
  justify-self: start;
}
.tp-head .heading-section {
  margin: 0;
}
.tp-lead {
  max-width: 46ch;
  margin: 0;
}
.tp-panel {
  grid-area: panel;
  align-self: start;
  display: grid;
  gap: 1.1rem;
  min-width: 0;
}

/* ---------- Wheel ---------- */
.tp-stage {
  --tp-mode: desktop;
  grid-area: stage;
  align-self: center;
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  margin: 0 auto;
  outline: none;
  touch-action: pan-y;
  overflow: hidden;
}
.tp-stage:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 4px;
  border-radius: 12px;
}
.tp-ring,
.tp-halo,
.tp-hub {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.tp-ring {
  pointer-events: none;
}
.tp-ring-outer {
  border: 1.5px dashed var(--tp-mint-2);
}
.tp-ring-inner {
  border: 1px solid var(--tp-mint-3);
  background: radial-gradient(circle, var(--brand-green-light) 0%, rgba(242, 248, 244, 0) 70%);
}
.tp-halo {
  background: radial-gradient(circle, rgba(63, 175, 104, 0.22), rgba(63, 175, 104, 0) 68%);
  pointer-events: none;
}
.tp-spoke {
  position: absolute;
  height: 2px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(63, 175, 104, 0), var(--tp-green-bright));
  pointer-events: none;
}
.tp-spoke::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tp-green-bright);
}

.tp-hub {
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--tp-green-deep) 0%, #14532d 30%, var(--tp-green-mid) 60%, #2e8b57 85%, var(--tp-green-bright) 100%);
  box-shadow: 0 0 0 10px var(--white), 0 0 0 11px var(--tp-mint-2), var(--tp-shadow-md);
}
.tp-hub-inner {
  display: grid;
  justify-items: center;
  gap: 6px;
}
.tp-hub-inner[hidden] {
  display: none;
}
.tp-hub-inner.is-entering {
  animation: tpHubIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tp-hub-logo {
  display: grid;
  place-items: center;
  width: var(--tp-hub-logo);
  height: var(--tp-hub-logo);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(15, 61, 34, 0.35);
  font-size: calc(var(--tp-hub-logo) * 0.3);
}
.tp-hub-name {
  max-width: 92%;
  font-weight: 700;
  font-size: var(--tp-hub-name, 1rem);
  line-height: 1.2;
}
.tp-hub-meta {
  font-size: var(--tp-hub-meta, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.tp-timer {
  position: absolute;
  inset: -10px;
  transform: rotate(-90deg);
  pointer-events: none;
}
.tp-timer circle {
  fill: none;
  stroke: var(--tp-green-bright);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.tp-item {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  will-change: transform, opacity, filter;
  -webkit-tap-highlight-color: transparent;
}
.tp-chip {
  display: grid;
  place-items: center;
  width: var(--tp-chip);
  height: var(--tp-chip);
  border-radius: 50%;
  background: var(--white);
  border: 2px solid transparent;
  box-shadow: var(--tp-shadow-sm);
  font-size: calc(var(--tp-chip) * 0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tp-item.is-focus .tp-chip {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 6px rgba(63, 175, 104, 0.16), var(--tp-shadow-md);
}

/* Logo when uploaded, otherwise two initials */
.tp-logo {
  display: block;
  width: 58%;
  height: 58%;
  object-fit: contain;
}
.tp-initials {
  display: grid;
  place-items: center;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9f7ea, #c8e6c9);
  color: var(--brand-green);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tp-hub-logo .tp-initials {
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 0 6px var(--white);
}

/* Without JS: plain row of logos, no wheel */
.tech-partners:not(.is-ready) .tp-stage {
  aspect-ratio: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.tech-partners:not(.is-ready) .tp-ring,
.tech-partners:not(.is-ready) .tp-halo,
.tech-partners:not(.is-ready) .tp-spoke,
.tech-partners:not(.is-ready) .tp-hub {
  display: none;
}
.tech-partners:not(.is-ready) .tp-item {
  position: static;
}

/* ---------- Partner card ---------- */
.tp-card {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--tp-mint-2);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--tp-shadow-sm);
}
.tp-card[hidden] {
  display: none;
}
.tp-card.is-entering {
  animation: tpCardIn 0.45s ease-out;
}
.tp-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.tp-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.tp-card-category {
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}
.tp-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--tp-mint-2);
  border-radius: 999px;
  background: var(--brand-green-light);
  color: var(--brand-green);
  font-size: 0.72rem;
  font-weight: 600;
}
.tp-tier svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.tp-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding-block: 14px;
  border-block: 1px solid var(--tp-mint-3);
}
.tp-stat {
  display: grid;
  gap: 2px;
  padding-inline: 4px;
  text-align: center;
}
.tp-stat + .tp-stat {
  border-left: 1px solid var(--tp-mint-3);
}
.tp-stat b {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand-green);
  font-variant-numeric: tabular-nums;
}
.tp-stat span {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tp-certs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tp-certs span {
  padding: 3px 10px;
  border: 1px solid var(--tp-mint-3);
  border-radius: 999px;
  background: var(--brand-green-light);
  font-size: 0.72rem;
}
.tp-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  border-radius: 25px;
  background: var(--brand-green);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.tp-cta:hover,
.tp-cta:focus-visible {
  background: var(--tp-green-mid);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(31, 111, 67, 0.22);
}

/* ---------- Controls ---------- */
.tp-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tp-nav button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid var(--tp-mint-2);
  border-radius: 50%;
  background: var(--white);
  color: var(--brand-green);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tp-nav button:hover,
.tp-nav button:focus-visible {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: var(--white);
}
.tp-nav svg {
  width: 18px;
  height: 18px;
}
.tp-count {
  min-width: 64px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tp-count b {
  color: var(--brand-green);
}
.tp-dots {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.tp-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--tp-mint-2);
  transition: width 0.3s ease, background 0.3s ease;
}
.tp-dots i.on {
  width: 18px;
  background: var(--brand-green);
}
.tp-hint {
  display: none;
  margin: 0;
  font-size: 0.72rem;
  text-align: center;
  color: var(--text-muted);
}

@keyframes tpHubIn {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes tpCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 991.98px) {
  .tp-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "stage panel";
    column-gap: 1.75rem;
    row-gap: 1.75rem;
  }
  .tp-head {
    justify-items: center;
    text-align: center;
  }
  .tp-head .eyebrow {
    justify-self: center;
  }
  .tp-lead {
    margin-inline: auto;
  }
  .tp-stage {
    --tp-mode: tablet;
  }
  .tp-panel {
    align-self: center;
  }
  .tp-dots {
    display: none;
  }
  .tp-card {
    padding: 1.1rem;
  }
  .tp-stat b {
    font-size: 1.25rem;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
  .tp-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "stage"
      "panel";
    row-gap: 0.9rem;
  }
  .tp-stage {
    --tp-mode: mobile;
    aspect-ratio: auto;
    max-width: 480px;
  }
  .tp-nav {
    justify-content: center;
  }
  .tp-cta {
    justify-self: stretch;
  }
  .tp-hint {
    display: block;
  }
  .tp-card-title {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-hub-inner.is-entering,
  .tp-card.is-entering {
    animation: none;
  }
}
