/* ==========================================================================
   Knottle public site — shared design system
   公開マーケサイト（/ , /ai-crm , /legal/*）共通の土台。
   ページ固有のレイアウトは home.css / ai.css / legal.css に分けている。

   言語: 「紙と墨と、一本の糸」
   - 紙 (paper)   … 大福帳の温かいオフホワイト
   - 墨 (ink)     … ブランドの紺 #1b2440
   - 糸 (thread)  … ブランドの緑 #0f7a5f。仕事の流れを結ぶ一本の線として使う
   ========================================================================== */

:root {
  --paper: #f5f3ee;
  --paper-2: #ece9e1;
  --paper-3: #e3dfd4;
  --surface: #fcfbf8;
  --ink: #1b2440;
  --ink-2: #3f4863;
  --ink-3: #5f6680;
  --rule: rgba(27, 36, 64, .14);
  --rule-soft: rgba(27, 36, 64, .08);

  --thread: #0f7a5f;
  --thread-2: #0a5c46;
  --thread-tint: #dfece5;
  --thread-glow: rgba(15, 122, 95, .18);

  --night: #10172a;
  --night-2: #182139;
  --night-3: #222c47;
  --on-night: #eceef3;
  --on-night-2: rgba(236, 238, 243, .7);
  --on-night-3: rgba(236, 238, 243, .5);
  --rule-night: rgba(236, 238, 243, .12);
  --thread-night: #4fbf98;

  --gold: #9a7430;

  /* 朱 ＝ 編集者の赤ペン。困りごと・注意・手書きの一言だけに使う（解決は緑の糸） */
  --shu: #b9471f;
  --shu-soft: rgba(185, 71, 31, .14);
  --shu-night: #f08a62;

  --serif: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Menlo, Consolas, monospace;

  --wrap: 1280px;
  --gutter: clamp(20px, 4.2vw, 56px);
  --header-h: 72px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --shadow-ui: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 40px 80px -40px rgba(27, 36, 64, .45), 0 12px 24px -16px rgba(27, 36, 64, .25);
  --shadow-soft: 0 18px 40px -26px rgba(27, 36, 64, .45);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  font-feature-settings: "palt" 0;
  line-break: strict;
}
p, li { text-wrap: pretty; }
/* 見出しだけ文節で改行する（本文は行末をそろえるため通常の改行） */
h1, h2, h3, .display, .h2, .h2-sm, .statement p, .footer-lede, .plan-name, .chips li { word-break: auto-phrase; }
/* 解説文は、HTMLに入れた改行候補（<wbr>・文節の切れ目）でだけ折る。
   auto-phrase と違い Safari でも効く。1つの塊が幅より長いときだけ、はみ出さないよう強制的に折る */
:where(p, li, td, dd, h3):has(wbr) { word-break: keep-all; overflow-wrap: anywhere; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
table { border-collapse: collapse; }
/* アイコン（<svg class="i"><use href="#i-*"/></svg>）。サイズは各所で上書きする */
.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
::selection { background: var(--thread); color: #fff; }
:focus-visible { outline: 2px solid var(--thread); outline-offset: 3px; border-radius: 4px; }
.on-night :focus-visible, .night :focus-visible { outline-color: var(--thread-night); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 700; font-size: .9rem; transition: top .2s;
}
.skip:focus { top: 12px; }

/* 日本語の改行を句の単位で止める */
.nb { display: inline-block; }
.nowrap { white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); position: relative; }
.wrap-narrow { max-width: 880px; }

/* ---------- typography ---------- */
.display, h1.display {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.2rem, 1rem + 4.35vw, 5.1rem);
  line-height: 1.2;
  letter-spacing: .01em;
  font-feature-settings: "palt" 1;
}
.h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.85rem, 1.05rem + 2.9vw, 3.35rem);
  line-height: 1.34;
  letter-spacing: .01em;
  font-feature-settings: "palt" 1;
}
.h2-sm {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.5rem, 1rem + 1.7vw, 2.3rem);
  line-height: 1.42;
  font-feature-settings: "palt" 1;
}
.h3 { font-size: clamp(1.08rem, 1rem + .35vw, 1.28rem); font-weight: 700; line-height: 1.55; letter-spacing: .01em; }
.lead { font-size: clamp(1rem, .95rem + .25vw, 1.12rem); line-height: 2; color: var(--ink-2); max-width: 32em; }
.lead strong, .body strong { color: var(--ink); font-weight: 700; }
.body { color: var(--ink-2); max-width: 34em; }
.small { font-size: .86rem; line-height: 1.8; }
.fine { font-size: .78rem; line-height: 1.7; color: var(--ink-3); }

