:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1c1f23;
  --text-sub: #3d434b;
  --muted: #646b75;
  --border: #e3e3df;
  --accent: #2563eb;
  --shadow: 0 1px 2px rgb(20 24 28 / 0.06), 0 8px 24px -12px rgb(20 24 28 / 0.2);

  --radius: 12px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP",
    "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131518;
    --surface: #1b1e22;
    --text: #e9ebee;
    --text-sub: #c5cad1;
    --muted: #9aa2ac;
    --border: #2c3138;
    --accent: #6ea0ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 10px 26px -12px rgb(0 0 0 / 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 16px 48px;
}

@media (min-width: 640px) {
  .page { padding: 64px 24px; }
}

/* ヘッダー */
.site-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.3;
}

.lead {
  margin: 8px 0 0;
  color: var(--text-sub);
}

/* カテゴリ */
.category {
  margin-top: 40px;
}

.category h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 700;
}

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* アプリのカード */
.app {
  position: relative;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.app-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.app-name a {
  color: inherit;
  text-decoration: none;
}

/* カード全体をクリックできるようにする */
.app-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.app-name a:focus-visible {
  outline: none;
}

.app-name a:focus-visible::after {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.app-url {
  margin: 2px 0 0;
  font: 0.8rem/1.5 var(--font-mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.app-desc {
  margin: 8px 0 0;
  color: var(--text-sub);
  font-size: 0.9rem;
  line-height: 1.75;
  text-wrap: pretty;
}

/* フッター */
.site-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .app { transition: none; }
}
