:root {
  /* surfaces */
  --bg:           #fbfaf6;
  --card:         #ffffff;
  --card-hover:   #f6f4ee;
  --pill:         #f2efe5;
  --border:       #e8e3d3;
  --border-hover: #d6d0bd;

  /* text */
  --ink:    #0e0e0e;
  --ink-2:  #2b2b2b;
  --muted:  #6b6860;
  --soft:   #b3afa4;

  /* brand */
  --accent: #d97757;  /* Anthropic terracotta — matches Claude Code logo */

  /* sticker pastels */
  --hl-mint:  #d8edd0;
  --hl-lemon: #ffeca0;
  --hl-peach: #ffd8bd;
  --hl-pink:  #ffd6e0;
  --hl-sky:   #d4e5fa;
  --hl-lilac: #e0d4f5;
  --hl-coral: #ff9476;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "A2-Gothic", "A2G", "A2 Gothic", "산돌 에이투지", "에이투지체", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  font-size: 14px;
  word-break: keep-all;
}

::selection { background: var(--accent); color: var(--card); }

/* ============ HERO ============ */
.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 32px 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.hero-main { min-width: 0; }
.hero-art {
  width: clamp(160px, 22vw, 240px);
  aspect-ratio: 1;
  flex-shrink: 0;
}
.hero-art svg { display: block; width: 100%; height: 100%; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-right { flex-direction: row; justify-content: space-between; align-items: center; order: -1; }
  .hero-art { width: 96px; margin-bottom: -8px; }
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}
.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.service-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.1;
}
.service-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.service-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.service-sub svg { flex-shrink: 0; }

/* ─── Hero right column (actions stacked above logo) ────────── */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}
.brand-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.service-brand-dot {
  color: var(--soft);
  font-size: 18px;
  line-height: 1;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
}
.lang-toggle:hover { border-color: var(--ink); color: var(--ink); }
.lang-toggle .lang-opt {
  padding: 2px 4px;
  transition: color .15s;
}
.lang-toggle .lang-opt.active { color: var(--ink); }
.lang-toggle .lang-sep { color: var(--soft); }

.gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(14, 14, 14, 0.12);
}
.gh-btn:hover {
  transform: translateY(-1px);
  background: #1a1a1a;
  box-shadow: 0 3px 10px rgba(14, 14, 14, 0.2);
}
.gh-btn:active { transform: translateY(0); }
.gh-btn-icon { flex-shrink: 0; }
.gh-btn-text { letter-spacing: -0.01em; }

/* legacy — kept for compat */
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--pill);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: -0.005em;
  white-space: nowrap;
  line-height: 1;
}
.top-link:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.ctrl-link {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--pill);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: -0.005em;
  white-space: nowrap;
  line-height: 1;
}
.ctrl-link:hover {
  background: var(--ink);
  color: var(--card);
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--card);
  border: 1px solid var(--pill);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: all .15s;
  letter-spacing: -0.005em;
}
.week-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--hl-mint);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.week-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: week-blink 1.8s ease-in-out infinite;
}
@keyframes week-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.brand-chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.brand-chip .brand-mark {
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 60px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 36px;
  max-width: 900px;
}
.hero h1 em {
  font-style: normal;
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding: 0 4px;
  z-index: 1;
}
.hero h1 em::after {
  content: "";
  position: absolute;
  inset: 0 -4px;
  border-radius: 6px;
  z-index: -1;
}
.hero h1 em.hl-mint::after { background: var(--hl-mint); transform: rotate(-0.8deg); }
.hero h1 em.hl-lemon::after { background: var(--hl-lemon); transform: rotate(0.5deg); }

.subtitle {
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--ink-2);
  max-width: 680px;
  line-height: 1.75;
  font-weight: 400;
  margin-bottom: 32px;
}
.subtitle strong { color: var(--ink); font-weight: 700; }

.hero-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.hero-stats strong {
  color: var(--ink);
  font-weight: 700;
  margin-right: 2px;
  font-variant-numeric: tabular-nums;
}
.hero-stats .dot { color: var(--soft); }

