/* ==========================================================
   ビットコインの歴史 / Bitcoin History for Beginners
   レイアウト:Apple 風。全幅の帯(白 / グレー / 黒)を交互に積み、
   大きな見出しと短い文で見せる。本文は 692px の1カラム。
   ========================================================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --chip: #e8e8ed;
  --accent: #f7931a;          /* ビットコインオレンジ:面・線・点 */
  --accent-ink: #b45309;      /* 白地の上の文字・リンク */
  --on-accent: #1d1d1f;       /* オレンジの面の上の文字 */
  --link: #b45309;
  --tint: rgba(247, 147, 26, 0.12);
  --tip-bg: #1d1d1f;
  --tip-ink: #f5f5f7;
  --good-bg: #e9f7ee; --good-border: #8fd0a3; --good-ink: #1d6f35;
  --bad-bg: #fdeeee;  --bad-border: #f0b0b0;  --bad-ink: #b42318;
  --nav-bg: rgba(250, 250, 252, 0.8);
  --nav-line: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12);
  --tip-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  /* 黒い帯(テーマに関係なく常に黒) */
  --ink-bg: #000000;
  --ink-surface: #1d1d1f;
  --ink-chip: #333336;
  --ink-text: #f5f5f7;
  --ink-text-2: #d2d2d7;
  --ink-muted: #a1a1a6;
  --ink-line: #3a3a3c;
  --ink-accent: #ffb04d;
  --grad: linear-gradient(90deg, #f7931a 0%, #ffc56b 100%);
  /* イラスト用(黒い帯の上で使うので両テーマ共通) */
  --coin-hi: #ffe7b8; --coin-mid: #f7931a; --coin-lo: #8a4500; --coin-face: #fff6e6;
  --glow: rgba(247, 147, 26, 0.38);
  --crust: #e2a24c; --cheese: #ffd36b; --pepperoni: #c8442b; --basil: #4f9a4a;
  --paper: #f4efe4; --paper-ink: #1d1d1f;
  /* 文字 */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Segoe UI", "Yu Gothic UI", Meiryo, Roboto, "Helvetica Neue", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans", "Noto Sans JP",
    "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Times New Roman", Times, Georgia, "Hiragino Mincho ProN", serif;
  --radius: 18px;
  --radius-lg: 28px;
  --wrap: 1024px;
  --prose: 692px;
  --nav-h: 48px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-alt: #161617; --surface: #1d1d1f; --text: #f5f5f7; --text-2: #d2d2d7;
    --muted: #a1a1a6; --line: #424245; --chip: #333336; --accent-ink: #ffb04d; --link: #ffb04d;
    --tint: rgba(247, 147, 26, 0.16); --tip-bg: #f5f5f7; --tip-ink: #1d1d1f;
    --good-bg: #13291b; --good-border: #2f6b40; --good-ink: #86dba0;
    --bad-bg: #331a1a; --bad-border: #7a3434; --bad-ink: #ff9d9d;
    --nav-bg: rgba(22, 22, 23, 0.8); --nav-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.5); --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --tip-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); --ink-bg: #0b0b0c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-alt: #161617; --surface: #1d1d1f; --text: #f5f5f7; --text-2: #d2d2d7;
  --muted: #a1a1a6; --line: #424245; --chip: #333336; --accent-ink: #ffb04d; --link: #ffb04d;
  --tint: rgba(247, 147, 26, 0.16); --tip-bg: #f5f5f7; --tip-ink: #1d1d1f;
  --good-bg: #13291b; --good-border: #2f6b40; --good-ink: #86dba0;
  --bad-bg: #331a1a; --bad-border: #7a3434; --bad-ink: #ff9d9d;
  --nav-bg: rgba(22, 22, 23, 0.8); --nav-line: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.5); --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --tip-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); --ink-bg: #0b0b0c;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.8; letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
