/* ==========================================================================
   si7b — skill library
   A task recipe ledger: compact rows on desktop, stacked cards on mobile.
   ========================================================================== */

.skills-section {
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 16px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background:
    linear-gradient(to right, rgba(20, 35, 27, 0.05) 1px, transparent 1px),
    #e8eeda;
  background-size: 96px 100%;
  color: var(--ink);
}

.skills-heading {
  padding-top: 78px;
}

.skills-heading .kicker {
  color: #586651;
}

.skills-body {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 32px 88px;
}

.skills-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--ink);
}

.skills-filter-block {
  min-width: 0;
}

.skills-filter-label {
  display: block;
  color: #5f6c58;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.skill-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.skill-category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(20, 35, 27, 0.22);
  border-radius: 1px;
  background: rgba(255, 253, 247, 0.34);
  color: #3b4a3c;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.skill-category span {
  color: #74806c;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.skill-category:hover {
  border-color: var(--ink);
  background: rgba(255, 253, 247, 0.64);
}

.skill-category.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--lime);
}

.skill-category.is-active span {
  color: rgba(201, 239, 74, 0.58);
}

.skill-tally {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0 0 1px;
  color: #5d6957;
}

.skill-tally strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.skill-tally span {
  font-size: 11px;
  white-space: nowrap;
}

.skill-list-head,
.skill-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.8fr) minmax(0, 0.72fr) minmax(0, 1fr) 74px 26px;
  gap: 22px;
  align-items: center;
}

.skill-list-head {
  padding: 12px 6px 10px;
  border-bottom: 1px solid rgba(20, 35, 27, 0.28);
  color: #5f6b58;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-list {
  border-bottom: 1px solid rgba(20, 35, 27, 0.32);
}

.skill-row {
  width: 100%;
  padding: 17px 6px;
  border: 0;
  border-bottom: 1px solid rgba(20, 35, 27, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.skill-row:last-child {
  border-bottom: 0;
}

.skill-row:hover {
  background: rgba(201, 239, 74, 0.36);
  box-shadow: inset 3px 0 0 var(--ink);
}

.skill-row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -3px;
  background: rgba(201, 239, 74, 0.24);
}

.skill-row-no {
  color: #64705c;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.skill-row-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.skill-row-cat {
  color: #5f6d56;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.skill-row-title {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-row-desc {
  overflow: hidden;
  color: #566451;
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-row-output {
  color: #3f4d3b;
  font-size: 11.5px;
  line-height: 1.6;
}

.skill-row-models {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  color: #4d5c48;
  font-size: 11px;
  line-height: 1.5;
}

.skill-row-models span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-row-mem {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--mono);
  line-height: 1.2;
  white-space: nowrap;
}

.skill-row-mem strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.skill-row-mem span {
  color: #67735f;
  font-size: 10px;
  letter-spacing: 0;
}

.skill-row-arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  justify-self: end;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #586650;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.skill-row:hover .skill-row-arrow {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--lime);
}

.skill-row-arrow .icon {
  width: 13px;
  height: 13px;
}

.skill-footnote {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  padding-top: 17px;
}

.skill-footnote-mark {
  color: #68755f;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.skill-footnote p {
  max-width: 760px;
  margin: 0;
  color: #53614e;
  font-size: 12px;
  line-height: 1.75;
}

.skill-footnote a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid #7e8b73;
  color: #3f4f3a;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.skill-footnote a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.skill-footnote a .icon {
  width: 13px;
  height: 13px;
}

.skill-empty {
  margin: 0;
  padding: 26px 6px;
  color: #5c6a55;
  font-size: 12.5px;
  line-height: 1.7;
}

/* Skill detail drawer */

.skill-dialog {
  width: min(820px, 100vw);
}

