/* 将棋解析 公式サイト（shogi-ai.jp）の共通スタイル。
   値の正は Claude Design の「将棋解析 公式サイト」プロジェクト（memory/handoff-website.md）。
   色はアプリのトークン（design/redesign/tokens.mjs）と揃える —
   朱 #ab2817 はアイコンの矢印、藍 #2f5f8f は良い手・リンク、弁柄は画面の説明でのみ使う。 */

:root {
  --bg: #fffdf9;          /* 地 */
  --surface: #f2e9d8;     /* 和紙の面（カード） */
  --text: #2b2319;
  --sub: #6b4a35;         /* 焦茶。補助の文字 */
  --body-sub: #3d3128;
  --nav: #4a2f1c;
  --rule: #e6dac4;
  --accent: #ab2817;      /* 朱。アイコンの矢印と同じ */
  --link: #2f5f8f;        /* 藍 */
  --link-hover: #1f4368;
  --gothic: "Zen Kaku Gothic New", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  --mincho: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --wrap: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--gothic);
  font-weight: 500;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible,
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* width/height 属性を読み込みのずれ防止で書いているので、**height: auto が無いと縦に伸びる**
   （CSS で幅だけ指定すると、高さは属性の値のまま固定される） */
img { max-width: 100%; height: auto; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; width: 100%; }

