/* ===================================================
   게임 포털 스타일
   ---------------------------------------------------
   포트폴리오(css/style.css)와 같은 디자인 토큰을 씁니다.
   짙은 네이비 배경 + 민트 포인트, 다크 기본.
   레이아웃만 포털용(헤더 + 카드 그리드)으로 다릅니다.
   =================================================== */

:root {
  --bg:          #0f172a;
  --bg-soft:     #131c31;
  --text:        #94a3b8;
  --heading:     #e2e8f0;
  --muted:       #64748b;
  --accent:      #5eead4;
  --accent-dim:  rgba(45, 212, 191, .1);
  --line:        #475569;
  --line-soft:   #1e293b;
  --card:        rgba(30, 41, 59, .45);
  --card-hover:  rgba(30, 41, 59, .8);
  --thumb-border: rgba(148, 163, 184, .15);
  --shadow:      0 18px 40px -22px rgba(2, 6, 23, .9);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

:root[data-theme="light"] {
  --bg:          #f8fafc;
  --bg-soft:     #eef2f7;
  --text:        #475569;
  --heading:     #0f172a;
  --muted:       #64748b;
  --accent:      #0d9488;
  --accent-dim:  rgba(13, 148, 136, .09);
  --line:        #94a3b8;
  --line-soft:   #e2e8f0;
  --card:        #ffffff;
  --card-hover:  #ffffff;
  --thumb-border: rgba(15, 23, 42, .12);
  --shadow:      0 18px 40px -26px rgba(15, 23, 42, .35);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

img { max-width: 100%; display: block; }
ul  { list-style: none; padding: 0; margin: 0; }
a   { color: inherit; text-decoration: none; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

/* ===== 헤더 ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding-block: 10px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand .dot { color: var(--accent); }

.search {
  position: relative;
  flex: 1 1 200px;
  max-width: 380px;
}
.search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  color: var(--heading);
  font-size: .92rem;
  transition: border-color .18s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); }
.search svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.ghost-link {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--text);
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}
.ghost-link:hover { color: var(--accent); background: var(--accent-dim); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease;
}
.icon-btn:hover { color: var(--accent); background: var(--accent-dim); }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun  { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ===== 히어로 ===== */

.hero {
  padding-block: 54px 34px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(700px 260px at 12% -10%, var(--accent-dim), transparent 70%);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  color: var(--heading);
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  margin: 0;
  max-width: 52ch;
  font-size: clamp(.95rem, 2.3vw, 1.05rem);
}

/* ===== 장르 필터 ===== */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 22px 6px;
}
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  font-size: .86rem;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ===== 섹션 / 그리드 ===== */

.section { padding-block: 30px 10px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--heading);
  letter-spacing: -.01em;
}
.section-head .count {
  font-size: .82rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--card);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease,
              background-color .2s ease, box-shadow .2s ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--tint, var(--accent)) 55%, transparent);
  background: var(--card-hover);
  box-shadow: var(--shadow);
}

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--thumb-border);
  overflow: hidden;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .card-thumb img { transform: scale(1.045); }

.thumb-initial {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(140deg,
              var(--tint, var(--accent)),
              color-mix(in srgb, var(--tint, var(--accent)) 45%, var(--bg-soft)));
}

.badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  backdrop-filter: blur(6px);
}
.badge-web  { background: rgba(94, 234, 212, .92); color: #0f172a; }
.badge-app  { background: rgba(167, 139, 250, .92); color: #0f172a; }
.badge-soon { background: rgba(148, 163, 184, .85); color: #0f172a; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px 16px;
  flex: 1;
}
.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -.01em;
}
.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.card-desc {
  margin: 0;
  font-size: .855rem;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.card-genres li {
  font-size: .72rem;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 2px 7px;
}

.card-links {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  font-size: .8rem;
}
.card-links a {
  color: var(--muted);
  transition: color .16s ease;
}
.card-links a:hover { color: var(--accent); }

.empty-msg {
  padding: 30px 0;
  color: var(--muted);
  font-size: .92rem;
}

/* ===== 푸터 ===== */

.site-footer {
  margin-top: 50px;
  padding-block: 26px 40px;
  border-top: 1px solid var(--line-soft);
  font-size: .84rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}
.site-footer a:hover { color: var(--accent); }
.site-footer .spacer { margin-left: auto; }

@media (max-width: 560px) {
  .wrap { width: min(1180px, 100% - 28px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .card-desc { -webkit-line-clamp: 2; font-size: .8rem; }
  .hero { padding-block: 36px 26px; }
}
