/* ==========================================================
   トップページ専用(/index.html)
   モバイル(959px以下)= LP型の一本道 / PC(960px以上)= 資料型
   ========================================================== */

.top-section { padding-block: var(--section-y); }
.sec-head { display: grid; gap: 16px; margin-bottom: 40px; max-width: var(--measure); }
@media (min-width: 960px) { .sec-head--center { margin-inline: auto; text-align: center; } }
.sec-lead { color: var(--text-muted); }
@media (min-width: 960px) {
  .sec-head { margin-bottom: 56px; gap: 20px; }
}

/* 4列のそろえ(② 共感 と ③ 診察サイクル で位置を合わせる) */
@media (min-width: 960px) {
  .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

/* ---------- ① ヒーロー ---------- */

.hero { overflow: hidden; }
.hero__inner {
  display: grid;
  gap: 28px;
  padding-top: 48px;
}
.hero__text { display: grid; gap: 24px; justify-items: start; }
.hero__brand { display: flex; align-items: center; gap: 16px; }
.hero__brand .app-icon { --icon-size: 52px; }
.hero__brand .wordmark { --wm-size: 26px; }
.hero__sub { color: var(--text-muted); max-width: 34em; }
/* モバイル:手前の1枚(Bridge Session)だけ。見出し・テーマ・伝えたいことメモの上2件までがはっきり見える高さで切る */
.hero__shot { --crop-h: 440px; position: relative; margin-top: 8px; }
.hero__shot .shot { --shot-w: 250px; }
.hero__stack { position: relative; }
.hero__shot::before {
  /* スクショの背後にだけ、ごく弱い光 */
  content: "";
  position: absolute;
  inset: 10% 5% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(129, 140, 248, .22), rgba(129, 140, 248, 0));
  pointer-events: none;
}
.hero__shot .shot { position: relative; }

@media (min-width: 960px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    align-items: center;
    gap: 48px;
    padding-block: 88px 112px;
    min-height: min(820px, calc(100vh - var(--header-h)));
  }
  .hero__text { gap: 28px; }
  .hero__brand .app-icon { --icon-size: 64px; }
  .hero__brand .wordmark { --wm-size: 32px; }
  .hero h1 { font-size: clamp(34px, 2.2vw + 14px, 46px); }
  .hero__shot { --crop-h: auto; height: auto; -webkit-mask-image: none; mask-image: none; margin: 0; overflow: visible; }

  /* PC:スマホ枠を3枚重ねる(手前 Bridge Session / 後ろ左 ホーム / 後ろ右 見せるモード)。
     重ねた全体の幅は手前の約1.44倍。右列の幅(960pxで約333px、1200px以上で429px)に収まるよう手前の幅を決める */
  .hero__stack { --hero-w: min(300px, calc(27.5vw - 36px)); width: var(--hero-w); }
  .hero__stack .hero__front { --shot-w: var(--hero-w); position: relative; z-index: 1; }
  .hero__stack .hero__front.shot--device {
    /* ロゴの階段と同じインディゴの淡い発光 */
    box-shadow:
      0 0 0 1px rgba(129, 140, 248, .18),
      0 0 56px 6px rgba(129, 140, 248, .20),
      0 28px 60px rgba(0, 0, 0, .45);
  }
  .hero__stack .hero__back {
    --shot-w: calc(var(--hero-w) * .82);
    position: absolute;
    top: 9%;
    filter: brightness(.58) saturate(.9);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .45);
  }
  .hero__stack .hero__back--left { left: calc(var(--hero-w) * -.22); transform: rotate(-3deg); transform-origin: right center; }
  .hero__stack .hero__back--right { right: calc(var(--hero-w) * -.22); transform: rotate(3deg); transform-origin: left center; }
}

/* ---------- ② 共感 ---------- */

.empathy__list { display: grid; gap: 12px; position: relative; }
.empathy__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 18px 16px;
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.empathy__item p { padding-top: 6px; }
.empathy__close {
  margin-top: 40px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
  text-wrap: balance;
}
.empathy__close em { font-style: normal; color: var(--ps-accent); }

@media (min-width: 960px) {
  .empathy__list { gap: 20px; }
  .empathy__item { flex-direction: column; gap: 16px; padding: 24px; }
  .empathy__item p { padding-top: 0; }
  .empathy__close { margin-top: 56px; font-size: 22px; text-align: center; }
}

/* ---------- ③ 診察サイクル ---------- */

.cycle {
  background: linear-gradient(to bottom, rgba(129, 140, 248, 0), rgba(129, 140, 248, .045) 30%, rgba(129, 140, 248, .045) 70%, rgba(129, 140, 248, 0));
}
.cycle__diagram { margin: 0 auto 48px; }
.cycle__diagram svg { width: 100%; height: auto; overflow: visible; }
.cycle__diagram--sp { max-width: 280px; }
.cycle__diagram--pc { max-width: 640px; margin-bottom: 64px; }

