/* =========================================================
   あかり サンプルデッキ「みはらし 事業説明資料」
   正本：system/SLIDES.md（寸法・文字・12レイアウト）／DESIGN.md（色・状態の灯り・系列色）
   1920×1080 のステージを JS で拡大縮小。寸法はすべてステージ上の px。
   数値の体系：
     外周  左右 120 / 上 96 / 下 144（家具の帯 y 984〜1080）
     本文領域 x 120〜1800、y 96〜936（1680×840）。タイトル組のあとの本文は y=272 から
     罫 2px（＝pptx 1pt）、角丸 4 / 8 / 12、影なし
     文字 表紙 88 / 章題 80 / タイトル 56 / 小見出し 36 / 本文 32 / カード・表 28 / 注記・家具 24（最小）
   ========================================================= */

/* ---------- 1. トークン（DESIGN.md 2章・3章・4章の値） ---------- */
:root {
  --bg: #0E1218; --surface: #161C26; --surface-2: #1E2632; --line: #2B3646;
  --text: #E8EDF3; --text-2: #9AA7B8; --text-3: #5F7186; --accent: #4C9AFF;
  --on-accent: var(--bg); --on-status: var(--bg);
  --st-ok: #3FB27F; --st-info: #4C9AFF; --st-caution: #D9A62E;
  --st-warning: #E8833A; --st-critical: #E5534B; --st-stopped: #5F7186;
  --series-1: #4C9AFF; --series-2: #3FB27F; --series-3: #A371F7; --series-4: #39C5CF;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  /* スライドの書体（DESIGN.md 6.5）：游ゴシック、コードだけ Consolas。
     その書体がない環境（Mac・Linux の一部）でだけ Web の書体で代わりに表示する */
  --font-slide: "Yu Gothic", YuGothic, "Noto Sans JP", sans-serif;
  --font-code: Consolas, "JetBrains Mono", monospace;
  --rule: 2px solid var(--line);
}
.st--ok { --st: var(--st-ok); } .st--info { --st: var(--st-info); } .st--caution { --st: var(--st-caution); }
.st--warning { --st: var(--st-warning); } .st--critical { --st: var(--st-critical); } .st--stopped { --st: var(--st-stopped); }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 2. 表示枠（閲覧画面） ---------- */
html, body.deck { height: 100%; }
body.deck { margin: 0; background: #000; overflow: hidden; }
.deck-stage { position: fixed; left: 0; top: 0; right: 0; bottom: 44px; overflow: hidden; cursor: pointer; }
.deck-scaler { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%) scale(var(--k, .5)); }
.deck-scaler > .slide { position: absolute; left: 0; top: 0; }
.deck-scaler > .slide:not(.is-active) { display: none; }
.deck-bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: var(--bg); border-top: 1px solid var(--line);
  font-family: "Noto Sans JP", sans-serif; font-size: 13px; color: var(--text-2);
}
.deck-bar p { margin: 0; }
.deck-bar__count { margin-left: auto !important; color: var(--text); font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.deck-bar__links { display: flex; gap: 16px; }
.deck-bar a { color: var(--accent); text-decoration: none; }
.deck-bar a:hover { text-decoration: underline; }
.deck-bar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 3. スライドの共通 ---------- */
.slide {
  position: relative; width: 1920px; height: 1080px; overflow: hidden; box-sizing: border-box;
  background: var(--bg); color: var(--text);
  font-family: var(--font-slide); font-weight: 500; font-size: 32px; line-height: 1.7; letter-spacing: .02em;
  -webkit-font-smoothing: antialiased; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.slide *, .slide *::before, .slide *::after { box-sizing: border-box; }
.slide h1, .slide h2, .slide h3, .slide p, .slide ul, .slide ol, .slide li, .slide figure, .slide blockquote, .slide table, .slide pre { margin: 0; padding: 0; }
.slide ul, .slide ol { list-style: none; }
.slide h1, .slide h2, .slide h3 { font-weight: 700; letter-spacing: .01em; color: var(--text); }
.slide strong { font-weight: 700; }
.slide svg { display: block; }
.code, .slide .num { font-family: var(--font-code); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.sub { color: var(--text-2); }

/* 背景の点（DESIGN.md 8.5：表紙・章扉だけ。24px 間隔・直径 2px、罫の色、不透明度 40%、マスクで端を消す） */
.bg-dots::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.2px); background-size: 24px 24px; background-position: 12px 12px;
  -webkit-mask-image: radial-gradient(ellipse 60% 75% at 78% 45%, #000 15%, transparent 72%);
          mask-image: radial-gradient(ellipse 60% 75% at 78% 45%, #000 15%, transparent 72%);
}

/* タイトル組：見出しラベル（y=96、Consolas 24px）→ 12px → タイトル（y=144、56px）→ 本文は y=272 */
.eyebrow {
  position: absolute; left: 120px; top: 96px; height: 36px;
  font-family: var(--font-code); font-size: 24px; line-height: 1.5; letter-spacing: .08em; color: var(--text-2);
}
.eyebrow b { font-weight: 400; color: var(--accent); margin-right: 16px; }
.s-title { position: absolute; left: 120px; top: 144px; max-width: 1680px; font-size: 56px; line-height: 1.4; white-space: nowrap; }

.note { font-size: 24px; line-height: 1.6; color: var(--text-2); }

/* 状態の灯り（スライド寸法）：インライン型 アイコン 24＋間 8＋ラベル 28、バッジ型 高さ 44・左右 16・角丸 4 */
.st-icon { width: 24px; height: 24px; flex: none; color: var(--st); }
.st-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 28px; line-height: 1.5; color: var(--text); white-space: nowrap; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--st) 14%, transparent); border: 2px solid color-mix(in srgb, var(--st) 40%, transparent);
  font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); white-space: nowrap;
}
.tag {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--accent); font-size: 24px; line-height: 1; color: var(--text); background: var(--bg);
}