/* ヘッダー */
.site-header { background: rgba(255, 253, 249, .94); box-shadow: 0 1px 0 var(--rule); }
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; text-decoration: none; color: var(--text);
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-weight: 700; font-size: 18px; letter-spacing: .06em; }
.site-nav { display: flex; align-items: stretch; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.site-nav a {
  padding: 22px 16px; border-bottom: 3px solid transparent;
  color: var(--nav); text-decoration: none;
}
.site-nav a:hover { border-bottom-color: var(--accent); color: var(--text); }

/* 読み物のページ（プライバシーポリシーなど） */
.doc { max-width: 760px; width: 100%; margin: 0 auto; padding: 72px 24px 96px; }
.eyebrow {
  margin: 0 0 14px; font-size: 13px; letter-spacing: .2em;
  color: var(--accent); font-weight: 700;
}
.doc h1 {
  margin: 0 0 12px; font-family: var(--mincho); font-weight: 900;
  font-size: clamp(30px, 4vw, 44px); line-height: 1.3;
}
.updated { margin: 0 0 48px; font-size: 14px; color: var(--sub); }
.doc-body { display: grid; gap: 40px; font-size: 16px; line-height: 1.95; }
.doc-body h2 {
  margin: 0 0 12px; font-size: 20px; font-weight: 700;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.doc-body p { margin: 0; text-wrap: pretty; }
.doc-body p + p { margin-top: 16px; }
.doc-body ul { margin: 0; padding-left: 1.2em; }
.doc-body p + ul { margin-top: 12px; }
.doc-body ul + p { margin-top: 16px; }
.doc-body li + li { margin-top: 6px; }

/* フッター */
.site-footer { margin-top: auto; border-top: 1px solid var(--rule); background: var(--bg); }
.site-footer .wrap {
  padding: 28px 24px 36px; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--sub);
}
.site-footer .owner { display: flex; align-items: center; gap: 10px; color: var(--text); flex-wrap: wrap; }
.site-footer .owner img { width: 28px; height: 28px; border-radius: 7px; }
.site-footer .owner b { font-weight: 700; letter-spacing: .06em; }
.site-footer .owner span { color: var(--sub); font-weight: 500; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer nav a { color: var(--sub); text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 600px) {
  /* 4 項目を 1 行に収める。入りきらない機種（320px 等）は折り返さずに横スクロール
     — 折り返すとヘッダーが 2〜3 行に伸びて、本文が下に押し出される */
  .site-nav {
    width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    justify-content: space-between; font-size: 13px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 10px 6px 12px; white-space: nowrap; }
  .brand { padding: 12px 0 6px; }
}

@media (max-width: 360px) {
  /* 320px 機でも 4 項目が見切れないように詰める */
  .site-nav { font-size: 12px; }
  .site-nav a { padding: 10px 3px 12px; }
  .doc { padding: 48px 24px 72px; }
  .doc-body { gap: 32px; }
}

/* ===== トップページ ===== */

/* ヒーロー。木の盤を CSS で描く（デザインの値をそのまま写す） */
.hero {
  position: relative; overflow: hidden;
  background-color: #e0ad5f;
  background-image:
    repeating-linear-gradient(90deg, rgba(110,62,18,.10) 0 1px, transparent 1px 6px, rgba(110,62,18,.06) 6px 8px, transparent 8px 19px, rgba(110,62,18,.08) 19px 20px, transparent 20px 31px),
    repeating-linear-gradient(90deg, rgba(255,232,178,.22) 0 1px, transparent 1px 11px),
    linear-gradient(90deg, #e0ac5e, #d7a052 22%, #e6b96e 48%, #d69d4e 74%, #e2b064);
}
.hero-grid, .hero-light { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  background-image:
    linear-gradient(rgba(255,238,200,.5) 0 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,238,200,.5) 0 1px, transparent 1px),
    linear-gradient(#3b2410 0 2px, transparent 2px),
    linear-gradient(90deg, #3b2410 0 2px, transparent 2px),
    radial-gradient(circle, #3b2410 4px, transparent 5px);
  background-size: 150px 150px, 150px 150px, 150px 150px, 150px 150px, 450px 450px;
  background-position: -58px -47px, -57px -48px, -60px -50px, -60px -50px, 165px 175px;
}
.hero-light {
  background:
    radial-gradient(ellipse at 15% -10%, rgba(255,246,220,.6), transparent 55%),
    radial-gradient(ellipse at 90% 110%, rgba(70,35,5,.28), transparent 55%),
    linear-gradient(180deg, transparent 60%, #fffdf9 100%);
}
.hero .site-header { position: relative; }
.hero-inner {
  position: relative; max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 48px; align-items: end; padding: 56px 24px 0;
}
.hero-copy { position: relative; padding: 40px 32px; margin-bottom: 64px; }
.hero-copy::before {
  content: ""; position: absolute; inset: -64px -80px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: rgba(255,253,249,.66);
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000 28%, rgba(0,0,0,.92) 42%, rgba(0,0,0,.7) 56%, rgba(0,0,0,.42) 70%, rgba(0,0,0,.18) 84%, rgba(0,0,0,.05) 94%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000 28%, rgba(0,0,0,.92) 42%, rgba(0,0,0,.7) 56%, rgba(0,0,0,.42) 70%, rgba(0,0,0,.18) 84%, rgba(0,0,0,.05) 94%, transparent 100%);
}
.hero-copy > * { position: relative; }
.hero h1 {
  margin: 0 0 24px; font-family: var(--mincho); font-weight: 900;
  font-size: clamp(36px, 4.6vw, 60px); line-height: 1.3; letter-spacing: .01em; text-wrap: balance;
}
.hero-lede { margin: 0 0 32px; font-size: 17px; line-height: 1.9; max-width: 560px; text-wrap: pretty; }
.hero-shot { height: 600px; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; padding-top: 16px; }
.phone { background: #2b2319; padding: 4px; border-radius: 44px; box-shadow: 0 40px 80px -30px rgba(43,35,25,.7); }
.phone img { display: block; width: 100%; border-radius: 40px; }
.phone-top { background: #2b2319; padding: 4px; border-radius: 34px 34px 0 0; width: 230px; }
.phone-top img { display: block; width: 100%; border-radius: 30px 30px 0 0; }

/* ストアのボタン */
.stores { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stores.center { justify-content: center; }
.stores img { display: block; height: 52px; width: auto; }
.badge-note {
  display: inline-flex; align-items: center; height: 52px; padding: 0 20px;
  border: 1.5px solid var(--text); border-radius: 9px; font-size: 14px; font-weight: 700;
}

/* 事実の一覧 */
.facts {
  max-width: var(--wrap); width: 100%; margin: 40px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
}
.fact { background: var(--surface); border-radius: 12px; padding: 18px 20px; border-top: 3px solid var(--sub); }
.fact dt { font-size: 11px; letter-spacing: .12em; color: var(--sub); font-weight: 700; margin-bottom: 8px; }
.fact dd { margin: 0; font-size: 15px; font-weight: 700; }
.fact dd small { display: block; font-size: 12px; font-weight: 500; color: var(--sub); margin-top: 2px; }

/* 節 */
.section { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 112px 24px 0; scroll-margin-top: 80px; }
.section.split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 56px; align-items: center;
}
.section.narrow { max-width: 840px; }
.section h2 {
  margin: 0 0 20px; font-family: var(--mincho); font-weight: 900;
  font-size: clamp(28px, 3vw, 38px); line-height: 1.4; text-wrap: balance;
}
.section p { font-size: 16px; line-height: 1.9; text-wrap: pretty; }
.band { background: var(--surface); margin-top: 112px; padding: 96px 24px; scroll-margin-top: 80px; }
.band .inner {
  max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 56px; align-items: center;
}
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.shot-box {
  height: 520px; overflow: hidden; border-radius: 20px; background: var(--surface);
  display: flex; justify-content: center; padding-top: 24px;
}
.shot-box.deep { padding-top: 72px; }
.shot-box.light { background: var(--bg); gap: 16px; }
.shot-box.light .phone-top + .phone-top { margin-top: 56px; }

.features { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; font-size: 15px; line-height: 1.7; }
.features li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.features b { color: var(--link); font-weight: 700; }

/* 使い方の 3 枚 */
.steps {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.steps li { background: var(--surface); border-radius: 16px; padding: 28px 28px 32px; border-top: 3px solid var(--sub); }
.steps .num { font-family: var(--mincho); font-weight: 900; font-size: 40px; line-height: 1; color: var(--accent); margin-bottom: 16px; }
.steps h3 { margin: 0 0 12px; font-size: 19px; font-weight: 700; }
.steps p { margin: 0; font-size: 15px; line-height: 1.85; }
.kifu-support {
  margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; align-items: center; border-top: 1px solid var(--rule); padding-top: 32px;
}
.kifu-support h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.kifu-support p { margin: 0; font-size: 15px; line-height: 1.8; color: #5a4d3f; }
.tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; font-weight: 700; }
.tags li { padding: 10px 18px; border: 1.5px solid var(--text); border-radius: 9px; }

/* よくある質問 */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between;
  align-items: baseline; gap: 16px; padding: 20px 4px; font-size: 17px; font-weight: 700; line-height: 1.5;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .mark { flex: none; color: var(--accent); font-family: var(--mincho); font-size: 22px; line-height: 1; }
.faq details[open] summary .mark { visibility: hidden; }
.faq p { margin: 0; padding: 0 4px 22px; font-size: 15px; line-height: 1.9; color: var(--body-sub); }

/* 開発者から */
.author {
  background: var(--surface); border-radius: 20px; padding: 40px 40px 36px;
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start;
}
.author > img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 8px 20px -8px rgba(43,35,25,.5); }
.author p { margin: 0 0 16px; font-size: 16px; line-height: 1.95; }
.author .sign { margin: 0; font-size: 14px; font-weight: 700; }

.cta { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 112px 24px 96px; text-align: center; }
.cta h2 { margin: 0 0 28px; font-family: var(--mincho); font-weight: 900; font-size: clamp(28px, 3vw, 38px); line-height: 1.4; }

.legal { margin: 0; font-size: 12px; line-height: 1.8; color: var(--sub); }

/* お問い合わせ */
.contact-mail {
  background: var(--surface); border-radius: 12px; padding: 18px 20px;
  border-top: 3px solid var(--sub); display: inline-block;
}
.contact-mail .label { font-size: 11px; letter-spacing: .12em; color: var(--sub); font-weight: 700; margin-bottom: 8px; }
.contact-mail a { font-size: 15px; font-weight: 700; color: var(--text); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; padding-bottom: 8px; }
  .hero-copy { padding: 24px 8px; margin-bottom: 24px; }
  .hero-copy::before { inset: -32px -24px; }
  .hero-shot { height: 420px; }
  .section { padding-top: 88px; }
  .band { margin-top: 88px; padding: 72px 24px; }
  .shot-box, .shot-box.deep { height: 420px; padding-top: 20px; }
  .author { grid-template-columns: 1fr; gap: 20px; padding: 28px 24px 26px; }
}
/* Google の公式バッジは素材に余白が入っているので、Apple と見た目の高さを揃える */
.stores img.gplay { height: 62px; }

/* 日本語の見出しは文節で折る（対応していないブラウザは既定の折り方に戻る） */
.hero h1, .section h2, .doc h1, .steps h3, .cta h2 { word-break: auto-phrase; }
