/* ═══════════════════════════════════════════════════════════════════
   skills.arions.dev — premium skill browser
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #09090b;
  --bg-1: #0d0d12;
  --bg-2: #121219;
  --surface: #15151c;
  --surface-hi: #1b1b24;
  --border: #25252f;
  --border-hi: #32323e;
  --fg: #ededf0;
  --fg-2: #b8b8c2;
  --fg-3: #85858f;
  --fg-4: #55555f;
  --accent: oklch(75% 0.18 295);
  --accent-2: oklch(68% 0.22 295);
  --ok: oklch(78% 0.15 155);
  --warn: oklch(80% 0.17 75);
  --f-sans: "Inter var", Inter, system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --page: 76rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--f-sans); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--f-mono); font-size: 0.92em; }
button, select { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in oklch, var(--accent) 45%, transparent); color: #fff; }

/* ambient */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient__mesh {
  position: absolute; inset: -20%;
  background:
    radial-gradient(45% 35% at 15% 10%, color-mix(in oklch, var(--accent) 28%, transparent) 0%, transparent 65%),
    radial-gradient(40% 32% at 85% 15%, color-mix(in oklch, #22d3ee 20%, transparent) 0%, transparent 70%);
  filter: blur(60px); opacity: 0.4;
}
.ambient__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 20%, #000 20%, transparent 100%);
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem max(1rem, calc((100vw - var(--page)) / 2 + 1rem));
  backdrop-filter: blur(14px) saturate(1.3);
  background: color-mix(in oklch, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav__brand { display: inline-flex; align-items: baseline; gap: 0.55rem; font-weight: 650; letter-spacing: -0.01em; font-size: 1rem; }
.nav__brand svg { transform: translateY(2px); }
.nav__links { display: flex; gap: 1.35rem; margin-left: auto; font-size: 0.92rem; color: var(--fg-2); }
.nav__links a { transition: color 0.18s var(--ease-out); }
.nav__links a:hover { color: var(--fg); }

main > section {
  max-width: var(--page); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
}

/* hero */
.hero { text-align: center; padding-bottom: clamp(1.5rem, 4vw, 2.5rem) !important; }
.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--f-mono); font-size: 0.72rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); opacity: 0.9;
}
.hero h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.05;
}
.hero__sub {
  max-width: 40rem; margin: 0 auto 1.75rem;
  color: var(--fg-2); font-size: 1.02rem;
}

/* search */
.search { max-width: 40rem; margin: 0 auto; }
.search__box {
  position: relative;
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 1rem 0.15rem 1.1rem;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.search__box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 18%, transparent);
}
.search__icon { color: var(--fg-3); margin-right: 0.6rem; flex-shrink: 0; }
#q {
  flex: 1; padding: 0.9rem 0;
  background: transparent; border: 0; color: var(--fg);
  font-family: var(--f-sans); font-size: 1rem; outline: 0;
}
#q::placeholder { color: var(--fg-3); }
.search__kbd {
  margin-left: 0.5rem;
  font-family: var(--f-mono); font-size: 0.72rem;
  color: var(--fg-3); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.12rem 0.4rem;
}

/* filters */
.filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem; margin: 1.1rem auto 0;
  max-width: 48rem;
}
.filter {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--fg-2); font-size: 0.86rem;
  border-radius: 999px;
  transition: all 0.2s var(--ease-out);
}
.filter:hover { color: var(--fg); border-color: var(--fg-4); }
.filter.is-active {
  background: color-mix(in oklch, var(--accent) 15%, var(--surface));
  border-color: var(--accent); color: var(--fg);
}
.filter__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }

/* results */
.results { padding-top: 1rem !important; }
.results__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
  color: var(--fg-3); font-size: 0.88rem;
}
.results__count { font-family: var(--f-mono); color: var(--fg-2); }
#sort {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0.4rem 0.75rem; color: var(--fg-2);
  font-family: var(--f-mono); font-size: 0.84rem;
  cursor: pointer;
}
#sort:hover { border-color: var(--fg-4); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.grid__loading { display: contents; }
.sk {
  height: 160px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hi) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  border: 1px solid var(--border); border-radius: var(--r);
  animation: shimmer 1.4s var(--ease-out) infinite;
  animation-delay: calc(var(--i, 0) * 0.08s);
}
@keyframes shimmer {
  0% { background-position: -120% 0; }
  100% { background-position: 120% 0; }
}
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.05rem 1.1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r);
  transition:
    transform 0.24s var(--ease-out),
    border-color 0.24s var(--ease-out),
    box-shadow 0.24s var(--ease-out);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}