/* セクション見出しのラベル: 番号＋語 */
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--thread);
  margin-bottom: 22px;
}
.kicker .no { font-family: var(--mono); font-weight: 500; letter-spacing: .06em; color: var(--ink-3); }
.kicker::before { content: ""; width: 28px; height: 1.5px; background: currentColor; border-radius: 2px; }
.night .kicker, .on-night .kicker { color: var(--thread-night); }
.night .kicker .no, .on-night .kicker .no { color: var(--on-night-3); }

.mono { font-family: var(--mono); letter-spacing: .02em; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--rule); color: var(--ink-2); background: var(--surface);
  line-height: 1.5; white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn {
  --bh: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--bh); padding: 0 26px;
  border-radius: 999px;
  font-weight: 700; font-size: .98rem; letter-spacing: .03em; line-height: 1.2;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease-out), box-shadow .25s;
  white-space: nowrap;
}
.btn .arr { width: 16px; height: 16px; transition: transform .3s var(--ease-out); flex-shrink: 0; }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--thread); color: #fff; box-shadow: 0 10px 24px -12px rgba(15, 122, 95, .7); }
.btn-primary:hover { background: var(--thread-2); transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #10172a; transform: translateY(-1px); }
.btn-line { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: var(--on-night); color: var(--ink); }
.btn-light:hover { background: #fff; transform: translateY(-1px); }
.btn-line-night { border: 1.5px solid var(--rule-night); color: var(--on-night); }
.btn-line-night:hover { border-color: var(--on-night); }
.btn-sm { --bh: 42px; padding: 0 18px; font-size: .88rem; }
.btn-lg { --bh: 60px; padding: 0 34px; font-size: 1.04rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem;
  border-bottom: 1.5px solid currentColor; padding-bottom: 2px;
}
.link-arrow svg { width: 14px; height: 14px; transition: transform .3s var(--ease-out); }
.link-arrow:hover svg { transform: translateX(3px); }

.ticks { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .86rem; color: var(--ink-2); }
.ticks li { display: inline-flex; align-items: center; gap: 8px; }
.ticks svg { width: 15px; height: 15px; color: var(--thread); flex-shrink: 0; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .35s, box-shadow .35s, backdrop-filter .35s;
}
.site-header.is-scrolled, .site-header.is-open {
  background: rgba(245, 243, 238, .86);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--rule);
}
/* 暗いセクションの上にいる間はヘッダーも夜色に切り替える（site.js が .on-dark を付ける） */
.site-header.on-dark:not(.is-open) { color: var(--on-night); }
.site-header.on-dark.is-scrolled:not(.is-open) { background: rgba(16, 23, 42, .82); box-shadow: 0 1px 0 var(--rule-night); }
.site-header.on-dark:not(.is-open) .nav a { color: var(--on-night-2); }
.site-header.on-dark:not(.is-open) .nav a:hover,
.site-header.on-dark:not(.is-open) .nav a[aria-current="page"] { color: var(--on-night); }
.site-header.on-dark:not(.is-open) .nav a[aria-current="page"]::after { background: var(--thread-night); }
.site-header.on-dark:not(.is-open) .nav-login { color: var(--on-night-2); }
.site-header.on-dark:not(.is-open) .menu-btn { border-color: var(--rule-night); }
.site-header.on-dark:not(.is-open) .brand-mark { filter: brightness(1.35); }
.bar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  max-width: calc(var(--wrap) + 80px); margin-inline: auto; padding-inline: var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 4px; font-family: var(--serif); font-weight: 800; font-size: 1.42rem; letter-spacing: .01em; line-height: 1; }
.brand-mark { width: auto; height: 32px; margin-left: -13px; flex-shrink: 0; } /* 画像左の余白ぶん寄せる（切り抜かない） */
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative; padding: 8px 12px; font-size: .9rem; font-weight: 500; color: var(--ink-2);
  border-radius: 999px; transition: color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 1.5px; background: var(--thread); border-radius: 2px;
}
.bar-actions { display: flex; align-items: center; gap: 14px; }
.nav-login { font-size: .9rem; font-weight: 700; color: var(--ink-2); padding: 8px 4px; }
.nav-login:hover { color: var(--thread); }
.menu-btn {
  display: none; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule);
  font-size: .85rem; font-weight: 700;
}
.menu-btn .bars { width: 16px; height: 10px; position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform .3s var(--ease-out), top .3s var(--ease-out);
}
.menu-btn .bars::before { top: 1px; }
.menu-btn .bars::after { top: 8px; }
.menu-btn[aria-expanded="true"] .bars::before { top: 4.5px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { top: 4.5px; transform: rotate(-45deg); }

.mobile-menu {
  border-top: 1px solid var(--rule);
  padding: 12px var(--gutter) 28px;
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a.mm-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 2px; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--serif); font-weight: 700; font-size: 1.2rem;
}
.mobile-menu a.mm-link span { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
.mobile-menu .mm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

@media (max-width: 1080px) {
  .nav { display: none; }
  .bar-actions { margin-left: auto; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 560px) {
  .nav-login { display: none; }
  .bar-actions { gap: 8px; }
  .bar-actions .btn-sm { --bh: 38px; padding: 0 14px; font-size: .8rem; box-shadow: none; }
  .bar { gap: 12px; }
  .brand { font-size: 1.28rem; }
  .menu-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .menu-btn .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 340px) {
  .bar-actions .btn-sm { display: none; }
}

/* ---------- reveal ---------- */
.js .rv { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js .rv.is-in { opacity: 1; transform: none; }
.js .rv.d1 { transition-delay: .08s; }
.js .rv.d2 { transition-delay: .16s; }
.js .rv.d3 { transition-delay: .24s; }
.js .rv.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- thread primitives（糸） ---------- */
.thread-path { fill: none; stroke: var(--thread); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.js .draw .thread-path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.js .draw.is-in .thread-path { opacity: 1; }
.js .draw.is-in .thread-path { transition: stroke-dashoffset 1.6s var(--ease-io) .2s; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .js .draw .thread-path { stroke-dashoffset: 0; } }

.strike-thread { position: relative; white-space: nowrap; color: var(--ink-3); }
.strike-thread::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 54%; height: .09em; min-height: 2px;
  background: var(--thread); border-radius: 2px; transform-origin: left center; transform: scaleX(1);
}
.js .strike-thread::after { transform: scaleX(0); transition: transform 1.1s var(--ease-io) .35s; }
.js .is-in .strike-thread::after, .js .strike-thread.is-in::after { transform: scaleX(1); }

.marker { background: linear-gradient(180deg, transparent 58%, var(--thread-glow) 58% 92%, transparent 92%); padding: 0 .08em; }

/* ---------- UI primitives（製品画面の枠） ---------- */
.window {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-ui);
  border: 1px solid rgba(27, 36, 64, .1);
  overflow: hidden;
}
.window-bar {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  background: #efede7; border-bottom: 1px solid var(--rule-soft);
}
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d8d4ca; }
.window-bar .url {
  margin-inline: auto; transform: translateX(-20px);
  font-family: var(--mono); font-size: .68rem; color: var(--ink-3);
  background: var(--surface); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 2px 44px;
}

.phone {
  width: 240px; border-radius: 34px; padding: 9px;
  background: #11182b;
  box-shadow: 0 50px 80px -40px rgba(16, 23, 42, .7), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.phone-screen { border-radius: 26px; overflow: hidden; background: var(--surface); position: relative; }
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 72px; height: 20px; border-radius: 12px; background: #11182b; z-index: 2; }

/* ---------- chat window（会話デモ） ---------- */
.chat {
  background: #faf9f5; color: #29261b;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 50px 90px -50px rgba(0, 0, 0, .8);
  display: flex; flex-direction: column;
}
.chat-top {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .07); font-size: .85rem;
}
.chat-top b { font-weight: 700; }
.chat-top .conn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; color: var(--thread-2); background: var(--thread-tint); border-radius: 999px; padding: 3px 10px; font-weight: 700;
}
.chat-top .conn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--thread); }
.chat-body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 360px; max-height: 420px; overflow: hidden; }
.chat-msg-user {
  align-self: flex-end; max-width: 86%;
  background: #eeebe2; border-radius: 14px 14px 4px 14px; padding: 10px 14px; font-size: .9rem; line-height: 1.7;
}
.chat-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-tool {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .7rem; color: #5c5647;
  border: 1px solid rgba(0, 0, 0, .1); background: #fff; border-radius: 6px; padding: 3px 8px;
}
.chat-tool::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--thread); }
.chat-tool.is-run::before { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.chat-msg-ai { font-size: .9rem; line-height: 1.8; white-space: pre-line; max-width: 94%; }
.chat-caret { display: inline-block; width: 7px; height: 1em; background: var(--thread); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-input {
  margin: 0 14px 14px; border: 1px solid rgba(0, 0, 0, .1); border-radius: 12px; padding: 12px 14px;
  font-size: .82rem; color: #8c8676; background: #fff; display: flex; align-items: center; justify-content: space-between;
}
.chat-input i { width: 26px; height: 26px; border-radius: 8px; background: #29261b; opacity: .85; }

/* ---------- FAQ（details） ---------- */
.faq-list { border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: baseline;
  padding: 26px 4px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .q-no { font-family: var(--mono); font-size: .74rem; color: var(--thread); letter-spacing: .06em; }
.faq-item .q-text { font-weight: 700; font-size: clamp(1rem, .96rem + .25vw, 1.14rem); line-height: 1.6; margin: 0; }
.faq-item .q-icon { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule); position: relative; align-self: center; transition: background .25s, border-color .25s; }
.faq-item .q-icon::before, .faq-item .q-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: currentColor;
  transform: translate(-50%, -50%); transition: transform .3s var(--ease-out);
}
.faq-item .q-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .q-icon { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.faq-item[open] .q-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-item summary:hover .q-text { color: var(--thread-2); }
.faq-answer { padding: 0 52px 28px calc(4px + 2.4rem + 18px); color: var(--ink-2); max-width: 46em; }
.faq-answer p + p { margin-top: .8em; }
@media (max-width: 640px) {
  .faq-item summary { grid-template-columns: 1fr auto; gap: 12px; }
  .faq-item .q-no { grid-column: 1 / -1; margin-bottom: -10px; }
  .faq-answer { padding: 0 4px 24px; }
}

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--on-night); position: relative; overflow: hidden; }
.footer-top {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px;
  padding-top: clamp(64px, 8vw, 110px); padding-bottom: 56px;
}
.footer-lede { font-family: var(--serif); font-weight: 700; font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); line-height: 1.6; max-width: 15em; }
.footer-lede small { display: block; margin-top: 14px; font-family: var(--mono); font-weight: 400; font-size: .74rem; letter-spacing: .08em; color: var(--on-night-3); }
.footer-col h2 { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--on-night-3); font-weight: 500; margin-bottom: 16px; }
.footer-col a { display: block; padding: 5px 0; font-size: .9rem; color: var(--on-night-2); transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-word {
  font-family: var(--serif); font-weight: 800; line-height: .78; letter-spacing: -.01em;
  font-size: min(18.5vw, 15.5rem); color: transparent;
  -webkit-text-stroke: 1.2px rgba(236, 238, 243, .44);
  user-select: none; white-space: nowrap;
  display: flex; align-items: center; gap: .06em;
  padding-block: .06em .1em;
}
/* ロゴ画像は左側に余白を持っているので、切り抜かずに余白ぶんだけ左へ寄せる（右端が見切れないように） */
.footer-word img { width: auto; height: .56em; margin-left: -.28em; opacity: .95; flex-shrink: 0; }
.footer-base {
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--rule-night); padding-block: 22px; font-size: .78rem; color: var(--on-night-3);
}
.footer-note { font-size: .74rem; line-height: 1.8; color: var(--on-night-3); padding-bottom: 28px; max-width: 70em; }
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-lede { grid-column: 1 / -1; }
}