/* 家具：左下にデッキ名、右下にページ番号（下端から 48px、y 996〜1032） */
.f-deck { position: absolute; left: 120px; bottom: 48px; font-size: 24px; line-height: 1.5; color: var(--text-2); }
.f-page { position: absolute; right: 120px; bottom: 48px; font-family: var(--font-code); font-size: 24px; line-height: 1.5; color: var(--text-2); font-variant-numeric: tabular-nums; }
.f-page b { font-weight: 400; color: var(--text); }

/* ---------- 4. レイアウト12種（番号は SLIDES.md 6章） ---------- */

/* 01 表紙：背景の点。左寄せで ロゴ（y=96）→ 表紙タイトル 88px（y=360〜、2行）→ 40px → サブ 32px → 下に日付・発行者 */
.cover-logo { position: absolute; left: 120px; top: 96px; display: flex; align-items: center; gap: 16px; font-size: 32px; font-weight: 700; line-height: 1.5; }
.cover-logo svg { width: 48px; height: 48px; }
.cover-main { position: absolute; left: 120px; top: 360px; width: 1200px; }
.cover-kicker { font-family: var(--font-code); font-size: 24px; line-height: 1.5; letter-spacing: .08em; color: var(--text-2); }
.cover-title { margin-top: 24px !important; font-size: 88px; line-height: 1.3; }
.cover-sub { margin-top: 40px !important; font-size: 32px; line-height: 1.7; color: var(--text-2); }
.cover-meta { position: absolute; left: 120px; bottom: 96px; display: flex; gap: 48px; font-size: 24px; line-height: 1.5; color: var(--text-2); }
.cover-meta .code { color: var(--text); }

/* 02 目次：行 1200px・高さ 104px、番号（Consolas 32px・薄）→ 項目名 36px → 右端に章名 24px。行の下に 2px 罫 */
.toc { position: absolute; left: 120px; top: 272px; width: 1200px; border-top: var(--rule); }
.toc li { display: flex; align-items: center; height: 104px; border-bottom: var(--rule); }
.toc__num { width: 96px; font-family: var(--font-code); font-size: 32px; line-height: 1; color: var(--text-2); }
.toc__name { font-size: 36px; font-weight: 700; line-height: 1.5; }
.toc__ch { margin-left: auto; font-size: 24px; line-height: 1.6; color: var(--text-2); }

/* 03 章扉：背景の点。章番号（Consolas 160px・青＝現在地）y=280 → 32px → 章題 80px → 40px → 要旨 32px（幅 1200） */
.ch-main { position: absolute; left: 120px; top: 280px; width: 1200px; }
.ch-num { font-family: var(--font-code); font-size: 160px; line-height: 1; color: var(--accent); letter-spacing: 0; }
.ch-title { margin-top: 32px !important; font-size: 80px; line-height: 1.3; }
.ch-summary { margin-top: 40px !important; color: var(--text-2); }