main { display: block; overflow-x: clip; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.center { text-align: center; }

/* ---------- 帯(セクション) ---------- */
.band { padding-block: clamp(72px, 11vw, 140px); position: relative; }
.band.tight { padding-block: clamp(56px, 8vw, 96px); }
.band.alt { background: var(--bg-alt); }
.band.ink {
  background: var(--ink-bg); color: var(--ink-text);
  --text: var(--ink-text); --text-2: var(--ink-text-2); --muted: var(--ink-muted); --line: var(--ink-line);
  --surface: var(--ink-surface); --bg-alt: var(--ink-surface); --chip: var(--ink-chip);
  --accent-ink: var(--ink-accent); --link: var(--ink-accent);
  --tip-bg: #f5f5f7; --tip-ink: #1d1d1f;
  color-scheme: dark;
}
.eyebrow { margin: 0 0 10px; font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 600; color: var(--accent-ink); letter-spacing: 0.01em; }
.headline {
  margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  font-size: clamp(2.3rem, 6.4vw, 5rem); text-wrap: balance;
}
.headline-s {
  margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem); text-wrap: balance;
}
.subhead { margin: 18px 0 0; font-size: clamp(1.1rem, 2.1vw, 1.55rem); line-height: 1.5; font-weight: 500; color: var(--muted); text-wrap: balance; }
.center .subhead { margin-inline: auto; max-width: 34em; }
.grad-text { color: var(--accent); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
}

