/* rapinics.co.jp — 採用デザイン（案 4 第二十三版）*/
:root {
  --bg: #0a0c0f;
  --fg: #e7eaee;
  --fg-2: #8d96a1;
  --body: #c3c9d0;
  --line: #232830;
  --line-2: #394049;
  --surface: #11141a;
  --surface-2: #171b22;
  --accent: #ff5a1f;
  --a0: #e7eaee;
  --a2: #8d96a1;
  --a3: #ff5a1f;
  --on-accent: #fff;
  --stage: radial-gradient(120% 80% at 50% 100%, #1b2029, #0d1014 70%);
  --header-bg: rgba(10,12,15,.84);
  --header-fg: #e7eaee;
  --bw: 1px;
  --shadow: none;
  --h2-fill: transparent;
  --h2-stroke: 1.5px;
  --ai: #ff5a1f;
  --avf: saturate(1);
  --grid-c: rgba(231,234,238,.045);
  --radius: 0px;

  --sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
  --gutter: clamp(16px, 4vw, 56px);
}

/* 配色は 4 種類。読み込み直すと次の配色になり、サイト内の移動では引き継ぐ（/assets/palette.js） */
/* 0: 白地と原色（案 2 第一版） */
:root[data-palette="0"] {
  --bg: #fbfaf6; --fg: #141414; --fg-2: #5a5a55; --body: #2b2b28; --line: #d9d7cf; --line-2: #141414;
  --surface: #ffffff; --surface-2: #f1f0ea; --accent: #e8502a; --a0: #141414; --a2: #f2c230; --a3: #1f5e45;
  --stage: #f2c230; --header-bg: #141414; --header-fg: #fff; --bw: 2px; --shadow: 8px 8px 0 #141414;
  --h2-fill: #e8502a; --h2-stroke: 0; --ai: #e8502a; --avf: saturate(1); --grid-c: rgba(20,20,20,.05);
}
/* 1: 紙と赤紫・黄緑（案 3 第一版） */
:root[data-palette="1"] {
  --bg: #f0efea; --fg: #111; --fg-2: #5a5852; --body: #262521; --line: #c9c6bc; --line-2: #111;
  --surface: #f7f6f2; --surface-2: #e6e4dc; --accent: #b0246b; --a0: #111; --a2: #a9c43c; --a3: #b0246b;
  --stage: radial-gradient(circle, rgba(17,17,17,.2) 1.1px, transparent 1.5px) 0 0 / 7px 7px, #a9c43c;
  --header-bg: #f0efea; --header-fg: #111; --bw: 3px; --shadow: 8px 8px 0 #111;
  --h2-fill: #b0246b; --h2-stroke: 0; --ai: #b0246b; --avf: saturate(1); --grid-c: rgba(17,17,17,.05);
}
/* 3: 白黒と橙（案 3 第二版） */
:root[data-palette="3"] {
  --bg: #eceef0; --fg: #0b0c0e; --fg-2: #545a62; --body: #25282c; --line: #c3c8ce; --line-2: #0b0c0e;
  --surface: #f6f7f8; --surface-2: #dde0e4; --accent: #ff4f12; --a0: #0b0c0e; --a2: #545a62; --a3: #ff4f12;
  --stage: radial-gradient(circle, rgba(236,238,240,.16) 1.1px, transparent 1.5px) 0 0 / 7px 7px, #1b1e23;
  --header-bg: #0b0c0e; --header-fg: #eceef0; --bw: 3px; --shadow: 8px 8px 0 #0b0c0e;
  --h2-fill: transparent; --h2-stroke: 1.6px; --ai: #ff4f12; --avf: saturate(1); --grid-c: rgba(11,12,14,.05);
}
/* 2: 黒鉛（案 2 第二版）は既定の値（data-palette が無いときもこれ） */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root { color-scheme: dark; }
:root[data-palette="0"], :root[data-palette="1"], :root[data-palette="3"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.85 var(--sans); font-feature-settings: "palt"; transition: background .4s, color .4s; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
.mono { font-family: var(--mono); letter-spacing: .08em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px var(--gutter); background: var(--header-bg); color: var(--header-fg); backdrop-filter: blur(10px); border-bottom: var(--bw) solid var(--line-2); }
.brand { background: #0b0c0e; padding: 6px 10px; }
.brand img { height: 24px; width: auto; }
.menu { margin-left: auto; position: relative; }
.menu summary { white-space: nowrap; cursor: pointer; list-style: none; padding: 8px 4px; font-size: 14px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ＋"; }
.menu[open] summary::after { content: " －"; }
.menu nav { position: absolute; right: 0; top: calc(100% + 14px); display: grid; min-width: 220px; background: var(--surface); color: var(--fg); border: var(--bw) solid var(--line-2); box-shadow: var(--shadow); }
.menu nav a { padding: 12px 16px; text-decoration: none; border-top: 1px solid var(--line); font-size: 14px; }
.menu nav a:hover { background: var(--surface-2); color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; font-weight: 700; font-size: 15px; text-decoration: none; border: var(--bw) solid var(--line-2); transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s; }
.btn::after { content: "→"; font-family: var(--mono); transition: transform .2s; }
.btn:hover::after { transform: translateX(4px); }
.btn:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.btn-ink { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-ink:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-line { background: transparent; color: var(--fg); }
.btn-hot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); padding: 8px 16px; font-size: 14px; white-space: nowrap; }
.btn-hot::after { content: none; }
.btn-hot:hover { box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.eyebrow { font-size: 12px; color: var(--fg-2); margin: 0 0 14px; }
.section-label { margin: 0 0 10px; font-size: clamp(22px, 2.6vw, 34px); font-weight: 800; line-height: 1.3; letter-spacing: .01em; }
.section-label .no { color: var(--accent); font-size: .78em; margin-right: 2px; }
.lab .section-label, .lab-copy .eyebrow { color: var(--accent); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding: clamp(40px, 6vw, 88px) var(--gutter) clamp(48px, 7vw, 96px);
  background: linear-gradient(var(--grid-c) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, var(--grid-c) 1px, transparent 1px) 0 0 / 40px 40px; }
.hero h1 { margin: 0 0 28px; font-size: clamp(26px, 3.9vw, 60px); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.hero h1 > span { display: block; white-space: nowrap; }
.hero h1 .l2 { color: var(--h2-fill); -webkit-text-stroke: var(--h2-stroke) var(--fg); }
.hero h1 .ai { color: var(--ai); -webkit-text-stroke: 0; }
.hero-copy p { max-width: 34em; margin: 0 0 12px; color: var(--body); }

.window { margin: 0; border: var(--bw) solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); position: relative; }
.window::before, .window::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent); z-index: 2; }
.window::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.window::after { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
.window-bar { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: var(--bw) solid var(--line-2); color: var(--fg-2); font-size: 11px; }
.status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.2s steps(1) infinite; }
.window.scanned .status i { animation-duration: 2.8s; }
.window figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; font-size: 12px; color: var(--fg-2); border-top: var(--bw) solid var(--line-2); }

.stage { --scan: 100%; position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--stage); perspective: 900px; }
/* 時間帯の光（4 枚を重ね、いまの時間帯だけ見せる） */
.tod { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; pointer-events: none; z-index: 3; mix-blend-mode: soft-light; }
.tod-morning { background: linear-gradient(105deg, rgba(255,214,160,.9), rgba(255,214,160,0) 62%); }
.tod-day { background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 60%); }
.tod-evening { background: linear-gradient(255deg, rgba(255,110,40,.95), rgba(255,110,40,0) 66%); mix-blend-mode: overlay; }
.tod-night { background: linear-gradient(180deg, rgba(8,16,48,.85), rgba(0,0,0,.55)); mix-blend-mode: multiply; }
.stage[data-time="morning"] .tod-morning, .stage[data-time="day"] .tod-day, .stage[data-time="evening"] .tod-evening, .stage[data-time="night"] .tod-night { opacity: 1; }
.stage[data-time="night"] .figure { filter: brightness(.82); }

