/*
  15 スイス格子 — 下層ページの装飾
  読み込む順番: style.css（ヘッダー・フッター・ボタン）→ _shared/pages-base.css（配置）→ このファイル
  トップと同じく、白・黒・1 色の赤、太い黒の罫、左の 3 列に見出し・右の 9 列に中身の格子で組む。
  .pg-motion は pages.js が付ける（JS が無い・動きを抑える設定のときは付かず、すべて最初から見える）。
*/

:root {
  --pg-bg: #fff;
  --pg-fg: #000;
  --pg-muted: #4d4d4d;
  --pg-accent: #000;
  --pg-accent-fg: #fff;
  --pg-line: #000;
  --pg-card-bg: #fff;
  --pg-radius: 0px;
  --pg-max: calc(var(--max) - 2 * var(--pad));
  --pg-font-head: var(--font);
  --pg-font-body: var(--font);
}

.page { padding-inline: var(--pad); }
.page p, .page li, .page dd { line-height: 1.85; }

/* ---- ページの頭: 大きな題と太い罫 ---- */
.page .page-head {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-bottom: clamp(28px, 3.4vw, 48px);
}
.page .page-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--rule-l);
  background: var(--ink);
  transform-origin: left center;
}
.page .page-head > * { grid-column: 1 / -1; }
.page .page-title {
  position: relative;
  width: fit-content;
  max-width: 100%;
  font-size: clamp(40px, 7.4vw, 112px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  font-feature-settings: "palt";
}
.page .page-lead {
  grid-column: 1 / 9;
  max-width: none;
  margin-top: clamp(20px, 2.4vw, 32px);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.9;
}

/* ---- 区画: 上に細い罫、左 3 列に見出し、右 9 列に中身 ---- */
.page .page-section { position: relative; padding-top: clamp(20px, 2.4vw, 28px); }
.page .page-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--rule-m);
  background: var(--ink);
  transform-origin: left center;
}
/* 題の太い罫のすぐ下の区画は、細い罫を重ねない */
.page > .page-head + .page-section { padding-top: 0; }
.page > .page-head + .page-section::before { display: none; }
.page .section-title { font-size: clamp(22px, 2.2vw, 30px); font-weight: 700; line-height: 1.45; }
@media (min-width: 761px) {
  .page .page-section {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: start;
  }
  .page .page-section > * { grid-column: 4 / -1; }
  .page .page-section > .section-title { grid-column: 1 / 4; grid-row: 1 / span 40; padding-right: 8px; }
  .page .page-section > .section-title + * { margin-top: 0; }
}

/* 本文 */
.page .prose { max-width: 44em; }
.page .prose a:hover, .page .faq__answer a:hover { color: var(--red); }
.page .notice { padding: 14px 20px; border-left: 6px solid var(--red); }

/* 写真（白黒で、横長のセルに） */
.page figure.media { margin-inline: auto; }
.page figure.media img { aspect-ratio: 21 / 9; object-fit: cover; filter: grayscale(1) contrast(1.12); }

/* ---- 条件の一覧 ---- */
.page dl.terms-list { max-width: none; }
.page dl.terms-list > div {
  grid-template-columns: minmax(0, 3fr) minmax(0, 6fr);
  column-gap: var(--gutter);
  padding: 16px 0;
  border-top: 1px solid var(--ink);
}
.page dl.terms-list > div:last-child { border-bottom: var(--rule-m) solid var(--ink); }
.page dl.terms-list dt { font-weight: 700; line-height: 1.7; }

/* ---- 納品物 ---- */
.page ul.deliverables { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
.page ul.deliverables > li { padding: 12px 0; border-top: 1px solid var(--ink); font-weight: 700; }

/* ---- 3 つの確認: 太い罫の 3 列 ---- */
.page .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--gutter); }
.page .checks > .check { position: relative; gap: 10px; padding: 24px 0 8px; border-top: 0; }
.page .checks > .check::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--rule-l);
  background: var(--ink);
  transform-origin: left center;
}
.page .check__role { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.25; }
.page .check__who { font-size: 15px; font-weight: 700; }
.page .check__looks { font-size: 15px; }