/* ---------- ボタン・リンク ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 10px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 600 1.02rem/1.2 var(--font); text-decoration: none;
  transition: filter .2s ease, transform .2s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.small { min-height: 32px; padding: 6px 16px; font-size: 0.85rem; }
.more { color: var(--link); text-decoration: none; font-size: 1.1rem; font-weight: 500; }
.more::after { content: " ›"; }
.more:hover { text-decoration: underline; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: center; margin-top: 30px; }

/* ---------- グローバルナビ ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: var(--nav-bg); border-bottom: 1px solid var(--nav-line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.site-header.is-static { position: relative; }
.site-header .inner {
  max-width: var(--wrap); margin: 0 auto; height: var(--nav-h);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.brand .coin {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 0.82rem;
}
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a { color: var(--text); opacity: 0.82; text-decoration: none; font-size: 0.82rem; padding: 6px 10px; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; }
.site-nav a[aria-current="page"] { font-weight: 600; }
.site-nav .lang { margin-left: 4px; box-shadow: inset 0 0 0 1px var(--line); opacity: 1; }

/* ---------- 章のローカルナビ(スクロールしても上に残る) ---------- */
.local-nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 39;
  background: var(--nav-bg); border-bottom: 1px solid var(--nav-line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.local-nav .inner {
  max-width: var(--wrap); margin: 0 auto; height: 52px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ln-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ln-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.ln-bar span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- 汎用ヒーロー(ルート・404) ---------- */
.hero {
  min-height: 100vh; min-height: 100svh; display: grid; place-content: center; text-align: center; gap: 8px;
  padding-block: 48px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: var(--ink-bg); color: var(--ink-text); --muted: var(--ink-muted); --accent-ink: var(--ink-accent);
}
.hero h1 { font-size: clamp(2.2rem, 7vw, 4.5rem); margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
.hero .lead { color: var(--ink-muted); font-size: clamp(1.05rem, 2vw, 1.4rem); margin: 8px 0 18px; }
.hero .btn.secondary { color: var(--ink-accent); }

/* ---------- 立体コイン ---------- */
.coin-stage { position: relative; display: grid; place-items: center; margin: clamp(40px, 6vw, 64px) auto 0; perspective: 900px; }
.coin-stage::before {
  content: ""; position: absolute; width: 140%; height: 70%; bottom: -18%; left: -20%;
  background: radial-gradient(ellipse at center, var(--glow), transparent 62%); filter: blur(8px); pointer-events: none;
}
.coin3d {
  position: relative; width: min(60vw, 300px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 26%, var(--coin-hi) 0%, var(--coin-mid) 42%, var(--coin-lo) 100%);
  box-shadow: inset 0 -14px 34px rgba(0, 0, 0, 0.35), inset 0 12px 28px rgba(255, 255, 255, 0.35), 0 40px 90px var(--glow);
  animation: coin-float 7s ease-in-out infinite; transform-style: preserve-3d;
}
.coin3d::before {
  content: ""; position: absolute; inset: 8%; border-radius: 50%;
  border: 3px solid rgba(255, 240, 210, 0.55); box-shadow: inset 0 0 0 7px rgba(140, 70, 0, 0.22);
}
.coin3d span {
  position: relative; font: 800 clamp(5.5rem, 28vw, 10rem)/1 var(--font-display); color: var(--coin-face);
  text-shadow: 0 3px 0 rgba(140, 70, 0, 0.55), 0 12px 30px rgba(120, 60, 0, 0.45); transform: rotate(14deg);
}
.coin3d.sm { width: min(40vw, 180px); }
.coin3d.sm span { font-size: clamp(3.6rem, 18vw, 6rem); }
@keyframes coin-float {
  0%, 100% { transform: translateY(0) rotateY(-14deg); }
  50% { transform: translateY(-14px) rotateY(16deg); }
}

/* ---------- 章のヒーロー ---------- */
.ch-hero { text-align: center; overflow: hidden; padding-block: clamp(64px, 10vw, 120px) clamp(56px, 8vw, 96px); }
.ch-hero::after {
  content: ""; position: absolute; inset: auto 10% -30% 10%; height: 60%;
  background: radial-gradient(ellipse at center, var(--glow), transparent 65%); pointer-events: none;
}
.ch-hero .wrap { position: relative; z-index: 1; }
.ch-hero .kicker { margin: 0 0 12px; font-weight: 600; font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--accent-ink); }
.ch-hero h1 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; font-size: clamp(2.2rem, 6.2vw, 4.6rem); }
.ch-hero .era { margin: 18px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.4rem); font-weight: 500; }
.ch-art { margin: clamp(36px, 6vw, 56px) auto 0; }
.ch-art .word {
  display: block; font: 800 clamp(4rem, 17vw, 11rem)/1 var(--font-display); letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ch-art .mono { display: block; margin-top: 14px; font-family: var(--mono); font-size: clamp(0.7rem, 1.6vw, 0.9rem); color: var(--muted); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.progress { display: flex; gap: 6px; max-width: 240px; margin: clamp(36px, 5vw, 48px) auto 0; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.progress span.done { background: var(--accent); }

/* ---------- 横スクロール(年表・章カード) ---------- */
.h-scroll {
  list-style: none; margin: 40px 0 0; display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-left: max(var(--gutter-l), calc((100% - var(--wrap)) / 2 + 20px));
  padding: 6px max(var(--gutter-r), calc((100% - var(--wrap)) / 2 + 20px)) 28px max(var(--gutter-l), calc((100% - var(--wrap)) / 2 + 20px));
}
.js-hs .h-scroll { scrollbar-width: none; }
.js-hs .h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > li { scroll-snap-align: start; flex: 0 0 auto; }
.hs-controls { display: flex; justify-content: flex-end; gap: 14px; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.hs-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--chip); color: var(--text); font: 600 1.35rem/1 var(--font); transition: opacity .2s, filter .2s;
}
.hs-btn:hover { filter: brightness(0.95); }
.hs-btn:disabled { opacity: 0.35; cursor: default; }

/* 年表カード */
.timeline > li {
  width: min(300px, 78vw); min-height: 200px; padding: 28px 26px; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
}
.timeline .y { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.01em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.timeline .t { font-size: 1rem; line-height: 1.65; }

/* ---------- 本文(1カラム) ---------- */
.prose { max-width: var(--prose); margin: 0 auto; padding-block: clamp(56px, 8vw, 100px) 32px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); font-size: 1.1rem; }
.prose > h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.22; letter-spacing: -0.015em; margin: 2.3em 0 0.65em; }
.prose > h2:first-child { margin-top: 0; }
/* :where() で詳細度を0にして、本文中に差し込んだビジュアルの部品側の指定を優先させる */
:where(.prose) h3 { font-size: 1.3rem; font-weight: 700; margin: 1.9em 0 0.45em; line-height: 1.4; }
:where(.prose) p { margin: 0 0 1.25em; }
:where(.prose) :is(ul, ol):not([class]) { padding-left: 1.3em; margin: 0 0 1.4em; }
:where(.prose) :is(ul, ol):not([class]) > li { margin-bottom: 0.45em; }
:where(.prose) strong { font-weight: 700; }

/* 本文から全幅にはみ出す帯 */
.bleed { width: 100vw; margin-left: calc(50% - 50vw); margin-block: clamp(56px, 8vw, 96px); }
.prose > .bleed:last-child { margin-bottom: 0; }

/* 囲み */
.box { background: var(--bg-alt); border-radius: var(--radius); padding: 24px 26px; margin: 34px 0; }
.box.point { background: var(--tint); }
.box .label { display: block; font-size: 0.86rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 8px; letter-spacing: 0.02em; }
.box.warn { background: var(--bad-bg); }
.box.warn .label { color: var(--bad-ink); }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }

/* 新聞の見出し(第3章の引用) */
blockquote {
  margin: 40px 0; padding: 30px 30px 24px; border-radius: 6px; background: var(--paper); color: var(--paper-ink);
  font-family: var(--serif); font-size: clamp(1.35rem, 3.4vw, 1.9rem); line-height: 1.3; font-weight: 700;
  box-shadow: var(--shadow-lg); transform: rotate(-1.2deg); border-top: 6px double var(--paper-ink);
}
blockquote cite { display: block; margin-top: 16px; font: 400 0.82rem/1.5 var(--font); color: var(--paper-ink); opacity: 0.75; font-style: normal; }

/* ---------- 用語のプチ解説 ---------- */
.term {
  position: relative; cursor: help; font-weight: 600; outline: none;
  text-decoration: underline dotted var(--accent) 2px; text-underline-offset: 4px;
}
.term::after {
  content: attr(data-def); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: 260px; padding: 10px 12px; border-radius: 12px; z-index: 30;
  background: var(--tip-bg); color: var(--tip-ink); font-size: 0.85rem; font-weight: 400; line-height: 1.6;
  box-shadow: var(--tip-shadow); opacity: 0; pointer-events: none; transition: opacity .12s; white-space: normal;
}
.term:hover::after, .term:focus::after { opacity: 1; }
.term:focus-visible { box-shadow: 0 0 0 3px var(--tint); border-radius: 4px; outline: none; }
.js-terms .term::after { content: none; display: none; }
.term-tip {
  position: absolute; z-index: 60; max-width: min(300px, calc(100vw - 32px)); padding: 10px 13px; border-radius: 12px;
  background: var(--tip-bg); color: var(--tip-ink); font-size: 0.86rem; line-height: 1.6; font-weight: 400;
  box-shadow: var(--tip-shadow); pointer-events: none;
}

