/* デザイン: 上品ミニマル（白黒＋アスパラの黄緑の差し色、太いゴシックの見出し）。見本は design/mockups/top-c3.html */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --soft: #f6f6f3;
  --text: #1a1b1f;
  --muted: #6b6b70;
  --line: #e6e6e2;
  --lime: #c4c423;
  --lime-soft: #f2f4d0;
  --warn: #9a4a12;
  --warn-soft: #fbeee3;
  --code-bg: #f4f4f1;
  --footer-bg: #1a1b1f;
  --footer-text: #c9c9cc;
  --radius: 10px;
  --display: "Inter", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --surface: #1c1d21;
    --soft: #1f2024;
    --text: #ececea;
    --muted: #a3a3a8;
    --line: #2f3035;
    --lime-soft: #2e3014;
    --warn: #f0a46c;
    --warn-soft: #3a2a1e;
    --code-bg: #222327;
    --footer-bg: #0c0d0f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}
a { color: var(--text); text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 3px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 76px; padding-top: 8px; padding-bottom: 8px; }
.logo { text-decoration: none; line-height: 1.3; }
.logo .en { display: block; font-family: var(--display); font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.logo .ja { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.site-nav a { font-size: 13px; letter-spacing: .05em; white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--lime); }
.site-nav a.cta { background: var(--text); color: var(--bg); padding: 8px 20px; border-radius: 999px; border: 0; font-weight: 700; }
.site-nav a.cta[aria-current="page"] { box-shadow: 0 0 0 3px var(--lime); }
.site-footer { margin-top: 96px; padding: 48px 0 32px; background: var(--footer-bg); color: var(--footer-text); font-size: 13px; }
.site-footer .brand { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: #fff; margin: 0 0 16px; line-height: 1.2; }
.site-footer p { margin: 0 0 4px; }
.small { font-size: 13px; }

/* home */
.hero { padding: 48px 0 88px; }
.hero-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.big { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 7.2vw, 96px); line-height: .98; letter-spacing: -.045em; margin: 0; }
.big .ruby { display: block; font-family: "Noto Sans JP", sans-serif; font-weight: 500; font-size: 13px; line-height: 1.6; letter-spacing: .1em; color: var(--muted); margin-top: 16px; }
.tagline { font-size: 12px; letter-spacing: .2em; color: var(--muted); margin: 32px 0 0; }
.catch { font-weight: 900; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.35; letter-spacing: -.01em; margin: 0 0 20px; }
.catch::before { content: ""; display: block; width: 56px; height: 3px; background: var(--lime); margin-bottom: 20px; }
.catch .nw { display: inline-block; }
.hero-lead { color: var(--muted); margin: 0 0 28px; font-size: 16px; }
.btn { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; font-weight: 700; font-size: 15px; }
.btn i { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--text); display: grid; place-items: center; font-style: normal; transition: background .2s, border-color .2s; }
.btn:hover i { background: var(--lime); border-color: var(--lime); color: #1a1b1f; }

.section { padding: 72px 0 0; border-top: 1px solid var(--line); }
.head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 32px; }
.head h2 { font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: -.03em; margin: 0; line-height: 1; }
.head span { font-size: 13px; color: var(--muted); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; }
.card a { display: block; height: 100%; text-decoration: none; border-top: 1px solid var(--text); padding-top: 18px; }
.card .cat { display: block; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.card .cat::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-right: 8px; vertical-align: 1px; }
.card .t { display: block; font-weight: 700; font-size: 18px; line-height: 1.6; margin: 8px 0; }
.card .d { display: block; font-size: 14px; color: var(--muted); line-height: 1.8; }
.card a:hover .t { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.empty { color: var(--muted); }

/* article（本文は読みやすい幅にしぼる） */
.article, .related { max-width: 760px; margin-left: auto; margin-right: auto; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 24px 0 0; }
.breadcrumb a { color: var(--muted); }
.eyebrow { margin: 40px 0 8px; font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-right: 8px; vertical-align: 1px; }
.article h1 { font-weight: 900; font-size: clamp(28px, 5.5vw, 40px); line-height: 1.4; letter-spacing: -.01em; margin: 0 0 20px; }
.article h1::before { content: ""; display: block; width: 56px; height: 3px; background: var(--lime); margin-bottom: 20px; }
.lead { color: var(--muted); margin: 0; }
.meta { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.draft-banner {
  margin-top: 24px; padding: 10px 14px; border-radius: 8px;
  background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 14px;
}

.prose { margin-top: 48px; }
.prose h2 { font-weight: 900; font-size: 24px; line-height: 1.5; margin: 64px 0 20px; padding-top: 16px; border-top: 1px solid var(--text); }
.prose h3 { font-size: 18px; margin: 32px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 20px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted); }
.prose strong { background: linear-gradient(transparent 62%, var(--lime-soft) 62%); }
.prose code { background: var(--code-bg); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--code-bg); white-space: nowrap; }