/* ---- 進め方: 巨大な番号・見出し・本文の 3 列の行 ---- */
.page .steps > .step {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 4fr);
  grid-template-areas: "num title body" "num weeks ask";
  grid-template-rows: auto 1fr;
  column-gap: var(--gutter);
  row-gap: 8px;
  padding: 22px 0 28px;
  border-top: var(--rule-m) solid var(--ink);
}
.page .steps > .step:last-child { border-bottom: var(--rule-m) solid var(--ink); }
.page .steps > .step::before {
  grid-area: num;
  font-family: var(--num);
  font-size: clamp(52px, 5.6vw, 92px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.page .steps > .step > .step__title { grid-area: title; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; }
.page .steps > .step > .step__weeks { grid-area: weeks; font-size: 14px; font-weight: 700; }
.page .steps > .step > .step__body { grid-area: body; }
.page .steps > .step > .step__ask { grid-area: ask; }
.page .step__ask strong { margin-bottom: 2px; font-size: 14px; }

/* ---- よくある質問 ---- */
.page .faq { max-width: none; }
.page details.faq__item { border-top: 1px solid var(--ink); }
.page details.faq__item:last-child { border-bottom: var(--rule-m) solid var(--ink); }
.page .faq__item > summary { padding: 18px 3em 18px 0; font-size: clamp(16px, 1.4vw, 19px); font-weight: 700; line-height: 1.6; }
.page .faq__item > summary:hover { color: var(--red); }
.page .faq__item > summary::after { top: 50%; right: 0; font-family: var(--num); font-size: 30px; font-weight: 800; line-height: 1; transform: translateY(-50%); }
.page .faq__item[open] > summary::after { color: var(--red); }

/* ---- 相談フォーム（準備中で入力できない状態でも文字は 4.5:1 以上） ---- */
.page .contact-form label { font-weight: 700; font-size: 15px; }
.page .contact-form input,
.page .contact-form select,
.page .contact-form textarea { border: var(--rule-m) solid var(--ink); border-radius: 0; }
.page .contact-form :is(input, select, textarea):disabled {
  background: #f2f2f2;
  color: #333;
  -webkit-text-fill-color: #333;
  border-color: #595959;
  opacity: 1;
}
.page .contact-form ::placeholder { color: #595959; opacity: 1; }

/* ---- 締めの帯: 赤い面 ---- */
.page .cta-band {
  position: relative;
  isolation: isolate;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 20px;
  justify-items: start;
  padding: clamp(32px, 5vw, 72px);
  border: 0;
  background: var(--red);
  color: var(--paper);
}
.page .cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--red);
  transform-origin: left center;
}
.page .cta-band > * { grid-column: 1 / 10; }
.page .cta-band h2 { font-size: clamp(26px, 3.6vw, 52px); line-height: 1.35; letter-spacing: -.01em; color: var(--paper); }
.page .cta-band p { color: var(--paper); font-size: clamp(16px, 1.4vw, 19px); }
.page .cta-band .button { margin-top: 8px; background: var(--paper); color: var(--ink); border-color: var(--paper); }
.page .cta-band .button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.page .cta-band :focus-visible { outline-color: var(--paper); }

/* =========================================================
   料金のページ（pages/pricing.html）: 商品を時刻表のような行に並べる
   ========================================================= */
@media (min-width: 761px) {
  .page #plans > * { grid-column: 1 / -1; }
  .page #plans > .section-title { grid-row: auto; }
  .page #plans > .price-cards { margin-top: clamp(20px, 2.4vw, 32px); }
}
.page .price-cards { grid-template-columns: minmax(0, 1fr); gap: 0; }
.page .price-card {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 20px;
  align-items: start;
  padding: 28px 0 36px;
  background: none;
  border: 0;
}
.page .price-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--rule-m);
  background: var(--ink);
  transform-origin: left center;
}
.page .price-card.is-featured { box-shadow: none; }
.page .price-card.is-featured::before { height: var(--rule-l); background: var(--red); }
.page .price-cards > .price-card:last-child { border-bottom: var(--rule-m) solid var(--ink); }

