/* ame-shell ドキュメントサイト。ame-shell のガラスと夜空色に合わせた見た目 */
:root {
  --bg: #070b18;
  --bg2: #0b1430;
  --glass: rgba(16, 26, 54, 0.55);
  --glass-strong: rgba(14, 22, 46, 0.78);
  --rim: rgba(160, 190, 255, 0.16);
  --rim-hi: rgba(200, 220, 255, 0.32);
  --text: #eaf2ff;
  --sub: #a7b6d8;
  --dim: #7383a8;
  --accent: #7ab8ff;
  --accent2: #9a8cff;
  --yes: #7de0b0;
  --no: #ff8aa0;
  --part: #ffd38a;
  --radius: 18px;
  --max: 960px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.85 "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
code, pre { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---- 背景: ゆっくり動くオーロラ ---- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(1200px 600px at 70% -10%, #13234e 0%, transparent 60%), linear-gradient(180deg, #070b18, #050813 70%); }
.sky i { position: absolute; width: 70vw; height: 50vh; border-radius: 50%; filter: blur(90px); opacity: .35; animation: drift 26s ease-in-out infinite alternate; }
.sky i:nth-child(1) { left: -10vw; top: 6vh; background: #1fae9a; }
.sky i:nth-child(2) { left: 30vw; top: -8vh; background: #3d6bff; animation-duration: 32s; }
.sky i:nth-child(3) { left: 55vw; top: 18vh; background: #8a5cff; animation-duration: 38s; opacity: .25; }
@keyframes drift { to { transform: translate3d(6vw, 5vh, 0) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .sky i { animation: none; } }

/* ---- ヘッダ ---- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 4vw, 40px); background: rgba(7, 11, 24, .62);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--rim); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 900; font-size: 19px; letter-spacing: .02em; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 900; }
.brand:hover { text-decoration: none; }
#nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
#nav::-webkit-scrollbar { display: none; }
#nav a { color: var(--sub); padding: 6px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; transition: background .2s, color .2s; }
#nav a:hover { color: var(--text); background: rgba(255,255,255,.06); text-decoration: none; }
#nav a.on { color: #08101e; background: var(--accent); font-weight: 700; }
.gh { color: var(--sub); font-size: 14px; border: 1px solid var(--rim); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }

/* ---- 本文 ---- */
.layout { display: grid; grid-template-columns: minmax(0, var(--max)) 220px; gap: 40px; justify-content: center;
  padding: 0 clamp(16px, 4vw, 40px); }
main { min-width: 0; padding: 28px 0 60px; outline: none; }
main.enter { animation: enter .55s cubic-bezier(.2, .9, .25, 1.06); }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }
.loading { color: var(--dim); }
h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.25; margin: 18px 0 18px; font-weight: 900; letter-spacing: .01em; }
h2 { font-size: clamp(22px, 3vw, 28px); margin: 64px 0 14px; padding-top: 6px; font-weight: 800; position: relative; }
h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
h2 .anchor { position: absolute; left: -22px; color: var(--dim); opacity: 0; font-weight: 400; }
h2:hover .anchor { opacity: 1; text-decoration: none; }
h3 { font-size: 19px; margin: 32px 0 8px; }
h4 { margin: 0 0 4px; font-size: 16px; }
p, li { color: #d6e1f7; }
strong { color: var(--text); }
ul, ol { padding-left: 1.3em; }
li { margin: 4px 0; }
:not(pre) > code { background: rgba(122, 184, 255, .12); color: #cfe3ff; padding: 1px 6px; border-radius: 6px; font-size: .88em; }
pre.code { background: rgba(6, 10, 24, .82); border: 1px solid var(--rim); border-radius: 14px; padding: 16px 18px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.65; color: #d9e6ff; position: relative; }
pre.code[data-lang]::before { content: attr(data-lang); position: absolute; right: 12px; top: 8px; font-size: 11px; color: var(--dim); }

/* 表 */
.table { overflow-x: auto; margin: 18px 0; border-radius: 14px; border: 1px solid var(--rim); background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.6; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(160,190,255,.09); }
th { color: var(--text); background: rgba(122,184,255,.08); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--text); font-weight: 500; }
.yes, .no, .part { font-weight: 900; margin-right: 4px; }
.yes { color: var(--yes); } .no { color: var(--no); } .part { color: var(--part); }

/* 補足 */
.note { margin: 20px 0; padding: 14px 18px; border-radius: 14px; background: rgba(122,184,255,.08); border: 1px solid rgba(122,184,255,.25); }
.note p { margin: 0; }
.note.warn { background: rgba(255,211,138,.07); border-color: rgba(255,211,138,.3); }

/* 写真・動画 */
.media { margin: 26px 0; }
.media img, .media video { width: 100%; border-radius: var(--radius); border: 1px solid var(--rim-hi);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02); background: #0a1024; cursor: zoom-in; }
.media video { cursor: default; aspect-ratio: 16 / 9; }
figcaption { color: var(--sub); font-size: 14px; margin-top: 10px; text-align: center; }

/* 数字のカード */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 28px 0; }
.stat { padding: 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--rim);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.stat b { display: block; font-size: clamp(20px, 2.6vw, 26px); font-weight: 900; line-height: 1.3;
  background: linear-gradient(90deg, #cfe6ff, var(--accent) 60%, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--sub); font-size: 13px; line-height: 1.5; display: block; margin-top: 4px; }

/* 機能のカード */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 24px 0; }
.card { padding: 18px 18px 14px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--rim);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .35s cubic-bezier(.2,.9,.25,1.2), border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--rim-hi); }
.card i { font-style: normal; font-size: 26px; display: block; margin-bottom: 6px; }
.card p { margin: 0; font-size: 14.5px; color: var(--sub); line-height: 1.7; }

/* ヒーロー */
.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 34px; align-items: center; margin: 22px 0 10px; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .08em; font-size: 13px; margin: 0; }
.hero-title { font-size: clamp(48px, 8vw, 84px); line-height: 1; margin: 8px 0 14px; letter-spacing: -.02em; }
.hero-title span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 17px; color: #d3def5; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--rim-hi); color: var(--text); font-weight: 700; font-size: 15px;
  background: rgba(255,255,255,.05); transition: transform .25s cubic-bezier(.2,.9,.25,1.3), background .2s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); background: rgba(255,255,255,.1); }
.btn.primary { background: linear-gradient(90deg, var(--accent), #8fa6ff); color: #07101f; border: 0; box-shadow: 0 10px 30px -10px rgba(122,184,255,.7); }
.btn.ghost { background: transparent; }
.hero-video video { width: 100%; border-radius: 20px; border: 1px solid var(--rim-hi); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 80px -30px rgba(122,184,255,.5); }

/* 目次 */
.toc { position: sticky; top: 84px; align-self: start; padding-top: 34px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc:not(:empty)::before { content: "このページ"; display: block; color: var(--dim); font-size: 12px; letter-spacing: .1em; margin-bottom: 8px; }
.toc a { display: block; color: var(--sub); font-size: 13.5px; padding: 4px 10px; border-left: 2px solid var(--rim); line-height: 1.5; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }

/* 前後のページ */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 70px; }
.pager a { flex: 1; max-width: 48%; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--rim); background: var(--glass); color: var(--text); font-weight: 700; }
.pager a:hover { text-decoration: none; border-color: var(--rim-hi); }
.pager small { display: block; color: var(--dim); font-weight: 400; font-size: 12px; }
.pager .next { text-align: right; margin-left: auto; }

/* デモ */
.demo { margin: 22px 0; padding: 18px; border-radius: var(--radius); background: var(--glass-strong); border: 1px solid var(--rim-hi);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); }
.demo h4 { display: flex; align-items: center; gap: 8px; }
.demo .tag { font-size: 11px; font-weight: 700; color: #08101e; background: var(--accent); padding: 1px 8px; border-radius: 999px; }
.demo canvas { width: 100%; display: block; border-radius: 12px; background: rgba(4,8,20,.7); cursor: crosshair; touch-action: none; }
.demo .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; font-size: 14px; color: var(--sub); }
.demo button { font: inherit; font-weight: 700; color: var(--text); background: rgba(255,255,255,.07); border: 1px solid var(--rim-hi);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.demo button:hover { background: rgba(255,255,255,.13); }
.demo label { display: flex; align-items: center; gap: 8px; }
.demo input[type=range] { accent-color: var(--accent); width: 130px; }
.demo input[type=search] { width: 100%; font: inherit; font-size: 17px; color: var(--text); padding: 12px 16px; border-radius: 999px;
  background: rgba(4,8,20,.7); border: 1px solid var(--rim-hi); outline: none; }
.demo input[type=search]:focus { border-color: var(--accent); }
.fz-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.fz-list li { display: flex; justify-content: space-between; padding: 7px 14px; border-radius: 10px; background: rgba(255,255,255,.03); margin: 0; transition: transform .3s; }
.fz-list li:first-child { background: rgba(122,184,255,.14); }
.fz-list mark { background: none; color: var(--accent); font-weight: 800; }
.fz-list .sc { color: var(--dim); font-family: "JetBrains Mono", monospace; font-size: 13px; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.cl-item { border-radius: 12px; overflow: hidden; border: 1px solid var(--rim); background: #0a1024; cursor: pointer; padding: 0; text-align: left; color: var(--text); font: inherit; }
.cl-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.cl-item div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-family: "JetBrains Mono", monospace; font-size: 13px; }
.cl-item i { width: 18px; height: 18px; border-radius: 50%; display: inline-block; box-shadow: 0 0 12px currentColor; }
.cl-preview { margin-top: 14px; padding: 16px; border-radius: 14px; border: 1px solid; transition: background .6s, border-color .6s; }
.cl-preview b { transition: color .6s; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--sub); }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* 拡大表示 */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(3,6,14,.86); display: flex; align-items: center; justify-content: center;
  padding: 3vw; cursor: zoom-out; backdrop-filter: blur(8px); }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 92vh; border-radius: 14px; animation: pop .35s cubic-bezier(.2,.9,.25,1.15); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }

.foot { text-align: center; color: var(--dim); font-size: 13px; padding: 30px 16px 50px; border-top: 1px solid var(--rim); }
.foot p { margin: 4px 0; color: var(--dim); }

@media (max-width: 1100px) { .layout { grid-template-columns: minmax(0, var(--max)); } .toc { display: none; } }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .top { gap: 10px; flex-wrap: wrap; }
  #nav { order: 3; flex-basis: 100%; }
  .gh { margin-left: auto; }
  h2 .anchor { display: none; }
  .pager a { max-width: none; }
}

