/*
  全サイト共通のスタイル。紙の印刷物のような組版にする：
  生成りの紙・墨の文字・細い罫線。差し色（--accent、site.theme.accent）は要所だけに使う。
  色や書体はサイト専用の CSS（site.stylesheet）で :root の変数を上書きすれば変えられる。
*/

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f0e6;
  --paper-2: #ebe5d6;
  --sheet: #fbf9f3;
  --ink: #1d1c19;
  --ink-2: #514d45;
  --ink-3: #857f71;
  --rule: #d5cbb8;
  --rule-strong: #1d1c19;
  --danger: #b3261e;
  /* 日本語の字は、和文の書体に落ちるよう明示する（lang="ja" と組み合わせる） */
  --serif: "Newsreader", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", Georgia, serif;
  --sans: "IBM Plex Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 36em;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161511;
    --paper-2: #201e19;
    --sheet: #1c1a16;
    --ink: #ebe5d7;
    --ink-2: #b3ab9b;
    --ink-3: #7f7869;
    --rule: #39352d;
    --rule-strong: #ebe5d7;
    --danger: #ff8a7a;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-weight: 500;
}

h1,
h2 {
  font-family: var(--serif);
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  font-variation-settings: "opsz" 72;
}

h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  line-height: 1.12;
  font-variation-settings: "opsz" 48;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 720px;
}

.lead,
.hero-lead,
.source,
.note,
.caption,
.help,
.hero-note,
.muted,
.fig-caption {
  color: var(--ink-2);
}

.preview-bar {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 4px 16px;
  background: var(--ink);
  color: var(--paper);
}

/* ヘッダー・フッター */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
}

.site-nav a:not(.button) {
  color: var(--ink-2);
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  color: var(--ink);
}

.site-nav .button {
  padding: 9px 14px;
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--rule-strong);
  padding: 40px 0 56px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.colophon {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 16px;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
}

/* ボタンとリンク */

.button {
  display: inline-block;
  font: 500 1rem/1 var(--sans);
  padding: 15px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.text-link {
  font-weight: 500;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.text-link::after {
  content: " →";
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin: 32px 0 16px;
}

/* ファーストビュー */

.section-hero {
  padding: 72px 0 96px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 20px;
}

.hero-lead {
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: 34em;
}

.hero-note {
  font-size: 0.92rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 64px;
  align-items: center;
}

.hero-grid h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
}

/* セクション：左に見出し、右に本文 */

.section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 64px;
}

.section-head {
  position: sticky;
  top: 96px;
  align-self: start;
}

.section-head .lead {
  font-size: 1rem;
}

.section-body > :first-child {
  margin-top: 0;
}

/* 数字の表 */

.figures {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--rule-strong);
}

.figures th,
.figures td {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.figures th {
  text-align: left;
  font-weight: 400;
}

.figures .num {
  width: 1%;
  padding-right: 32px;
  text-align: left;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.source {
  font-size: 0.85rem;
  margin-top: 16px;
}

/* 項目の一覧（cards） */

.entries {
  border-top: 1px solid var(--rule-strong);
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 15em) minmax(0, 1fr);
  gap: 8px 32px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.entry h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
}

.entry p {
  margin: 0;
  color: var(--ink-2);
}

/* 手順 */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule-strong);
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step);
  font-family: var(--serif);
  font-style: italic;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent-text);
}

.steps h3 {
  margin-bottom: 4px;
}

.steps p {
  margin: 0;
  color: var(--ink-2);
}

/* 文章・脚注 */

.prose {
  max-width: var(--measure);
}

.prose p {
  font-size: 1.05rem;
}

.prose sup a,
.footnote-ref {
  font-family: var(--mono);
  font-size: 0.72em;
  color: var(--accent-text);
  text-decoration: none;
  margin-left: 1px;
}

.footnotes {
  margin: 32px 0 0;
  padding: 16px 0 0 1.4em;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-2);
}

.footnotes li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

/* コード */

.code {
  margin: 0;
  padding: 18px 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  counter-reset: line;
}

.code .line {
  display: block;
  padding: 0 20px 0 0;
  white-space: pre;
}

.code .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 3em;
  padding-right: 1.2em;
  text-align: right;
  color: var(--ink-3);
  user-select: none;
}

.code .hl {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.caption {
  font-size: 0.9rem;
  margin-top: 12px;
}

/* 図 */

.figure {
  margin: 0;
}

.fig-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.fig-caption {
  font-size: 0.88rem;
  margin: 14px 0 0;
}

/* 料金 */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 28px 32px 32px 0;
}

.plan + .plan {
  padding: 28px 0 32px 32px;
  border-left: 1px solid var(--rule);
}

.plan-highlight {
  box-shadow: inset 0 3px 0 var(--accent);
}

.plan h3 {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.price {
  margin: 4px 0 8px;
}

.amount {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
}

.period {
  color: var(--ink-3);
}

.plan-description {
  color: var(--ink-2);
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex: 1;
}

.plan li {
  position: relative;
  padding-left: 1.3em;
  margin-bottom: 6px;
}

.plan li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

.plan .button {
  align-self: flex-start;
}

.note {
  font-size: 0.9rem;
  margin-top: 16px;
}

/* よくある質問 */

.faq {
  border-top: 1px solid var(--rule-strong);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 20px 2.5rem 20px 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.35;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 20px;
  font-family: var(--mono);
  color: var(--ink-3);
}

.faq details[open] summary::after {
  content: "−";
}

.faq .answer {
  max-width: var(--measure);
  padding-bottom: 20px;
  color: var(--ink-2);
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* フォーム */

.lp-form {
  display: grid;
  gap: 22px;
  max-width: 560px;
  padding-top: 28px;
  border-top: 1px solid var(--rule-strong);
}

.field label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.req,
.opt {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  margin-left: 8px;
}

.req {
  color: var(--accent-text);
}

.opt {
  color: var(--ink-3);
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 12px;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--ink-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--ink);
}

.field-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.field-checkbox input {
  margin-top: 5px;
  accent-color: var(--accent);
}

.field-checkbox label {
  font-weight: 400;
  margin: 0;
}

.help {
  font-size: 0.88rem;
  margin: 6px 0 0;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lp-form .button {
  justify-self: start;
}

.errors {
  color: var(--danger);
}

/* 完了ページ・ポリシーなど（1段組み） */

main > .section:first-child {
  border-top: 0;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 1.8em;
}

@media (max-width: 960px) {
  .hero-grid,
  .section-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .section-head {
    position: static;
  }

  .site-nav a:not(.button) {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .section-hero {
    padding: 40px 0 64px;
  }

  .section {
    padding: 56px 0;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan,
  .plan + .plan {
    padding: 24px 0 28px;
    border-left: 0;
  }

  .plan + .plan {
    border-top: 1px solid var(--rule);
  }

  .figures .num {
    font-size: 1.5rem;
    padding-right: 18px;
  }
}

/* 会社ごとのレポート（/r/<id>） */
.section-report h2 {
  font-size: 1.35rem;
  margin-top: 1.8em;
}

.table-scroll {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-table th,
.report-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.report-table th {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.report-voices {
  padding-left: 1.2em;
}

.report-voices li {
  margin-bottom: 10px;
}

.voice-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}

.report-cta {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--rule-strong);
}

/* 完了ページ・エラーページは見出しを控えめに */
.container.narrow h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.container.narrow .prose {
  margin-bottom: 24px;
}