.page .price-card__name { grid-column: 1 / 4; grid-row: 1; font-size: clamp(20px, 2vw, 28px); line-height: 1.4; }
.page .price-card__badge {
  grid-column: 1 / 4;
  grid-row: 2;
  justify-self: start;
  padding: 4px 10px;
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}
.page .price-card__price { grid-column: 4 / -1; grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; gap: 8px; }
.page .price-card__ex { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; font-size: clamp(16px, 1.5vw, 20px); font-weight: 700; line-height: 1.4; }
.page .price-card__num {
  font-family: var(--num);
  font-size: clamp(48px, 8.4vw, 132px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums lining-nums;
}
.page .price-card.is-featured .price-card__num { color: var(--red); }
.page .price-card__in { font-size: 15px; }
.page .price-card__summary { grid-column: 4 / 8; grid-row: 3; }
.page .price-card__for { grid-column: 8 / -1; grid-row: 3; }
.page .price-card__for strong { margin-bottom: 4px; font-size: 13px; }
.page .price-card__includes { grid-column: 4 / 8; grid-row: 4; margin: 0; padding: 0; list-style: none; }
.page .price-card__includes > li { padding: 8px 0; border-top: 1px solid var(--ink); }
.page .price-card__includes > li:last-child { border-bottom: 1px solid var(--ink); }
.page .price-card__terms { grid-column: 8 / -1; grid-row: 4; gap: 0; }
.page .price-card__terms > div { padding: 8px 0; border-top: 1px solid var(--ink); }
.page .price-card__terms > div:last-child { border-bottom: 1px solid var(--ink); }
.page .price-card__terms dt { font-weight: 700; }
.page .price-card__cta { grid-column: 1 / 4; grid-row: 3 / span 2; align-self: end; justify-self: start; margin-top: 0; }

/* ---- 中くらいの画面 ---- */
@media (max-width: 1000px) {
  .page .page-lead { grid-column: 1 / -1; }
  .page .checks { grid-template-columns: minmax(0, 1fr); }
  .page .steps > .step {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    grid-template-areas: "num title" "num weeks" "num body" "num ask";
    grid-template-rows: auto;
  }
  .page .price-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page .price-card__name { grid-column: 1 / -1; grid-row: 1; }
  .page .price-card__badge { grid-column: 1 / -1; grid-row: 2; }
  .page .price-card__price { grid-column: 1 / -1; grid-row: 3; }
  .page .price-card__summary { grid-column: 1; grid-row: 4; }
  .page .price-card__for { grid-column: 2; grid-row: 4; }
  .page .price-card__includes { grid-column: 1; grid-row: 5; }
  .page .price-card__terms { grid-column: 2; grid-row: 5; }
  .page .price-card__cta { grid-column: 1 / -1; grid-row: 6; align-self: start; }
}

/* ---- 狭い画面 ---- */
@media (max-width: 760px) {
  .page .section-title + * { margin-top: 18px; }
  .page figure.media img { aspect-ratio: 16 / 9; }
  .page dl.terms-list > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .page ul.deliverables { grid-template-columns: minmax(0, 1fr); }
  .page .steps > .step { grid-template-columns: 3.6rem minmax(0, 1fr); column-gap: 14px; }
  .page .steps > .step::before { font-size: 48px; }
  .page .price-card { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .page .price-card > * { grid-column: 1 / -1; grid-row: auto; }
  .page .price-card__terms > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .page .cta-band > * { grid-column: 1 / -1; }
}

/* =========================================================
   動き（pages.js が html に .pg-motion を付けたときだけ）
   ========================================================= */
/* 題の上を赤い面が横に滑る */
@keyframes sw-title-plane {
  0% { transform: scaleX(0); transform-origin: left center; }
  45% { transform: scaleX(1); transform-origin: left center; }
  46% { transform: scaleX(1); transform-origin: right center; }
  100% { transform: scaleX(0); transform-origin: right center; }
}
@keyframes sw-title-text {
  0%, 45% { color: transparent; }
  46%, 100% { color: var(--ink); }
}
.pg-motion .page-title.is-wiping { animation: sw-title-text .76s linear .12s both; }
.pg-motion .page-title.is-wiping > .sw-wipe { animation: sw-title-plane .76s cubic-bezier(.65, 0, .35, 1) .12s both; }

/* 罫が左から引かれる */
.pg-motion .page .page-head::after,
.pg-motion .page .page-section::before,
.pg-motion .page .price-card::before,
.pg-motion .page .checks > .check::before { transition: transform .9s cubic-bezier(.65, 0, .35, 1); }
.pg-motion .page .page-head:not(.is-in)::after,
.pg-motion .page .page-section:not(.is-in)::before,
.pg-motion .page .price-card:not(.is-in)::before,
.pg-motion .page .checks > .check:not(.is-in)::before { transform: scaleX(0); }
.pg-motion .page .checks > .check:nth-child(2)::before { transition-delay: .12s; }
.pg-motion .page .checks > .check:nth-child(3)::before { transition-delay: .24s; }

/* 数字が刻むように出る（文字数ぶんの段で左から） */
.pg-motion .page .price-card__num {
  clip-path: inset(-20% 100% -20% 0);
  transition: clip-path calc(var(--steps, 6) * .08s + .2s) steps(var(--steps, 6), end) .25s;
}
.pg-motion .page .price-card.is-in .price-card__num { clip-path: inset(-20% -12% -20% 0); }
.pg-motion .page .steps > .step::before { clip-path: inset(-20% 100% -20% 0); transition: clip-path .3s steps(3, end) .1s; }
.pg-motion .page .steps > .step.is-in::before { clip-path: inset(-20% -20% -20% 0); }

/* 「最初の 1 本に」の赤い面が横に滑り出る */
.pg-motion .page .price-card__badge { clip-path: inset(0 100% 0 0); transition: clip-path .5s cubic-bezier(.65, 0, .35, 1) .55s; }
.pg-motion .page .price-card.is-in .price-card__badge { clip-path: inset(0 0 0 0); }

/* 締めの帯: 赤い面が左から滑って覆い、そのあと文字が出る */
.pg-motion .page .cta-band { background: transparent; }
.pg-motion .page .cta-band::before { transition: transform .7s cubic-bezier(.65, 0, .35, 1); }
.pg-motion .page .cta-band:not(.is-in)::before { transform: scaleX(0); }
.pg-motion .page .cta-band > * { transition: opacity .45s ease .55s; }
.pg-motion .page .cta-band:not(.is-in) > * { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .pg-motion .page-title.is-wiping, .pg-motion .page-title.is-wiping > .sw-wipe { animation: none; }
}