.note, .warn, .output { border-radius: var(--radius); padding: 16px 18px; margin: 0 0 24px; }
.note { background: var(--soft); border-left: 4px solid var(--lime); }
.warn { background: var(--warn-soft); }
.warn::before { content: "注意"; display: block; font-weight: 700; color: var(--warn); font-size: 14px; }
.output { border: 1px dashed var(--line); background: var(--surface); }
.output::before { content: "出力例（実際の回答は毎回少し変わります）"; display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.note > :last-child, .warn > :last-child, .output > :last-child { margin-bottom: 0; }

.prompt { position: relative; margin: 0 0 24px; background: var(--code-bg); border-radius: var(--radius); padding: 14px 18px 16px; }
.prompt figcaption { font-size: 13px; font-weight: 700; color: var(--muted); padding-right: 110px; }
.prompt pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 15px; line-height: 1.8; }
.prompt .copy {
  position: absolute; top: 10px; right: 10px; border: 0; background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 4px 14px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.prompt .copy:hover { box-shadow: 0 0 0 3px var(--lime); }

/* 目次 */
.toc { background: var(--soft); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 32px; }
.toc .toc-title { font-weight: 700; margin: 0 0 4px; }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc li { margin-bottom: 2px; }
.prose h2[id] { scroll-margin-top: 16px; }

/* 用語リスト */
.prose dl { margin: 0 0 24px; }
.prose dt { font-weight: 700; font-size: 18px; margin-top: 24px; line-height: 1.6; }
.prose dt .reading { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 8px; }
.prose dd { margin: 6px 0 0; padding-left: 14px; border-left: 3px solid var(--lime); }

/* 用語集（検索窓と索引はスクリプトが .glossary-tools にまとめて上部に固定する） */
.glossary-tools {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  padding: 12px 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.glossary-tools input {
  width: 100%; padding: 10px 16px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--text); border-radius: 999px;
}
.glossary-tools input:focus { outline: 3px solid var(--lime); outline-offset: 0; }
.kana-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.glossary-tools .kana-index { margin-top: 10px; }
.kana-index a {
  display: inline-grid; place-items: center; min-width: 40px; height: 36px; padding: 0 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: 0;
}
.kana-index a:hover { background: var(--lime); border-color: var(--lime); color: #1a1b1f; }
.glossary-status { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.glossary-status:empty { display: none; }
.glossary h2 { margin-top: 40px; }
.prose .glossary h2[id] { scroll-margin-top: calc(var(--tools-h, 150px) + 12px); }
.glossary [hidden] { display: none; }

.related { margin-top: 80px; }
.related h2 { font-weight: 900; font-size: 18px; margin: 0 0 20px; }

@media (max-width: 760px) {
  .site-nav { margin-left: 0; gap: 8px 16px; }
  .hero { padding: 32px 0 64px; }
  .hero-row { grid-template-columns: 1fr; gap: 32px; }
  .head h2 { font-size: 34px; }
  .cards { gap: 24px; }
}
