/* ひろ@AI遊び場 共通スタイル（scripts/build_site.py が全ページに読み込ませる）
   色・余白・角丸はここのトークンだけを使う。ページに値を直書きしない。
   基準: 背景はオフホワイト、ブランド色（木の茶）は面積の 1〜7%、余白は 4px 単位。 */
:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F3EDE4;
  --ink: #2A2420;
  --ink-2: #6B5F57;
  --ink-3: #988B81;
  --line: rgba(42, 36, 32, 0.10);
  --brand: #8B5A2B;
  --brand-strong: #6E4520;
  --brand-soft: #F1E6D8;
  --ok: #1F7A4D;
  --ok-soft: #E3F2EA;
  --wip: #9A5B00;
  --wip-soft: #FCEFD9;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --shadow: 0 1px 2px rgba(42, 36, 32, 0.06), 0 4px 16px rgba(42, 36, 32, 0.06);
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --w: 1080px;
}

/* ---------- 共通ヘッダー（既存ページの header/nav の CSS と当たらないよう sh- の class だけで組む） ---------- */
.sh {
  position: sticky; top: 0; z-index: 1000;
  display: block; width: 100%; align-self: stretch;
  margin: 0; padding: 0; box-sizing: border-box;
  background: rgba(250, 247, 242, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line); box-shadow: none;
  font-family: var(--font); line-height: 1.5; text-align: left;
}
.sh *, .sf * { box-sizing: border-box; }
.sh-in {
  max-width: var(--w); margin: 0 auto; padding: 0 16px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sh-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.sh-brand img { width: 32px; height: 32px; border-radius: 8px; display: block; margin: 0; }
.sh-brand span { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.sh-nav { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.sh-nav a {
  display: inline-flex; align-items: center; gap: 4px; margin: 0;
  padding: 8px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  background: transparent; box-shadow: none; transition: background 0.15s, color 0.15s;
}
.sh-nav a:hover { background: var(--surface-2); color: var(--ink); }
.sh-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.sh-nav .sh-ico { font-size: 15px; line-height: 1; }
@media (max-width: 640px) {
  .sh { position: static; }
  .sh-in { height: auto; flex-wrap: wrap; padding: 8px 12px 4px; gap: 4px; }
  .sh-nav { width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding-bottom: 4px; }
  .sh-nav::-webkit-scrollbar { display: none; }
  .sh-nav a { padding: 8px 12px; font-size: 13px; }
}

/* ---------- 共通フッター ---------- */
.sf {
  display: block; width: 100%; align-self: stretch; clear: both;
  margin: 64px 0 0; padding: 32px 16px 40px; box-sizing: border-box;
  border-top: 1px solid var(--line); background: transparent;
  font-family: var(--font); line-height: 1.6; text-align: center; color: var(--ink-2);
}
.sf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; max-width: 760px; margin: 0 auto; }
.sf-links a { color: var(--ink-2); text-decoration: none; font-size: 13px; padding: 4px 8px; border-radius: var(--r-s); }
.sf-links a:hover { color: var(--ink); background: var(--surface-2); }
.sf-copy { margin-top: 16px; font-size: 12px; color: var(--ink-3); }

/* ---------- ここから下は build_site.py が作るページ（トップ・アプリ紹介）だけが使う ---------- */
:where(.site *) { box-sizing: border-box; margin: 0; padding: 0; }
body.site {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility;
}
.site img { max-width: 100%; }
:where(.site) a { color: var(--brand-strong); }
.site .wrap { max-width: var(--w); margin: 0 auto; padding: 0 16px; }
.site .sec { margin-top: 56px; scroll-margin-top: 76px; }
.site .sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.site .sec-h h2 { font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.site .sec-h a { font-size: 14px; font-weight: 600; text-decoration: none; }
.site .sec-sub { font-size: 14px; color: var(--ink-2); margin: -8px 0 16px; }

/* ヒーロー（トップ） */
.site .hero { padding: 40px 0 8px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.site .hero-logo { width: 88px; height: 88px; border-radius: var(--r-l); box-shadow: var(--shadow); display: block; }
.site .hero h1 { font-size: 30px; font-weight: 800; line-height: 1.3; letter-spacing: 0.01em; }
.site .hero p { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
@media (max-width: 640px) {
.site .hero { gap: 12px; padding-top: 24px; align-items: start; }
.site .hero-logo { width: 56px; height: 56px; border-radius: 14px; }
.site .hero h1 { font-size: 24px; }
}

/* 入口タイル（優待データベース・ツール） */
.site .doors { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-top: 24px; }
.site .door {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 148px;
  padding: 20px; border-radius: var(--r-l); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.site .door:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(42,36,32,.08), 0 12px 28px rgba(42,36,32,.10); }
.site .door-ico { font-size: 32px; line-height: 1; }
.site .door-t { font-size: 18px; font-weight: 800; margin-top: 8px; }
.site .door-d { font-size: 13px; color: var(--ink-2); }
.site .door-n { font-size: 13px; font-weight: 700; color: var(--brand-strong); margin-top: auto; padding-top: 8px; }
.site .door.main { background: linear-gradient(140deg, #8B5A2B 0%, #5E3A18 100%); color: #fff; border: 0; }
.site .door.main .door-d { color: rgba(255,255,255,.82); }
.site .door.main .door-n { color: #FFE2B8; }
.site .door.main .door-t { font-size: 22px; }
@media (max-width: 860px) {.site .doors { grid-template-columns: 1fr 1fr; }.site .door.main { grid-column: 1 / -1; } }

/* アプリ一覧 */
.site .apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.site .app {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center;
  padding: 16px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
.site .app:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(42,36,32,.08), 0 12px 28px rgba(42,36,32,.10); }
.site .app img { width: 64px; height: 64px; border-radius: 16px; display: block; box-shadow: 0 0 0 1px var(--line); }
.site .app-n { font-size: 16px; font-weight: 800; line-height: 1.35; }
.site .app-d { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site .badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1.6; }
.site .badge.ok { background: var(--ok-soft); color: var(--ok); }
.site .badge.wip { background: var(--wip-soft); color: var(--wip); }
.site .app-group { font-size: 13px; font-weight: 700; color: var(--ink-3); margin: 24px 0 8px; letter-spacing: 0.04em; }

/* 記事 */
.site .posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.site .post { display: block; padding: 20px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.site .post:hover { border-color: rgba(139,90,43,.35); }
.site .post-m { font-size: 12px; color: var(--ink-3); }
.site .post-t { font-size: 16px; font-weight: 800; line-height: 1.5; margin-top: 4px; }
.site .post-d { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* ボタン */
.site .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.site .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 20px; border-radius: 999px; font-size: 15px; font-weight: 700; text-decoration: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.site .btn:hover { background: var(--surface-2); }
.site .btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.site .btn.primary:hover { background: #000; }
.site .btn .gp { width: 18px; height: 18px; display: block; }

/* アプリ紹介ページ */
.site .crumb { font-size: 13px; color: var(--ink-3); padding-top: 16px; }
.site .crumb a { color: var(--ink-2); text-decoration: none; }
.site .crumb a:hover { text-decoration: underline; }
.site .ap-hero { display: grid; grid-template-columns: 112px 1fr; gap: 24px; align-items: center; padding: 24px 0 8px; }
.site .ap-hero > img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 0 0 1px var(--line), var(--shadow); display: block; }
.site .ap-hero h1 { font-size: 30px; font-weight: 800; line-height: 1.25; }
.site .ap-sub { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.site .ap-lead { font-size: 16px; margin-top: 12px; max-width: 640px; }
.site .ap-hero .btns { margin-top: 16px; }
.site .ap-note { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
@media (max-width: 640px) {
.site .ap-hero { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
.site .ap-hero > img { width: 80px; height: 80px; border-radius: 20px; }
.site .ap-hero h1 { font-size: 24px; }
}
.site .shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 16px; margin: 0 -16px;
  scrollbar-width: thin; }
.site .shots img { flex: 0 0 auto; width: 220px; height: auto; border-radius: var(--r-m); border: 1px solid var(--line);
  box-shadow: var(--shadow); scroll-snap-align: start; background: var(--surface-2); }
@media (max-width: 640px) {.site .shots img { width: 64vw; max-width: 240px; } }
.site .feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.site .feats.even { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {.site .feats, .site .feats.even { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {.site .feats, .site .feats.even { grid-template-columns: 1fr; } }
.site .feat { padding: 20px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); }
.site .feat-i { font-size: 28px; line-height: 1; }
.site .feat-t { font-size: 16px; font-weight: 800; margin-top: 12px; line-height: 1.45; }
.site .feat-d { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.site .steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; counter-reset: s; }
.site .steps li { position: relative; padding: 16px 16px 16px 56px; border-radius: var(--r-l); background: var(--surface-2); font-size: 14px; counter-increment: s; }
.site .steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.site .facts { list-style: none; display: grid; gap: 8px; }
.site .facts li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-size: 14px; color: var(--ink-2); }
.site .facts li span:first-child { font-size: 18px; line-height: 1.5; text-align: center; }
.site .cta { margin-top: 56px; padding: 24px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site .cta-t { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.site .cta-t img { width: 48px; height: 48px; border-radius: 12px; display: block; box-shadow: 0 0 0 1px var(--line); }
.site .more { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.site .more a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: var(--r-m);
  text-decoration: none; color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.4; }
.site .more a:hover { background: var(--surface-2); }
.site .more img { width: 56px; height: 56px; border-radius: 14px; display: block; box-shadow: 0 0 0 1px var(--line); }

/* 優待ページのアプリ案内（茶色の帯）の中のリンク */
.app-banner a { color: #FFE2B8; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