/* ============ UPDATE BAR ============ */
.update-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.update-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.update-meta strong {
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.update-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse-dot 2.4s ease-out infinite;
  margin-right: 4px;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.update-sep { color: var(--soft); }
.version-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--pill);
  border-radius: 100px;
  letter-spacing: 0.02em;
}
.version-pill:empty { display: none; }
.version-pill.is-archive {
  background: #fff3d6;
  color: #8a6500;
}

/* ── archive menu ── */
.archive-wrap { position: relative; }
.archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
}
.archive-btn:hover { border-color: var(--ink); color: var(--ink); }
.archive-btn svg { opacity: 0.75; }
.archive-caret { font-size: 10px; opacity: 0.6; }
.archive-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(14, 14, 14, 0.12);
}
.archive-menu li { margin: 0; }
.archive-menu button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.archive-menu button:hover { background: var(--card-hover); color: var(--ink); }
.archive-menu button.is-active { background: var(--pill); color: var(--ink); font-weight: 600; }
.archive-menu .ar-ver { font-weight: 600; }
.archive-menu .ar-date {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ============ CATEGORY FILTER ============ */
.cat-filter {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 32px 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
}
.cat-chip:hover { border-color: var(--ink); color: var(--ink); }
.cat-chip.is-active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
  font-weight: 600;
}
.cat-chip.is-active .cat-count { color: rgba(255, 255, 255, 0.65); }
.cat-emoji { font-size: 13px; }
.cat-count {
  font-size: 11px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .update-bar { padding: 0 16px 8px; font-size: 12px; }
  .cat-filter { padding: 4px 16px 8px; }
}

/* ============ CONTROLS ============ */
.controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--pill);
  border-radius: 100px;
}
.tab {
  padding: 9px 18px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 100px;
  cursor: pointer;
  transition: all .16s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: var(--card); }
.tab-emoji { font-size: 13px; }
.tab-count {
  font-size: 11.5px;
  padding: 1px 7px;
  background: rgba(0,0,0,0.08);
  color: var(--muted);
  border-radius: 100px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: rgba(255,255,255,0.18); color: var(--card); }

.search-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pill);
  border-radius: 100px;
  padding: 0 16px;
}
.search-wrap svg { color: var(--soft); flex-shrink: 0; }
#search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 0;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
}
#search::placeholder { color: var(--soft); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px 96px;
}

/* ============ GRID ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ============ CARD ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
  min-height: 420px;
}
.card:hover { border-color: var(--border-hover); }
.card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

/* rank chip top-left */
.card-rank {
  position: absolute;
  top: -10px; left: 20px;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--card);
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  z-index: 2;
}

/* sticker circle */
.sticker {
  position: absolute;
  top: 14px; right: 14px;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  padding: 8px;
  transform: rotate(-7deg);
  z-index: 3;
  letter-spacing: 0.02em;
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.card:hover .sticker { transform: rotate(4deg) scale(1.06); }
.sticker strong {
  font-size: 14px;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
}
.sticker.s-mint { background: var(--hl-mint); }
.sticker.s-lemon { background: var(--hl-lemon); }
.sticker.s-peach { background: var(--hl-peach); }
.sticker.s-coral { background: var(--hl-coral); color: var(--card); }
.sticker.s-pink { background: var(--hl-pink); }
.sticker.s-sky { background: var(--hl-sky); }
.sticker.s-lilac { background: var(--hl-lilac); }
.grid .card:nth-child(1) .sticker.s-mint { background: var(--card); }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
  padding-right: 80px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--pill);
  flex-shrink: 0;
  object-fit: cover;
}
.head-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.category-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.repo-id {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repo-id .owner { color: var(--soft); }
.repo-id .slash { color: var(--soft); }

.card h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.025em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
}
.catch {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.5em * 2);
}

.features {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.features li {
  padding: 9px 14px;
  background: var(--pill);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.35;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.src-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 2px;
}
.src-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  background: var(--card-hover);
  color: var(--muted);
  border-radius: 100px;
  letter-spacing: 0;
}
.src-score {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--card);
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto;
  gap: 10px;
  padding-top: 14px;
}