/* 表の列が多いときは詰めずに横へスクロール */
th, td { min-width: 6.5em; }
td:first-child, th:first-child { min-width: 7.5em; }
/* 比較のページ: ame-shell の列を目立たせる */
main[data-page=compare] .table tr > :nth-child(2) { background: rgba(122,184,255,.09); }
main[data-page=compare] .table th:nth-child(2) { color: var(--accent); }
/* 数字のカード: 値は折り返さない */
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat b { white-space: nowrap; font-size: clamp(19px, 2.2vw, 24px); }

/* 技術解説: 章の一覧(横)とナビの入口 */
#nav a.tech { margin-left: 8px; border: 1px solid var(--rim-hi); }
#nav a.tech.on { border-color: transparent; }
.toc:not(:empty)::before { content: none; }
.toc .here::before { content: "このページ"; display: block; color: var(--dim); font-size: 12px; letter-spacing: .1em; margin: 0 0 8px; }
.toc .chap { margin-bottom: 22px; }
.toc .chap p { color: var(--dim); font-size: 12px; letter-spacing: .1em; margin: 0 0 8px; }
.toc .chap a { border-left-color: transparent; font-size: 13px; padding: 3px 10px; }
.toc .chap a.cur { color: var(--text); font-weight: 700; border-left-color: var(--accent2); background: rgba(154,140,255,.08); }
.layout { grid-template-columns: minmax(0, var(--max)) 250px; }
main[data-page^=tech] h3 { color: #cfe0ff; }
.file { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--sub); }
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, var(--max)); }
  .toc { display: block; position: static; max-height: none; padding-top: 0; order: -1; }
  .toc .here { display: none; }
  .toc .chap { display: flex; flex-wrap: wrap; gap: 4px; }
  .toc .chap p { flex-basis: 100%; }
  .toc .chap a { border: 1px solid var(--rim); border-radius: 999px; }
  main:not([data-page^=tech]) + .toc { display: none; }
}
.cl-preview { display: grid; gap: 10px; }
.cl-sw { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--sub); line-height: 1.6; }
.cl-sw i { flex: none; width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 18px currentColor; border: 1px solid rgba(255,255,255,.2); }
.cl-sw b { color: var(--text); }
.cl-sw small { color: var(--dim); margin-left: 6px; }
.demo button.cl-item { border-radius: 12px; padding: 0; background: #0a1024; font-weight: 400; }
.demo button.cl-item:hover { border-color: var(--rim-hi); background: #0d1530; }
