:root {
  color-scheme: light;
  --bg: #FBFBFD;
  --bg-soft: #F5F5F7;
  --text: #0C0C0C;
  --text-soft: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --card: #F5F5F7;
  --accent: #2A64F6;
  --radius: 22px;
  --nav-h: 52px;
  --maxw: 1080px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Pretendard", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 속성이 display 규칙(grid/flex)에 덮이지 않도록 보장 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand-accent { color: var(--accent); }
.nav-links { display: flex; gap: 26px; font-size: 14px; }
.nav-links a { color: var(--text-soft); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links .muted { opacity: 0.85; }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 120px 22px 90px;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-soft) 0%, var(--bg) 60%);
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.lead {
  margin: 20px auto 0;
  max-width: 540px;
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--text-soft);
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 34px;
  padding: 12px 26px;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.2s, opacity 0.2s;
}
.cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---- Sections ---- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 72px 22px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 34px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.count { color: var(--text-soft); font-size: 14px; margin-top: 4px; }

/* 검색 */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 980px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  min-width: 200px;
}
.search svg { width: 16px; height: 16px; fill: var(--text-soft); flex: none; }
.search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  outline: none;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  padding: 7px 15px;
  border-radius: 980px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---- Grid & Cards ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--card);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s;
  opacity: 0;
  transform: translateY(16px);
}
.card.in { opacity: 1; transform: none; }
.card[role="button"] { cursor: pointer; }
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.35);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 35%, var(--line));
}
.card:focus-visible { outline: 2px solid var(--card-accent, var(--accent)); outline-offset: 3px; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(140% 120% at 50% -10%, color-mix(in srgb, var(--card-accent, var(--accent)) 14%, transparent), transparent 60%);
  transition: opacity 0.3s;
}
.card:hover::after { opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ver {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 980px;
}
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--card-accent, var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 16px;
}
.card-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--card-accent, var(--accent));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card h3 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
}
.card .tagline { color: var(--text-soft); font-size: 15px; }
.card .desc { color: var(--text-soft); font-size: 14px; margin-top: 10px; }
.card .platform { font-size: 12px; color: var(--text-soft); margin-top: 14px; }
.card-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn {
  flex: 1;
  min-width: 110px;
  text-align: center;
  padding: 10px 16px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  color: var(--text);
  transition: all 0.18s;
}
.btn:hover { background: rgba(0, 0, 0, 0.05); }
.btn.primary {
  background: var(--card-accent, var(--accent));
  color: #fff;
  border-color: transparent;
}
.btn.primary:hover { opacity: 0.9; }
.btn:active { transform: scale(0.97); }
.btn.ghost { opacity: 0.5; pointer-events: none; }

.loading { color: var(--text-soft); padding: 40px 0; }
.empty { color: var(--text-soft); padding: 40px 0; grid-column: 1 / -1; text-align: center; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 40px 22px;
  color: var(--text-soft);
  font-size: 13px;
}

/* ---- Skeletons ---- */
.card.skeleton { opacity: 1; transform: none; cursor: default; }
.card.skeleton::before { display: none; }
.skeleton .sk-icon, .skeleton .sk-line, .skeleton .sk-btn {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--line) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
.skeleton .sk-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }
.skeleton .sk-line { height: 13px; margin-bottom: 10px; }
.skeleton .w40 { width: 40%; } .skeleton .w60 { width: 60%; } .skeleton .w80 { width: 80%; }
.skeleton .sk-btn { height: 38px; width: 120px; border-radius: 980px; margin-top: 16px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- Detail sheet ---- */
.sheet {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: end center;
}
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.25s;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-box {
  position: relative;
  width: 100%; max-width: 720px;
  max-height: 92vh; overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  padding: 40px;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s;
}
.sheet.open .sheet-box { transform: none; opacity: 1; }
.sheet-close {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--bg-soft); color: var(--text-soft);
  font-size: 14px;
}
.sheet-close:hover { color: var(--text); }
.detail-head { display: flex; gap: 20px; align-items: flex-start; }
.detail-icon {
  width: 80px; height: 80px; border-radius: 20px; flex: none;
  object-fit: cover;
  background: var(--card-accent, var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 34px;
}
.detail-head h2 { font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.03em; margin: 4px 0 6px; }
.detail-head .tagline { color: var(--text-soft); font-size: 17px; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; color: var(--text-soft); font-size: 13px; }
.detail-meta span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 980px; }
.detail-actions { display: flex; gap: 10px; margin: 26px 0; flex-wrap: wrap; }
.detail-actions .btn { flex: none; min-width: 150px; }
.gallery {
  display: flex; gap: 14px; overflow-x: auto;
  padding-bottom: 10px; margin-bottom: 26px;
  scroll-snap-type: x mandatory;
}
.gallery img {
  height: 360px; border-radius: 18px;
  border: 1px solid var(--line);
  scroll-snap-align: start; flex: none;
}
.detail-desc { color: var(--text); font-size: 16px; line-height: 1.65; white-space: normal; }

.releases { margin-top: 28px; }
.releases h4 { font-size: 15px; font-weight: 650; margin-bottom: 12px; letter-spacing: -0.01em; }
.release {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.release .rv { font-weight: 600; font-size: 15px; }
.release .rv em { font-style: normal; font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 980px; padding: 1px 7px; margin-left: 6px; }
.release .rd { color: var(--text-soft); font-size: 13px; }
.release .muted { color: var(--text-soft); font-size: 13px; }
.btn.small { flex: none; min-width: 0; padding: 7px 16px; font-size: 13px; }

@media (max-width: 600px) {
  .hero { padding: 86px 22px 64px; }
  .search { min-width: 0; flex: 1; }
  .sheet-box { padding: 28px 22px; }
  .detail-head { flex-direction: column; }
  .gallery img { height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
