/* Skill library page — card grid, search, category filters,
   themed modal, App Store callout. Inherits the design tokens
   from styles.css. */

.skills-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  /* Clear the fixed 72px nav with breathing room — other pages use
     calc(var(--nav-h) + 3rem). Without this the hero hides behind
     the nav strip on first paint. */
  padding: calc(var(--nav-h) + 3rem) 2rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}
.skills-hero-text { max-width: 640px; }
.skills-hero h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 0.7rem;
  color: var(--text);
}
.skills-hero p.lead {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}
.skills-hero .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Right-column CTA stack: App Store badge + workshop link */
.skills-hero-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  min-width: 0;
}

/* Secondary "Open the workshop" link — editorial counterpart to
   the App Store pill. Sits flush below it; reads as a sibling
   action ("get the app" / "or build a skill yourself") without
   competing visually. */
.build-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.build-link:hover {
  border-color: var(--core-accent);
  background: var(--core-glow);
  transform: translateY(-1px);
}
.build-link-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.build-link-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.build-link-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  margin-top: 0.15rem;
}
.build-link-title em {
  font-style: italic;
  color: var(--core-accent);
}
.build-link-arrow {
  width: 18px;
  height: 18px;
  color: var(--core-accent);
  transition: transform 0.15s;
  flex: 0 0 auto;
}
.build-link:hover .build-link-arrow {
  transform: translateX(3px);
}

/* App Store badge */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  text-decoration: none;
  font-family: var(--font-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.appstore-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}
.appstore-badge svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
.appstore-badge .ab-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.appstore-badge .ab-small {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  opacity: 0.78;
}
.appstore-badge .ab-big {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 720px) {
  .skills-hero {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-h) + 2rem) 1.4rem 1.5rem;
    gap: 1.4rem;
    align-items: start;
  }
}

/* ── How-it-works strip ── */

.skills-howto {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.howto-step {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}
.howto-step .step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.howto-step h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.howto-step p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

/* ── Search + filter bar ── */

.skills-controls {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.skills-search {
  position: relative;
  display: flex;
  align-items: center;
}
.skills-search input {
  width: 100%;
  padding: 0.95rem 1.1rem 0.95rem 2.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.skills-search input:focus { border-color: var(--brand-dim); }
.skills-search input::placeholder { color: var(--text-muted); }
.skills-search svg {
  position: absolute;
  left: 1.05rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.skills-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.skills-filter {
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.skills-filter:hover { border-color: var(--border-light); color: var(--text); }
.skills-filter[aria-pressed="true"] {
  background: var(--bg-card);
  border-color: var(--brand-dim);
  color: var(--brand);
}
.skills-filter .count { margin-left: 0.4rem; color: var(--text-muted); }

/* ── Card grid ── */

.skills-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.1rem;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.skill-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.skill-card-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 7px;
  opacity: 0.75; /* tame so it sits behind the title rather than next to it */
  transition: opacity 0.18s ease;
}
.skill-card:hover .skill-card-icon { opacity: 1; }
.skill-card-icon img {
  width: 100%;
  height: 100%;
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
  filter: saturate(0.85);
}
.skill-card-head-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.skill-card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skill-card-icon--fallback {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  padding: 0;
}
.skill-card-icon--fallback[data-cat="search"]    { color: #7aa3d4; border-color: rgba(122,163,212,0.5); }
.skill-card-icon--fallback[data-cat="knowledge"] { color: #b889d1; border-color: rgba(184,137,209,0.5); }
.skill-card-icon--fallback[data-cat="notes"]     { color: #d4a86a; border-color: rgba(212,168,106,0.5); }
.skill-card-icon--fallback[data-cat="tasks"]     { color: #8ab87a; border-color: rgba(138,184,122,0.5); }
.skill-card-icon--fallback[data-cat="apps"]      { color: #c1532b; border-color: rgba(193,83,43,0.5); }
.skill-card-icon--fallback[data-cat="media"]     { color: #cf6889; border-color: rgba(207,104,137,0.5); }
.skill-card-icon--fallback[data-cat="messaging"] { color: #6abdb0; border-color: rgba(106,189,176,0.5); }
.skill-card-icon--fallback[data-cat="dev"]       { color: #9a92e8; border-color: rgba(154,146,232,0.5); }
.skill-card-icon--fallback[data-cat="email"]     { color: #d27e6a; border-color: rgba(210,126,106,0.5); }
.skill-card-icon--fallback[data-cat="alerts"]    { color: #d96e6e; border-color: rgba(217,110,110,0.5); }

.skill-card-head-text { min-width: 0; }
.skill-card-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}
.skill-card-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.18rem;
}
.skill-card-blurb {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
}
.skill-card-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
  margin-top: 0.1rem;
}
.skill-card-meta code {
  background: var(--bg-surface);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.65rem;
}

.skill-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.skill-card-btn {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.skill-card-btn:hover {
  border-color: var(--brand-dim);
  background: var(--brand-glow);
}
.skill-card-btn--primary {
  border-color: var(--brand-dim);
  color: var(--brand);
}
.skill-card-btn--primary:hover { background: var(--brand); color: var(--bg); }
.skill-card-btn.copied {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-glow);
}

.skills-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text-muted);
}

/* ── Trust / closing strip ── */

.skills-trust {
  max-width: var(--max-w);
  margin: 0 auto 5rem;
  padding: 2.4rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.skills-trust .col h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.45rem;
  margin: 0 0 0.6rem;
  color: var(--text);
}
.skills-trust .col p {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 0.55rem;
}
.skills-trust .col p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .skills-trust { grid-template-columns: 1fr; margin: 0 1.4rem 4rem; }
}

/* ── Modal ── */

.skills-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.skills-modal.open { display: flex; }
.skills-modal-inner {
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-head {
  padding: 1.5rem 1.6rem 0.9rem;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 1.2rem;
  font-family: var(--font-body);
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-surface); color: var(--text); }
.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.35rem;
}
.modal-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.modal-blurb {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}
.modal-body {
  padding: 0.4rem 1.6rem 1.6rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.modal-block .modal-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.modal-block p {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}
.modal-mono {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}
.modal-secrets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.modal-secrets li code {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand);
}
.modal-fineprint {
  font-family: var(--font-body);
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  margin-top: 0.5rem !important;
}
.modal-steps {
  margin: 0;
  padding-left: 1.2rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-dim);
}
.modal-steps em {
  color: var(--brand);
  font-style: normal;
  font-weight: 500;
}
.modal-copy {
  margin-top: 0.5rem;
  padding: 0.85rem;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--brand-dim);
  background: var(--brand-glow);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-copy:hover { background: var(--brand); color: var(--bg); }
.modal-copy.copied { background: var(--brand); color: var(--bg); }
.modal-code {
  width: 100%;
  min-height: 140px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  resize: vertical;
}

@media (max-width: 640px) {
  .skills-howto { padding: 0 1.4rem; }
  .skills-controls { padding: 0 1.4rem 1rem; }
  .skills-grid { padding: 0.5rem 1.4rem 4rem; grid-template-columns: 1fr; }
  .modal-head { padding: 1.2rem 1.2rem 0.7rem; }
  .modal-body { padding: 0.4rem 1.2rem 1.2rem; }
}
