/* ============================================================
   文庫判 — 公開ページ共通スタイル
   トークンはアプリの design.md §3-1 に合わせる
   （生成りの紙・墨・薄墨・罫・朱・藍）
   外部のフォントや JS は読み込まない
   ============================================================ */

:root {
  --paper: #F3EDE0;
  --surface: #FBF8F1;
  --ink: #2A2622;
  --ink-sub: #655D52;
  --rule: #D9CFBC;
  --shu: #B03A28;
  --shu-text: #A3341F;
  --on-shu: #FFFFFF;
  --ai: #2F4A6B;
  --maxw: 1040px;
  --radius: 14px;
  --mincho: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B1A17;
    --surface: #25231F;
    --ink: #E8E1D3;
    --ink-sub: #A39A8B;
    --rule: #3A3630;
    --shu: #E0735C;
    --shu-text: #E88A74;
    --on-shu: #1B1A17;
    --ai: #9DB5D6;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--gothic);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

img { max-width: 100%; }
a { color: var(--ai); }
a:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; border-radius: 4px; }

.mincho { font-family: var(--mincho); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- ナビ ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--mincho); font-weight: 600; font-size: 19px; letter-spacing: 0.08em;
  white-space: nowrap;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--rule); }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav-links a { color: var(--ink-sub); text-decoration: none; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--shu); text-underline-offset: 6px; }
@media (max-width: 520px) {
  .nav-links { gap: 12px; font-size: 13px; }
}

/* ---------- ヒーロー ---------- */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero-icon { width: 88px; height: 88px; border-radius: 20px; border: 1px solid var(--rule); display: block; margin-bottom: 20px; }
.hero h1 {
  font-family: var(--mincho); font-weight: 600;
  font-size: clamp(28px, 5.4vw, 48px); line-height: 1.45; letter-spacing: 0.04em;
}
.hero .lead { margin-top: 18px; color: var(--ink-sub); font-size: clamp(15px, 2vw, 17px); }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 28px; }
.badge-soon {
  display: inline-flex; flex-direction: column; line-height: 1.3;
  background: var(--shu); color: var(--on-shu);
  padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 15px;
}
.badge-soon small { font-size: 12px; font-weight: 500; }
.hero-note { font-size: 13px; color: var(--ink-sub); }