.cyc-arc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .8; }
.cyc-arc--back { stroke: var(--ps-accent); stroke-width: 3.2; opacity: 1; }
.cyc-glow { filter: drop-shadow(0 0 4px rgba(129, 140, 248, .55)); }
.cyc-glow--back { filter: drop-shadow(0 0 8px rgba(165, 180, 252, .9)); }
.cyc-node { fill: var(--surface); stroke: var(--accent); stroke-width: calc(var(--branch-fs, 12px) * .125); }
.cyc-num { fill: var(--accent); font-size: 22px; font-weight: 700; font-family: var(--font); }
.cyc-time { fill: var(--text-muted); font-size: 13px; font-weight: 500; font-family: var(--font); }
.cyc-name { fill: var(--text); font-size: 16px; font-weight: 700; font-family: var(--font); }

.steps { display: grid; gap: 0; }
.step {
  position: relative;
  display: grid;
  gap: 14px;
  align-content: start;
}
.step__head { display: flex; align-items: center; gap: 12px; }
.step__time { color: var(--text-muted); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.step__name { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 1.45; }
.step__name .ficon { --ficon-size: 22px; }
.step__body { color: var(--text-muted); }
.step .shot-crop { --crop-h: 380px; margin-top: 6px; }
.step .shot { --shot-w: 230px; }

/* モバイル:縦の一本道。カードの間に下向きの線 */
.step + .step { margin-top: 44px; }
.step + .step::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -36px;
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(129, 140, 248, 0), var(--accent));
}

/* ⑤ から ① へ戻る */
.cycle-return {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  color: var(--ps-accent);
}
.cycle-return svg { width: 36px; height: 36px; filter: drop-shadow(0 0 6px rgba(165, 180, 252, .7)); }
.cycle-return .cnum { border-color: var(--ps-accent); color: var(--ps-accent); box-shadow: 0 0 10px rgba(165, 180, 252, .35); }

@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .step + .step { margin-top: 0; }
  .step + .step::before { content: none; }
  .step:not(.step--next) { display: flex; flex-direction: column; gap: 14px; }
  .step .shot-crop { --crop-h: 340px; margin-top: auto; padding-top: 8px; }
  .step .shot { --shot-w: 100%; }
  .step .shot__img { border-radius: 20px; }
  .step__name { font-size: 18px; }
  /* ①→②→③→④ の間に小さな矢印 */
  .step:not(.step--next):not(:nth-child(4))::after {
    content: "";
    position: absolute;
    top: 44px;
    right: -16px;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    transform: rotate(45deg);
    opacity: .8;
  }
  .step--next {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 200px;
    column-gap: 48px;
    align-items: center;
  }
  .step--next .shot-crop { --crop-h: 300px; margin: 0; padding: 0; align-self: end; }
  .step--next .shot .shot__img { border-radius: 20px; }
  .step--next .cycle-return { justify-content: flex-start; margin-top: 8px; }
}
/* モバイル:⑤のカードの最後(スクショの後)に「①へ戻る」矢印 */
@media (max-width: 959px) {
  .step--next .step__text { display: contents; }
  .step--next .cycle-return { order: 10; margin-top: 8px; }
}
@media (min-width: 960px) {
  .step--next .step__text { display: grid; gap: 14px; }
}

/* ---------- ④ 日々の記録 ---------- */