/* スキャン: 下はぼやけた点の集まり、走査線が通ったところからはっきり見える */
.figure { position: absolute; inset: 5% 0 0; z-index: 2; transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.2,.7,.2,1), filter 1.1s; }
.av { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 100%; animation: breathe 4.6s ease-in-out infinite; }
.av-sharp { filter: var(--avf); clip-path: inset(0 0 calc(100% - var(--scan)) 0); }
.av-blur { filter: var(--avf) blur(14px); opacity: .75; clip-path: inset(var(--scan) 0 0 0); }
.av-dots { filter: var(--avf) contrast(1.4); clip-path: inset(var(--scan) 0 0 0);
  -webkit-mask: radial-gradient(circle, #000 1.4px, transparent 1.9px) 0 0 / 6px 6px; mask: radial-gradient(circle, #000 1.4px, transparent 1.9px) 0 0 / 6px 6px; }
.scanline { position: absolute; left: 0; right: 0; z-index: 4; top: calc(4% + var(--scan-line, 110%) * .96); height: 2px; background: var(--accent); box-shadow: 0 0 0 1px rgba(255,90,31,.25); pointer-events: none; }
.scanline::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 26px; background: linear-gradient(rgba(255,90,31,.22), transparent); }
.window.idle .figure { transform: rotate(-4deg) translateY(2%); }
/* 立体のアバター（avatar3d.js）。描けたら、3枚の絵と同じ役割のキャンバスに入れ替える */
.figure .av3d { display: none; }
.figure.has-3d .av3d { display: block; }
.figure.has-3d img.av { display: none; }

/* system: 本文 + 追従する図 */
.system { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(24px, 5vw, 72px); padding: 0 var(--gutter); border-top: var(--bw) solid var(--line-2); }
.story > section { padding: clamp(56px, 8vw, 112px) 0; border-bottom: 1px solid var(--line); }
.story h2 { margin: 0 0 24px; font-size: clamp(18px, 2.1vw, 26px); line-height: 1.6; font-weight: 700; color: var(--body); text-wrap: balance; }
.story p { max-width: 38em; color: var(--body); }
.small { font-size: 13px; color: var(--fg-2) !important; }

/* めくれて現れる（案 3 のフリップ） */
.flip { transform-origin: 0 50%; }
.js .flip { transform: perspective(900px) rotateY(80deg); opacity: 0; transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .5s, box-shadow .2s, background .25s; transition-delay: var(--d, 0s); }
.js .flip.in { transform: perspective(900px) rotateY(0deg); opacity: 1; }
/* こちらへ向き直る（案 3 のアバター） */
.js .turn img { scale: -1 1; transition: scale .55s cubic-bezier(.3,1.3,.4,1) .35s; }
.js .turn.in img { scale: 1 1; }

.b-main .num { color: var(--accent); -webkit-text-stroke: 0; font-size: 88px; }
.koma { position: relative; margin: 0; overflow: hidden; min-height: 170px; border: var(--bw) solid var(--line-2); background: var(--stage); }
.koma img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; transform: scale(1.25); transform-origin: 52% 72%; filter: var(--avf); }