/* ---------- 大きな数字の帯 ---------- */
.stat { text-align: center; }
.stat-num {
  display: block; margin: 6px 0 0; font: 800 clamp(3.4rem, 13vw, 9.5rem)/1 var(--font-display); letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat-num.long { font-size: clamp(2.4rem, 9.5vw, 7rem); }
.stat-cap { margin: 22px auto 0; max-width: 30em; font-size: clamp(1.1rem, 2.2vw, 1.6rem); line-height: 1.5; font-weight: 600; color: var(--text); text-wrap: balance; }
.stat-note { margin: 14px auto 0; max-width: 36em; color: var(--muted); font-size: 1rem; line-height: 1.7; }

/* ---------- タイル(ベントー) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 20px; margin-top: 44px; }
.tile {
  background: var(--surface); border-radius: var(--radius-lg); padding: 30px 28px 28px; min-width: 0;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.band.alt .tile { box-shadow: none; }
.tile.wide { grid-column: span 2; }
.tile.ink { background: var(--ink-bg); color: var(--ink-text); --muted: var(--ink-muted); --accent-ink: var(--ink-accent); }
.tile-k { margin: 0; font: 700 clamp(2.1rem, 4.6vw, 3.3rem)/1.05 var(--font-display); letter-spacing: -0.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-k small { font-size: 0.45em; letter-spacing: 0; margin-left: 4px; font-weight: 700; }
.tile-v { margin: 0; font-size: 1.02rem; line-height: 1.6; color: var(--muted); font-weight: 500; }
.tile-t { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.4; }
.tile .ico { width: 40px; height: 40px; color: var(--accent-ink); }
@media (max-width: 734px) { .tile.wide { grid-column: auto; } }

/* ---------- ブロックの鎖 ---------- */
.chain { display: flex; align-items: center; gap: 0; width: fit-content; max-width: 100%; margin: 48px auto 0; overflow-x: auto; padding: 10px 2px 20px; scrollbar-width: thin; }
.chain .block {
  flex: 0 0 auto; width: 190px; padding: 18px 18px 16px; border-radius: 18px; background: var(--ink-surface);
  box-shadow: inset 0 0 0 1px var(--ink-line); display: grid; gap: 6px; text-align: left;
}
.chain .block.first { box-shadow: inset 0 0 0 2px var(--accent); }
.chain .bn { font: 700 1.5rem/1.1 var(--font-display); color: var(--ink-text); }
.chain .bh { font: 0.72rem/1.4 var(--mono); color: var(--ink-muted); overflow-wrap: anywhere; }
.chain .bt { font-size: 0.85rem; color: var(--ink-accent); font-weight: 600; }
.chain .link { flex: 0 0 34px; height: 3px; background: var(--accent); position: relative; }
.chain .link::before, .chain .link::after { content: ""; position: absolute; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.chain .link::before { left: -5px; } .chain .link::after { right: -5px; }
.chain .gap { flex: 0 0 auto; padding: 0 14px; font: 700 1.6rem/1 var(--font-display); color: var(--ink-muted); letter-spacing: 0.2em; }
.in .chain .block, .in .chain .link { animation: chain-in .7s both; }
.in .chain > :nth-child(2) { animation-delay: .1s; } .in .chain > :nth-child(3) { animation-delay: .2s; }
.in .chain > :nth-child(4) { animation-delay: .3s; } .in .chain > :nth-child(5) { animation-delay: .4s; }
.in .chain > :nth-child(6) { animation-delay: .5s; } .in .chain > :nth-child(7) { animation-delay: .6s; }
@keyframes chain-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

/* ---------- 棒グラフ(半減期) ---------- */
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(8px, 2.4vw, 22px); align-items: end; height: 300px; margin-top: 48px; }
.bars .bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; text-align: center; min-width: 0; }
.bars .val { font: 700 clamp(0.95rem, 2.4vw, 1.4rem)/1.2 var(--font-display); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.bars .col { border-radius: 12px 12px 4px 4px; background: var(--grad); height: calc((100% - 70px) * var(--k)); min-height: 8px; transform-origin: bottom; }
.bars .yr { margin-top: 10px; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.in .bars .col { animation: bar-grow 1s cubic-bezier(.2, .7, .2, 1) both; }
.in .bars .bar:nth-child(2) .col { animation-delay: .12s; } .in .bars .bar:nth-child(3) .col { animation-delay: .24s; }
.in .bars .bar:nth-child(4) .col { animation-delay: .36s; } .in .bars .bar:nth-child(5) .col { animation-delay: .48s; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* 供給量のメーター */
.meter { margin: 40px auto 0; max-width: 720px; }
.meter .track { height: 18px; border-radius: 9px; background: var(--chip); overflow: hidden; }
.meter .fill { height: 100%; width: var(--p); border-radius: 9px; background: var(--grad); transform-origin: left; }
.in .meter .fill { animation: meter-grow 1.4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes meter-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.meter .legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 系譜(第2章) ---------- */
.lineage { list-style: none; margin: 52px 0 0; padding: 0; text-align: left; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; position: relative; }
.lineage li { position: relative; padding: 22px 20px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 4px; min-width: 0; }
.lineage .ly { font: 700 1.1rem/1.2 var(--font-display); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.lineage .ln { font: 700 1.25rem/1.3 var(--font-display); }
.lineage .lw { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.lineage li.goal { background: var(--grad); box-shadow: none; --accent-ink: var(--on-accent); color: var(--on-accent); --muted: var(--on-accent); }

/* ---------- ピザ ---------- */
.pizzas { display: flex; justify-content: center; gap: clamp(12px, 4vw, 40px); margin: 44px 0 0; }
.pizza { width: min(38vw, 200px); height: auto; }
.pizza .crust { fill: var(--crust); } .pizza .cheese { fill: var(--cheese); }
.pizza .pep { fill: var(--pepperoni); } .pizza .basil { fill: var(--basil); }
.in .pizza { animation: pizza-spin 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.in .pizza + .pizza { animation-delay: .15s; }
@keyframes pizza-spin { from { opacity: 0; transform: rotate(-90deg) scale(.7); } to { opacity: 1; transform: none; } }

/* ---------- ドーナツ・分岐 ---------- */
.donut { width: min(64vw, 260px); margin: 44px auto 0; display: block; }
.donut .bg { fill: none; stroke: var(--chip); }
.donut .fg { fill: none; stroke: var(--accent); stroke-linecap: round; }
.donut text { fill: var(--text); font-family: var(--font-display); font-weight: 800; }
.donut .sub { fill: var(--muted); font-weight: 500; }
.in .donut .fg { animation: donut-draw 1.4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes donut-draw { from { stroke-dasharray: 0 100; } }
.fork { display: block; width: 100%; max-width: 760px; margin: 44px auto 0; overflow: visible; }
.fork .main-line { stroke: var(--accent); stroke-width: 6; fill: none; stroke-linecap: round; }
.fork .side-line { stroke: var(--muted); stroke-width: 6; fill: none; stroke-linecap: round; stroke-dasharray: 2 14; }
.fork .node { fill: var(--accent); } .fork .node.side { fill: var(--muted); }
.fork text { fill: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.fork .small { fill: var(--muted); font-weight: 500; font-size: 14px; }

/* ---------- カード群(同じパターン・注意点) ---------- */
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; margin-top: 44px; }
.cards3 .card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px 26px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.cards3 .card .yr { font: 700 1rem/1.2 var(--font-display); color: var(--accent-ink); }
.cards3 .card .nm { font: 700 1.6rem/1.25 var(--font-display); letter-spacing: -0.01em; }
.cards3 .card .ds { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 0; }
.cards3 .card .ico { width: 44px; height: 44px; color: var(--accent-ink); }

/* 4年サイクル */
.cycles { display: grid; gap: 14px; margin-top: 44px; }
.cycle { display: grid; grid-template-columns: 74px repeat(3, 1fr); gap: 10px; align-items: stretch; }
.cycle .cy { font: 700 1rem/1 var(--font-display); color: var(--muted); align-self: center; font-variant-numeric: tabular-nums; }
.cycle span { border-radius: 14px; padding: 14px 12px; font-size: 0.92rem; font-weight: 600; line-height: 1.35; text-align: center; min-width: 0; }
.cycle .h { background: var(--chip); }
.cycle .p { background: var(--grad); color: var(--on-accent); }
.cycle .d { background: var(--bad-bg); color: var(--bad-ink); }
.cycle.open .p, .cycle.open .d { background: transparent; box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }
.cycle b { display: block; font: 700 1.05rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .cycle { grid-template-columns: 1fr 1fr 1fr; } .cycle .cy { grid-column: 1 / -1; } }

/* ---------- 価格チャート ---------- */
.chart { margin: 48px 0; background: var(--bg-alt); border-radius: var(--radius-lg); padding: 26px 24px 18px; }
.chart figcaption { font: 700 1.25rem/1.4 var(--font-display); margin-bottom: 4px; }
.chart .note { color: var(--muted); font-size: 0.86rem; margin: 0 0 12px; }
.chart .chart-svg { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: 0.1; }
.chart .dot { fill: var(--accent); stroke: var(--bg-alt); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .crosshair { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .tip {
  position: absolute; background: var(--tip-bg); color: var(--tip-ink); font-size: 0.82rem; line-height: 1.5;
  padding: 6px 10px; border-radius: 10px; pointer-events: none; transform: translate(-50%, -118%);
  white-space: nowrap; box-shadow: var(--tip-shadow);
}
.chart details { margin-top: 10px; font-size: 0.92rem; }
.chart summary { cursor: pointer; color: var(--link); font-weight: 600; }
.chart table { border-collapse: collapse; width: 100%; margin-top: 8px; }
.chart th, .chart td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.chart td:last-child, .chart th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 章末クイズ ---------- */
.quiz-band .inner { max-width: var(--prose); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.quiz h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin: 6px 0 10px; letter-spacing: -0.015em; line-height: 1.15; }
.quiz .quiz-intro { color: var(--muted); font-size: 1.05rem; margin: 0 0 28px; }
.quiz fieldset.q { border: 0; border-radius: var(--radius-lg); background: var(--surface); padding: 22px 22px 18px; margin: 0 0 16px; box-shadow: inset 0 0 0 2px transparent; }
.quiz legend { float: left; width: 100%; padding: 0 4px; margin: 0 0 10px; font: 700 1.1rem/1.5 var(--font-display); }
.quiz fieldset.q > *:not(legend) { clear: both; }
.quiz label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; margin: 4px 0; border-radius: 14px; cursor: pointer; line-height: 1.6; background: var(--bg-alt); }
.quiz label:hover { filter: brightness(0.97); }
.quiz input[type="radio"] { margin-top: 6px; accent-color: var(--accent); flex-shrink: 0; }
.quiz .explain { display: none; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; font-size: 0.95rem; }
.quiz .explain::before { font-weight: 800; margin-right: 6px; }
.quiz fieldset.correct { box-shadow: inset 0 0 0 2px var(--good-border); }
.quiz fieldset.correct .explain { display: block; background: var(--good-bg); }
.quiz fieldset.correct .explain::before { content: "◯ " attr(data-ok); color: var(--good-ink); }
.quiz fieldset.wrong { box-shadow: inset 0 0 0 2px var(--bad-border); }
.quiz fieldset.wrong .explain { display: block; background: var(--bad-bg); }
.quiz fieldset.wrong .explain::before { content: "✕ " attr(data-ng); color: var(--bad-ink); }
.quiz fieldset.unanswered .explain::before { content: "− " attr(data-na); color: var(--bad-ink); }
.quiz label.is-answer { background: var(--good-bg); font-weight: 700; }
.quiz label.is-wrong { background: var(--bad-bg); text-decoration: line-through; }
.quiz .quiz-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.quiz .quiz-result { margin: 0; font: 700 1.2rem/1.3 var(--font-display); color: var(--accent-ink); }

/* ---------- 前後の章 ---------- */
.pager-wrap { max-width: var(--prose); margin: 0 auto; padding-block: 48px 72px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: block; padding: 18px 20px; border-radius: var(--radius); background: var(--bg-alt); color: var(--text); text-decoration: none; transition: transform .2s; min-width: 0; }
.pager a:hover { transform: translateY(-2px); }
.pager .dir { display: block; font-size: 0.82rem; color: var(--muted); }
.pager .ttl { font: 700 1.05rem/1.4 var(--font-display); }
.pager .next { text-align: right; }

/* ---------- 用語集 ---------- */
.glossary { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.glossary .g-item { background: var(--surface); border-radius: var(--radius-lg); padding: 24px 24px 22px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.glossary dt { font: 700 1.25rem/1.35 var(--font-display); }
.glossary dd { margin: 0; color: var(--text-2); font-size: 0.98rem; line-height: 1.7; }
.glossary .ref { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--accent-ink); font-weight: 600; }

/* ---------- トップ:値動きのストーリー ---------- */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 64px); margin-top: 56px; }
.story-visual { position: sticky; top: calc(var(--nav-h) + 24px); height: calc(100vh - var(--nav-h) - 48px); max-height: 640px; display: flex; flex-direction: column; justify-content: center; order: 2; }
.story-year { font: 700 clamp(1.1rem, 2vw, 1.4rem)/1.2 var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.story-price { margin-top: 6px; font: 800 clamp(3rem, 8vw, 6.4rem)/1 var(--font-display); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-svg { width: 100%; height: auto; margin-top: 26px; overflow: visible; }
.story-svg .grid { stroke: var(--line); stroke-width: 1; }
.story-svg .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.story-svg .path { fill: none; stroke: url(#storyGrad); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset .9s cubic-bezier(.2, .7, .2, 1); }
.story-svg .cur { fill: var(--accent); stroke: var(--ink-bg); stroke-width: 3; transition: cx .9s cubic-bezier(.2, .7, .2, 1), cy .9s cubic-bezier(.2, .7, .2, 1); }
.story-svg .halo { fill: var(--glow); transition: cx .9s cubic-bezier(.2, .7, .2, 1), cy .9s cubic-bezier(.2, .7, .2, 1); }
.story-steps { list-style: none; margin: 0; padding: 0; order: 1; }
.story-step { min-height: 72vh; display: flex; align-items: center; }
.story-step:first-child { min-height: 50vh; align-items: flex-start; padding-top: 10vh; }
.story-step:last-child { min-height: 60vh; }
.story-card { padding: 26px 26px 24px; border-radius: var(--radius-lg); background: var(--ink-surface); transition: opacity .4s, transform .4s; opacity: 0.4; }
.story-step.active .story-card, .no-story .story-card { opacity: 1; }
.story-card .sy { font: 700 1rem/1.2 var(--font-display); color: var(--ink-accent); font-variant-numeric: tabular-nums; }
.story-card .sp { margin: 6px 0 8px; font: 800 2rem/1.1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.story-card .st { margin: 0; color: var(--ink-text-2); font-size: 1.02rem; line-height: 1.7; }
@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; gap: 0; }
  .story-visual { order: 0; z-index: 2; top: var(--nav-h); height: auto; max-height: none; padding: 16px 0 14px; background: var(--ink-bg); }
  .story-price { font-size: clamp(2.6rem, 13vw, 4rem); }
  .story-svg { margin-top: 12px; max-height: 26vh; }
  .story-step, .story-step:first-child, .story-step:last-child { min-height: 64vh; padding-top: 0; align-items: center; }
}

/* ---------- トップ:章カード ---------- */
.ch-cards > li { width: min(340px, 80vw); }
.ch-card {
  height: 100%; min-height: 440px; display: flex; flex-direction: column; gap: 10px; padding: 30px 28px 28px;
  border-radius: var(--radius-lg); background: var(--ink-bg); color: var(--ink-text); text-decoration: none;
  position: relative; overflow: hidden; transition: transform .3s ease;
}
.ch-card:hover { transform: scale(1.015); }
.ch-card::after { content: ""; position: absolute; inset: auto -20% -35% -20%; height: 60%; background: radial-gradient(ellipse at center, var(--glow), transparent 65%); pointer-events: none; }
.ch-card .cn { font-size: 0.95rem; font-weight: 600; color: var(--ink-accent); }
.ch-card .ct { font: 700 1.6rem/1.25 var(--font-display); letter-spacing: -0.01em; }
.ch-card .ce { font-size: 0.9rem; color: var(--ink-muted); }
.ch-card .cd { font-size: 0.98rem; color: var(--ink-text-2); line-height: 1.65; margin: 4px 0 0; }
.ch-card .cw { margin-top: auto; font: 800 clamp(3.2rem, 9vw, 4.4rem)/1 var(--font-display); letter-spacing: -0.04em; position: relative; z-index: 1; white-space: nowrap; }
.ch-card .go { position: relative; z-index: 1; font-weight: 600; color: var(--ink-accent); }

/* 3つの柱 */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: clamp(28px, 5vw, 56px); margin-top: 56px; text-align: center; }
.pillars .ico { width: 64px; height: 64px; color: var(--accent-ink); margin: 0 auto 14px; display: block; }
.pillars h3 { margin: 0 0 8px; font-size: 1.45rem; }
.pillars p { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.7; }

/* 大きな引用 */
.big-quote { margin: 0 auto; max-width: 18em; font: 700 clamp(2rem, 5.4vw, 4rem)/1.15 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }

/* ---------- フッター ---------- */
.site-footer { background: var(--bg-alt); color: var(--muted); font-size: 0.8rem; line-height: 1.7; padding-block: 28px 44px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.site-footer p { max-width: var(--wrap); margin: 0 auto 6px; }

/* ---------- スクロールで現れる演出 ---------- */
.reveal.pre { opacity: 0; transform: translateY(44px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.reveal.pre.in { opacity: 1; transform: none; }

@media (max-width: 734px) {
  body { font-size: 16px; }
  .prose { font-size: 1.02rem; }
  .site-header .brand .txt { display: none; }
  .pager { grid-template-columns: 1fr; }
  .bars { height: 240px; }
  .ch-card { min-height: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.pre { opacity: 1; transform: none; }
}
.headline.xl { font-size: clamp(3.2rem, 11vw, 7.5rem); letter-spacing: -0.035em; }
.site-footer { border-top: 1px solid var(--line); }
.ch-art .word.long { font-size: clamp(3rem, 12vw, 8rem); }
.stat-num.xlong { font-size: clamp(1.9rem, 7.4vw, 6rem); }
.pizza .cut { stroke: var(--crust); stroke-width: 2; opacity: 0.55; fill: none; }
.end-band .coin-stage { margin-top: 0; }
@media (max-width: 734px) { .lineage li.goal { grid-column: 1 / -1; } }
/* 日本語は文節で折り返す(対応ブラウザのみ) */
:lang(ja) :is(h1, h2, h3, .headline, .headline-s, .subhead, .stat-cap, .eyebrow, .tile-v, .ct, .cd) { word-break: auto-phrase; }
.meter .legend span:last-child { white-space: nowrap; }
