/* ══════════════════════════════════════════════════════════════════════════
   SKILLS — the marketplace page.

   Structural twin of .sched-page; the shared column, gutters and entrance
   live in /pages.css. Cards
   reuse the app's surface/border tokens; the brand tile is .skill-ic from
   index.html at a larger size. Loaded after index.html's <style> block.
   ══════════════════════════════════════════════════════════════════════════ */

.skills-page {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: 22px 28px 96px;
}
.skills-page[hidden] { display: none; }

/* The page is the scroller (at ≥981px .main is a fixed-height flex column, so
   a view that doesn't claim the overflow is clipped) — same rule as
   .sched-page. */
#screen-home.active .skills-page:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.skills-page > .lede { margin-bottom: 16px; max-width: 640px; }

.sk-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sk-filters .net-chip .n {
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 6px;
  opacity: .6;
}

.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.sk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(244, 244, 238, .05);
  transition: border-color .2s, transform .2s var(--exp);
}
.sk-card:hover { border-color: color-mix(in srgb, var(--ink) 22%, transparent); transform: translateY(-1px); }
.sk-card.sk-flash { animation: skFlash 1.2s var(--exp); }
@keyframes skFlash {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(244, 244, 238, .05); }
  30% { box-shadow: 0 0 0 2px var(--on), 0 0 28px var(--on-glow); }
}

.sk-head { display: flex; align-items: center; gap: 14px; }
.sk-head .skill-ic { width: 52px; height: 52px; border-radius: 14px; }
.sk-head .skill-ic svg { width: 28px; height: 28px; }
.sk-head .skill-ic.wide svg { width: 46px; height: 46px; }
.sk-title { min-width: 0; flex: 1; }
.sk-name { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.sk-cat {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sk-status {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
}
.sk-status.on { color: var(--on); }

.sk-desc { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }

.sk-tries { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin-top: -4px; }
.sk-try-lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sk-try {
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  max-width: 100%;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sk-try:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 28%, transparent); }

.sk-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}
.sk-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sk-where { font-size: 12px; color: var(--ink-3); }
.sk-foot button { padding: 8px 16px; }
/* Connect (primary) and Disconnect (ghost) share one footprint, so cards
   don't change height between states. */
.sk-card .sk-foot button.primary,
.sk-card .sk-foot button.ghost,
.sk-card .sk-foot .skill-always {
  width: auto;
  min-width: 132px;
  height: 40px;
  min-height: 40px;
  padding: 0 18px;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.sk-skel { min-height: 220px; opacity: .5; animation: pulse 1.4s ease-in-out infinite; }
.sk-empty { grid-column: 1 / -1; padding: 24px 0; }

@media (max-width: 980px) {
  .skills-page { padding: 16px 16px 120px; }
  .sk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .sk-card { min-height: 0; }
}
@media (max-width: 640px) {
  .sk-grid { grid-template-columns: 1fr; }
}

/* The topbar drops its page-scoping chrome here, as on Schedules — the room
   switcher scopes the fleet, not the skills. */
#screen-home:has(.skills-page:not([hidden])) .room-slot { display: none; }

/* Coming soon: listed so people know it's on the way, but quieter and with
   nothing to press. */
.sk-card.is-soon { opacity: .72; }
.sk-card.is-soon:hover { transform: none; }
.sk-soon-tag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  border: 1px solid var(--border);
}
.sk-foot .sk-soon { color: var(--ink-3); }

/* ── Sliding filter highlight ─────────────────────────────────────────── */
/* One green pill that glides between ALL / CONNECTED / AVAILABLE; the
   chips themselves stay fixed (skills.js positionFilterInd drives it). */
.sk-filters { position: relative; }
.sk-filters .sk-ind {
  position: absolute;
  top: 0; left: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--on) 55%, transparent);
  background: color-mix(in srgb, var(--on) 12%, transparent);
  pointer-events: none;
  transition: transform .3s var(--ease), width .3s var(--ease);
  will-change: transform, width;
}
.sk-filters .net-chip { position: relative; z-index: 1; }
/* The glide replaces the per-chip repaint; keep only the text change. */
.sk-filters .net-chip.active { border-color: transparent; background: transparent; }
@media (prefers-reduced-motion: reduce) {
  .sk-filters .sk-ind { transition: none; }
}