.pairs { margin: 0 0 16px; display: grid; }
.pairs > div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.pairs dt { font-weight: 800; }
.pairs dd { margin: 0; color: var(--body); }

.lab { display: grid; grid-template-columns: 240px minmax(0, 1fr); margin-top: 32px; background: var(--surface); border: var(--bw) solid var(--line-2); border-left: 4px solid var(--accent); box-shadow: var(--shadow); }
.lab-screen { position: relative; margin: 0; background: var(--stage); border-right: var(--bw) solid var(--line-2); overflow: hidden; min-height: 240px; }
.lab-screen img { position: absolute; top: 4%; left: 50%; width: 118%; max-width: none; translate: -50% 0; filter: var(--avf); }
.onair { position: absolute; top: 10px; left: 10px; padding: 2px 8px; background: var(--accent); color: var(--on-accent); font-size: 11px; animation: blink 1.6s steps(1) infinite; }
.lab-copy { padding: 24px; }
.lab h3 { margin: 0 0 10px; font-size: 22px; line-height: 1.45; }
.pending { display: flex; gap: 18px; flex-wrap: wrap; }
.pending a { color: var(--fg-2); }

.steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.steps li { padding: 16px; font-weight: 700; background: var(--surface); border: var(--bw) solid var(--line-2); }
.steps li:hover { background: var(--fg); color: var(--bg); }
.steps li span { display: block; font-size: 11px; color: var(--accent); }
.sub { margin: 36px 0 12px; font-size: 18px; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.example { margin: 0; border: var(--bw) solid var(--line-2); background: var(--surface); }
.example div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.example div:last-child { border-bottom: 0; }
.example dt { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 3px; }
.example dd { margin: 0; font-size: 15px; color: var(--body); }


.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.tags span { padding: 2px 10px; border: 1px solid var(--line-2); font-size: 12px; color: var(--fg); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.cards.three, .cards.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.many article { padding: 16px 18px; }
.cards.many h3 { font-size: 16px; }
.cards.many p { font-size: 14px; }
.face-tag { display: inline-block; margin-bottom: 10px; padding: 1px 8px; font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent); }
.cards article { padding: 20px 22px; border: var(--bw) solid var(--line-2); background: var(--surface); }
.cards article:hover { box-shadow: var(--shadow); background: var(--surface-2); }
.cards h3 { margin: 0 0 6px; font-size: 18px; }
.cards p { margin: 0; font-size: 15px; }
.cards .num { display: block; font: 800 40px/1 var(--mono); color: transparent; -webkit-text-stroke: 1.2px var(--fg); margin-bottom: 12px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.checks li { position: relative; padding: 12px 16px 12px 40px; border: 1px solid var(--line); background: var(--surface); color: var(--body); }
.checks li::before { content: ""; position: absolute; left: 16px; top: 1.25em; width: 10px; height: 10px; background: var(--accent); }
.avatar-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: center; }
.avatar-row .koma { min-height: 0; aspect-ratio: 3 / 4; }
/* 立体のアバター（avatar3d.js）。描けたら絵と入れ替える */
.koma .av3d { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; filter: var(--avf); }
.koma.has-3d .av3d { opacity: 1; }
.koma.has-3d img { opacity: 0; transition: opacity .8s ease; }
.lead { font-size: 18px; line-height: 1.9; color: var(--fg) !important; }
.faces { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.faces li { padding: 16px 14px; border: var(--bw) solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 14px; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; }
.faces li span { font-size: 11px; color: var(--accent); }
.faces li:hover { background: var(--fg); color: var(--bg); }
.more { font-weight: 700; }
.more:hover { color: var(--accent); }

/* GPU: 3 分の 1 と、1 台でどれくらい使えるか */
.cards.three article p { margin-top: 8px; }
.third { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); margin: 28px 0; padding: 22px 26px; border: var(--bw) solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); }
.third-num { margin: 0; font-size: clamp(56px, 8vw, 104px); line-height: 1; font-weight: 800; color: var(--accent); white-space: nowrap; }
.third-num span:first-child { color: var(--fg); }
.third-text { margin: 0; font-size: clamp(18px, 2vw, 24px); font-weight: 800; line-height: 1.6; color: var(--fg) !important; }
.gpu-meter { margin: 28px 0 20px; padding: 22px 24px; border: var(--bw) solid var(--line-2); background: var(--surface); }
.gpu-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.gpu-head h3 { margin: 0; font-size: 18px; }
.gpu-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.gpu-tabs { display: flex; border: var(--bw) solid var(--line-2); }
.basis { margin-top: 8px; font-size: 13px; }
.basis summary { cursor: pointer; color: var(--fg-2); }
.basis table { width: 100%; margin: 10px 0 6px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.basis th, .basis td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; }
.basis th:first-child { text-align: left; font-weight: 700; }
.basis thead th { color: var(--fg-2); font: 700 12px var(--mono); }
.gpu-tabs button { padding: 6px 16px; background: transparent; color: var(--fg); border: 0; border-left: var(--bw) solid var(--line-2); cursor: pointer; font: 700 14px var(--mono); }
.gpu-tabs button:first-child { border-left: 0; }
.gpu-tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.gpu-x { margin: 12px 0 8px; font-size: 12px; color: var(--fg-2) !important; }
.gpu-rows { margin: 0 0 12px; display: grid; gap: 10px; }
.gpu-rows > div { display: grid; grid-template-columns: 15em minmax(0, 1fr); gap: 12px; align-items: center; }
.gpu-rows dt { font-weight: 700; font-size: 14px; line-height: 1.5; }
.gpu-rows dt small { display: block; font-weight: 400; font-size: 11.5px; color: var(--fg-2); }
.gpu-rows .na .unit { opacity: .4; }
.gpu-rows dd { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 6.5em 7.5em; gap: 10px; align-items: center; }
.gpu-rows .num-cell { display: flex; justify-content: flex-end; align-items: baseline; gap: 3px; }
.gpu-rows .approx { font-size: 12px; color: var(--fg-2); }
.gpu-rows .bar { position: relative; height: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.gpu-rows .bar i { position: absolute; inset: 0 auto 0 0; width: var(--w, 10%); background: var(--accent); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.gpu-rows .val { font: 800 20px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.gpu-rows .unit { font-size: 12px; color: var(--fg-2); }

.nolimit { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: center; margin: 0 0 28px; padding: 22px 26px; border: var(--bw) solid var(--accent); background: var(--surface); box-shadow: var(--shadow); }
.nolimit h3 { margin: 0 0 8px; font-size: clamp(18px, 2vw, 24px); line-height: 1.5; }
.nolimit p:last-child { margin: 0; font-size: 15px; }
.nolimit .eyebrow { color: var(--accent); margin-bottom: 6px; }
.dial { width: 150px; height: 150px; }
.dial .ticks line { stroke: var(--fg-2); stroke-width: 1.2; }
.dial-track { fill: none; stroke: var(--line); stroke-width: 6; }
.dial-run { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 22 78; transform-origin: 60px 60px; animation: dial 4s linear infinite; }
.dial-big { font: 800 22px var(--mono); fill: var(--fg); text-anchor: middle; }
.dial-small { font: 700 10px var(--sans); fill: var(--fg-2); text-anchor: middle; }
@keyframes dial { to { transform: rotate(360deg); } }

/* 導入の条件: フローチャート */
.flow { list-style: none; margin: 24px 0 16px; padding: 0; position: relative; display: grid; gap: 28px; }
.flow::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px; background: var(--line-2); transform-origin: top; transform: scaleY(var(--flow, 1)); }
.flow-step { position: relative; margin-left: 64px; padding: 18px 20px; border: var(--bw) solid var(--line-2); background: var(--surface); }
.flow-step::before { content: ""; position: absolute; left: -44px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.flow-step::after { content: ""; position: absolute; left: -30px; top: 28px; width: 30px; height: 2px; background: var(--line-2); }
.flow-step.start::before, .flow-step.end::before { background: var(--accent); }
.flow-no { display: inline-block; margin-bottom: 6px; font-size: 11px; color: var(--accent); }
.flow-step h3 { margin: 0 0 6px; font-size: 18px; }
.flow-step p { margin: 0 0 8px; font-size: 15px; }
.flow-step .line { margin: 4px 0 0; font-size: 14px; color: var(--fg) !important; }
.branch { display: grid; gap: 10px; margin: 12px 0 8px; position: relative; }
.branch.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.branch.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.branch > div { padding: 12px 14px; border: 1px solid var(--line-2); background: var(--bg); font-size: 14px; color: var(--body); }
.branch b { display: block; margin-bottom: 4px; color: var(--fg); font-size: 15px; }
.branch ul { margin: 0; padding-left: 1.2em; }
.branch .deny { border-color: var(--accent); }
.branch .deny b { color: var(--accent); }
.decision { margin: 10px 0 !important; }
.decision span { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border: 2px solid var(--accent); font-weight: 800; color: var(--fg); }
.decision span::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--accent); transform: rotate(45deg); }
.cost { margin: 10px 0 0; display: grid; gap: 4px; }
.cost div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; font-size: 13px; }
.cost dt { font: 700 12px var(--mono); color: var(--accent); }
.cost dd { margin: 0; }
.org { display: flex; gap: 8px; margin-top: 10px; }
.org span { padding: 4px 14px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; }
.org span:nth-child(3) { border-style: dashed; }
.org-box { fill: var(--surface); stroke: var(--fg); stroke-width: 1.2; }
.org-line { fill: none; stroke: var(--fg-2); stroke-width: 1; }