.card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(70% 50% at 50% 0%, color-mix(in oklch, var(--accent) 18%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.24s var(--ease-out);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--fg-4);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.5);
}
.card:hover::after { opacity: 1; }
.card__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
}
.card__name {
  margin: 0;
  font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--fg);
  font-family: var(--f-mono);
}
.card__source {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--f-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-3);
}
.card__src-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }
.card__desc {
  margin: 0;
  color: var(--fg-2); font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__tags {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
  margin-top: 0.2rem;
}
.card__tag {
  background: var(--bg-2); color: var(--fg-3);
  font-size: 0.72rem; padding: 0.1rem 0.45rem;
  border-radius: 3px; font-family: var(--f-mono);
}
.card__cta {
  margin-top: 0.5rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}
.card__install {
  font-family: var(--f-mono); font-size: 0.82rem; color: var(--fg-2);
  user-select: all;
}
.card__install .tok-prompt { color: var(--accent); margin-right: 0.35rem; user-select: none; }
.card__install-id {
  color: var(--accent); transition: color 0.2s var(--ease-out);
}
.card:hover .card__install-id { color: #f0abfc; }
.card__copy {
  font-family: var(--f-mono); font-size: 0.72rem;
  color: var(--fg-3); padding: 0.25rem 0.55rem;
  border: 1px solid var(--border); border-radius: 4px;
  transition: all 0.2s var(--ease-out);
}
.card__copy:hover { color: var(--accent); border-color: var(--accent); }
.card__copy[data-copied] { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 40%, var(--border)); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--fg-3);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r);
}
.empty code { background: var(--bg-2); padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.86rem; color: var(--fg-2); }
.empty__big { color: var(--fg); font-size: 1.05rem; font-weight: 550; margin-bottom: 0.4rem; }

/* Modal */
.modal {
  border: 0; padding: 0;
  background: transparent;
  max-width: min(28rem, 92vw);
}
.modal::backdrop {
  background: rgba(5,5,10,0.6);
  backdrop-filter: blur(6px);
}
.modal__form {
  margin: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.75rem;
  color: var(--fg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.modal__close {
  position: absolute; top: 1rem; right: 1rem;
  width: 28px; height: 28px;
  border-radius: 50%; color: var(--fg-3);
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.modal__close:hover { background: var(--bg-2); color: var(--fg); }
.modal__head { margin-bottom: 1rem; }
.modal__head h2 { margin: 0.1rem 0 0.35rem; font-size: 1.15rem; letter-spacing: -0.01em; font-family: var(--f-mono); }
.modal__desc { margin: 0; color: var(--fg-2); font-size: 0.9rem; }
.modal__cmd {
  position: relative;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.9rem 1rem;
  overflow-x: auto;
}
.modal__cmd code {
  font-family: var(--f-mono); font-size: 0.88rem;
  color: var(--fg); white-space: pre; user-select: all;
}
.modal__copy {
  position: absolute; top: 0.6rem; right: 0.6rem;
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--fg-3);
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 0.3rem 0.55rem; border-radius: 4px;
  transition: all 0.2s var(--ease-out);
}
.modal__copy:hover { color: var(--accent); border-color: var(--accent); }
.modal__copy[data-copied] { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 40%, var(--border)); }
.modal__note {
  margin: 1rem 0 0;
  font-size: 0.82rem; color: var(--fg-3);
}
.modal__note code { background: var(--bg-2); padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.86em; }

/* footer */
.footer {
  max-width: var(--page); margin: 2rem auto 0;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--border);
  color: var(--fg-3); font-size: 0.88rem; text-align: center;
}
.footer p { margin: 0.4rem 0; }
.footer code { background: var(--bg-2); padding: 0.1rem 0.4rem; border-radius: 3px; color: var(--fg-2); font-size: 0.88em; }
.footer__meta { color: var(--fg-4); font-size: 0.82rem; }
.footer__meta a { margin: 0 0.15rem; transition: color 0.2s var(--ease-out); }
.footer__meta a:hover { color: var(--accent); }

/* reveal */
.reveal { opacity: 0; transform: translateY(6px); transition: all 0.5s var(--ease-out) var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