/* 版面の見本（縦書き） */
.hanmen {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(42, 38, 34, 0.12);
  padding: 44px 24px 40px;
  max-width: 340px; width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
.hanmen-body {
  writing-mode: vertical-rl;
  -webkit-writing-mode: vertical-rl;
  font-family: var(--mincho);
  font-size: 17px;
  line-height: 2.05;
  height: 18em;            /* 1列18字 */
  width: 16.4em;           /* 8列ちょうど（2.05em × 8）。はみ出した列は列の境目で切れる */
  max-width: 100%;
  margin-left: auto;
  overflow: hidden;
  color: var(--ink);
  text-align: justify;
}
.hanmen-body p { text-indent: 1em; }
.hanmen-body rt { font-size: 0.5em; }
.hanmen-body .bouten { -webkit-text-emphasis: sesame; text-emphasis: sesame; }
.hanmen .hashira, .hanmen .nombre {
  position: absolute; font-family: var(--mincho); font-size: 11px; color: var(--ink-sub);
}
.hanmen .hashira { top: 14px; left: 24px; letter-spacing: 0.1em; }
.hanmen .nombre { bottom: 12px; left: 24px; }
.hanmen-caption { margin-top: 12px; text-align: center; font-size: 13px; color: var(--ink-sub); }

@media (max-width: 820px) {
  .hero { padding: 40px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-icon { width: 72px; height: 72px; border-radius: 16px; }
}
@media (max-width: 380px) {
  .hanmen { padding: 40px 18px 36px; }
  .hanmen-body { font-size: 15px; }
  .hanmen .hashira, .hanmen .nombre { left: 18px; }
}

/* ---------- セクション ---------- */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-label {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--shu-text); margin-bottom: 8px;
}
.section h2 {
  font-family: var(--mincho); font-weight: 600;
  font-size: clamp(22px, 3.8vw, 32px); line-height: 1.5; letter-spacing: 0.03em;
}
.section p.desc { margin-top: 12px; color: var(--ink-sub); font-size: clamp(15px, 2vw, 16px); max-width: 44em; }

.features { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.features li {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px 20px 18px;
}
.features h3 { font-family: var(--mincho); font-weight: 600; font-size: 19px; line-height: 1.5; margin-bottom: 6px; }
.features p { font-size: 15px; color: var(--ink-sub); }
@media (max-width: 680px) { .features { grid-template-columns: 1fr; } }

/* 同梱の9作 */
.works { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.works li {
  font-family: var(--mincho); font-size: 15px;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 999px; padding: 4px 14px;
}
.works li small { color: var(--ink-sub); font-size: 12px; margin-left: 6px; }

/* Plus */
.plus-box {
  margin-top: 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 24px 20px;
}
.plus-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 6px;
  background: var(--shu); color: var(--on-shu);
  font-family: var(--mincho); font-weight: 600; font-size: 13px; line-height: 1.1;
  writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl;
  flex: none;
}
.plus-head b { font-family: var(--mincho); font-size: 20px; font-weight: 600; }
.plus-head .price { font-size: 15px; color: var(--ink-sub); }
.plus-list { list-style: none; margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plus-list li { border-top: 2px solid var(--shu); padding-top: 10px; }
.plus-list b { display: block; font-size: 16px; }
.plus-list span { font-size: 14px; color: var(--ink-sub); }
@media (max-width: 680px) { .plus-list { grid-template-columns: 1fr; } }
.note { margin-top: 16px; font-size: 13px; color: var(--ink-sub); }

/* 表（無料と Plus） */
.table-wrap { margin-top: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 300px; }
.compare th, .compare td { border-bottom: 1px solid var(--rule); padding: 10px 8px; text-align: left; vertical-align: top; }
.compare thead th { font-size: 13px; color: var(--ink-sub); font-weight: 600; }
.compare td.c, .compare th.c { text-align: center; width: 5.5em; }

/* 端末の中だけ */
.privacy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.pcard { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 14px; }
.pcard b { display: block; font-size: 15px; }
.pcard span { font-size: 13px; color: var(--ink-sub); }
@media (max-width: 760px) { .privacy-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .privacy-grid { grid-template-columns: 1fr; } }

/* 出典（奥付ふう） */
.colophon {
  margin-top: 24px; font-family: var(--mincho); font-size: 15px; line-height: 2;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 16px 0;
}
.colophon p + p { margin-top: 8px; }

/* ---------- 文書ページ ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 40px 16px 80px; }
.doc h1 {
  font-family: var(--mincho); font-weight: 600;
  font-size: clamp(26px, 5vw, 36px); letter-spacing: 0.04em; margin-bottom: 4px;
}
.doc .updated { color: var(--ink-sub); font-size: 14px; margin-bottom: 28px; }
.doc h2 {
  font-family: var(--mincho); font-weight: 600;
  font-size: 20px; margin: 40px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
.doc h3 { font-size: 17px; font-weight: 700; margin: 28px 0 6px; }
.doc h3::before { content: "問"; color: var(--shu-text); font-family: var(--mincho); margin-right: 8px; }
.doc.plain h3::before { content: none; }
.doc p, .doc li { font-size: 16px; line-height: 1.9; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { padding-left: 1.5em; margin: 10px 0; }
.doc li { margin: 4px 0; }
.doc .callout {
  background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--shu);
  border-radius: 10px; padding: 14px 18px; margin: 20px 0;
}
.doc .path { font-weight: 600; }
.back-home { display: inline-block; color: var(--ink-sub); font-size: 14px; text-decoration: none; margin-bottom: 20px; }
.back-home:hover { color: var(--ink); }
.mail { font-weight: 700; }

/* ---------- フッター ---------- */
.footer { border-top: 1px solid var(--rule); background: var(--surface); padding: 36px 0 40px; font-size: 14px; color: var(--ink-sub); }
.footer-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.footer .brand { font-size: 16px; }
.footer .brand img { width: 26px; height: 26px; }
.footer-links { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-sub); }
.footer-links a:hover { color: var(--ink); }
.credit { margin-top: 20px; font-size: 13px; line-height: 1.9; }
.credit p + p { margin-top: 6px; }
.copyright { margin-top: 16px; font-size: 13px; }