.example-card { margin: 0; padding: 18px 20px; border: var(--bw) solid var(--line-2); background: var(--surface); }
.example-card h4 { margin: 0 0 8px; font-size: 16px; color: var(--accent); }
.example-card p { margin: 0; font-size: 15px; color: var(--body); }

.decide { display: grid; gap: 14px; margin: 24px 0 16px; }
.decide article { padding: 18px 20px; border: var(--bw) solid var(--line-2); background: var(--surface); }
.decide h3 { margin: 0 0 6px; font-size: 18px; }
.decide p { margin: 0 0 8px; font-size: 15px; }
.cost-steps { list-style: none; margin: 12px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; counter-reset: cs; }
.cost-steps li { counter-increment: cs; padding: 14px 16px; border: var(--bw) solid var(--line-2); background: var(--surface); display: grid; gap: 4px; }
.cost-steps b { font-size: 16px; }
.cost-steps b::before { content: counter(cs, decimal-leading-zero) " "; font: 700 11px var(--mono); color: var(--accent); }
.cost-steps span { font-size: 13.5px; color: var(--body); }
.gpu-cost { padding: 18px 20px; border: var(--bw) solid var(--line-2); background: var(--surface); }

/* 静かな部屋: 動きを止め、事実を読みやすく */
.story > .quiet { background: transparent; }
.quiet h2 { font-size: clamp(18px, 2.1vw, 26px) !important; }
.table { margin: 0 0 16px; }
.table div { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.table dt { font-weight: 700; color: var(--fg-2); }
.table dd { margin: 0; }

/* rail */
.rail { position: relative; }
.rail-inner { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); padding: 18px 0 24px; }
.rail-head { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 11px; color: var(--fg-2); }
#build-pct { color: var(--accent); font-weight: 700; }
.diagram { display: block; width: 100%; height: auto; max-height: calc(100vh - 130px); overflow: visible; }
.diagram text { font: 700 11px var(--sans); fill: var(--fg); text-anchor: middle; }
.diagram text.sm { font-size: 10.5px; }
.diagram text.xs { font-size: 9.5px; font-weight: 400; fill: var(--fg-2); paint-order: stroke fill; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.diagram text.in { text-anchor: start; fill: var(--fg); }
.diagram text.end { text-anchor: end; }
.diagram text.start { text-anchor: start; }
.diagram text.on-hot { fill: var(--on-accent); }
.diagram text.on-base { fill: var(--bg); }
.diagram text.caption { font: 10px var(--mono); fill: var(--fg-2); }
.diagram text.cap { font: 700 9.5px var(--sans); fill: var(--fg-2); text-anchor: start;
  paint-order: stroke fill; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.diagram text.cap.end { text-anchor: end; }
.diagram text.cap.mid { text-anchor: middle; }
.diagram .hl.cap { fill: var(--accent); }
.ring { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.face-bg { fill: var(--surface-2); }
.diagram image { filter: var(--avf); }
.wire { fill: none; stroke: var(--fg-2); stroke-width: 1.3; }
.wire.thin { stroke-width: 1; }
.wire.dash { stroke-dasharray: .02 .02; }
.shape { fill: var(--surface); stroke: var(--fg); stroke-width: 1.5; transition: fill .4s, stroke .4s; }
.node .pulse { display: none; }
.node text { transition: fill .4s; }
.diagram[data-active="1"] .b1 .shape, .diagram[data-active="2"] .b2 .shape, .diagram[data-active="3"] .b3 .shape, .diagram[data-active="4"] .b4 .shape { fill: var(--accent); stroke: var(--accent); }
.diagram[data-active="1"] .b1 .pulse, .diagram[data-active="2"] .b2 .pulse, .diagram[data-active="3"] .b3 .pulse, .diagram[data-active="4"] .b4 .pulse { display: inline; }
.diagram[data-active="1"] .b1 text, .diagram[data-active="2"] .b2 text, .diagram[data-active="3"] .b3 text, .diagram[data-active="4"] .b4 text { fill: var(--accent); }
.diagram[data-active="1"] .b1 .pill, .diagram[data-active="2"] .b2 .pill, .diagram[data-active="3"] .b3 .pill, .diagram[data-active="4"] .b4 .pill { stroke: var(--accent); stroke-width: 1.6; }
.diagram[data-active="1"] .wire.b1, .diagram[data-active="2"] .wire.b2, .diagram[data-active="3"] .wire.b3, .diagram[data-active="4"] .wire.b4 { stroke: var(--accent); stroke-width: 2; }
.diagram[data-active="5"] .face .pill { stroke: var(--accent); stroke-width: 1.6; }
.pill { fill: var(--surface); stroke: var(--fg-2); stroke-width: 1; }
.pill.hot { fill: var(--accent); stroke: var(--accent); }
.mini-sq { fill: none; stroke: var(--fg); stroke-width: 1.2; }
.mini-tri { fill: none; stroke: var(--fg); stroke-width: 1.2; }
.waves path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.slab { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; }
.fence { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 6 5; }
.person { fill: var(--fg); }
.person-body { fill: none; stroke: var(--fg); stroke-width: 2; }
.dot { fill: var(--fg); }
.dot.hot { fill: var(--accent); }
.base { fill: var(--fg); }
.halo { fill: none; stroke: var(--accent); stroke-width: 2; }
.pulse { fill: none; stroke: var(--accent); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-out infinite; }
.done .halo { transform-box: fill-box; transform-origin: center; animation: halo 3s ease-in-out infinite; }

.js .diagram .p { transition: opacity .5s, transform .6s cubic-bezier(.2,.8,.2,1), stroke-dashoffset 1s cubic-bezier(.5,0,.2,1); }
.js .diagram .p:not(.on) { opacity: .07; }
.js .diagram .wire { stroke-dasharray: 1; }
.js .diagram .wire.dash { stroke-dasharray: .02 .02; }
.js .diagram .wire:not(.on) { stroke-dashoffset: 1; opacity: 1; }
.js .diagram .wire.dash:not(.on) { opacity: 0; }
.js .diagram .fence { stroke-dasharray: 6 5; }
.js .diagram .node, .js .diagram .pop, .js .diagram .bar { transform-box: fill-box; transform-origin: center; }
.js .diagram .node:not(.on), .js .diagram .pop:not(.on) { transform: scale(.3); }
.js .diagram .bar { transform-origin: left center; }
.js .diagram .bar:not(.on) { transform: scaleX(0); }

.inline-diagram { display: none; }

/* 読んでいる項目と、図の該当部分 */
#rail-now { color: var(--accent); font-weight: 700; }
.diagram [data-id] { transition: opacity .35s; }
.diagram .root { fill: var(--fg-2); }
.diagram.has-hl [data-id]:not(.hl):not(.hl-soft):not(.read) { opacity: .28; }
.diagram.has-hl [data-id].read { opacity: .72; filter: saturate(.3); }
.diagram.has-hl [data-id].hl-soft { opacity: 1; }
.diagram [data-id].flash { animation: flash 1.5s ease-in-out infinite; }
@keyframes flash { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 90, 31, 0)); } 50% { filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 2px var(--accent)); } }
.diagram.has-hl .fence:not(.hl):not(.hl-soft):not(.read) { opacity: .2; }
.diagram.has-hl .fence.read { opacity: .5; filter: saturate(.3); }
.diagram .hl .pill, .diagram .hl .slab, .diagram .hl .org-box { fill: var(--accent); stroke: var(--accent); }
.diagram .hl text { fill: var(--accent); }
.diagram .hl .pill + text, .diagram .hl .slab + text, .diagram .hl text.in { fill: var(--on-accent); }
.diagram .hl .shape { fill: var(--accent); stroke: var(--accent); }
.diagram .node.hl .pulse { display: inline; }
.diagram .hl .dot, .diagram .hl .person { fill: var(--accent); }
.diagram .hl .person-body, .diagram .hl .org-line { stroke: var(--accent); }
.diagram .wire.hl { stroke: var(--accent); stroke-width: 2; }
.diagram .fence.hl { stroke-width: 2.4; }
.diagram .hl .base { fill: var(--accent); }
.diagram .hl .base + text { fill: var(--on-accent); }
.diagram .core.hl .ring { stroke: var(--accent); stroke-width: 2.5; }
.diagram .waves.hl path { stroke-width: 2.4; }

