/* docs/IMPL.md §2-5 */

:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --text: #1E2530;
  --text-sub: #4A5260;
  --border: #E1E4E9;
  --divider: #ECEEF1;
  --link: #2B5594;

  --font: 'M PLUS 2', system-ui, sans-serif;

  --radius-card: 28px;
  --radius-info: 20px;
  --radius-icon: 13px; /* 56px のときの角丸 */

  --max-w: 1040px;
  --gutter: clamp(16px, 4vw, 40px);

  --tap: 44px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  min-height: 100vh;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* ===== header ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.site-header__brand {
  color: var(--text);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-header__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.site-header__nav {
  color: var(--link);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

/* ===== main layout ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
}

.intro {
  padding: 16px 0 32px;
}

.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.intro p {
  margin: 0;
  color: var(--text-sub);
  font-size: 15px;
}

/* ===== apps ===== */
.apps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app__photo {
  background: var(--tint, var(--bg));
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 36px;
  overflow: hidden;
}

.app__photo img {
  width: 220px;
  height: auto;
  display: block;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.app__body {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
}

.app__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  flex: 0 0 auto;
}

.app__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.app__name {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.app__sub {
  margin: 2px 0 0;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
}

.app__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--tint, var(--bg));
  color: var(--tint-ink, var(--text));
}

.app__desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

/* 説明文のすぐ下に置く（下端に寄せると、ボタンが2段のカードの隣でストアのバッジが1段下がる） */
.app__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app__store img {
  display: block;
  height: 48px;
  width: auto;
}

/* Google Play のバッジは画像の外周に指定の余白を含む（見た目の高さは約 74%）。
   App Store のバッジと高さが揃うよう大きめに出し、余白ぶんを負のマージンで相殺する。画像は改変しない */
.app__store--play img {
  height: 64px;
  margin: -8px -6px;
}

/* 写真の代わりにアイコンを置く（画面写真がまだ無い開発中のアプリ） */
.app__photo--icon {
  align-items: center;
  padding-top: 0;
}

.app__photo--icon img {
  width: 160px;
  border-radius: 36px;
}

.app__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--link);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  min-height: var(--tap);
}

.app__arrow {
  flex: 0 0 auto;
}

.app__soon {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
}

/* 奇数枚のとき最後の1枚を横長カードにする */
.app:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  flex-direction: row;
}

.app:last-child:nth-child(odd) .app__photo {
  flex: 1 1 320px;
}

.app:last-child:nth-child(odd) .app__photo img {
  width: 220px;
}

.app:last-child:nth-child(odd) .app__photo--icon img {
  width: 160px;
}

.app:last-child:nth-child(odd) .app__body {
  flex: 1 1 320px;
  justify-content: center;
}

.app:last-child:nth-child(odd) .app__actions {
  margin-top: 0;
}

/* ===== info ===== */
.info {
  margin-top: 56px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-info);
  padding: 28px;
}

.info h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.info p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.7;
}

.info__note {
  color: var(--text-sub);
  font-size: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 18px;
  min-height: var(--tap);
  background: var(--text);
  border-radius: 12px;
  color: var(--surface);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.button__icon {
  flex: 0 0 auto;
}

/* ===== footer ===== */
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--gutter) 40px;
  color: var(--text-sub);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--divider);
}

footer p {
  margin: 0 0 4px;
}

/* ===== responsive: < 720px (スマホ) ===== */
@media (max-width: 719px) {
  .intro {
    padding: 8px 0 24px;
  }

  /* アプリは1本の箱にまとめてリスト化 */
  .apps {
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-info);
    overflow: hidden;
  }

  .app {
    border: none;
    border-radius: 0;
    flex-direction: row;
    padding: 16px;
    background: transparent;
  }

  .app + .app {
    border-top: 1px solid var(--divider);
  }

  /* 写真枠は表示しない */
  .app__photo {
    display: none;
  }

  .app__body {
    padding: 0;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .app__head {
    gap: 12px;
  }

  .app__name {
    font-size: 18px;
  }

  .app__sub {
    font-size: 12px;
  }

  .app__desc {
    font-size: 14px;
  }

  .app__store img {
    height: 44px;
  }

  .app__store--play img {
    height: 59px;
    margin: -7.5px -5px;
  }

  .app__link {
    font-size: 14px;
  }

  /* 奇数カードの横並びを解除 */
  .app:last-child:nth-child(odd) {
    grid-column: auto;
    flex-direction: row;
  }

  /* info は1列 */
  .info {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 40px;
  }

  .info > div {
    padding: 20px;
  }
}
