/*
  GitHub Pages 用の共通スタイル。
  外部フォント・外部 CDN には依存しない（読み込み失敗と追跡を避けるため）。
  App Store バッジも Apple の配布物を assets/badges/ に同梱している。
*/

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --text: #1c1c1e;
  --text-muted: #6b7280;
  --border: #e3e5e8;
  /* 猫タイマーのボタンの橙と、部屋の木の色から取った色。本文のリンクに使うため暗めにしている */
  --accent: #b5531c;
  --accent-contrast: #ffffff;
  --hero-glow: rgba(255, 140, 40, 0.16);
  --radius: 14px;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --bg-subtle: #1a1d20;
    --text: #e9eaec;
    --text-muted: #9aa1a9;
    --border: #2b2f34;
    --accent: #ffab66;
    --accent-contrast: #1f1208;
    --hero-glow: rgba(255, 140, 40, 0.12);
  }
}

* {
  box-sizing: border-box;
}

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

/* 日本語以外で開いたとき、訳を当て終えるまで原文（日本語）を見せない */
html.i18n-pending body {
  visibility: hidden;
}

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Noto Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
}

/* 欧文は行間を詰めたほうが読みやすい */
html:not([lang="ja"]):not([lang^="zh"]):not([lang="ko"]) body {
  line-height: 1.65;
}

html[lang="zh-Hans"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

html[lang="zh-Hant"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

html[lang="ko"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ── ヘッダー ───────────────────────────── */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

header.site .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.3;
}

header.site .brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  flex: none;
}

.lang-picker {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  color: var(--text-muted);
}

.lang-picker svg {
  position: absolute;
  left: 0.65rem;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.lang-picker select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg-subtle)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 0.7rem center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 2rem 0.45rem 2.1rem;
  cursor: pointer;
}

.lang-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── トップページのヒーロー ─────────────── */

.hero {
  text-align: center;
  padding: 1rem 0 2.5rem;
  background: radial-gradient(closest-side, var(--hero-glow), transparent) no-repeat center 0 / 100% 16rem;
}

.hero .icon {
  width: 128px;
  height: 128px;
  border-radius: 29px;
  image-rendering: pixelated;
  box-shadow: 0 10px 30px rgba(181, 83, 28, 0.25), 0 1px 3px rgba(0, 0, 0, 0.12);
}

.hero h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: 1.25rem 0 0.4rem;
}

.hero .tagline {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
}

/* Apple のガイドラインどおり、バッジは縦横比を変えず 40px 以上の高さで出す */
.store-badge img {
  height: 54px;
  width: auto;
}

.store-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero .requires {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── スクリーンショット ─────────────────── */

.shots {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0.1rem 1rem;
  margin: 0 0 1.5rem;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.shots li {
  flex: none;
  margin: 0;
  scroll-snap-align: start;
}

.shots img {
  display: block;
  width: 200px;
  height: auto;
  aspect-ratio: 1290 / 2796;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

@media (max-width: 480px) {
  .shots img {
    width: 58vw;
  }
}

/* ── 本文 ───────────────────────────────── */

h1 {
  font-size: 1.75rem;
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 2.75rem 0 0.9rem;
  padding-top: 0.25rem;
}

h3 {
  font-size: 1rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.35rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 0 2rem;
}

.lead {
  font-size: 1.05rem;
}

/* ── パーツ ─────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.feature {
  padding: 1.1rem 1.2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.5;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.7;
}

.card {
  display: block;
  padding: 1rem 1.15rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

a.card:hover,
a.card:focus-visible {
  border-color: var(--accent);
}

.card .card-title {
  font-weight: 600;
  display: block;
}

.card .card-desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.note {
  padding: 0.9rem 1.15rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.925rem;
  margin: 0 0 1rem;
}

.note :last-child {
  margin-bottom: 0;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.cta {
  text-align: center;
  margin: 3rem 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  margin: 0 0 1rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  white-space: nowrap;
  color: var(--text-muted);
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

/* ── フッター ───────────────────────────── */

footer.site {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer.site nav a {
  margin-right: 1rem;
  display: inline-block;
}