/* modal source/evidence */
.m-score-box {
  padding: 16px 18px;
  background: var(--ink);
  color: var(--card);
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.m-score-box strong {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.m-score-formula {
  font-size: 11.5px;
  color: var(--soft);
  margin-left: auto;
}
.m-src-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.m-src-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.m-src-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.m-evidence {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-evidence li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--pill);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.m-evidence a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--soft);
}
.m-evidence a:hover { color: var(--accent); border-color: var(--accent); }
.meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.stars-line { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.repo-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--card);
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  transition: background .15s;
  text-transform: uppercase;
}
.repo-link:hover { background: var(--accent); }
.repo-link .arrow {
  display: inline-flex;
  width: 18px; height: 18px;
  background: var(--card);
  color: var(--ink);
  border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

/* ============ MODAL ============ */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(14,14,14,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadein-m .2s ease;
}
@keyframes fadein-m { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup-m {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-panel {
  position: relative;
  background: var(--card);
  border-radius: 20px;
  max-width: 920px; width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.14);
  animation: slideup-m .28s cubic-bezier(.2,.8,.2,1);
  z-index: 1;
}
.modal-close {
  position: absolute;
  top: 22px; right: 22px;
  background: var(--pill);
  border: none;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  line-height: 1;
  transition: all .15s;
  z-index: 2;
}
.modal-close:hover { background: var(--ink); color: var(--card); }

.modal-body { padding: 56px 64px 60px; }
.m-rank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.m-rank .accent { color: var(--accent); font-weight: 700; }
.m-rank .dot-sep { color: var(--soft); }

.m-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--pill);
}
.m-avatar {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--pill);
  object-fit: cover;
}
.m-meta { flex: 1; min-width: 0; }
.m-category {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}
.m-repo {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-repo .owner { color: var(--soft); }
.m-repo .slash { color: var(--soft); }
.m-stars {
  font-size: 17px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.modal-body h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.3;
  margin-bottom: 18px;
  color: var(--ink);
  max-width: 720px;
}
.m-catch {
  font-size: 18px;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 14px;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  max-width: 720px;
  font-weight: 500;
}
.m-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 18px 0 32px;
}
.m-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 100px;
  background: var(--pill);
  color: var(--ink-2);
}
.m-badge.b-rising { background: var(--ink); color: var(--card); }
.m-badge.b-classic { background: var(--accent); color: var(--card); }

.m-section { margin-bottom: 40px; }
.m-section:last-of-type { margin-bottom: 28px; }
.m-section .m-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.m-section .m-label::before {
  content: "";
  width: 20px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.m-summary {
  font-size: 16.5px;
  color: var(--ink-2);
  line-height: 2;
  max-width: 720px;
  font-weight: 400;
  word-break: keep-all;
}
.m-features {
  list-style: none; padding: 0;
  counter-reset: feat;
  display: flex; flex-direction: column; gap: 10px;
}
.m-features li {
  padding: 20px 22px 20px 60px;
  background: var(--pill);
  border-radius: 14px;
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.75;
  position: relative;
  font-weight: 400;
  word-break: keep-all;
}
.m-features li::before {
  counter-increment: feat;
  content: counter(feat, decimal-leading-zero);
  position: absolute;
  left: 22px; top: 20px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.m-usecase {
  padding: 22px 24px;
  background: var(--hl-lemon);
  border-radius: 14px;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.85;
  word-break: keep-all;
  font-weight: 500;
}
.m-install {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  padding: 18px 20px;
  background: var(--ink);
  color: var(--card);
  border-radius: 14px;
  overflow-x: auto;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.6;
}
.m-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.m-tag {
  font-size: 12.5px;
  color: var(--muted);
  padding: 5px 12px;
  background: var(--pill);
  border-radius: 100px;
}
.m-tag::before { content: "#"; color: var(--soft); margin-right: 1px; }

.m-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--pill);
}
.m-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--card);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.m-cta:hover { background: var(--accent); }