.site-footer { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: 190px; padding: 40px var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); background: #060709; color: #e7eaee; font-size: 13px; }
.footer-peek { position: absolute; right: 12%; bottom: 100%; width: 240px; height: 184px; overflow: hidden; pointer-events: none; }
.footer-peek img { width: 240px; max-width: none; margin: 0; filter: var(--avf); transform: translateY(var(--peek, 0%)); transition: transform .8s cubic-bezier(.3,1.4,.4,1); }
.flogo { height: 24px; width: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer nav a { text-decoration: none; color: #9aa2ab; }
.site-footer nav a:hover { color: #fff; }
.site-footer p { margin: 0 0 0 auto; color: #9aa2ab; }
.qr-block { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: #fff; }
.qr-block img { width: 104px; height: 104px; display: block; }
.qr-block p { margin: 0 !important; color: #0b0c0e !important; font-size: 10px; letter-spacing: .06em; }
.inner .window { max-width: 420px; margin: 0 0 28px; }
@media (max-width: 900px) { .qr-block { display: none; } }

.dock-note { position: fixed; right: 96px; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); color: var(--fg); border: var(--bw) solid var(--line-2); font-size: 12px; font-weight: 700; }
.dock-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.006, 1.014); } }
@keyframes blink { 0%, 70% { opacity: 1; } 71%, 100% { opacity: .25; } }
@keyframes pulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .4; } }

