/* Tagrid 配布サイトの唯一のスタイルシート。
   方針は docs/WEBSITE_BUILD_PLAN.md §8。

   意匠の芯は「アイコンをそのまま帯にする」こと。アプリのアイコンは
   琥珀→橙のグラデーションに白い格子が乗ったもので、それを画面幅いっぱいの
   帯として敷き、アプリの窓をその上に浮かせる。強い表情はここ 1 か所だけで、
   ほかは白地・細い罫線・線画のアイコンで静かに保つ。

   ダークモードには対応しない（2026-09-06 ユーザー判断）。
   PC での見やすさを優先し、外枠は 70rem、長い文章は 38rem。 */

:root {
  /* アイコンから採った色。ここに無い色は使わない。 */
  --amber: #FDBE24;   /* 帯の上端。面の色で、文字には使えない（白地で 1.6:1） */
  --orange: #F98111;  /* 帯の下端。同上 */
  --red: #C52D49;     /* リンクとボタン。白地で 5.3:1、白抜きで 5.5:1 */
  --ink: #1C1B19;
  --paper: #FCFBF9;

  --rule: color-mix(in srgb, var(--ink) 13%, transparent);
  --rule-strong: color-mix(in srgb, var(--ink) 26%, transparent);
  /* 58% だと白地で 4.2:1、フッターの地（--sunk）で 3.9:1 しかなく、
     コントラストの基準 4.5:1 に届かない。65% で 5.3:1 / 4.9:1。 */
  --muted: color-mix(in srgb, var(--ink) 65%, var(--paper));
  --sunk: color-mix(in srgb, var(--ink) 4%, var(--paper));

  --page: 72rem;    /* 外枠。大きな画面でも これ以上は広げない（1152px）*/
  --prose: 38rem;   /* 長い文章の 1 行の長さ */
  --gutter: 1.5rem;

  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.8 -apple-system, BlinkMacSystemFont, "Hiragino Sans",
        "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "palt";
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* 帯（全幅）の中身を中央の枠に収める共通の器。 */
.bar {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a { color: var(--red); text-underline-offset: .18em; }
a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; }

/* --- ヘッダー ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header .bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
}
.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: .9375rem;
}
.site-header a { text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.site-header .here { color: var(--ink); }
.site-header .lang {
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.01em;
}
.wordmark img { width: 26px; height: 26px; border-radius: 6px; }

/* --- トップ: 見出し（全幅の帯に、文章とスクリーンショットを横並び）--------- */

.hero {
  padding: 3rem 0 3.5rem;
  /* アイコンそのもの。琥珀→橙のグラデーションに白い格子。
     升目は正方形にして、画面の幅が変わっても表情が変わらないようにする。 */
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .3) 0 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .3) 0 1px, transparent 1px),
    linear-gradient(160deg, var(--amber), var(--orange));
  background-size: 128px 128px, 128px 128px, 100% 100%;
  background-position: center top;
}

.hero-copy { text-align: center; max-width: 44rem; margin: 0 auto 3rem; }
.hero-copy > :last-child { margin-bottom: 0; }

/* 地が琥珀・橙でも、墨の文字なら 6.8:1 以上あって読める
   （読めないのは「白地に琥珀の文字」のほう）。 */
.hero h1 {
  font-size: clamp(1.875rem, 5vw, 2.625rem);
  line-height: 1.16;
  margin: 0 0 1rem;
  letter-spacing: -.035em;
}
.hero .lede {
  margin: 0 auto 2rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 36rem;
}
.hero .lede strong { font-weight: 700; }
.button {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  padding: .8125rem 1.75rem;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: color-mix(in srgb, var(--red) 88%, #000); }
/* ライトとダークを斜めにずらして重ねる。どちらにも対応していることが 1 目で分かる。
   文章での説明は置かず、alt に書いて検索と AI に渡す。 */
/* 文章の枠より広く。窓は大きいほど中身が伝わる。
   ずらしは padding で作る。子の margin-top は親と相殺されて、
   中身がずれずに図版ごと下がってしまうため。 */
.shots {
  position: relative;
  width: min(92vw, 78rem);   /* 図版だけ本文より広い。上限 1248px */
  margin: 0 auto;
  /* 上と右に余白を取り、その分だけダークを上・右にずらす（斜めの重なり）。
     ライトは内側の枠いっぱい、ダークは外枠の 92%。どちらも同じ大きさになる。 */
  padding: 7% 8% 0 0;
}
.shots img {
  display: block;
  /* 画像そのものに窓の影が焼き込まれているので、影は形に沿わせる。 */
  filter: drop-shadow(0 16px 26px rgba(85, 42, 0, .34));
}
/* <picture> は箱として数えない。中の <img> に .shots の枠がそのまま効くようにする。 */
.shots picture { display: contents; }
.shot-dark { position: absolute; top: 0; right: 0; width: 92%; }
.shot-light { position: relative; width: 100%; }

/* --- ダウンロード（帯の外・白地。アイコンとボタンを縦に並べる）------------- */

.download { padding: 3rem 0 3.25rem; text-align: center; }
.download + .section { border-top: 1px solid var(--rule); }

.cta-icon {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto .875rem;
  border-radius: 20px;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--orange) 70%, transparent);
}
.cta-name {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.cta { margin: 0 0 1rem; }
/* ダウンロードのボタン。面を張れる色は赤だけ（白抜きで 5.5:1）。 */
.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8125rem 1.75rem;
  border: 1.5px solid var(--red);
  border-radius: 10px;
  background: var(--red);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.button svg { width: 1.125rem; height: 1.125rem; flex: none; }
.button:hover { background: color-mix(in srgb, var(--red) 88%, var(--ink)); }
.button:focus-visible { outline-offset: 4px; }
/* 寄付への誘い。ボタンより静かに、文字の大きさで一段下げる。 */
.cta-support { margin: .875rem 0 0; font-size: .9375rem; }
.cta-support a {
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  text-decoration-color: color-mix(in srgb, var(--red) 40%, transparent);
}
.cta-support svg { width: 1.1875rem; height: 1.1875rem; flex: none; }

.cta-note {
  margin: 0;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* --- 節 ------------------------------------------------------------------ */

.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section > .bar > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  margin: 0 0 .625rem;
  text-align: center;
}
.section-note {
  max-width: 34rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--muted);
}