body.modal-open { overflow: hidden; }

/* ============ CRITERIA MODAL ============ */
.cr-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 10px;
}
.cr-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--ink);
}
.cr-lede {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 28px;
}

.cr-formula {
  background: var(--pill);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 36px;
}
.cr-formula-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--ink);
}
.cr-token { font-weight: 700; }
.cr-eq, .cr-plus { color: var(--soft); }
.cr-weight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 500;
}
.cr-weight b { font-weight: 800; }
.cr-bar {
  display: flex;
  height: 14px;
  border-radius: 100px;
  overflow: hidden;
  gap: 2px;
}
.cr-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cr-bar-seg span { white-space: nowrap; }

.w-velocity { background: var(--hl-peach); }
.w-buzz { background: var(--hl-mint); }
.w-quality { background: var(--hl-sky); }
.w-recency { background: var(--hl-lilac); }
.cr-axis-dot.w-velocity,
.cr-axis-dot.w-buzz,
.cr-axis-dot.w-quality,
.cr-axis-dot.w-recency {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cr-section { margin-bottom: 36px; }
.cr-section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cr-section-label::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.cr-axes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cr-axis {
  background: var(--pill);
  border-radius: 14px;
  padding: 18px 20px;
}
.cr-axis-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cr-axis-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}
.cr-axis-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: var(--card);
  padding: 2px 9px;
  border-radius: 100px;
}
.cr-axis-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
}

.cr-versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cr-vs-card {
  border-radius: 14px;
  padding: 20px 22px;
}
.cr-vs-card.cr-rising { background: var(--hl-mint); }
.cr-vs-card.cr-classic { background: var(--hl-lemon); }
.cr-vs-head {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cr-vs-icon { font-size: 17px; }
.cr-vs-head strong { font-weight: 700; }
.cr-vs-rule {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.7;
}
.cr-vs-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cr-vs-card li {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}
.cr-vs-card li::before {
  content: "·";
  position: absolute;
  left: 4px; top: -2px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.cr-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  text-align: center;
}
.cr-note strong { color: var(--ink); }

.cr-bias {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cr-bias-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--pill);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.cr-bias-tag {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--card);
  border-radius: 100px;
  letter-spacing: 0.02em;
}

.cr-foot {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 28px 0 18px;
  padding: 14px 16px;
  border-top: 1px solid var(--pill);
  border-bottom: 1px solid var(--pill);
  line-height: 1.65;
}

@media (max-width: 640px) {
  .cr-axes, .cr-versus { grid-template-columns: 1fr; }
  .cr-formula-line { font-size: 12px; }
  .cr-title { font-size: 24px; }
}

/* ============ EMPTY / FOOTER ============ */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
  font-size: 13.5px;
}

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
footer .foot-brand { color: var(--ink); font-weight: 700; }
footer a, footer .foot-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--soft);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
footer a:hover, footer .foot-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 640px) {
  .hero { padding: 64px 20px 40px; }
  .controls { padding: 12px 20px 18px; }
  main { padding: 16px 20px 72px; }
  .card { padding: 22px 20px; min-height: auto; }
  .grid .card:nth-child(1) h3 { font-size: 24px; }
  .card h3 { font-size: 20px; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; }
  .search-wrap { width: 100%; }
  .modal { padding: 20px 12px; }
  .modal-body { padding: 36px 24px 36px; }
  .modal-body h2 { font-size: 24px; line-height: 1.3; }
  .m-catch { font-size: 15.5px; padding-left: 14px; line-height: 1.65; }
  .m-summary { font-size: 15px; line-height: 1.9; }
  .m-features li { font-size: 14.5px; padding: 16px 18px 16px 50px; line-height: 1.7; }
  .m-features li::before { left: 18px; top: 16px; }
  .m-usecase { font-size: 15px; padding: 18px 20px; line-height: 1.8; }
  .m-section { margin-bottom: 32px; }
  footer { padding: 32px 20px 40px; }
}