@media (max-width: 1000px) {
  .cost-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .window { order: -1; max-width: 520px; width: 100%; }
  .stage { aspect-ratio: 4 / 5; }
  .system { grid-template-columns: 1fr; }
  .rail { display: none; }
  .inline-diagram { display: block; margin: 8px 0 28px; padding: 14px; border: var(--bw) solid var(--line-2); background: var(--surface); }
  .inline-diagram svg { width: 100%; max-width: 380px; height: auto; margin: 0 auto; display: block; overflow: visible; }
  .inline-diagram p { margin: 0 0 6px; font: 11px var(--mono); color: var(--accent); font-weight: 700; }
}
@media (max-width: 640px) {
  .cost-steps { grid-template-columns: 1fr; }
  .nolimit { grid-template-columns: 1fr; justify-items: start; }
  .dial { width: 110px; height: 110px; }
  .branch.three, .branch.two { grid-template-columns: 1fr; }
  .third { flex-direction: column; align-items: flex-start; }
  .gpu-rows > div { grid-template-columns: 1fr; gap: 4px; }
  .gpu-rows dd { grid-template-columns: minmax(0, 1fr) 5.5em 6.5em; }
  .flow-step { margin-left: 40px; }
  .flow::before { left: 15px; }
  .flow-step::before { left: -32px; }
  .flow-step::after { left: -18px; width: 18px; }
  .cards, .cards.three { grid-template-columns: 1fr; }
  .cards.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar-row { grid-template-columns: 1fr; }
  .avatar-row .koma { width: min(100%, 300px); justify-self: center; }
    .pairs > div, .table div, .example div { grid-template-columns: 1fr; gap: 2px; }
  .examples { grid-template-columns: 1fr; }
  .lab { grid-template-columns: 1fr; }
  .lab-screen { border-right: 0; border-bottom: var(--bw) solid var(--line-2); min-height: 200px; }
  .lab-screen img { width: 70%; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-peek { right: 4%; width: 170px; height: 132px; }
  .footer-peek img { width: 170px; margin: 0; }
  .dock-note { right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); padding: 3px 8px; font-size: 10px; }
  .site-header { gap: 10px; }
  .brand img { height: 20px; }
}
@media (max-width: 440px) {
  .cards.many { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ───────── 下層ページ ───────── */
.page-shell { display: flow-root; }
.skip-link { position: absolute; left: -9999px; top: 0; padding: 10px 16px; background: var(--accent); color: var(--on-accent); z-index: 50; }
.skip-link:focus { left: 0; }
.page { max-width: 940px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) clamp(64px, 9vw, 120px); }
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 4vw, 56px); max-width: 1400px; margin: 0 auto; padding-right: var(--gutter); }
.with-rail .page { max-width: none; margin: 0; padding-right: 0; }
.with-rail .rail-inner { padding-top: clamp(28px, 5vw, 56px); }
@media (max-width: 1100px) { .with-rail { grid-template-columns: 1fr; padding-right: 0; } .with-rail .rail { display: none; } }
.crumb { margin: 0 0 20px; font-size: 12px; color: var(--fg-2); }
.crumb a { color: inherit; }
.inner h1 { margin: 0 0 20px; font-size: clamp(24px, 3.4vw, 40px); font-weight: 800; line-height: 1.35; letter-spacing: .01em; text-wrap: balance; }
.inner .lead { margin: 0 0 28px; font-size: 18px; line-height: 1.95; color: var(--fg); }
.inner p { max-width: 44em; color: var(--body); }
.inner .sub-head { margin: clamp(40px, 6vw, 64px) 0 16px; padding-top: clamp(24px, 4vw, 36px); border-top: 1px solid var(--line-2); font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; line-height: 1.5; color: var(--fg); }
.inner .sub-head:first-of-type { border-top: 0; padding-top: 0; }
.inner .cards, .inner .examples, .inner .checks, .inner .faces, .inner .steps, .inner .flow, .inner .cost-steps { margin-bottom: 24px; }
.inner .small { color: var(--fg-2) !important; font-size: 13px; }
.inner .actions { margin-top: 32px; }

