/* apps.wslaw.kr — neutral paper shelf that lets each app's own color lead. */
:root {
  --bg: #F5F4EF;
  --surface: #FFFFFF;
  --ink: #15171A;
  --muted: #565B63;
  --line: #E2E0D8;
  --line-strong: #CFCCC2;
  --focus: #2350D8;
  --store: #0B6B4F;
  --store-bg: #E3F2EC;
  --soon: #7A4A00;
  --soon-bg: #F8EBD3;
  --web: #3A3F9E;
  --web-bg: #E7E8F8;
  --oss: #3D4450;
  --oss-bg: #E8EAEE;

  --fs-xs: 0.875rem;
  --fs-s: 0.9375rem;
  --fs-m: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --fs-l: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --fs-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --fs-display: clamp(2.75rem, 1.6rem + 5vw, 5.5rem);

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --shadow-1: 0 1px 2px rgba(21, 23, 26, 0.06);
  --shadow-2: 0 1px 2px rgba(21, 23, 26, 0.06), 0 18px 36px -22px rgba(21, 23, 26, 0.32);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --space-section: clamp(56px, 4vw + 40px, 104px);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: var(--fs-m);
  line-height: 1.65;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1240px, 100% - 2 * clamp(20px, 4vw, 40px)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: 12px; transform: translateY(-200%); z-index: 50; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--radius-s); text-decoration: none; }
.skip:focus { transform: none; }

/* header */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(245, 244, 239, .94); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.site-head.is-scrolled { border-bottom-color: var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; text-decoration: none; min-height: 44px; }
.brand .dim { color: var(--muted); font-weight: 500; }
.mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 26px; height: 26px; padding: 4px; background: var(--ink); border-radius: 7px; }
.mark i { border-radius: 2px; }

