@media (max-width: 980px) {
  :root {
    --type-display: 44px;
    --type-section-title: 34px;
    --type-block-title: 29px;
  }
}

@media (max-width: 640px) {
  :root {
    --type-display: 37px;
    --type-section-title: 32px;
    --type-block-title: 25px;
    --type-card-title: 19px;
  }
}

/* ヒーローの2カラムは最低幅(左560+右500+gap)が約1100px必要なため、981〜1140pxで詰まる。
   iPad横(1024px)を含むこの帯から、ヒーローを1カラム＝SP表示（装飾オフ・画像を背面に薄敷き）に切り替える。
   ※この1ブロックで〜1140px全域（980px以下も含む）のヒーローを一括処理する。 */
@media (max-width: 1140px) {
  .hero {
    min-height: auto;
    background: var(--white);
  }
  .photo-arc,
  .shape {
    display: none;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    position: relative;

    & > div:first-child {
      position: relative;
      z-index: 1;
    }
  }
  .hero-visual {
    position: absolute;
    inset: 0;
    z-index: 0;
    min-height: 0;
    opacity: .18;
    pointer-events: none;
  }
  .hero-illustration {
    width: min(115vw, 560px);
    transform: none;
  }
}

@media (max-width: 980px) {
  /* スマホヘッダーは「広告主ログイン」＋「相談する」CTAの2つに絞る */
  .nav {
    gap: 10px;
  }

  /* ページ内リンク（選ばれる理由・料金プラン等）は非表示 */
  .nav > a:not(.nav-sub) {
    display: none;
  }

  /* ページ内リンクを隠すと nav-sub の左区切り線だけが浮くため除去 */
  .nav-sub {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }

  /* 資料請求ボタンは非表示（本文CTAに任せる） */
  .nav-actions .cta.ghost {
    display: none;
  }

  .intro-grid,
  .concept-flow-steps,
  .possibility-row,
  .possibility-row:nth-child(even) {
    grid-template-columns: 1fr;
  }

  /* introの「はみ出しカード」はPC幅専用。1カラム化では画像と同寸に戻す（画面端の見切れ防止） */
  .question-art::before {
    inset: 0;
  }

  .possibility-row:nth-child(odd) .possibility-copy,
  .possibility-row:nth-child(odd) .possibility-visual,
  .possibility-row:nth-child(even) .possibility-visual {
    order: initial;
  }

  /* ヒーローのSP表示（1カラム・装飾オフ・画像を背面に薄敷き）は上の ≤1140px ブロックで一括処理 */

  /* (D) concept のステップ間矢印はSPでは破綻するため非表示にし、素直に縦積み */
  .concept-flow-step:not(:last-child)::after {
    content: none;
  }

  .concept-flow-step {
    padding-bottom: 28px;
  }

  .concept-actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* (E) flow の装飾画像はSPで文字に被るため非表示（装飾用・aria-hidden） */
  .flow-deco-img {
    display: none;
  }

  .faq-row-v2 {
    grid-template-columns: 54px 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 92px 0;
  }

  .inner,
  .header-inner {
    width: min(100% - 32px, var(--max));
  }

  /* 狭い画面でヘッダーの2要素が収まるようロゴ・ボタンを詰める */
  .header-inner {
    gap: 12px;
  }

  .logo-img {
    height: 34px;
  }

  .nav {
    gap: 8px;
  }

  .nav-sub {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .nav .cta {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  .hero {
    padding-top: 118px;
  }

  .hero-inner > * {
    min-width: 0;
  }

  .hero h1 {
    font-size: 37px;
    line-height: 1.28;
    max-width: 100%;
  }

  .hero h1 .hero-big {
    font-size: 1.04em;
    letter-spacing: 0;
  }

  .hero h1 .hero-small {
    margin-left: .1em;
    font-size: .78em;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-illustration {
    width: min(118vw, 460px);
  }

  /* (C) intro：1カラム化時の余白だけ調整（イラストはPCのカード内で完結） */
  .intro-grid {
    gap: 32px;
    margin-top: 40px;
  }

  /* カードの大きさ(min-height)はPC共通。狭い画面では横の余白だけ詰めて文字が窮屈にならないように */
  .possibility-copy {
    padding: 44px 28px 36px;
  }

  .possibility-copy h3 {
    margin-bottom: 12px;
    font-size: var(--type-card-title);
    line-height: 1.55;
  }

  .hero-actions,
  .final-actions {
    width: 100%;
    flex-direction: column;
  }

  .hero-actions .cta,
  .concept-actions .cta,
  .final-actions .cta {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 980px) {
  .flow-layout {
    max-width: 680px;
    margin: 54px auto 0;
  }

  .flow-timeline-v2 {
    width: min(100%, 620px);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .pricing-v2,
  .flow-v2,
  .faq-v2,
  .final {
    padding-top: 88px;
    padding-bottom: 96px;
  }

  .flow-step-v2 {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
    min-height: 146px;
  }

  .flow-step-v2::before {
    left: 21px;
    top: 44px;
  }

  .flow-step-number {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .flow-step-body p,
  .faq-row-v2 p {
    font-size: var(--type-card-body);
  }

  .faq-v2::before,
  .faq-v2::after {
    opacity: .22;
  }

  .faq-row-v2 {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .faq-pair {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
  }

  .faq-badge {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .faq-row-v2 h3 {
    font-size: 17px;
  }
}

@media (max-width: 640px) {
  .final-actions { flex-direction: column; align-items: stretch; gap: 14px; }
  .final-actions .cta { min-width: 0; width: 100%; }
}