.capability { margin: clamp(40px, 6vw, 64px) 0 24px; padding: 20px 22px; border: var(--bw) solid var(--line-2); background: var(--surface); }
.capability .sub-head { margin: 0 0 14px; padding-top: 0; border-top: 0; }
.capability .cap-label { margin: 0; font-size: 11px; letter-spacing: .1em; }
.capability.current { border-left: 4px solid var(--accent); }
.capability.current .cap-label { color: var(--accent); }
.capability.future { border-style: dashed; background: transparent; }
.capability.future .cap-label { color: var(--fg-2); }
.capability.future p { color: var(--fg-2); }

.scroll { overflow-x: auto; margin: 0 0 24px; }
.grid-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14.5px; }
.grid-table th, .grid-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid-table thead th { font: 700 12px var(--mono); color: var(--fg-2); border-bottom: 1px solid var(--line-2); letter-spacing: .06em; }
.grid-table tbody th, .grid-table td:first-child { font-weight: 700; color: var(--fg); white-space: nowrap; }
.grid-table td { color: var(--body); }

.link-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.link-list li { background: var(--bg); }
.link-list a { display: block; padding: 16px 18px; font-weight: 700; text-decoration: none; }
.link-list a:hover { background: var(--surface); color: var(--accent); }
@media (max-width: 640px) { .link-list { grid-template-columns: 1fr; } }

.qa { margin: 0 0 24px; display: grid; }
.qa > div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.qa dt { margin-bottom: 6px; font-weight: 800; }
.qa dt::before { content: "Q. "; color: var(--accent); font-family: var(--mono); }
.qa dd { margin: 0; color: var(--body); }

form { display: grid; gap: 20px; max-width: 44em; margin: 8px 0 0; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.field .req { margin-left: 6px; padding: 1px 6px; font: 700 11px var(--mono); color: var(--on-accent); background: var(--accent); }
.field .optional { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--fg-2); }
.field .small { margin: 0; }
input, select, textarea { padding: 12px 14px; background: var(--surface); color: var(--fg); border: 1px solid var(--line-2); font: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.consent { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.field.consent input { width: 18px; height: 18px; }
.field.hp { position: absolute; left: -9999px; }

.avatar-dock { position: fixed; right: 96px; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); color: var(--fg); border: var(--bw) solid var(--line-2); font-size: 12px; font-weight: 700; }
.avatar-dock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
@media (max-width: 640px) {
  .avatar-dock { right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); padding: 3px 8px; font-size: 10px; }
  .inner .lead { font-size: 16px; }
}
