/* =============================================================
   SKILLS.CSS — Orbit visual, skill category cards, credential tabs
   ============================================================= */

/* ─── Skills hero — title/stats and the orbit side by side, instead
   of stacking (which was pushing everything below the fold) ────── */
.skills-hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
}
@media (max-width: 900px) {
  .skills-hero__grid { grid-template-columns: 1fr; }
}

/* ─── Orbit hero visual (highlight skills) ──────────────── */
/* Pill radius is derived from --orbit-size (below) rather than an
   independent vw formula, so it can never exceed the box the pills
   are meant to stay inside of — the two used to drift apart on narrow
   viewports and pills got clipped by the screen edge. The floor on
   --orbit-size keeps things readable on very small phones instead of
   shrinking indefinitely. */
.orbit {
  --orbit-size: clamp(230px, 76vw, 360px);
  position: relative;
  width: var(--orbit-size);
  aspect-ratio: 1;
  margin-inline: auto;
  /* pills are allowed to extend slightly past this box (no clipping) —
     it's a sizing reference for the rings/core, not a hard boundary */
  overflow: visible;
}
@media (max-width: 900px) {
  .orbit { margin-top: 1rem; }
}
.orbit__core {
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: var(--gradient-brand);
  filter: blur(0.5px);
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent-violet) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.orbit__core svg { color: var(--bg); }

/* Purely decorative dashed circles — no text, so independent rotation
   speeds are safe here (nothing to collide). */
.orbit__ring {
  position: absolute;
  inset: 0;
  border: 1px dashed var(--border-strong);
  border-radius: 50%;
  animation: orbit-spin-cw 34s linear infinite;
}
.orbit__ring--2 { inset: 17%; animation: orbit-spin-ccw 26s linear infinite; }
@keyframes orbit-spin-cw { to { transform: rotate(360deg); } }
@keyframes orbit-spin-ccw { to { transform: rotate(-360deg); } }

/* Outer/inner pill groups rotate together at the exact same speed and
   direction, as one rigid assembly — the angular offset between an
   outer pill and its nearest inner neighbour never changes. That's
   what actually guarantees they can never drift into each other
   (independently-timed rings would periodically realign and collide).
   Each pill then counter-rotates at that same speed/duration so its
   text always reads upright instead of spinning in place. */
.orbit__group {
  position: absolute;
  inset: 0;
  animation: orbit-spin-cw 42s linear infinite;
}
.orbit__item .pill {
  white-space: nowrap;
  animation: orbit-spin-ccw 42s linear infinite;
  /* Shrinks alongside --orbit-size on narrow screens — smaller pills
     need less radial gap, which is what actually keeps the two rings
     from overlapping once the whole orbit is forced smaller. */
  font-size: clamp(0.5rem, 0.36rem + 0.5vw, 0.6875rem);
  padding: clamp(0.3em, 0.22em + 0.28vw, 0.4em) clamp(0.6em, 0.44em + 0.56vw, 0.9em);
}

.orbit__item { position: absolute; top: 50%; left: 50%; }
.orbit__group--outer .orbit__item {
  --radius: calc(var(--orbit-size) * 0.4583);
  transform: translate(-50%, -50%) rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle)));
}
.orbit__group--inner .orbit__item {
  --radius: calc(var(--orbit-size) * 0.25);
  transform: translate(-50%, -50%) rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle)));
}

@media (prefers-reduced-motion: reduce) {
  .orbit__ring, .orbit__group, .orbit__item .pill { animation: none; }
}

/* ─── Generic tab component (credentials + skills-by-category) ──
   One shared chrome: a pill nav + swappable panels. Bound generically
   in initSkillsInteractions() via [data-tab-group], so any section
   can drop this in without new JS. ──────────────────────────────── */
.tab-group__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.tab-group__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur-fast);
}
.tab-group__tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab-group__tab.is-active { color: var(--bg); background: var(--gradient-brand); border-color: transparent; }
.tab-group__count {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  padding: 0.1rem 0.45rem;
  border-radius: var(--r-full);
  background: color-mix(in srgb, currentColor 18%, transparent);
}
.tab-group__panel { display: none; }
.tab-group__panel.is-active { display: block; }

/* ─── Skills by category — focused tab panel content ─────────── */
.skill-panel__head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.8rem;
}
.skill-panel__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: var(--bg);
  box-shadow: 0 0 34px color-mix(in srgb, var(--accent-violet) 45%, transparent);
  flex-shrink: 0;
}
.skill-panel__title { font-size: var(--fs-xl); margin-bottom: 0.2rem; }
.skill-panel__count { color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-xs); }

.skill-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.75em 1.2em;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.skill-chip:hover {
  border-color: var(--accent-cyan);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--accent-cyan) 45%, transparent);
}
.skill-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-brand);
  flex-shrink: 0;
}
.skill-chip--working .skill-chip__dot { background: var(--accent-amber); opacity: 0.75; }

.creds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-sm);
}

.cred-card {
  padding: 1.4rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.cred-card:hover { border-color: var(--accent-cyan); transform: translateY(-3px); }
.cred-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.cred-card__meta { display: flex; gap: 0.5rem; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-faint); text-transform: uppercase; }
.cred-card__group { font-size: var(--fs-2xs); color: var(--accent-cyan); }
.cred-card__title { font-size: var(--fs-base); margin-bottom: 0.4rem; line-height: var(--lh-snug); }
.cred-card__desc { font-size: var(--fs-xs); color: var(--text-dim); line-height: var(--lh-relaxed); margin-bottom: 0.8rem; }
.cred-card__link { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-cyan); display: inline-flex; gap: 0.35em; align-items: center; }
.cred-card__link:hover { text-decoration: underline; }

.skills-filter-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin-top: 0.4rem;
}
