/* =========================================================
   Cardano Alpha Growth — 解説資料 デザインシステム
   自己完結（外部CDN不使用）／ライト・ダーク両対応
   ========================================================= */

:root {
  /* Cardano ブランド */
  --ada-blue:      #0033AD;
  --ada-blue-600:  #123FBF;
  --ada-blue-400:  #3B6EF0;
  --ada-cyan:      #2EC4F1;
  --ada-teal:      #17B897;
  --alpha-gold:    #E8B23A;
  --danger:        #E5484D;
  --warn:          #E8901F;

  /* ライトテーマ */
  --bg:            #F6F8FC;
  --bg-elev:       #FFFFFF;
  --bg-sunken:     #EDF1F9;
  --text:          #16203A;
  --text-soft:     #46536F;
  --text-faint:    #7A8699;
  --border:        #DCE3F0;
  --border-strong: #C3CEE3;
  --hero-grad-1:   #0033AD;
  --hero-grad-2:   #123FBF;
  --hero-grad-3:   #2EC4F1;
  --code-bg:       #EEF2FB;

  --shadow-sm: 0 1px 2px rgba(16,32,74,.06), 0 1px 3px rgba(16,32,74,.08);
  --shadow-md: 0 4px 12px rgba(16,32,74,.08), 0 2px 6px rgba(16,32,74,.06);
  --shadow-lg: 0 18px 48px rgba(16,32,74,.14);

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --maxw: 880px;
  --font-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
             "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0B1120;
    --bg-elev:       #121a2e;
    --bg-sunken:     #0e1626;
    --text:          #E7ECF7;
    --text-soft:     #AAB6D0;
    --text-faint:    #77839E;
    --border:        #23304C;
    --border-strong: #33436A;
    --hero-grad-1:   #071a4d;
    --hero-grad-2:   #0f2f8f;
    --hero-grad-3:   #146a8f;
    --code-bg:       #16203a;
    --ada-blue-400:  #6C97FF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 6px 18px rgba(0,0,0,.45);
    --shadow-lg: 0 20px 52px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg:#0B1120; --bg-elev:#121a2e; --bg-sunken:#0e1626;
  --text:#E7ECF7; --text-soft:#AAB6D0; --text-faint:#77839E;
  --border:#23304C; --border-strong:#33436A;
  --hero-grad-1:#071a4d; --hero-grad-2:#0f2f8f; --hero-grad-3:#146a8f;
  --code-bg:#16203a; --ada-blue-400:#6C97FF;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 6px 18px rgba(0,0,0,.45);
  --shadow-lg:0 20px 52px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 17px;
  letter-spacing: .01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- レイアウト ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
section { padding: 46px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

/* ---------- ヘッダー / ナビ ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 56px; max-width: 1120px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .01em;
  font-size: 15px; white-space: nowrap; flex: 0 0 auto; }
.brand .dot { width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--ada-cyan), var(--ada-blue)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ada-blue) 22%, transparent); }
.topbar nav { margin-left: auto; display: flex; gap: 2px; flex-wrap: nowrap; }
@media (max-width: 820px){ .topbar nav { display: none; } }
.topbar nav a {
  color: var(--text-soft); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 99px;
}
.topbar nav a:hover { color: var(--text); background: var(--bg-sunken); }
.theme-toggle {
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text-soft);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 15px; line-height: 1;
}
.theme-toggle:hover { color: var(--text); border-color: var(--ada-blue-400); }
.lang-toggle {
  display: inline-grid; place-items: center; min-width: 40px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text-soft);
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: .04em;
  text-decoration: none; white-space: nowrap;
}
.lang-toggle:hover { color: var(--text); border-color: var(--ada-blue-400); }

/* ---------- ヒーロー ---------- */
.hero {
  position: relative; color: #fff; padding: 74px 0 66px; border: none; overflow: hidden;
  background: linear-gradient(135deg, var(--hero-grad-1), var(--hero-grad-2) 55%, var(--hero-grad-3));
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(680px 320px at 82% -8%, rgba(255,255,255,.30), transparent 60%),
    radial-gradient(520px 320px at 8% 118%, rgba(46,196,241,.42), transparent 60%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  padding: 6px 13px; border-radius: 99px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 6vw, 50px); line-height: 1.28; margin: 0 0 16px; font-weight: 900; letter-spacing: .01em; }
.hero b, .hero strong { color: #fff; }
.hero-meta .chip b { color: #fff; }
.hero .lede { font-size: clamp(16px, 2.4vw, 19px); max-width: 40em; color: rgba(255,255,255,.92); margin: 0 0 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta .chip {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.26);
  padding: 7px 13px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.hero-meta .chip b { font-weight: 800; }

/* ---------- 見出し ---------- */
.kicker { color: var(--ada-blue-400); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; }
h2.sec-title { font-size: clamp(23px, 4vw, 31px); font-weight: 850; margin: 0 0 6px; letter-spacing: .01em; line-height: 1.35; }
.sec-sub { color: var(--text-soft); margin: 0 0 26px; font-size: 15.5px; }
h3 { font-size: 20px; font-weight: 800; margin: 34px 0 12px; letter-spacing: .01em; }
p { margin: 0 0 16px; }
a { color: var(--ada-blue-400); }
strong, b { color: var(--text); font-weight: 700; }
mark { background: color-mix(in srgb, var(--alpha-gold) 40%, transparent); color: inherit; padding: 0 3px; border-radius: 4px; }

/* ---------- カード ---------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); margin: 18px 0;
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 680px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* 数字タイル */
.stat { text-align: center; }
.stat .num { font-size: 34px; font-weight: 900; color: var(--ada-blue-400); line-height: 1.1; letter-spacing: .01em; }
.stat .lbl { font-size: 13.5px; color: var(--text-soft); margin-top: 4px; }

/* ---------- コールアウト ---------- */
.callout {
  border-left: 4px solid var(--ada-blue-400); background: var(--bg-sunken);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 16px 20px; margin: 20px 0;
}
.callout.warn   { border-color: var(--warn); }
.callout.danger { border-color: var(--danger); }
.callout.good   { border-color: var(--ada-teal); }
/* 擁護トーンの補足。控えめ・小さめに */
.callout.critic { border-color: #C4B5E6; background: color-mix(in srgb, #8B5CF6 4%, var(--bg-sunken)); border-left-width: 3px; }
.callout.critic .c-title { color: #7C6AB0; font-size: 13.5px; }
.callout.critic, .callout.critic p, .callout.critic li { font-size: 13px; line-height: 1.7; color: var(--text-soft); }
.callout.critic b { color: var(--text-soft); font-weight: 700; }
.ctag {
  display: inline-block; margin-left: 7px; padding: 1px 8px; border-radius: 99px;
  background: color-mix(in srgb, #8B5CF6 16%, transparent); color: #7C6AB0;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: middle;
}
.callout .c-title { font-weight: 800; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- 引用（原音声の発言） ---------- */
.quote {
  position: relative; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px 18px; margin: 22px 0; box-shadow: var(--shadow-sm);
}
.quote::before {
  content: "“"; position: absolute; top: -6px; left: 16px; font-size: 60px; line-height: 1;
  color: var(--ada-blue-400); opacity: .35; font-family: Georgia, serif;
}
.quote .jp { font-size: 18px; font-weight: 700; margin: 6px 0 10px; padding-left: 26px; }
.quote .en { color: var(--text-faint); font-size: 14px; font-style: italic; padding-left: 26px; }
.quote .who { margin-top: 10px; font-size: 13px; color: var(--text-soft); padding-left: 26px; }

/* ---------- 図解コンテナ ---------- */
.figure {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; margin: 24px 0; box-shadow: var(--shadow-md); overflow-x: auto;
}
.figure svg { display: block; width: 100%; height: auto; max-width: 100%; }
.figure .cap { margin-top: 12px; font-size: 13px; color: var(--text-soft); text-align: center; }
.svg-label { font-family: var(--font-jp); fill: var(--text); }
.svg-sub    { font-family: var(--font-jp); fill: var(--text-soft); }

/* ---------- 比較テーブル ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 460px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--bg-sunken); font-weight: 800; color: var(--text); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: color-mix(in srgb, var(--ada-blue-400) 6%, transparent); }

/* ---------- 用語チップ / 目次 ---------- */
.term { display: inline-block; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 1px 7px; font-size: .92em; font-family: var(--font-mono); color: var(--ada-blue-400); }
.toc { display: grid; gap: 8px; grid-template-columns: repeat(2,1fr); }
@media (max-width: 680px){ .toc { grid-template-columns: 1fr; } }
.toc a {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; box-shadow: var(--shadow-sm); font-weight: 600; font-size: 15px; transition: transform .12s, border-color .12s;
}
.toc a:hover { transform: translateY(-2px); border-color: var(--ada-blue-400); }
.toc a .n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ada-blue); color: #fff; font-weight: 800; font-size: 13px; }

/* ---------- タイムライン ---------- */
.timeline { position: relative; margin: 22px 0; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border-strong); }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ada-blue-400); border: 3px solid var(--bg); }
.tl-item .t { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); }

/* ---------- 注意書き / フッター ---------- */
.notebox { font-size: 13.5px; color: var(--text-soft); background: var(--bg-sunken);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px 18px; margin: 20px 0; }
footer { border-top: 1px solid var(--border); padding: 40px 0 60px; color: var(--text-faint); font-size: 13.5px; }
footer a { color: var(--text-soft); }

/* ---------- 進捗バー ---------- */
.readbar { position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--ada-cyan), var(--ada-blue-400)); z-index: 60; transition: width .1s; }

ul.clean { list-style: none; padding-left: 0; }
ul.clean li { position: relative; padding-left: 26px; margin-bottom: 10px; }
ul.clean li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 8px; height: 8px; border-radius: 2px;
  background: var(--ada-blue-400); transform: rotate(45deg); }

.small { font-size: 13.5px; color: var(--text-soft); }
.center { text-align: center; }

/* ---------- 用語ツールチップ（ミニ注釈) ---------- */
.tip {
  border-bottom: 1.5px dotted var(--ada-blue-400);
  cursor: help; position: relative; font-weight: 700; white-space: nowrap;
}
.tip:hover, .tip:focus { color: var(--ada-blue-400); outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%) translateY(4px);
  background: var(--text); color: var(--bg-elev);
  width: max-content; max-width: 250px; padding: 9px 12px; border-radius: 9px;
  font-size: 12.5px; font-weight: 500; line-height: 1.55; white-space: normal; text-align: left;
  letter-spacing: .01em; box-shadow: var(--shadow-lg); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .14s, transform .14s;
}
.tip::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity .14s; z-index: 41;
}
.tip:hover::after, .tip:focus::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.tip:hover::before, .tip:focus::before { opacity: 1; }
@media (max-width: 620px){ .tip::after { max-width: 190px; } }