/* 04 本文：段 1200px（約36字）、リード → 32px → 箇条（印 16×4px・薄、字下げ 40px、間 16px）。右 480px は空ける */
.body-col { position: absolute; left: 120px; top: 272px; width: 1200px; }
.list { margin-top: 32px !important; }
.list li { position: relative; padding-left: 40px; }
.list li + li { margin-top: 16px; }
.list li::before { content: ""; position: absolute; left: 0; top: calc(.85em - 2px); width: 16px; height: 4px; background: var(--text-2); }

/* 05 2カラム：800px＋間 80px（中央に 2px の縦罫）＋800px。小見出し 36px → 24px → 本文 32px */
.cols { position: absolute; left: 120px; top: 272px; width: 1680px; display: grid; grid-template-columns: 800px 800px; column-gap: 80px; }
.cols::before { content: ""; position: absolute; left: 839px; top: 0; height: 584px; width: 2px; background: var(--line); }
.col__title { font-size: 36px; line-height: 1.5; }
.col__text { margin-top: 24px !important; }
.codeblock {
  margin-top: 32px !important; padding: 24px 32px !important; background: var(--bg); border: var(--rule); border-radius: var(--radius-md);
  font-family: var(--font-code); font-size: 24px; line-height: 1.6; color: var(--text); white-space: pre; letter-spacing: 0;
}
.codeblock .k { color: var(--text-2); }