.daily__grid { display: grid; gap: 16px; }
.fcard { display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.fcard__head { display: flex; align-items: center; gap: 14px; }
.fcard__head .eyebrow { margin-bottom: 2px; }
.fcard .shot-crop { --crop-h: 340px; margin: auto -4px 0; padding-top: 8px; }
.fcard .shot { --shot-w: 210px; }

/* ストレス記録 → 3つの対処法 */
.branch { display: flex; align-items: center; justify-content: center; gap: 0; margin-top: 4px; font-size: var(--branch-fs, 12px); font-weight: 700; line-height: 1.3; }
.branch__root, .branch__leaf {
  display: inline-flex;
  align-items: center;
  padding: .5em .8333em;
  border-radius: .6667em;
  white-space: nowrap;
}
.branch__root { background: var(--accent-soft); border: .0833em solid var(--accent); color: var(--accent); }
.branch__lines { width: 3em; height: 9em; flex: none; }
.branch__lines path { fill: none; stroke: var(--accent); stroke-width: calc(var(--branch-fs, 12px) * .125); opacity: .7; vector-effect: non-scaling-stroke; }
.branch__leaves { display: grid; grid-template-rows: repeat(3, 3em); align-items: center; }
.branch__leaf { background: var(--surface); border: .0833em solid var(--border); color: var(--text); justify-self: start; }

.daily__more { margin-top: 32px; color: var(--text-muted); font-size: var(--fs-small); }
.daily__more .link-arrow { margin-left: 4px; font-size: var(--fs-small); }

@media (min-width: 960px) {
  .daily__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .fcard .shot { --shot-w: 200px; }
  .fcard .shot-crop { --crop-h: 330px; }
  /* 上段:アイコン・見出し・本文を横いっぱい / 下段:左に分岐図、右にスマホ(隣のチェックインと同じ大きさ・同じ位置で消える) */
  .fcard--wide {
    display: grid;
    grid-column: span 2;
    grid-template-columns: minmax(0, 1fr) var(--shot-col, 200px);
    grid-template-rows: auto auto 1fr;
    column-gap: 28px;
    row-gap: 16px;
    container-type: inline-size;
  }
  .fcard--wide .fcard__text { display: contents; }
  .fcard--wide .fcard__head, .fcard--wide .card__text { grid-column: 1 / -1; }
  .fcard--wide .branch { grid-column: 1; grid-row: 3; align-self: center; justify-self: center; margin: 0 -28px 0 0; --branch-fs: clamp(14px, 2.6cqw, 25px); }
  .fcard--wide .shot-crop { grid-column: 2; grid-row: 3; margin: 0; align-self: end; }
  .daily__more { text-align: center; margin-top: 40px; }
}
.fcard__text { display: grid; gap: 16px; align-content: start; }

/* ---------- ⑤ もしもの備え ---------- */

.prep__inner { display: grid; gap: 32px; }
.prep__text { display: grid; gap: 24px; max-width: var(--measure); }
.prep__text p { color: var(--text-muted); }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.phase {
  --sc: var(--safe);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--sc);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--sc) 9%, var(--surface));
  color: var(--sc);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.phase--safe { --sc: var(--safe); }
.phase--caution { --sc: var(--caution); }
.phase--crisis { --sc: var(--crisis); }
.prep__shot { --crop-h: 400px; }
.prep__shot .shot { --shot-w: 240px; }

@media (min-width: 960px) {
  .prep__inner { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: center; }
  .phases { max-width: 480px; }
  .prep__shot { --crop-h: auto; height: auto; -webkit-mask-image: none; mask-image: none; }
  .prep__shot .shot { --shot-w: 260px; }
}

/* ---------- ⑥ 安心の根拠 ---------- */

.trust__points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trust__point {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px 16px;
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.trust__point h3 { font-size: 16px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.trust__point p { color: var(--text-muted); font-size: 14px; line-height: 1.75; }
.trust__point .ficon--soft { width: 40px; height: 40px; }
.trust__note { margin-top: 24px; }
.trust__note p { color: var(--text); }
.trust__medical { margin-top: 24px; color: var(--text-muted); max-width: var(--measure); }

@media (min-width: 960px) {
  .trust__points { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .trust__point { padding: 24px; gap: 12px; }
  .trust__point h3 { font-size: 18px; }
  .trust__point p { font-size: 15px; }
  .trust__note { margin-top: 32px; }
  .trust__note p { max-width: 52em; }
}

/* ---------- ⑦ 作った人 ---------- */

.creator-sp { display: grid; gap: 20px; }
.creator-sp__quote { font-size: 22px; line-height: 1.55; }
.creator-sp p { color: var(--text-muted); }


/* ---------- ⑧ よくある質問 ---------- */

.faq-section .sec-head { margin-bottom: 32px; }

/* ---------- タブレット〜小さめのPC(960〜1199px):4列・3列が窮屈にならないよう詰める ---------- */
@media (min-width: 960px) {
  .step__body { font-size: 15px; line-height: 1.85; }
}
@media (min-width: 960px) and (max-width: 1199px) {
  .grid4, .steps { gap: 14px; }
  .empathy__item, .step.card, .fcard.card, .trust__point { padding: 20px; }
  .step__name { font-size: 16px; }
  .step:not(.step--next):not(:nth-child(4))::after { right: -12px; width: 9px; height: 9px; }
  .step .shot-crop { --crop-h: 280px; }
  .fcard--wide { --shot-col: 180px; }
  .fcard .shot { --shot-w: 180px; }
}

/* ⑦ 作った人:Threads(作者個人の発信)への導線 */
.creator-sp .creator__threads { margin-top: 4px; padding-top: 20px; border-top: 1px solid var(--border); }

/* 320px 前後の極小幅:見出しが文節の途中で折れないよう少し小さくする */
@media (max-width: 359px) {
  .t-hero { font-size: 26px; }
  .trust__point h3 { font-size: 15px; }
}