.skill-detail-header .detail-mark {
  width: 52px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.skill-detail-header .detail-specs dd {
  overflow: visible;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

.skill-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: skill-step;
}

.skill-steps li {
  position: relative;
  padding: 12px 14px 12px 46px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: #4f5c51;
  font-size: 12.5px;
  line-height: 1.7;
  counter-increment: skill-step;
}

.skill-steps li::before {
  content: "0" counter(skill-step);
  position: absolute;
  top: 13px;
  left: 14px;
  color: #8a927f;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.7;
}

.skill-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.skill-model-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.skill-model-card:hover {
  border-color: var(--ink);
  background: var(--card);
}

.skill-model-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.skill-model-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.skill-model-vendor {
  color: #6c7869;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-model-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-model-card > span:not(.skill-model-head):not(.skill-model-action) {
  color: #697567;
  font-size: 10.5px;
  line-height: 1.5;
}

.skill-model-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.skill-model-action .icon {
  width: 11px;
  height: 11px;
}

.skill-dialog-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-top: 4px;
}

.skill-dialog-footer p {
  max-width: 56%;
  margin: 0;
  color: #7c867c;
  font-size: 10.5px;
  line-height: 1.65;
}

.skill-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 1px;
  background: var(--lime);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.skill-filter-button:hover {
  border-color: var(--ink);
  background: var(--lime-strong);
}

.skill-filter-button .icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 1180px) {
  .skill-list-head,
  .skill-row {
    grid-template-columns: 46px minmax(0, 1.7fr) minmax(0, 0.95fr) 70px 24px;
  }

  .skill-list-head span:nth-child(3),
  .skill-row-output {
    display: none;
  }
}

@media (max-width: 980px) {
  .skills-body {
    padding-right: 24px;
    padding-left: 24px;
  }

  .skill-list-head,
  .skill-row {
    grid-template-columns: 44px minmax(0, 1.8fr) minmax(0, 0.95fr) 66px 22px;
    gap: 16px;
  }

  .skill-row-title {
    font-size: 18px;
  }

  .skill-footnote {
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px 22px;
  }

  .skill-footnote a {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 860px) {
  .skills-heading {
    padding-top: 65px;
  }

  .skills-body {
    padding: 28px 20px 70px;
  }

  .skill-list-head {
    display: none;
  }

  .skill-list {
    border-top: 1px solid rgba(20, 35, 27, 0.28);
  }

  .skill-row {
    grid-template-areas:
      "no main mem arrow"
      "no models mem arrow";
    grid-template-columns: 38px minmax(0, 1fr) 53px 22px;
    gap: 5px 12px;
    align-items: start;
    padding: 17px 6px;
  }

  .skill-row-no {
    grid-area: no;
    padding-top: 3px;
  }

  .skill-row-main {
    grid-area: main;
  }

  .skill-row-models {
    grid-area: models;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 10px;
    padding-top: 2px;
  }

  .skill-row-mem {
    grid-area: mem;
    align-self: stretch;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    align-items: flex-end;
  }

  .skill-row-arrow {
    grid-area: arrow;
    align-self: center;
    width: 22px;
    height: 22px;
  }

  .skill-row-title {
    font-size: 19px;
  }

  .skill-row-desc {
    white-space: normal;
  }

  .skill-dialog-footer {
    flex-direction: column;
  }

  .skill-dialog-footer p {
    max-width: 100%;
  }

  .skill-filter-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .skills-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  .skills-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .skill-tally {
    align-self: flex-start;
  }

  .skill-categories {
    gap: 5px;
  }

  .skill-category {
    min-height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .skill-row {
    grid-template-columns: 32px minmax(0, 1fr) 46px 20px;
    gap: 5px 10px;
    padding: 16px 3px;
  }

  .skill-row-no {
    font-size: 10px;
  }

  .skill-row-title {
    font-size: 18px;
  }

  .skill-row-desc {
    font-size: 11.5px;
  }

  .skill-row-models {
    font-size: 10.5px;
  }

  .skill-row-mem strong {
    font-size: 15px;
  }

  .skill-row-mem span {
    font-size: 9.5px;
  }

  .skill-footnote {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .skill-footnote a {
    grid-column: 1;
  }

  .skill-model-grid {
    grid-template-columns: 1fr;
  }

  .skill-detail-header .detail-summary {
    margin-left: 0;
  }

  .skill-dialog .detail-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .skill-row {
    grid-template-columns: 28px minmax(0, 1fr) 43px 18px;
    gap: 4px 8px;
  }

  .skill-row-title {
    font-size: 17px;
  }

  .skill-row-models {
    flex-direction: column;
    gap: 1px;
  }

  .skill-steps li {
    padding-left: 40px;
  }
}
