:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1c1d1f;
  --muted: #6b6e75;
  --line: #e6e6e2;
  --soft: #f0f0ec;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e8efff;
  --note: #fff7e6;
  --note-line: #f3d9a4;
  --code: #f2f2ef;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 24px rgba(0, 0, 0, .05);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214;
    --card: #1a1b1e;
    --text: #ececef;
    --muted: #9a9ca3;
    --line: #2c2e33;
    --soft: #232529;
    --accent: #6c9bff;
    --accent-ink: #0d1220;
    --accent-soft: #1d2740;
    --note: #2a2414;
    --note-line: #4d3f1c;
    --code: #232529;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111214;
  --card: #1a1b1e;
  --text: #ececef;
  --muted: #9a9ca3;
  --line: #2c2e33;
  --soft: #232529;
  --accent: #6c9bff;
  --accent-ink: #0d1220;
  --accent-soft: #1d2740;
  --note: #2a2414;
  --note-line: #4d3f1c;
  --code: #232529;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { font-weight: 700; text-decoration: none; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a {
  text-decoration: none; color: var(--muted); font-size: 14px;
  padding: 6px 12px; border-radius: 8px;
}
.top nav a:hover { color: var(--text); background: var(--soft); }

.hero { padding: 56px 0 32px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
.hero p { margin: 0; color: var(--muted); font-size: 18px; }
.hero .stat { margin-top: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }

/* 카테고리 이동 */
.cats {
  position: sticky; top: 56px; z-index: 9;
  background: var(--bg);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cats ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.cats ul::-webkit-scrollbar { display: none; }
.cats a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
}
.cats a:hover, .cats a.on { border-color: var(--accent); color: var(--accent); }
.cats .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.ic { flex: none; color: var(--muted); }
.cats a:hover .ic, .cats a.on .ic { color: currentColor; }

/* 섹션 */
section.cat { padding-top: 40px; }
section.cat > h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--muted);
  margin: 0 0 16px;
}

/* 카드 */
.app {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 4px 24px;
}
.app .icon { width: 76px; height: 76px; border-radius: 16px; grid-row: span 2; }
.app header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.app h3 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); align-self: center;
}
.ver { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tagline { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 4px 0 0; }
.body { grid-column: 2; min-width: 0; }
.head { min-width: 0; }
.desc { margin: 12px 0 0; color: var(--text); }
.feats { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 4px; }
.feats li { position: relative; padding-left: 24px; }
.feats li::before {
  content: ""; position: absolute; left: 8px; top: .7em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .6;
}
.note {
  margin: 16px 0 0; font-size: 14px; color: var(--text);
  background: var(--note); border: 1px solid var(--note-line);
  border-radius: 12px; padding: 12px 16px;
}

.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: border-color .15s ease-out, color .15s ease-out, background-color .15s ease-out;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }

.install { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.install .cmd {
  display: flex; align-items: center; gap: 8px;
  background: var(--code); border-radius: 10px; padding: 8px 8px 8px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}
.install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.install .label { font-size: 13px; color: var(--muted); }
.copy {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-family: inherit; font-size: 12px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }

.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.meta li { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 4px 8px; }

.fb { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.fb a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.fb a:hover .ic { color: currentColor; }
.fb a:hover { color: var(--accent); }

.shots {
  grid-column: 1 / -1; display: flex; gap: 12px; overflow-x: auto; margin-top: 24px;
  scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 4px;
}
.shots img {
  flex: none; height: 220px; width: auto; border-radius: 8px; border: 1px solid var(--line);
  background: var(--soft); scroll-snap-align: start;
}

/* 꼬리 */
footer { margin: 48px 0 0; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 6px; }
footer a { color: var(--text); }

@media (max-width: 640px) {
  html { scroll-padding-top: 112px; }
  .hero { padding: 36px 0 20px; }
  .hero p { font-size: 16px; }
  .app { grid-template-columns: 56px minmax(0, 1fr); padding: 20px 16px; gap: 4px 16px; }
  .app .icon { width: 56px; height: 56px; border-radius: 12px; grid-row: span 1; }
  .body { grid-column: 1 / -1; }
  .app h3 { font-size: 20px; }
  .tagline { font-size: 17px; }
  .shots img { height: 180px; }
  .head { align-self: center; }
  .btn { flex: 1 1 auto; justify-content: center; }
}

/* Microsoft Store 버튼 */
.btn.store { gap: 8px; padding-left: 12px; }
.btn.store .store-ic { flex: none; }

/* 이미지 확대 */
.shots img, .app .icon { cursor: zoom-in; }
.shots img:focus-visible, .app .icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.zoom {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(17, 18, 20, .82); cursor: zoom-out; animation: zoom-in .16s ease-out;
}
.zoom[hidden] { display: none; }
.zoom img {
  max-width: min(100%, 1200px); max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: 10px; box-shadow: 0 12px 48px rgba(0, 0, 0, .35); background: var(--card);
}
.zoom img.is-icon { width: min(70vw, 360px); border-radius: 22%; }
.zoom:focus { outline: none; }
html.zoomed { overflow: hidden; }
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zoom { animation: none; } }