/* 06 ビジュアル中心：画面フレーム 1120×640（2px 罫・角丸 12、上端に 48px のバー）→ 80px → 説明 480px（下端をフレームの下端 y=912 に揃える） */
.vis-frame { position: absolute; left: 120px; top: 272px; width: 1120px; height: 640px; background: var(--surface); border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.vis-bar { display: flex; align-items: center; height: 48px; padding: 0 24px; background: var(--surface-2); border-bottom: var(--rule); font-family: var(--font-code); font-size: 24px; color: var(--text-2); }
.vis-body { padding: 32px; }
.vis-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.vis-head h3 { font-size: 32px; line-height: 1.4; }
.vis-head .sub { font-size: 24px; }
.vis-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.vis-kpi { padding: 16px 24px; background: var(--bg); border: var(--rule); border-radius: var(--radius-lg); }
.vis-kpi p:first-child { font-size: 24px; line-height: 1.5; color: var(--text-2); }
.vis-kpi .big { font-family: var(--font-code); font-size: 48px; line-height: 1.2; }
.vis-kpi .big span { font-family: var(--font-slide); font-size: 24px; color: var(--text-2); margin-left: 8px; }
.vis-rows { border-top: var(--rule); }
.vis-rows li { display: grid; grid-template-columns: 200px 1fr 160px; align-items: center; height: 56px; border-bottom: var(--rule); font-size: 28px; }
.vis-rows .code { font-size: 24px; color: var(--text-2); }
.vis-rows .num { text-align: right; font-size: 28px; }
.vis-desc { position: absolute; left: 1320px; bottom: 168px; width: 480px; }
.vis-desc__title { font-size: 36px; line-height: 1.5; }
.vis-desc p { margin-top: 24px; }
.vis-desc .note { margin-top: 24px; }

/* 07 カード3枚：各 528px・間 48px・高さ 600px（y 272〜872）。宵の面＋2px 罫・角丸 12、内側 48px 40px */
.cards { position: absolute; left: 120px; top: 272px; display: grid; grid-template-columns: repeat(3, 528px); column-gap: 48px; }
.card { height: 600px; padding: 48px 40px; background: var(--surface); border: var(--rule); border-radius: var(--radius-lg); }
.card__num { font-family: var(--font-code); font-size: 32px; line-height: 1; color: var(--text-2); }
.card__title { margin-top: 32px !important; font-size: 36px; line-height: 1.5; }
.card__text { margin-top: 16px !important; font-size: 28px; line-height: 1.7; color: var(--text-2); }
.card__states { margin-top: 32px !important; display: grid; grid-template-columns: repeat(2, max-content); gap: 16px 40px; }

/* 08 表：幅 1680、見出し行 72px（文字 24px・薄・下に 2px 罫）、行 88px（28px）。縦罫・外枠・しまなし。数値は右揃え Consolas */
.tbl-wrap { position: absolute; left: 120px; top: 272px; width: 1680px; }
.tbl { width: 1680px; border-collapse: collapse; table-layout: fixed; font-size: 28px; line-height: 1.5; }
.tbl th, .tbl td { height: 88px; padding: 0 24px; text-align: left; vertical-align: middle; border-bottom: var(--rule); font-weight: 500; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead th { height: 72px; font-size: 24px; color: var(--text-2); }
.tbl tbody th { font-weight: 700; }
.tbl .num { text-align: right; font-family: var(--font-code); font-variant-numeric: tabular-nums; }
.tbl .rec td, .tbl .rec th { background: var(--surface); }
.tbl-wrap .note { margin-top: 24px; }

/* 09 ステップ：4段（各 384px・間 48px）。番号 Consolas 64px の高さに 2px の横罫を通す。小見出し 36px → 本文 28px */
.steps { position: absolute; left: 120px; top: 272px; width: 1680px; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 48px; }
.step__num { display: flex; align-items: center; gap: 24px; font-family: var(--font-code); font-size: 64px; line-height: 1; color: var(--text); }
.step__num::after { content: ""; flex: 1; height: 2px; background: var(--line); margin-right: -24px; }
.step:last-child .step__num::after { margin-right: 0; }
.step:first-child .step__num { color: var(--accent); }
.step__title { margin-top: 40px !important; font-size: 36px; line-height: 1.5; }
.step__text { margin-top: 16px !important; font-size: 28px; line-height: 1.7; color: var(--text-2); }
.step .codeblock { margin-top: 24px !important; padding: 16px 20px !important; font-size: 24px; }

/* 10 声・引用：引用符（Consolas 160px・淡）x=120・y=240、引用文 44px（x=240、幅 1280、縦中央 y=520）→ 48px → 出典 24px */
.q-mark { position: absolute; left: 120px; top: 240px; font-family: var(--font-code); font-size: 160px; line-height: 1; color: var(--text-3); }
.q-body { position: absolute; left: 240px; top: 520px; transform: translateY(-50%); width: 1280px; }
.q-text { font-size: 44px; font-weight: 700; line-height: 1.7; }
.q-cite { margin-top: 48px; font-size: 24px; line-height: 1.6; color: var(--text-2); }

/* 11 比較：項目 320＋A 640＋B 640（間 40）。見出し行 72px、行 96px。B だけを青 2px・角丸 12 で囲み（外へ 24px）、上にタグ */
.cmp { position: absolute; left: 120px; top: 344px; width: 1680px; }
.cmp__row { display: grid; grid-template-columns: 320px 640px 640px; column-gap: 40px; height: 96px; }
.cmp__row > span { display: flex; align-items: center; border-bottom: var(--rule); font-size: 28px; line-height: 1.5; }
.cmp__row--head { height: 72px; }
.cmp__row--head > span { font-size: 24px; color: var(--text-2); }
.cmp__label { color: var(--text-2); }
.cmp__b { padding: 0 24px; }
.cmp__a { color: var(--text-2); }
.cmp__box { position: absolute; left: 1040px; width: 640px; top: -24px; bottom: -24px; border: 2px solid var(--accent); border-radius: var(--radius-lg); pointer-events: none; }
.cmp__tag { position: absolute; left: 1040px; top: -88px; }

/* 12 クロージング：中央揃え。一文 64px → 48px → 連絡先（Consolas 32px）→ 32px → 注記。家具なし */
.cl-main { position: absolute; left: 120px; top: 50%; width: 1680px; transform: translateY(-50%); text-align: center; }
.cl-logo { display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 32px; font-weight: 700; line-height: 1.5; margin-bottom: 48px !important; }
.cl-logo svg { width: 48px; height: 48px; }
.cl-title { font-size: 64px; line-height: 1.4; }
.cl-contact { margin-top: 48px !important; font-family: var(--font-code); font-size: 32px; line-height: 1.6; color: var(--text); }
.cl-main .note { margin-top: 32px; }

/* ---------- 5. 印刷：1ページ1スライド ---------- */
@page { size: 1920px 1080px; margin: 0; }
@media print {
  html, body.deck { height: auto; overflow: visible; background: none; }
  .deck-bar { display: none; }
  .deck-stage { position: static; overflow: visible; }
  .deck-scaler { position: static; transform: none; width: auto; height: auto; }
  .deck-scaler > .slide, .deck-scaler > .slide:not(.is-active) { display: block; position: relative; break-after: page; page-break-after: always; }
  .deck-scaler > .slide:last-child { break-after: auto; page-break-after: auto; }
}
