/* Skills-specific presentation.
 * Shared page shell, hero, toolbar, sidebar and responsive directory geometry
 * live in src/core/app-shell/directory-page.css.
 */
:root {
  --ant-primary: var(--directory-primary, #18a957);
  --ant-primary-hover: #35b86d;
  --ant-primary-bg: var(--directory-primary-bg, #eaf7ef);
  --ant-text: var(--directory-text, #1f1f1f);
  --ant-text-secondary: var(--directory-secondary, #666);
  --ant-text-tertiary: var(--directory-tertiary, #8c8c8c);
  --ant-border: var(--directory-border, #e5e5e5);
  --ant-fill: var(--directory-fill, #f5f5f5);
  --ant-surface: var(--directory-surface, #fff);
  --ant-radius: var(--directory-radius, 8px);
  --ant-shadow: var(--directory-shadow, 0 6px 20px rgba(0,0,0,.045));
}

body.skills-document { display: flex; min-height: 100svh; flex-direction: column; }
body.skills-document .skills-page { flex: 1 0 auto; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skills-icon { width: 1em; height: 1em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.hero-update-note { display: inline-flex; align-items: center; gap: 5px; color: var(--ant-text-tertiary); font-size: 10px; font-weight: 500; }
.hero-update-note strong { color: var(--ant-primary); font-size: 13px; }
.hero-update-note small { color: var(--ant-text-tertiary); font-size: 10px; }

/* Skills toolbar controls */
.repo-sort button:hover, .repo-toolbar-meta button:hover { background: #e3f1e7; color: #188347; }
.repo-sort button:focus-visible, .repo-toolbar-meta button:focus-visible { outline: 2px solid #188347; outline-offset: 2px; }
.repo-toolbar-actions { font-family: var(--font-sans-cjk); letter-spacing: 0; text-transform: none; display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 16px; }
.repo-sort { display: inline-flex; flex: 0 0 auto; padding: 3px; gap: 2px; border: 1px solid var(--ant-border); border-radius: 8px; background: #edf0ed; }
.repo-sort button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 5px; background: transparent; color: var(--ant-text-secondary); font-size: 12px; }
.repo-sort button.is-active { background: #e3f1e7; color: #188347; font-weight: 600; box-shadow: none; }
.repo-toolbar-meta { display: flex; min-width: 0; align-items: center; gap: 10px; }
.repo-sync { font-family: var(--font-sans-cjk); letter-spacing: 0; text-transform: none; display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border-radius: 4px; background: transparent; color: #68716b; font-size: 12px; white-space: nowrap; }
.repo-count { font-family: var(--font-number); font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; color: var(--ant-text-secondary); font-size: 12px; white-space: nowrap; }
.repo-toolbar-meta button { min-height: 32px; padding: 0 10px; border-radius: 6px; border: 0; background: transparent; color: var(--ant-primary); font-size: 12px; }

/* Skills-only sidebar controls */
.sidebar-mode-filter { display: grid; gap: 10px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--ant-border); }
.sidebar-mode-filter > p { margin: 0; color: var(--ant-text); font-size: 13px; font-weight: 600; }
.directory-mode-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 3px; gap: 2px; border: 1px solid var(--ant-border); border-radius: 8px; background: #edf0ed; }
.directory-mode-tabs button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ant-text-secondary); font-size: 12px; }
.directory-mode-tabs button b { color: var(--ant-text-tertiary); font-size: 10px; }
.directory-mode-tabs button.is-active { background: #fff; color: var(--ant-primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.directory-mode-tabs button.is-active b { color: var(--ant-primary); }
.repo-facets { display: grid; gap: 20px; }
.facet-group { display: grid; gap: 8px; }
.facet-group h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; color: var(--ant-text-tertiary); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.facet-group h3 b { font-size: 9px; }
.repo-subfilters { display: grid; gap: 2px; }
.repo-subfilter { display: grid; grid-template-columns: 14px minmax(0,1fr) auto; min-height: 34px; align-items: center; gap: 8px; padding: 0 5px; border: 0; border-radius: 5px; background: transparent; color: var(--ant-text-secondary); font-size: 12px; text-align: left; }
.repo-subfilter::before { width: 14px; height: 14px; border: 1px solid #d9d9d9; border-radius: 3px; content: ""; }
.repo-subfilter b { color: var(--ant-text-tertiary); font-size: 10px; }
.repo-subfilter:hover { background: var(--ant-fill); color: var(--ant-text); }
.repo-subfilter.is-active { color: var(--ant-text); font-weight: 600; }
.repo-subfilter.is-active::before { border-color: var(--ant-primary); background: var(--ant-primary); box-shadow: inset 0 0 0 3px #fff; }

/* Keep the desktop filter rail fully readable. The shared sticky rail can be
 * taller than the viewport when all Skill categories are present, which makes
 * the lower filters look cropped. Let the page own vertical scrolling and give
 * the rail enough width for labels + counts instead of clipping the content. */
@media (min-width: 821px) {
  body.skills-document .directory-layout {
    grid-template-columns: clamp(240px, 22vw, 280px) minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  body.skills-document .filter-sidebar.directory-sidebar {
    position: static !important;
    top: auto !important;
    width: 100%;
    min-width: 0;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Skill result cards */
.repo-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; align-items: stretch; }
.repo-row { display: flex; min-width: 0; overflow: hidden; flex-direction: column; border: 1px solid var(--ant-border); border-radius: var(--ant-radius); background: var(--ant-surface); box-shadow: var(--ant-shadow); transition: .18s ease; }
.repo-row,
.web-reference-group { content-visibility: auto; contain-intrinsic-size: auto 620px; }
.repo-row:hover { border-color: #cfcfcf; box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.repo-scene { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; border-bottom: 1px solid var(--ant-border); background: #f0f2f5; color: #fff; text-decoration: none; }
.repo-browser-bar { position: relative; z-index: 3; display: flex; height: 28px; align-items: center; gap: 4px; padding: 0 9px; border-bottom: 1px solid var(--ant-border); background: #fafafa; color: #8c8c8c; }
.repo-browser-bar i { width: 6px; height: 6px; border-radius: 50%; background: #d9d9d9; }
.repo-browser-bar i:first-child { background: #ff7875; }
.repo-browser-bar i:nth-child(2) { background: #ffc53d; }
.repo-browser-bar i:nth-child(3) { background: #73d13d; }
.repo-browser-bar b { min-width: 0; overflow: hidden; margin-left: 5px; color: var(--ant-text-tertiary); font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.repo-browser-bar em { display: grid; margin-left: auto; font-style: normal; }
.repo-browser-bar em .skills-icon { width: 11px; height: 11px; }
.repo-cover-image { display: block; width: 100%; height: calc(100% - 28px); object-fit: cover; object-position: top center; transition: transform .25s ease; }
.repo-row:hover .repo-cover-image { transform: scale(1.02); }
.repo-cover-shade, .repo-cover-caption { display: none; }
.repo-scene .repo-index { position: absolute; z-index: 4; top: 34px; right: 8px; display: grid; min-width: 26px; height: 22px; place-items: center; padding: 0 5px; border: 1px solid rgba(0,0,0,.08); border-radius: 4px; background: rgba(255,255,255,.92); color: var(--ant-text-secondary); font-size: 9px; backdrop-filter: blur(6px); }
.repo-card-body { display: flex; min-height: 250px; flex: 1; flex-direction: column; padding: 18px; }
.repo-main { display: grid; gap: 9px; }
.repo-category { width: fit-content; margin: 0; padding: 3px 8px; border-radius: 4px; background: transparent; color: #68716b; font-size: 12px; font-weight: 600; }
.repo-main a { display: inline-flex; min-width: 0; align-items: center; align-self: start; gap: 6px; color: var(--ant-text); font-size: 17px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; text-decoration: none; }
.repo-main a:hover { color: var(--ant-primary); }
.repo-verified { display: inline-grid; width: 16px; height: 16px; flex: 0 0 auto; place-items: center; color: var(--ant-primary); }
.repo-verified .skills-icon { width: 14px; height: 14px; }
.repo-description { margin: 0; color: var(--ant-text-secondary); font-size: 12px; line-height: 1.65; }
.repo-focus { display: flex; align-items: center; gap: 7px; margin: 2px 0 0; color: var(--ant-text); font-size: 11px; font-weight: 600; }
.repo-focus::before { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--ant-primary); content: ""; }
.repo-footer { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--ant-border); }
.repo-stats { display: grid; gap: 4px; color: var(--ant-text-secondary); font-size: 11px; }
.repo-stats > span { display: flex; align-items: center; gap: 4px; }
.repo-stats > span i { display: grid; color: #faad14; font-style: normal; }
.repo-stats > span i .skills-icon { width: 13px; height: 13px; }
.repo-stats > span small, .repo-stats > small { color: var(--ant-text-tertiary); font-size: 9px; }
.repo-stats b { color: var(--ant-text); font-size: 11px; }
.repo-copy-btn { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; color: var(--ant-text); font-size: 11px; font-weight: 600; white-space: nowrap; }
.repo-copy-btn b { display: grid; }
.repo-copy-btn b .skills-icon { width: 13px; height: 13px; }
.repo-copy-btn:hover, .repo-copy-btn.is-copied { border-color: var(--ant-primary); background: var(--ant-primary); color: #fff; }
.repo-empty { grid-column: 1/-1; margin: 0; padding: 64px 20px; border: 1px dashed #d9d9d9; border-radius: var(--ant-radius); background: #fff; color: var(--ant-text-secondary); font-size: 13px; text-align: center; }

/* Website mode */
.repo-list.is-web-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: start; }
.repo-list.is-web-list .web-reference-group,
.repo-list.is-web-list .web-reference-group > .web-reference-grid { display: contents; }
.repo-list.is-web-list .web-reference-group > header { display: none; }
.web-reference-group { display: grid; gap: 14px; }
.web-reference-group > header { display: grid; grid-template-columns: minmax(190px,.75fr) minmax(280px,1fr) auto; gap: 24px; align-items: end; padding: 16px 18px; border: 1px solid var(--ant-border); border-radius: var(--ant-radius); background: #fff; }
.web-reference-group > header > div { display: flex; align-items: center; gap: 9px; }
.web-reference-group > header span { color: var(--ant-primary); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.web-reference-group > header h3 { margin: 0; font-size: 19px; }
.web-reference-group > header p { margin: 0; color: var(--ant-text-secondary); font-size: 11px; line-height: 1.6; }
.web-reference-group > header > b { color: var(--ant-text-tertiary); font-size: 10px; }
.web-reference-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: start; }
.web-reference-card { display: flex; min-width: 0; overflow: hidden; align-self: start; flex-direction: column; border: 1px solid var(--ant-border); border-radius: var(--ant-radius); background: #fff; box-shadow: var(--ant-shadow); transition: .18s ease; }
.web-reference-card:hover { border-color: #cfcfcf; box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.web-reference-visual { position: relative; display: block; overflow: hidden; border-bottom: 1px solid var(--ant-border); background: #f0f2f5; text-decoration: none; }
.web-reference-visual img, .web-reference-visual video { position: static; display: block; width: 100%; height: auto; object-fit: contain; object-position: top center; transition: transform .25s ease; }
.web-reference-card:hover .web-reference-visual img, .web-reference-card:hover .web-reference-visual video { transform: scale(1.02); }
.web-reference-top { position: absolute; z-index: 2; top: 10px; right: 10px; left: 10px; display: flex; align-items: center; justify-content: space-between; }
.web-reference-top span, .web-reference-top b, .web-source-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 4px; background: rgba(255,255,255,.92); color: var(--ant-primary); font-size: 9px; font-weight: 600; }
.web-reference-top b { min-width: 26px; justify-content: center; color: var(--ant-text-secondary); }
.web-reference-body { display: flex; flex: 1; flex-direction: column; padding: 17px; }
.web-reference-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--ant-text); font-size: 17px; font-weight: 650; text-decoration: none; }
.web-reference-title i { display: grid; color: var(--ant-text-tertiary); font-style: normal; }
.web-reference-title i .skills-icon { width: 14px; height: 14px; }
.web-reference-title:hover { color: var(--ant-primary); }
.web-reference-domain { margin: 6px 0 0; color: var(--ant-primary); font-size: 10px; }
.web-source-badge { min-height: 20px; margin-left: 7px; background: var(--ant-primary-bg); vertical-align: 1px; }
.web-reference-description { margin: 14px 0 18px; color: var(--ant-text-secondary); font-size: 11px; line-height: 1.65; }
.web-reference-body footer { display: grid; gap: 4px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ant-border); }
.web-reference-card footer span { color: var(--ant-text-tertiary); font-size: 9px; }
.web-reference-card footer strong { font-size: 11px; font-weight: 600; }
.web-reference-card.is-preview-missing .web-reference-visual::after { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ant-text-secondary); font-size: 11px; content: "Official preview pending"; }

@media (max-width: 1480px) and (min-width: 1181px) {
  .repo-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 1180px) {
  .repo-toolbar-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .repo-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .repo-toolbar-actions { align-items: stretch; }
  .repo-sort { align-self: flex-start; }
  .repo-toolbar-meta { justify-content: space-between; }
  .repo-facets { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .web-reference-group > header { grid-template-columns: 1fr auto; gap: 8px 18px; }
  .web-reference-group > header p { grid-column: 1/-1; }
  .web-reference-grid,
  .repo-list.is-web-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .repo-facets { grid-template-columns: 1fr 1fr; }
  .repo-list, .web-reference-grid, .repo-list.is-web-list { grid-template-columns: 1fr; }
  .repo-toolbar-meta { flex-wrap: wrap; justify-content: flex-start; }
  .repo-card-body { min-height: 220px; }
}

@media (max-width: 430px) {
  .repo-facets { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Nothing-inspired dot-matrix directory mode. */
body.skills-document {
  --ant-primary:#000;
  --ant-primary-hover:#333;
  --ant-primary-bg:#f1f0eb;
  --ant-text:#111;
  --ant-text-secondary:#666;
  --ant-text-tertiary:#999;
  --ant-border:#ccc;
  --ant-fill:#f1f0eb;
  --ant-surface:#fff;
  --ant-radius:12px;
  --ant-shadow:none;
  --nd-accent:#d71921;
  --nd-success:#4a9e5c;
  background:#f5f6f7;
  color:#111;
  font-family:"Space Grotesk","DM Sans",system-ui,sans-serif;
}
body.skills-document .skills-page { background:transparent; }
body.skills-document .hero-update-note { font-family:"Space Mono",monospace; letter-spacing:.04em; text-transform:uppercase; }
body.skills-document .hero-update-note strong { color:var(--nd-success); }
body.skills-document .filter-sidebar-head,
body.skills-document .sidebar-mode-filter>p,
body.skills-document .facet-group h3,
body.skills-document .repo-category,
body.skills-document .repo-stats { font-family:"Space Mono",monospace; letter-spacing:.06em; text-transform:uppercase; }
body.skills-document .directory-mode-tabs { padding:3px; border:1px solid #ccc; border-radius:8px; background:transparent; }
body.skills-document .directory-mode-tabs button { min-height:38px; border-radius:5px; font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.06em; text-transform:uppercase; box-shadow:none; }
body.skills-document .directory-mode-tabs button.is-active { background:#000; color:#fff; box-shadow:none; }
body.skills-document .directory-mode-tabs button.is-active::before { content:"●"; color:var(--nd-accent); font-size:8px; }
body.skills-document .directory-mode-tabs button.is-active b { color:#999; }
body.skills-document .repo-subfilter { border-radius:4px; font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.02em; }
body.skills-document .repo-subfilter::before { border-radius:2px; }
body.skills-document .repo-subfilter.is-active::before { border-color:#000; background:#000; box-shadow:inset 0 0 0 3px #fff; }
body.skills-document .repo-subfilter.is-active { box-shadow:inset 2px 0 0 var(--nd-accent); }
body.skills-document .repo-row,
body.skills-document .web-reference-card { border-color:#ccc; border-radius:12px; box-shadow:none; transition:border-color .2s cubic-bezier(.25,.1,.25,1); }
body.skills-document .repo-row:hover,
body.skills-document .web-reference-card:hover { border-color:#000; box-shadow:none; transform:none; }
body.skills-document .repo-cover-image,
body.skills-document .web-reference-visual img,
body.skills-document .web-reference-visual video { transition:opacity .2s cubic-bezier(.25,.1,.25,1); }
body.skills-document .repo-row:hover .repo-cover-image,
body.skills-document .web-reference-card:hover .web-reference-visual img,
body.skills-document .web-reference-card:hover .web-reference-visual video { opacity:.86; transform:none; }
body.skills-document .repo-browser-bar i { background:#999; }
body.skills-document .repo-browser-bar i:first-child { background:var(--nd-accent); }
body.skills-document .repo-browser-bar i:nth-child(2),
body.skills-document .repo-browser-bar i:nth-child(3) { background:#ccc; }
body.skills-document .repo-browser-bar b,
body.skills-document .repo-scene .repo-index { font-family:"Space Mono",monospace; letter-spacing:.05em; }
body.skills-document .repo-scene .repo-index { border-color:#ccc; border-radius:4px; background:#fff; backdrop-filter:none; }
body.skills-document .repo-category { padding:4px 8px; border:1px solid #ccc; border-radius:4px; background:transparent; color:#666; }
body.skills-document .repo-focus::before { border-radius:1px; background:var(--nd-accent); }
body.skills-document .repo-copy-btn { min-height:40px; border-color:#ccc; border-radius:999px; font-family:"Space Mono",monospace; font-size:11px; letter-spacing:.05em; text-transform:uppercase; }
body.skills-document .repo-copy-btn:hover,
body.skills-document .repo-copy-btn.is-copied { border-color:#000; background:#000; color:#fff; }
body.skills-document .search-field { border-color:#ccc!important; border-radius:999px!important; background:#fff!important; box-shadow:none!important; }
body.skills-document .search-field:focus-within { border-color:#000!important; box-shadow:inset 3px 0 0 var(--nd-accent)!important; }
body.skills-document .search-field input { font-family:"Space Mono",monospace; }
