/* 프리사이언스 — 무채색 판 + 분야 색은 작은 점에만. 흐림(backdrop-filter)·알약 단추 쓰지 않음 */
:root {
  --bg: #0b0c0e;
  --panel: #121316;
  --panel-2: #17181c;
  --line: #24262b;
  --line-2: #33363c;
  --text: #ededef;
  --sub: #a2a4ab;
  --faint: #6a6c73;
  --accent: #f2f2f3;
  --r: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* 위 막대 */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 12, 14, .94); border-bottom: 1px solid transparent; transition: border-color .25s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { height: 64px; display: flex; align-items: center; gap: 24px; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.mark { width: 26px; height: 26px; }
.wordmark { font: 900 19px/1 Montserrat, sans-serif; letter-spacing: .02em; }
.search {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: min(380px, 100%); height: 38px; padding: 0 10px 0 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  color: var(--faint); transition: border-color .2s, background .2s; cursor: text;
}
.search:focus-within { border-color: var(--line-2); background: var(--panel-2); color: var(--sub); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none;
  color: var(--text); font: inherit; font-size: 14px;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font: 500 11px/1 ui-monospace, Consolas, monospace; color: var(--faint);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 4px 6px;
}
.search:focus-within kbd { display: none; }
.clear { display: grid; place-items: center; width: 24px; height: 24px; border: 0; background: none; color: var(--sub); border-radius: 6px; cursor: pointer; padding: 0; }
.clear:hover { background: var(--line); color: var(--text); }
.clear .ic { width: 15px; height: 15px; }
.clear[hidden] { display: none; }

/* 첫머리 */
.hero { padding: 44px 0 30px; max-width: 760px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.22; font-weight: 750; letter-spacing: -0.035em; }
.hero p { margin: 16px 0 0; color: var(--sub); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.7; }

/* 분야 탭 */
.tabs { display: flex; gap: 6px; margin: 0 0 22px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--sub);
  font: inherit; font-size: 14px; cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.tab:hover { color: var(--text); border-color: var(--line-2); }
.tab[aria-selected="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.tab .n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .n { color: #55575d; }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; }

/* 카드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .3s var(--ease), transform .45s var(--ease), background .3s;
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card:hover { border-color: var(--line-2); background: var(--panel-2); transform: translateY(-3px); }
.card:active { transform: translateY(-1px); }
.shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #060607; border-bottom: 1px solid var(--line); }
.shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(var(--z, 1.2)); transform-origin: var(--o, 50% 50%); transition: transform .8s var(--ease), opacity .4s;
}
.shot img[data-loading] { opacity: 0; }
.card:hover .shot img { transform: scale(calc(var(--z, 1.2) * 1.05)); }
.shot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35)); pointer-events: none; }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; height: 24px; padding: 0 9px; display: inline-flex; align-items: center;
  background: var(--accent); color: var(--bg); border-radius: 6px; font-size: 12px; font-weight: 700;
}
.body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 20px; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.meta .dot { width: 7px; height: 7px; border-radius: 50%; }
.meta .domain { margin-left: auto; color: var(--faint); font-size: 12.5px; }
.name { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 0; font-size: 26px; line-height: 1.2; font-weight: 750; letter-spacing: -0.03em; }
.name .brand { font: 800 12px/1 Montserrat, sans-serif; letter-spacing: .08em; color: var(--faint); }
.title { margin: 4px 0 0; color: var(--text); font-size: 15px; font-weight: 550; }
.desc { margin: 10px 0 0; color: var(--sub); font-size: 14px; line-height: 1.7; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.stats div { min-width: 0; }
.stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.stats dt { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stats dd { margin: 2px 0 0; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 18px; font-size: 14px; font-weight: 600; color: var(--text); }
.go .ic { transition: transform .35s var(--ease); }
.card:hover .go .ic { transform: translateX(4px); }
mark { background: none; color: var(--accent); text-decoration: underline 1.5px; text-underline-offset: 3px; }

.empty { margin: 8px 0 0; padding: 48px 0; text-align: center; color: var(--sub); border: 1px dashed var(--line-2); border-radius: var(--r); }

/* 바닥 */
.foot { margin-top: auto; padding-top: 72px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot-brand { font: 900 13px/1 Montserrat, sans-serif; letter-spacing: .04em; color: var(--sub); }
.foot-note { margin-left: auto; }

/* 2열(태블릿)일 때 남는 마지막 카드는 가로로 넓게 — 빈자리 없게 */
@media (min-width: 761px) and (max-width: 1139px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .card:last-child:nth-child(odd) .shot { flex: 0 0 50%; aspect-ratio: auto; min-height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
}

/* 태블릿·폰 */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .top-in { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
  .search { width: 100%; height: 42px; }
  .search input { font-size: 16px; } /* 아이폰 확대 막기 */
  .search kbd { display: none; }
  .hero { padding: 28px 0 22px; }
  .hero p { margin-top: 10px; }
  .tabs { margin: 0 -16px 16px; padding: 0 16px; }
  .tab { height: 36px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .body { padding: 16px 16px 18px; }
  .name { font-size: 23px; }
  .foot { padding-top: 48px; }
  .foot-note { margin-left: 0; }
}
@media (pointer: coarse) { .search input { font-size: 16px; } } /* 손가락 기기(아이패드 포함) 찾기 칸 확대 막기 */
@media (hover: none) { .card:hover { transform: none; } .card:hover .shot img { transform: scale(var(--z, 1.2)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
