:root {
  color-scheme: light;
  --bg: #f4f3ee;
  --surface: #fffdfa;
  --surface-muted: #eeece4;
  --text: #181b1d;
  --muted: #68706c;
  --line: #ded9cd;
  --accent: #0d756c;
  --accent-soft: #dff2ec;
  --warm: #b35a2f;
  --warm-soft: #fff1e8;
  --ink: #111415;
  --shadow: 0 18px 48px rgba(56, 47, 34, 0.09);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(13, 117, 108, 0.22);
  outline-offset: 2px;
}

.site-header {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px 40px;
  border-bottom: 1px solid rgba(222, 217, 205, 0.9);
  background: rgba(244, 243, 238, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #f7f5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.header-actions,
.footer-links,
.modal-links,
.detail-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions a,
.footer-links a,
.modal-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 160ms ease;
}

.header-actions a:hover,
.footer-links a:hover,
.modal-links a:hover {
  color: var(--text);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.78);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 150ms var(--ease-out),
    border-color 160ms ease,
    background 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .icon-button:hover,
  .skill-card:hover,
  .trending-card:hover,
  .category-button:hover {
    transform: translateY(-2px);
  }

  .icon-button:hover,
  .category-button:hover {
    border-color: rgba(13, 117, 108, 0.34);
    background: #fffdfa;
  }

  .skill-card:hover,
  .trending-card:hover {
    border-color: rgba(13, 117, 108, 0.34);
    box-shadow: 0 22px 54px rgba(56, 47, 34, 0.12);
  }
}

.icon-button:active,
.primary-button:active,
.link-button:active,
.copy-button:active,
.segmented button:active,
.category-button:active {
  transform: scale(0.97);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px 40px 48px;
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 32px;
  align-items: end;
  padding: 34px 0 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: #46504b;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.stats-grid div {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 253, 250, 0.86);
}

.stats-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.stats-grid dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 25px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.trending-panel {
  min-width: 0;
  overflow: hidden;
  padding: 24px 0 14px;
  border-top: 1px solid rgba(222, 217, 205, 0.86);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.section-head p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.trending-strip {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 12px;
  scroll-snap-type: x proximity;
}

.trending-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 0 0 292px;
  gap: 8px;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.82);
  box-shadow: 0 12px 28px rgba(56, 47, 34, 0.05);
  scroll-snap-align: start;
  text-decoration: none;
  animation: item-enter 360ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.trending-card strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  line-height: 1.25;
}

.trending-card small,
.trending-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.trending-card p {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trend-rank,
.trend-metric {
  width: fit-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.trend-rank {
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.trend-metric {
  align-self: end;
  padding: 5px 9px;
  background: var(--warm-soft);
  color: var(--warm);
}

.toolbar {
  position: relative;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 0;
  background: rgba(244, 243, 238, 0.9);
  backdrop-filter: blur(16px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.88);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: rgba(13, 117, 108, 0.58);
  box-shadow: 0 0 0 4px rgba(13, 117, 108, 0.12);
}

.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.segmented {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.segmented button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    background 160ms ease,
    color 160ms ease;
}

.segmented button.active {
  background: var(--ink);
  color: #fffdfa;
}

.content-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.category-sidebar {
  position: sticky;
  top: 140px;
  max-height: calc(100dvh - 158px);
  overflow: auto;
  padding-right: 6px;
}

.sidebar-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.category-list {
  display: grid;
  gap: 6px;
}

.category-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    border-color 160ms ease,
    background 160ms ease;
}

.category-button.active {
  border-color: rgba(13, 117, 108, 0.22);
  background: rgba(255, 253, 250, 0.9);
}

.category-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-button small,
.category-count {
  color: var(--muted);
  font-size: 12px;
}

.results-panel {
  min-width: 0;
}

.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 80px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--line);
}

.results-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.data-note {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0;
}

.skill-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  min-height: 274px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.86);
  box-shadow: 0 10px 28px rgba(56, 47, 34, 0.05);
  animation: item-enter 320ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 22ms);
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.skill-card:target {
  border-color: rgba(13, 117, 108, 0.66);
  box-shadow: 0 0 0 4px rgba(13, 117, 108, 0.12);
}

.skill-card > * {
  min-width: 0;
}

.card-top {
  display: grid;
  gap: 8px;
}

.skill-title {
  min-width: 0;
}

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.card-kicker span,
.fit-row span,
.detail-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.card-kicker span:first-child {
  background: var(--accent-soft);
  color: var(--accent);
}

.card-kicker span:last-child {
  background: var(--warm-soft);
  color: var(--warm);
}

.skill-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  line-height: 1.25;
}

.value-copy {
  display: -webkit-box;
  min-height: 72px;
  margin: 0;
  overflow: hidden;
  color: #323935;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.fit-row {
  display: grid;
  gap: 7px;
  align-self: end;
  padding-top: 2px;
}

.fit-row span {
  width: fit-content;
}

.fit-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.card-actions {
  align-self: end;
  flex-wrap: wrap;
  padding-top: 2px;
}

.primary-button,
.link-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.primary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdfa;
}

.primary-button:hover,
.link-button:hover,
.copy-button:hover {
  border-color: rgba(13, 117, 108, 0.5);
}

.primary-button:hover {
  background: #1e2424;
}

.empty-state {
  padding: 42px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 40px 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  max-width: 760px;
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(24, 27, 29, 0.46);
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: var(--shadow);
  text-align: center;
  animation: modal-enter 180ms var(--ease-out) both;
}

.skill-modal {
  width: min(720px, calc(100vw - 32px));
  text-align: left;
}

.modal h2 {
  margin-bottom: 14px;
  font-size: 26px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.modal img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto 12px;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    border-color 160ms ease;
}

.modal-close:active {
  transform: scale(0.94);
}

.detail-value {
  margin: 0 0 14px;
  color: #313834;
  font-size: 16px;
  line-height: 1.65;
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.skill-modal section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.skill-modal h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.skill-modal p,
.skill-modal li {
  color: var(--muted);
  font-size: 14px;
}

.skill-modal ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.detail-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 4px 0 16px;
}

.detail-command code {
  display: block;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1efe8;
  color: #1f2725;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.detail-actions {
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  max-width: min(320px, calc(100vw - 48px));
  padding: 11px 14px;
  border: 1px solid rgba(13, 117, 108, 0.2);
  border-radius: 8px;
  background: #17201e;
  color: #fffdfa;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-enter 180ms var(--ease-out) both;
}

@keyframes item-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .intro-panel,
  .toolbar,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-head,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .section-head p,
  .data-note {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 18px;
    padding-left: 18px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .app-shell {
    padding: 18px;
  }

  .intro-panel {
    padding-top: 26px;
  }

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

  h1 {
    font-size: 38px;
  }

  .lead {
    font-size: 16px;
  }

  .results-head h2,
  .section-head h2 {
    font-size: 27px;
  }

  .trending-card {
    flex-basis: min(286px, 82vw);
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding: 0 8px;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .card-actions,
  .detail-command,
  .detail-actions {
    grid-template-columns: 1fr;
  }

  .card-actions,
  .detail-actions {
    display: grid;
  }

  .primary-button,
  .link-button,
  .copy-button {
    width: 100%;
  }

  .skill-card {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