/* --- できること ---------------------------------------------------------- */

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem 3rem;
  grid-template-columns: 1fr;
}
.feature-grid li { margin: 0; }
.feature-grid svg {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: .875rem;
  color: var(--red);
}
.feature-grid h3 {
  font-size: 1.0625rem;
  margin: 0 0 .375rem;
}
.feature-grid p { margin: 0; color: color-mix(in srgb, var(--ink) 78%, var(--paper)); }

/* --- 対応形式（タグの印つきの縦リスト）------------------------------------ */

.format-list {
  list-style: none;
  /* 見出しの直後に説明文を置かない節なので、h2 の下 .625rem だけでは詰まって
     見えた。**隣り合う margin は相殺される**ので、この 2.5rem は h2 の .625rem に
     足されるのではなく置き換わる（2026-09-06）。 */
  margin: 2.5rem auto 0;
  padding: 0;
  max-width: 22rem;
  border-top: 1px solid var(--rule);
}
.format-list li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .125rem;
  border-bottom: 1px solid var(--rule);
}
.format-list svg { width: 18px; height: 18px; color: var(--red); flex: none; }
.format-list b { font-size: 1.0625rem; }
.format-list span {
  margin-left: auto;
  color: var(--muted);
  font: 400 .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- 長い文章のページ（使い方・ポリシー）-------------------------------- */

.prose-page { padding: 3rem 0 4.5rem; }
.prose-page .bar { display: grid; gap: 2.5rem; }
.prose-page article { max-width: var(--prose); min-width: 0; }

.toc { font-size: .9375rem; }
.toc h2 {
  font-size: .9375rem;
  margin: 0 0 .625rem;
  color: var(--muted);
  font-weight: 600;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: .3125rem 0 .3125rem .875rem;
  border-left: 2px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.toc a:hover { border-left-color: var(--red); color: var(--red); }

article h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}
article h2 {
  font-size: 1.375rem;
  line-height: 1.4;
  margin: 3.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
article h3 {
  font-size: 1.0625rem;
  line-height: 1.5;
  margin: 2rem 0 .5rem;
}
article h2 + h3 { margin-top: 1.25rem; }
article p, article ul, article ol, article dl, article table { margin: 0 0 1.25rem; }
article li { margin-bottom: .375rem; }
article .lede { font-size: 1.125rem; margin-bottom: 1.75rem; }

/* --- 表 ------------------------------------------------------------------ */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: .625rem .875rem .625rem 0;
  border-bottom: 1px solid var(--rule);
}
/* 見出し列に幅を与えないと、狭い枠の中で 1 文字ずつ折り返されてしまう。 */
th { min-width: 6rem; }
thead th { border-bottom-color: var(--rule-strong); }
tbody th { font-weight: 600; padding-right: 1.25rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  padding: .1em .35em;
  border-radius: 4px;
}
small { color: var(--muted); }
img { max-width: 100%; height: auto; }
figure { margin: 0; }

/* --- 見つからないページ -------------------------------------------------- */

.notfound { padding: 5rem 0 6rem; text-align: center; }
.notfound h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); margin: 0 0 1rem; }
.notfound h2 { font-size: 1.25rem; margin: 3rem 0 1rem; }
.notfound p { margin: 0 0 1rem; }

/* --- フッター（1 行目はリンクを等間隔、2 行目に著作権表示）----------------- */

.site-footer {
  background: var(--sunk);
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 2rem;
  font-size: .9375rem;
}
.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}
.site-footer .links a { color: var(--ink); text-decoration: none; }
.site-footer .links a:hover { text-decoration: underline; }
.site-footer .wordmark { text-decoration: none; }
.site-footer .copyright {
  margin: 1.5rem 0 0;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --- 広い画面 ------------------------------------------------------------ */

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
  body { font-size: 1.0625rem; }
  .section { padding: 5.5rem 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .hero { padding: 4.5rem 0 4rem; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 68rem) {
  .prose-page .bar {
    grid-template-columns: 13rem minmax(0, var(--prose));
    gap: 4.5rem;
    justify-content: center;
  }
  .toc { position: sticky; top: 5.5rem; align-self: start; }
}