/* hero */
.hero { padding-block: clamp(40px, 6vw, 96px) clamp(32px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 48px; align-items: end; }
.eyebrow { grid-column: 1 / -1; margin: 0 0 18px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); letter-spacing: .02em; }
.hero h1 { margin: 0; font-size: var(--fs-display); line-height: 1.04; letter-spacing: -0.045em; font-weight: 800; text-wrap: balance; }
.lede { margin: 0 0 6px; max-width: 34ch; color: var(--muted); font-size: var(--fs-m); text-wrap: pretty; }
.stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.stats div { display: flex; align-items: baseline; gap: 10px; }
.stats dt { font-size: var(--fs-s); color: var(--muted); }
.stats dd { margin: 0; font-size: var(--fs-l); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* toolbar */
.toolbar { position: sticky; top: 64px; z-index: 15; background: rgba(245, 244, 239, .96); border-block: 1px solid var(--line); }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .seg button {
  font: inherit; font-size: var(--fs-s); font-weight: 600; color: var(--muted);
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease);
}
.chip:hover, .seg button:hover { color: var(--ink); border-color: var(--ink); }
.chip:active, .seg button:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tools-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.seg button { border: 0; min-height: 34px; padding: 0 12px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.search input {
  font: inherit; font-size: var(--fs-s); width: min(260px, 70vw); min-height: 40px; padding: 0 14px 0 36px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23565B63' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 13px 50%;
  color: var(--ink);
}
.search input:focus-visible { outline-offset: 0; border-color: var(--focus); }
.result:empty { display: none; }
.result { margin-block: 14px 0; font-size: var(--fs-s); color: var(--muted); }

/* groups + cards */
.groups { padding-bottom: var(--space-section); }
.group { margin-top: clamp(28px, 3vw, 48px); }
.groups > .group:not([hidden]) ~ .group { margin-top: clamp(40px, 4vw, 64px); }
.group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.group h2 { margin: 0; font-size: var(--fs-xl); letter-spacing: -0.025em; }
.group-count { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.card-band {
  position: relative; height: 104px; display: flex; align-items: flex-end; padding: 0 20px;
  background: var(--app); border-bottom: 1px solid rgba(21, 23, 26, .06);
}
.card-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.04)); pointer-events: none; }
.card-band img {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 15px; transform: translateY(24px);
  box-shadow: 0 0 0 1px rgba(21,23,26,.08), 0 10px 22px -12px rgba(21,23,26,.45);
  transition: transform .26s var(--ease);
}
.icon-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 15px; transform: translateY(24px); background: var(--mk-bg); color: var(--mk-fg); font: italic 600 1.375rem Georgia, "Times New Roman", serif; letter-spacing: -0.02em; box-shadow: 0 0 0 1px rgba(21,23,26,.08), 0 10px 22px -12px rgba(21,23,26,.45); transition: transform .26s var(--ease); }
.icon-mark::after { content: ""; position: absolute; right: 13px; bottom: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--mk-dot); }
.card:hover .icon-mark { transform: translateY(20px) rotate(-3deg) scale(1.04); }
.card:hover .card-band img { transform: translateY(20px) rotate(-3deg) scale(1.04); }
.card-body { padding: 36px 20px 0; flex: 1; }
.card-name { margin: 0; font-size: var(--fs-l); line-height: 1.25; letter-spacing: -0.025em; }
.card-link { text-decoration: none; }
.card-link:focus-visible { outline: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.card-latin { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.card-line { margin: 12px 0 0; font-size: var(--fs-s); line-height: 1.6; text-wrap: pretty; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 20px 16px; }
.card-host { font-family: var(--mono); font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:hover .card-host { color: var(--ink); }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--store { color: var(--store); background: var(--store-bg); }
.pill--soon { color: var(--soon); background: var(--soon-bg); }
.pill--web { color: var(--web); background: var(--web-bg); }
.pill--oss { color: var(--oss); background: var(--oss-bg); }
.card-extra { position: relative; z-index: 3; display: flex; gap: 4px; margin: 0; padding: 0 12px 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.card-extra a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: var(--fs-s); font-weight: 600; color: var(--muted); text-decoration: none; border-radius: var(--radius-s); }
.card-extra a:hover { color: var(--ink); background: var(--bg); }
.empty { margin: 48px 0 0; padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-l); }

/* footer */
.site-foot { border-top: 1px solid var(--line); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 28px 40px; font-size: var(--fs-s); color: var(--muted); }
.foot-row p { margin: 0; }
.foot-row a { color: var(--ink); text-underline-offset: 3px; }
.foot-row .copy { text-align: right; }
.foot-row .copy small { font-size: inherit; }
.foot-row .copy small:first-child { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .foot-row .copy { text-align: left; } }

/* 404 */
.nf-main { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.nf-main h1 { margin: 0 0 12px; font-size: var(--fs-display); letter-spacing: -0.04em; line-height: 1.08; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; }
.btn:hover { background: #2B2E33; }

/* filtering */
.card[hidden], .group[hidden] { display: none; }

/* motion: shelf — cards are set down on the shelf one after another */
@media (prefers-reduced-motion: no-preference) {
  html.js .card.pre { opacity: 0; transform: translateY(18px); }
  html.js .card.pre .card-band img, html.js .card.pre .icon-mark { transform: translateY(36px) scale(.92); }
  html.js .card.in { transition: opacity .5s var(--ease), transform .5s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); transition-delay: calc(var(--d, 0) * 70ms); }
  html.js .card.in .card-band img, html.js .card.in .icon-mark { transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); transition-delay: calc(var(--d, 0) * 70ms + 120ms); }
  html.js .hero h1, html.js .hero .lede { animation: rise .6s var(--ease) both; }
  html.js .hero .lede { animation-delay: .08s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } }
  ::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .lede { margin-top: 20px; }
  .toolbar { position: static; }
  .tools-right { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
}
@media (max-width: 520px) {
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stats div { flex-direction: column-reverse; gap: 2px; }
  .stats dt { font-size: var(--fs-xs); line-height: 1.4; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding-inline: 20px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 8px; }
  .grid { grid-template-columns: 1fr; }
}