/* ---------- section helpers ---------- */
.night { background: var(--night); color: var(--on-night); }
.night .lead, .night .body { color: var(--on-night-2); }
.night .lead strong, .night .body strong { color: var(--on-night); }
.band { background: var(--paper-2); }
.section { padding-block: clamp(88px, 11vw, 168px); position: relative; }
.section-tight { padding-block: clamp(64px, 8vw, 112px); position: relative; }

.grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.night .grid-lines {
  background-image:
    linear-gradient(to right, rgba(236, 238, 243, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(236, 238, 243, .06) 1px, transparent 1px);
}
.ruled {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0 43px, var(--rule-soft) 43px 44px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 15%, #000 55%, transparent 90%);
  mask-image: linear-gradient(180deg, transparent, #000 15%, #000 55%, transparent 90%);
}

/* ==========================================================================
   手の跡 — 朱の赤ペン注釈（.ink-*）
   線は <svg class="ink"> の path を pathLength="1" で持ち、見えた時に描く。
   ========================================================================== */
.ink { overflow: visible; pointer-events: none; max-width: none; }
.ink path { fill: none; stroke: var(--shu); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.night .ink path, .on-night .ink path { stroke: var(--shu-night); }
.js .ink path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .is-in .ink path, .js .ink.is-in path { stroke-dashoffset: 0; transition: stroke-dashoffset 1s var(--ease-io) .35s; }
.js .is-in .ink path + path, .js .ink.is-in path + path { transition-delay: .9s; }

/* 語を丸で囲む */
.ink-circle { position: relative; display: inline-block; white-space: nowrap; }
.ink-circle > .ink { position: absolute; left: -12%; top: -22%; width: 124%; height: 150%; }
/* 語の下に朱の線を引く */
.ink-under { position: relative; display: inline; white-space: nowrap; }
.ink-under > .ink { position: absolute; left: -2%; bottom: -.34em; width: 104%; height: .5em; }
/* 長い一文は折り返せるように、線画ではなく朱の下線で引く */
.ink-under.wrap { white-space: normal; text-decoration: underline; text-decoration-color: var(--shu); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.ink-under.wrap > .ink { display: none; }
/* 手書きメモ（矢印つき） */
.ink-note {
  display: inline-flex; align-items: flex-start; gap: 6px;
  font-weight: 700; font-size: .86rem; line-height: 1.45; color: var(--shu); letter-spacing: .04em;
  transform: rotate(-3deg);
}
.night .ink-note, .on-night .ink-note { color: var(--shu-night); }
.ink-note .ink { width: 34px; height: 40px; flex-shrink: 0; }
.js .ink-note { opacity: 0; transition: opacity .6s var(--ease-out) .2s; }
.js .ink-note.is-in, .js .is-in .ink-note { opacity: 1; }
/* 印章（無料・済 など） */
.ink-seal {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--shu); color: var(--shu); font-family: var(--serif); font-weight: 800; font-size: 1rem; letter-spacing: .08em;
  transform: rotate(-12deg); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4.5px var(--shu-soft);
}
.js .ink-seal { opacity: 0; transform: rotate(-12deg) scale(1.5); transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.js .is-in .ink-seal, .js .ink-seal.is-in { opacity: 1; transform: rotate(-12deg) scale(1); transition-delay: .6s; }

/* ==========================================================================
   見出しのせり上がり（.lines）: .nb の塊ごとに下から現れる
   ========================================================================== */
.js .lines .nb { clip-path: inset(0 0 -.25em 0); }
.js .lines .nb > .l {
  display: inline-block; transform: translate3d(0, 105%, 0);
  transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms);
}
.js .lines.is-in .nb > .l { transform: none; }
/* 丸囲み・下線の注釈がはみ出せるように、注釈を含む塊は切り抜かない */
.js .lines .nb:has(.ink) { clip-path: none; }

/* ==========================================================================
   数字の組み: 等幅・字間を詰め・単位を小さく
   ========================================================================== */
.num { font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; font-feature-settings: "palt" 0; }
.num .u { font-size: .58em; margin-left: .12em; letter-spacing: 0; font-weight: 500; }

/* ==========================================================================
   背骨の糸（[data-spine]）: 左の余白を通る一本の糸。章の境目に結び目
   ========================================================================== */
.spine { position: absolute; top: 0; bottom: 0; left: max(18px, calc((100vw - var(--wrap)) / 2 - 22px)); width: 12px; pointer-events: none; z-index: 3; }
.spine::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.spine-fill { position: absolute; left: 4.5px; top: 0; width: 2px; height: 100%; background: var(--thread); transform-origin: top; transform: scaleY(var(--pg, 0)); border-radius: 2px; }
.spine-knot {
  position: absolute; left: 0; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--rule); transition: background .4s, border-color .4s, transform .4s var(--ease-out);
}
.spine-knot.is-past { background: var(--thread); border-color: var(--thread); transform: scale(1.15); }
@media (max-width: 1359px) { .spine { display: none; } }

/* ==========================================================================
   画面の中で起こる小さな操作（[data-loop]）と、傾き（[data-tilt]）
   ========================================================================== */
[data-tilt] { transition: transform .5s var(--ease-out); transform: perspective(1200px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); }

@media (prefers-reduced-motion: reduce) {
  .js .ink path { stroke-dashoffset: 0; }
  .js .ink-note, .js .ink-seal { opacity: 1; }
  .js .ink-seal { transform: rotate(-12deg); }
  .js .lines .nb > .l { transform: none; }
  .spine-fill { transform: scaleY(1); }
  [data-tilt] { transform: none; }
}
