/* ==========================================================================
   Skills Section — styles for skillsSection.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section title masks + particle layering
   (shared visual pattern with other sections — can be hoisted to a shared CSS)
   -------------------------------------------------------------------------- */
.leftmask   { transform: translateX(0); }
.rightmask  { transform: translateX(0); }
.topmask    { transform: translateY(0); }
.bottommask { transform: translateY(0); }

.sectionTitle { isolation: isolate; }

.particle-section {
  position: relative;
  overflow: hidden;
}
.particle-section > :not(.absolute) {
  z-index: 1;
  position: relative;
}

/* --------------------------------------------------------------------------
   Sphere wrapper + selected-skill panel
   -------------------------------------------------------------------------- */
.skills-sphere-wrap {
  position: relative;
}

.skills-selected-panel {
  position: relative;
  padding: 22px 24px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 48px -34px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
}

.dark .skills-selected-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 24px 48px -34px rgba(0, 0, 0, 0.9);
}

.skills-selected-kicker {
  margin: 0 0 8px;
  color: #000;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dark .skills-selected-kicker { color: #fff; }

.skills-selected-title {
  margin: 0;
  color: #000;
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1.05;
}
.dark .skills-selected-title { color: #fff; }

.skills-selected-copy {
  margin: 10px 0 0;
  color: #333;
  font-size: 0.98rem;
  line-height: 1.6;
}
.dark .skills-selected-copy { color: #ccc; }

/* --------------------------------------------------------------------------
   Shell — no rectangle, transparent, borderless.
   -------------------------------------------------------------------------- */
.skills-sphere-shell {
  position: relative;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dark .skills-sphere-shell {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.skills-sphere-stage {
  position: relative;
  width: 100%;
  height: 520px;
  min-height: 420px;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  contain: layout paint;
}

.skills-sphere-stage[data-ready="true"] {
  opacity: 1;
}

.skills-sphere-stage:active { cursor: grabbing; }

.skills-sphere-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* --------------------------------------------------------------------------
   Orbit badge — grayscale by default, color on hover/focus/active
   -------------------------------------------------------------------------- */
.skills-orbit-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: auto;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #000;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  user-select: none;
  box-shadow: none;
  transform-origin: center;
  contain: layout paint style;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

.dark .skills-orbit-label { color: #fff; }

.skills-orbit-anchor {
  min-width: 56px;
  min-height: 56px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.skills-orbit-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  pointer-events: none;
  filter: grayscale(1) contrast(0.9);
  opacity: 0.55;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.skills-orbit-icon.needs-dark-chip {
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.dark .skills-orbit-icon.needs-dark-chip {
  background: rgba(30, 30, 30, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.skills-orbit-text {
  position: static;
  transform: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  opacity: 0.75;
  pointer-events: none;
  box-shadow: none;
  transition: opacity 0.25s ease;
}

.skills-orbit-fallback {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
  pointer-events: none;
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.dark .skills-orbit-fallback { background: #fff; color: #000; }

.skills-orbit-label.is-active .skills-orbit-icon,
.skills-orbit-label:hover .skills-orbit-icon,
.skills-orbit-label:focus-visible .skills-orbit-icon {
  filter: grayscale(0) contrast(1.05) saturate(1.2);
  opacity: 1;
  transform: scale(1.18);
}

.skills-orbit-label.is-active .skills-orbit-text,
.skills-orbit-label:hover .skills-orbit-text,
.skills-orbit-label:focus-visible .skills-orbit-text {
  opacity: 1;
}

.skills-orbit-label.is-active .skills-orbit-fallback,
.skills-orbit-label:hover .skills-orbit-fallback,
.skills-orbit-label:focus-visible .skills-orbit-fallback {
  filter: grayscale(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Fallback list (shown when effects are off / WebGL unavailable)
   -------------------------------------------------------------------------- */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-content: flex-start;
  padding: 12px;
  opacity: 1;
}

.skills-list button {
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.skills-list button[aria-pressed="true"] {
  background: currentColor;
  color: #fff;
}

.dark .skills-list button[aria-pressed="true"] {
  color: #000;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .skills-sphere-stage { height: 480px; min-height: 380px; }
  .skills-orbit-label { gap: 5px; font-size: 10px; }
  .skills-orbit-icon { width: 30px; height: 30px; }
  .skills-orbit-fallback { width: 30px; height: 30px; font-size: 9px; }
  .skills-orbit-anchor { min-width: 50px; min-height: 50px; }
}

@media (max-width: 820px) {
  .skills-sphere-stage { height: 420px; min-height: 340px; }
  .skills-orbit-label { gap: 4px; font-size: 9px; }
  .skills-orbit-icon { width: 26px; height: 26px; }
  .skills-orbit-fallback { width: 26px; height: 26px; font-size: 8px; }
  .skills-orbit-anchor { min-width: 44px; min-height: 44px; }
  .skills-orbit-text { font-size: 9px; }
  .skills-selected-panel { padding: 16px 18px 18px; border-radius: 18px; }
  .skills-selected-title { font-size: clamp(1.2rem, 3vw, 1.5rem); }
  .skills-selected-copy { font-size: 0.85rem; }
}

@media (max-width: 640px) {
  .skills-sphere-stage { height: 360px; min-height: 300px; }
  .skills-orbit-label { gap: 3px; font-size: 8px; padding: 2px; }
  .skills-orbit-icon { width: 22px; height: 22px; }
  .skills-orbit-fallback { width: 22px; height: 22px; font-size: 7px; }
  .skills-orbit-anchor { min-width: 38px; min-height: 38px; }
  .skills-orbit-text { font-size: 8px; letter-spacing: 0.02em; }
  .skills-selected-panel { padding: 14px 16px 16px; border-radius: 16px; margin-top: 16px; }
  .skills-selected-kicker { font-size: 9px; margin-bottom: 4px; }
  .skills-selected-title { font-size: clamp(1rem, 4vw, 1.2rem); }
  .skills-selected-copy { font-size: 0.78rem; margin-top: 6px; line-height: 1.5; }
  #skills-instructions { font-size: 0.75rem; padding: 8px 16px; margin-bottom: 16px; }
}

@media (max-width: 380px) {
  .skills-sphere-stage { height: 300px; min-height: 260px; }
  .skills-orbit-icon { width: 18px; height: 18px; }
  .skills-orbit-fallback { width: 18px; height: 18px; font-size: 6px; }
  .skills-orbit-anchor { min-width: 32px; min-height: 32px; }
  .skills-orbit-label { gap: 2px; font-size: 7px; }
  .skills-orbit-text { font-size: 7px; }
  .skills-selected-panel { padding: 12px 14px 14px; border-radius: 14px; }
}

@media (hover: none) and (pointer: coarse) {
  .skills-orbit-anchor { min-width: 48px; min-height: 48px; }
  .skills-orbit-label { padding: 4px; min-width: 40px; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .skills-orbit-label,
  .skills-orbit-text,
  .skills-orbit-icon,
  .skills-orbit-fallback,
  .maintitle-title,
  .maintitle-title-shadow,
  .mask,
  .particle-section {
    transition: none !important;
  }
  .skills-sphere-stage {
    cursor: default;
    transition: none !important;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .skills-sphere-stage canvas { image-rendering: auto; }
}