/* Fu-Sen ホームページ。仕様: docs/homepage/公開ページ仕様書.md
   CSPでdata: URL・インラインstyleが使えないため、画像はSVGスプライトの<use>か/assets配下だけを参照する。 */

/* 共通の配色・文字・余白・ヘッダー・フッター・ボタンは site-shell.css が正本。ここはホームページ固有の値だけを置く。 */
:root {
  --fs-hero: clamp(2.125rem, 1.35rem + 3.6vw, 3.75rem);
  --fs-h2: clamp(1.625rem, 1.2rem + 1.8vw, 2.5rem);
  --fs-h3: 1.1875rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --section-space: clamp(4.5rem, 3rem + 7vw, 8.5rem);
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: inherit; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.br-wide { display: none; }
@media (min-width: 768px) {
  .br-wide { display: inline; }
}

/* ---------- 共通コンポーネント（ホームページ内） ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid #e9d690;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.4;
}
.status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.3);
}
.status--small { font-size: var(--fs-tiny); padding: 0.15rem 0.65rem; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s) var(--space-m);
}
.cta-row--center { justify-content: center; }

.eyebrow {
  margin-bottom: var(--space-s);
  color: var(--color-accent-ink);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.section { padding-block: var(--section-space); }

.section-head { max-width: 40rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }

.section-title {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.01em;
  word-break: auto-phrase;
  text-wrap: balance;
}

.section-lead {
  margin-top: var(--space-m);
  color: var(--color-muted);
  font-size: var(--fs-lead);
  line-height: 1.9;
}

.text-link {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration-color: var(--color-accent-hover); background: var(--color-accent-soft); }

.pill {
  display: inline-block;
  margin-top: var(--space-s);
  padding: 0.15rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-cream);
  color: var(--color-muted);
  font-size: var(--fs-tiny);
  font-weight: 600;
}

.mini-badge {
  display: inline-block;
  width: 0.62em;
  height: 0.93em;
  margin: 0 0.1em;
  vertical-align: super;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

mark {
  background: var(--color-highlight);
  color: inherit;
  border-radius: 2px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 2rem + 6vw, 7rem) clamp(4rem, 3rem + 6vw, 8rem);
  background:
    radial-gradient(60rem 30rem at 85% 20%, rgba(242, 201, 76, 0.18), transparent 60%),
    linear-gradient(var(--color-bg), var(--color-bg));
}

.hero__inner {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 960px) {
  .hero__inner { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}

.hero__title {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.hero__line { display: inline-block; }
.hero__title em {
  font-style: normal;
  background: linear-gradient(transparent 62%, rgba(242, 201, 76, 0.75) 62%, rgba(242, 201, 76, 0.75) 92%, transparent 92%);
}

.hero__lead {
  max-width: 34rem;
  margin-top: var(--space-l);
  color: #4a4640;
  font-size: var(--fs-lead);
  line-height: 1.95;
}

.hero .cta-row { margin-top: var(--space-l); }

.hero__note {
  margin-top: var(--space-m);
  color: var(--color-muted);
  font-size: var(--fs-small);
}

.hero__visual {
  position: relative;
  width: min(100%, 30rem);
  aspect-ratio: 1 / 0.9;
  /* 長い解説を全文のまま載せるため、文字を縮小せず下余白で解説の分の高さを先に確保する */
  --hero-chip-offset: clamp(4rem, calc(20rem - 50vw), 8rem);
  margin-bottom: var(--hero-chip-offset);
  margin-inline: auto;
}

.hero__halo {
  position: absolute;
  inset: 4% 6% 10% 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #fff6d6, rgba(253, 243, 207, 0.4) 60%, transparent 72%);
}

.hero__balloon-button {
  position: absolute;
  top: 0;
  right: 4%;
  width: 38%;
  aspect-ratio: 618 / 936;
  padding: 0;
  border: 0;
  border-radius: 46% 46% 40% 40%;
  background: none;
  color: inherit;
  font: inherit;
  transform: rotate(8deg);
}
.hero__balloon-button:enabled { cursor: pointer; }
.hero__balloon-button:focus-visible { outline: 3px solid var(--color-text); outline-offset: 6px; }

.hero__balloon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 22px rgba(138, 106, 0, 0.18));
}

/* SVGは1024四方の右上隅にだけ描画があるため、画像の箱ごとずらして描画部分を風船の右肩に重ねる。
   object-view-boxで切り抜かないのは、対応ブラウザが限られるため。 */
.hero__exclamation {
  position: absolute;
  top: 0;
  left: -19%;
  width: 119%;
  max-width: none;
  height: auto;
  margin-top: -2%;
  opacity: 0;
  pointer-events: none;
  transform-origin: 78% 22%;
}
[data-interactive] .hero__balloon-button:focus-visible .hero__exclamation { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  [data-interactive] .hero__balloon-button:hover .hero__exclamation { opacity: 1; }
}

.hero__paper {
  position: absolute;
  left: 0;
  bottom: 12%;
  width: 72%;
  padding: 1.5rem 1.4rem;
  display: grid;
  gap: 0.7rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-float);
  transform: rotate(-2deg);
  /* 重なりの見た目を変えずに、紙の下にある風船の端まで押せるようにする */
  pointer-events: none;
}
.hero__paper-line {
  height: 0.5rem;
  border-radius: 4px;
  background: #efe9dc;
}
.hero__paper-line--short { width: 45%; height: 0.7rem; background: #e6dfcf; }
.hero__paper-line--mid { width: 70%; }
.hero__paper-text {
  font-size: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  line-height: 1.9;
  color: #4a4640;
}

.hero__chip {
  position: absolute;
  right: 0;
  bottom: calc(-1 * var(--hero-chip-offset));
  width: 62%;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.35rem;
  background: #fffdf7;
  border: 1px solid #e0d9c8;
  border-radius: 12px;
  box-shadow: var(--shadow-float);
}
/* gridのdisplay指定がhidden属性に勝たないようにする */
.hero__chip[hidden] { display: none; }
.hero__chip-tag {
  justify-self: start;
  padding: 1px 7px;
  border-radius: 4px;
  background: #f0e3b8;
  color: #8a6d1a;
  font-size: 0.6875rem;
  font-weight: 700;
}
.hero__chip-text { font-size: var(--fs-small); font-weight: 600; line-height: 1.6; }

@media (prefers-reduced-motion: no-preference) {
  .hero__balloon-button { animation: fs-rise 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both; }
  .hero__paper { animation: fs-fade-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .hero__exclamation { transition: opacity 0.15s ease-out; }
  /* 表示中だけanimationを当てるので、ホバー・フォーカスに入り直すたびに最初から再生される */
  [data-interactive] .hero__balloon-button:focus-visible .hero__exclamation {
    animation: fs-hero-pop 0.35s cubic-bezier(0.3, 0.7, 0.4, 1) both;
  }
  @media (hover: hover) and (pointer: fine) {
    [data-interactive] .hero__balloon-button:hover .hero__exclamation {
      animation: fs-hero-pop 0.35s cubic-bezier(0.3, 0.7, 0.4, 1) both;
    }
  }
  [data-interactive] .hero__chip:not([hidden]) { animation: fs-hero-chip-in 0.2s ease-out both; }
}

/* fs-riseのtransformと競合しないよう、scale・translateの個別プロパティで動かす */
@keyframes fs-hero-pop {
  0% { opacity: 0; scale: 0.4; }
  60% { opacity: 1; scale: 1.12; }
  100% { opacity: 1; scale: 1; }
}
@keyframes fs-hero-chip-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes fs-rise {
  from { opacity: 0; transform: translateY(40px) rotate(2deg); }
  to { opacity: 1; transform: translateY(0) rotate(8deg); }
}
@keyframes fs-fade-up {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}

/* ---------- 利用例（デモ） ---------- */

.section--demo {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

/* 作者スタイルのdisplay指定がhidden属性に勝たないよう、デモ内では明示する */
.demo [hidden] { display: none !important; }

.demo {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.demo__tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xs);
}
.demo__tab {
  position: relative;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.5rem 0.7rem;
  overflow: hidden;
  border: 2px solid var(--color-line);
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: var(--color-muted);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.4;
  text-wrap: balance;
  cursor: pointer;
}
.demo__tab:hover { border-color: var(--color-accent); color: var(--color-text); }
.demo__tab[aria-selected="true"] {
  border-color: var(--color-text);
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: inset 0 -3px 0 var(--color-text);
}
.demo__tab:focus-visible { outline: 3px solid var(--color-text); outline-offset: 3px; }
.demo__tab-label--long { display: none; }
@media (min-width: 768px) {
  .demo__tab-label--short { display: none; }
  .demo__tab-label--long { display: inline; }
}

/* 進捗は装飾。選択中のタブ下端に、現在の例の1周分をかけて満ちる */
.demo__progress {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 3px;
  overflow: hidden;
}
.demo__progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: left center;
}

.demo__panel {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 960px) {
  .demo__panel { grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr); }
  .demo__example-title { grid-column: 1 / -1; }
}
.demo__example-title { font-size: var(--fs-h3); font-weight: 800; line-height: 1.5; }
.demo__panel + .demo__panel { padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--color-line); }

/* タブが出ている(JS有効)ときは見出しをタブが兼ねるので、見出し構造だけ残して画面から隠す */
.demo:has(> .demo__tabs:not([hidden])) .demo__example-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.demo:has(> .demo__tabs:not([hidden])) .demo__panel + .demo__panel { padding-top: 0; border-top: 0; }
.demo__panel:focus-visible { outline: 3px solid var(--color-text); outline-offset: 6px; border-radius: var(--radius-m); }

.demo__stage { position: relative; }

.demo__label {
  position: absolute;
  top: -0.8rem;
  left: 1.25rem;
  z-index: 3;
  padding: 0.1rem 0.75rem;
  background: var(--color-text);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.demo__frame {
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-float);
}

/* 枠(aria-hidden)の子にすると名前のない操作対象になるため、兄弟として枠全体に重ねる */
.demo__frame-toggle {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.demo__frame-toggle:focus-visible { outline: 3px solid var(--color-text); outline-offset: 4px; }

/* 下端の余白(.demo__viewportのpadding-bottom)にまたがせ、上端の「操作イメージ」とも演出とも重ねない */
.demo__frame-status {
  position: absolute;
  right: 1.25rem;
  bottom: -0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: calc(100% - 2.5rem);
  padding: 0.1rem 0.75rem;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-tiny);
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.demo__frame-status::before {
  content: "";
  flex: none;
  width: 0.6em;
  height: 0.7em;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.demo__frame-toggle[data-stopped] .demo__frame-status::before {
  box-sizing: border-box;
  border-inline: 0.2em solid;
  background: none;
  clip-path: none;
}
.demo__frame-toggle:is(:hover, :focus-visible) .demo__frame-status { background: var(--color-accent); }

.demo__chrome {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-line);
}
.demo__dots { display: flex; gap: 6px; }
.demo__dots span { width: 10px; height: 10px; border-radius: 50%; background: #e2dac7; }
.demo__url {
  flex: 1;
  min-width: 0;
  padding: 0.15rem 0.9rem;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-size: var(--fs-tiny);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 上の余白は、1行目の選択語でも吹き出しが枠の上端で切れない高さ */
.demo__viewport {
  position: relative;
  padding: 4rem clamp(1.25rem, 4vw, 2.5rem) 2rem;
  background: var(--color-surface);
}

/* 吹き出しの位置を記事の幅(cqi)で丸めるため、記事をコンテナにする */
.demo__article {
  position: relative;
  container-type: inline-size;
}

.demo__kicker { color: var(--color-accent-ink); font-size: var(--fs-tiny); font-weight: 700; }
.demo__title {
  margin: 0.25rem 0 1rem;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 800;
  line-height: 1.5;
}
.demo__para {
  margin-top: 0.9rem;
  color: #3e3a34;
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 2;
}

/* 風船・カーソル・吹き出しは、選択末尾の基準点(.demo__targetの右端・行の縦中央)からの相対位置で置く。
   fs-balloonのviewBox(38 94 618 936)は下のひもまで含むため、丸い本体(x 45〜650・y 99.5〜872)の中心は
   箱の横50%・縦41.9%にある。fs-pointer(viewBox 0 0 20 26)の先端(2, 1.5)は18×24pxに縮めると(1.8, 1.4)px。 */
.demo {
  --demo-balloon-w: 20px;
  --demo-balloon-h: 30px;
  --demo-balloon-top: -22px;
  --demo-body-x: calc(1px + var(--demo-balloon-w) * 0.5);
  --demo-body-y: calc(var(--demo-balloon-top) + var(--demo-balloon-h) * 0.419);
  --demo-tip-x: 1.8px;
  --demo-tip-y: 1.4px;
}

/* 選択色を文字の背面・段落背景の前面に描くため、独立した重ね合わせ文脈にする。
   選択語と風船を同じ行に保ち、右の余白に風船を置いて後ろの文字と重ねない */
.demo__target {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: inline-block;
  margin-right: calc(var(--demo-balloon-w) + 4px);
  white-space: nowrap;
}

.demo__word { position: relative; }
/* ::beforeはブラウザの選択色、::afterは拡張機能が保存箇所に付けるハイライト色(content.cssと同値) */
.demo__word::before,
.demo__word::after {
  content: "";
  position: absolute;
  inset: 0.1em -1px;
  z-index: -1;
  border-radius: 2px;
  transform-origin: left center;
}
.demo__word::before { background: var(--color-selection); opacity: 0; }
.demo__word::after { background: var(--color-highlight); }

/* 選択直後に出る風船(実機と同じ20×30px)。静止表示では保存済みの目印として残す */
.demo__balloon {
  position: absolute;
  top: calc(50% + var(--demo-balloon-top));
  left: calc(100% + 1px);
  width: var(--demo-balloon-w);
  height: var(--demo-balloon-h);
  transform-origin: 50% 100%;
}
.demo__balloon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}
/* 丸い本体の矩形(ひもを除く)。見た目はなく、カーソルの先端が内側に着地したかを測る目印 */
.demo__balloon-body {
  position: absolute;
  top: 0.59%;
  left: 1.13%;
  width: 97.9%;
  height: 82.5%;
}

/* 位置はleft/topで先端の座標から逆算し、押す動きのscaleは先端を中心にして着地点をずらさない */
.demo__cursor {
  --demo-cursor-line-y: calc(50% - var(--demo-tip-y));
  --demo-cursor-start-x: calc(0% - var(--demo-tip-x));
  --demo-cursor-end-x: calc(100% - var(--demo-tip-x));
  --demo-cursor-rest-x: calc(100% - 24px);
  --demo-cursor-rest-y: calc(50% + 14px);
  --demo-cursor-click-x: calc(100% + var(--demo-body-x) - var(--demo-tip-x));
  --demo-cursor-click-y: calc(50% + var(--demo-body-y) - var(--demo-tip-y));
  --demo-cursor-leave-x: calc(100% + 34px);
  --demo-cursor-leave-y: calc(50% + 26px);
  position: absolute;
  top: var(--demo-cursor-click-y);
  left: var(--demo-cursor-click-x);
  z-index: 1;
  width: 18px;
  height: 24px;
  opacity: 0;
  transform-origin: var(--demo-tip-x) var(--demo-tip-y);
}
.demo__cursor svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.demo__cursor-tip {
  position: absolute;
  top: var(--demo-tip-y);
  left: var(--demo-tip-x);
  width: 0;
  height: 0;
}

/* 吹き出し。JS無効時は基準点を測れないので、段落の下へ通常の流れで置く */
.demo__bubble {
  position: relative;
  z-index: 3;
  width: fit-content;
  max-width: min(17rem, 100%);
  margin-top: 1rem;
  padding: 0.45rem 0.8rem 0.5rem;
  border: 1.5px solid var(--color-text);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 8px 18px -10px rgba(43, 41, 38, 0.45);
  color: var(--color-text);
  font-size: var(--fs-tiny);
  line-height: 1.6;
}
.demo__bubble-lead { font-weight: 800; }
.demo__bubble::after {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--demo-tail-x, 1.25rem);
  width: 10px;
  height: 10px;
  border: solid var(--color-text);
  border-width: 1.5px 0 0 1.5px;
  background: inherit;
  translate: -50% 0;
  rotate: 45deg;
}

/* JSが基準点を--demo-anchor-x/yに渡したら、風船の右上へ置く。
   基準点が記事の右寄りでも枠からはみ出さないよう、横位置を記事の幅(100cqi)の内側に丸め、しっぽは風船の真上へ寄せる */
.demo[data-anchored] .demo__bubble {
  --demo-bubble-w: min(16rem, 100cqi);
  --demo-bubble-x: clamp(0px, calc(var(--demo-anchor-x, 0px) + var(--demo-balloon-w) - 6px), calc(100cqi - var(--demo-bubble-w)));
  --demo-tail-x: clamp(14px, calc(var(--demo-anchor-x, 0px) + var(--demo-body-x) - var(--demo-bubble-x)), calc(var(--demo-bubble-w) - 14px));
  position: absolute;
  top: calc(var(--demo-anchor-y, 0px) + var(--demo-balloon-top) - 6px);
  left: var(--demo-bubble-x);
  width: var(--demo-bubble-w);
  max-width: none;
  margin: 0;
  translate: 0 -100%;
  transform-origin: var(--demo-tail-x) 100%;
}
.demo[data-anchored] .demo__bubble::after {
  top: auto;
  bottom: -6px;
  border-width: 0 1.5px 1.5px 0;
}

/* 解説カード。extension/shared/explain-engine.js のカードCSSを縮尺して写したもの */
.fs-card {
  background: #fffdf7;
  border: 1px solid #e0d9c8;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  color: #33302a;
  font-size: 0.9375rem;
  line-height: 1.7;
  text-align: left;
  white-space: normal;
}
.fs-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #ece5d4;
  background: #f7f2e4;
  border-radius: 10px 10px 0 0;
}
.fs-card__target {
  flex: 1;
  min-width: 0;
  color: #8d857a;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-card__font {
  display: flex;
  border: 1px solid #d9d2c0;
  border-radius: 4px;
  background: #fff;
  color: #55503f;
  font-size: 11px;
  line-height: 1.6;
}
.fs-card__font span { min-width: 24px; padding: 0 5px; text-align: center; }
.fs-card__font span + span { border-left: 1px solid #d9d2c0; }
.fs-card__icon { color: #8d857a; font-size: 13px; line-height: 1; }
.fs-card__head { padding: 8px 12px 0; }
.fs-card__tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f0e3b8;
  color: #8a6d1a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.fs-card__body {
  position: relative;
  display: grid;
  gap: 0.5em;
  padding: 8px 14px 12px;
}
.fs-card__body strong { font-weight: 700; }
.fs-card__loading {
  position: absolute;
  top: 8px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8d857a;
  opacity: 0;
}
.fs-card__loading svg { width: 14px; height: 21px; }
.fs-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #ece5d4;
}
.fs-card__button {
  position: relative;
  display: inline-grid;
  padding: 2px 9px;
  border: 1px solid #d9d2c0;
  border-radius: 5px;
  background: #fff;
  color: #55503f;
  font-size: 12px;
  line-height: 1.6;
}
/* 保存前後のラベルを同じセルに重ね、切替時にボタン幅が揺れないようにする */
.fs-card__save > span { grid-area: 1 / 1; text-align: center; }
.fs-card__save-before { opacity: 0; }
.fs-card__save::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 5px;
  box-shadow: 0 0 0 0 rgba(242, 201, 76, 0);
}

/* 段落の下に通常の流れで置き、非表示の間も場所を取って、開いたときに枠の高さが変わらないようにする */
.demo__card {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  margin-top: 1rem;
}

/* 模擬画面(aria-hidden)の記事全文を、読み上げと検索のため画面から見えない形で各例に置く。文言は枠内と一字一句同じ */
.demo__passage {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.demo__steps {
  display: grid;
  gap: 0.25rem;
  counter-reset: demo-step;
}
@media (min-width: 960px) {
  .demo__steps { padding-top: 1.5rem; }
}
.demo__step {
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3.5rem;
  border-radius: var(--radius-m);
  counter-increment: demo-step;
}
.demo__step::before {
  content: counter(demo-step);
  position: absolute;
  top: 0.95rem;
  left: 1rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--color-accent);
  font-size: var(--fs-small);
  font-weight: 800;
}
.demo__step-title { font-size: 1.0625rem; font-weight: 800; line-height: 1.6; }
.demo__step p { margin-top: 0.15rem; color: var(--color-muted); font-size: var(--fs-small); line-height: 1.8; }
.demo__step .demo__step-quote {
  margin-top: 0.4rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text);
}

.demo__caption {
  margin-top: var(--space-l);
  color: var(--color-muted);
  font-size: var(--fs-tiny);
}

/* ---------- デモのタイムライン ----------
   JSが動作可能と判断したときだけrootとアクティブなパネルにdata-animateを付け、それ以外(JS無効・reduced-motion・非アクティブ)は上の完成状態を静的に見せる。
   再生状態は--demo-playで全要素へ一括で伝え、各要素の一時停止位置がずれないようにする。
   data-passはJSが再生開始時に決め、途中で既読になっても次の再生開始まで変えない。
   first=その例の初回(5.9秒)、repeat=既読の例(3.3秒)。どちらも保存済みの表示完了から1周の終わりまでを1.5秒にし、
   解説を出した後に読むための待ちは置かない。1周の終わりはフレームの時計(fs-demo-clock)のanimationendで知る。 */

.demo {
  --demo-play: paused;
  --demo-cycle: 5.9s;
}
.demo[data-pass="repeat"] { --demo-cycle: 3.3s; }
.demo[data-state="playing"] { --demo-play: running; }

.demo[data-animate] .demo__panel[data-animate] :is(
  .demo__frame, .demo__balloon, .demo__cursor, .demo__bubble, .demo__card, .fs-card__loading,
  .fs-card__text, .fs-card__save-before, .fs-card__save-after, .demo__step
),
.demo[data-animate] .demo__panel[data-animate] .demo__word::before,
.demo[data-animate] .demo__panel[data-animate] .demo__word::after,
.demo[data-animate] .demo__panel[data-animate] .fs-card__save::after,
.demo[data-animate] .demo__tab[aria-selected="true"] .demo__progress::after {
  animation-duration: var(--demo-cycle);
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-iteration-count: 1;
  animation-play-state: var(--demo-play);
}

.demo[data-state="reset"] *,
.demo[data-state="reset"] *::before,
.demo[data-state="reset"] *::after { animation-name: none !important; }

/* 時計と進捗バーは1周分。:is()は擬似要素を受け付けないため擬似要素は個別に書く */
.demo[data-animate] .demo__panel[data-animate] .demo__frame { animation-name: fs-demo-clock; }
.demo[data-animate] .demo__tab[aria-selected="true"] .demo__progress::after { animation-name: fs-demo-progress; }

/* 「保存済み」は表示を終えた瞬間にanimationendが届くよう、終わりを表示完了の時刻にそろえる。JSはこれで既読にする */
.demo[data-animate] .demo__panel[data-animate] .fs-card__save-after { animation-name: fs-demo-saved; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .fs-card__save-after {
  animation-delay: 4.2s;
  animation-duration: 0.2s;
}
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .fs-card__save-after {
  animation-duration: 1.8s;
  animation-timing-function: step-end;
}

.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__word::before { animation-name: fs-demo-first-selection; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__word::after { animation-name: fs-demo-first-highlight; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__balloon { animation-name: fs-demo-first-balloon; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__bubble { animation-name: fs-demo-first-bubble; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__cursor { animation-name: fs-demo-first-cursor; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__card { animation-name: fs-demo-first-card; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .fs-card__loading { animation-name: fs-demo-first-loading; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .fs-card__text { animation-name: fs-demo-first-text; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .fs-card__save-before { animation-name: fs-demo-first-save-before; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .fs-card__save::after { animation-name: fs-demo-first-save-ring; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__step:nth-child(1) { animation-name: fs-demo-first-step-1; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__step:nth-child(2) { animation-name: fs-demo-first-step-2; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__step:nth-child(3) { animation-name: fs-demo-first-step-3; }
.demo[data-animate][data-pass="first"] .demo__panel[data-animate] .demo__step:nth-child(4) { animation-name: fs-demo-first-step-4; }

/* 既読は読み込みを挟まないので、読み込み表示と手順1の強調は静止表示のまま */
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__word::before { animation-name: fs-demo-repeat-selection; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__word::after { animation-name: fs-demo-repeat-highlight; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__balloon { animation-name: fs-demo-repeat-balloon; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__bubble { animation-name: fs-demo-repeat-bubble; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__cursor { animation-name: fs-demo-repeat-cursor; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__card { animation-name: fs-demo-repeat-card; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .fs-card__text { animation-name: fs-demo-repeat-card; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .fs-card__save-before { animation-name: fs-demo-repeat-save-before; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .fs-card__save::after { animation-name: fs-demo-repeat-save-ring; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__step:nth-child(2) { animation-name: fs-demo-repeat-step-2; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__step:nth-child(3) { animation-name: fs-demo-repeat-step-3; }
.demo[data-animate][data-pass="repeat"] .demo__panel[data-animate] .demo__step:nth-child(4) { animation-name: fs-demo-repeat-step-4; }

/* 終了検知専用。見た目に影響しない値を動かし、animationendを受け取る */
@property --demo-clock {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@keyframes fs-demo-clock {
  from { --demo-clock: 0; }
  to { --demo-clock: 1; }
}

@keyframes fs-demo-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes fs-demo-saved {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 初回 5.9秒(1秒≒16.95%)
   0-0.8s 選択 / 0.8-1.0s 風船 / 1.0-2.5s 吹き出しを見せる / 2.5-3.2s カーソルを風船へ動かし3.2sにクリック
   3.2-3.8s 読み込み / 3.8-4.2s 解説の全文 / 4.2-4.4s 保存済み / 4.4-5.9s そのまま1.5秒
   0.01%差のキーフレームは、その時刻で瞬時に切り替えるためのもの */
@keyframes fs-demo-first-selection {
  0% { opacity: 1; transform: scaleX(0); }
  13.56%, 71.19% { opacity: 1; transform: scaleX(1); }
  74.58%, 100% { opacity: 0; transform: scaleX(1); }
}

@keyframes fs-demo-first-highlight {
  0%, 71.19% { opacity: 0; }
  74.58%, 100% { opacity: 1; }
}

@keyframes fs-demo-first-balloon {
  0%, 13.56% { opacity: 0; scale: 0.4; animation-timing-function: cubic-bezier(0.3, 1.6, 0.5, 1); }
  16.95%, 52.54% { opacity: 1; scale: 1; }
  54.24% { opacity: 1; scale: 0.86; }
  55.93%, 100% { opacity: 1; scale: 1; }
}

@keyframes fs-demo-first-bubble {
  0%, 16.95% { opacity: 0; scale: 0.6; animation-timing-function: cubic-bezier(0.3, 1.4, 0.5, 1); }
  20.34%, 54.24% { opacity: 1; scale: 1; }
  55.93%, 100% { opacity: 0; scale: 0.9; }
}

/* 選択語をなぞる → 選択末尾の下へ離れる → 吹き出しを見せた後に風船の本体へ動いて押す → 離れて消える */
@keyframes fs-demo-first-cursor {
  0% { left: var(--demo-cursor-start-x); top: var(--demo-cursor-line-y); scale: 1; opacity: 0; }
  1.69% { opacity: 1; }
  13.56% { left: var(--demo-cursor-end-x); top: var(--demo-cursor-line-y); animation-timing-function: ease-out; }
  20.34% { left: var(--demo-cursor-rest-x); top: var(--demo-cursor-rest-y); }
  42.37% { left: var(--demo-cursor-rest-x); top: var(--demo-cursor-rest-y); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  52.54% { left: var(--demo-cursor-click-x); top: var(--demo-cursor-click-y); scale: 1; }
  54.24% { left: var(--demo-cursor-click-x); top: var(--demo-cursor-click-y); scale: 0.82; opacity: 1; }
  55.93% { left: var(--demo-cursor-click-x); top: var(--demo-cursor-click-y); scale: 1; opacity: 1; animation-timing-function: ease-in; }
  61.02%, 100% { left: var(--demo-cursor-leave-x); top: var(--demo-cursor-leave-y); scale: 1; opacity: 0; }
}

@keyframes fs-demo-first-card {
  0%, 54.24% { opacity: 0; translate: 0 8px; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  57.63%, 100% { opacity: 1; translate: 0 0; }
}

@keyframes fs-demo-first-loading {
  0%, 54.24% { opacity: 0; }
  55.93%, 63.56% { opacity: 1; }
  64.41%, 100% { opacity: 0; }
}

@keyframes fs-demo-first-text {
  0%, 64.41% { opacity: 0; clip-path: inset(0 0 100% 0); }
  65.25% { opacity: 1; }
  71.19%, 100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes fs-demo-first-save-before {
  0%, 71.19% { opacity: 1; }
  74.58%, 100% { opacity: 0; }
}

@keyframes fs-demo-first-save-ring {
  0%, 74.58% { box-shadow: 0 0 0 0 rgba(242, 201, 76, 0.9); }
  83.05%, 100% { box-shadow: 0 0 0 7px rgba(242, 201, 76, 0); }
}

/* 現在の段階だけ淡い黄色の面を敷く。読み上げには段階の変化を通知しない */
@keyframes fs-demo-first-step-1 {
  0%, 13.56% { background: var(--color-accent-soft); }
  13.57%, 100% { background: transparent; }
}
@keyframes fs-demo-first-step-2 {
  0%, 13.56% { background: transparent; }
  13.57%, 42.37% { background: var(--color-accent-soft); }
  42.38%, 100% { background: transparent; }
}
@keyframes fs-demo-first-step-3 {
  0%, 42.37% { background: transparent; }
  42.38%, 71.19% { background: var(--color-accent-soft); }
  71.2%, 100% { background: transparent; }
}
@keyframes fs-demo-first-step-4 {
  0%, 71.19% { background: transparent; }
  71.2%, 100% { background: var(--color-accent-soft); }
}

/* 既読 3.3秒(1秒≒30.3%)
   0-1.2s 選択・風船・吹き出しを最初から見せる / 1.2-1.8s カーソルを風船へ動かし1.8sにクリック
   1.8s 解説の全文と保存済みを読み込みなしで表示 / 1.8-3.3s そのまま1.5秒 */
@keyframes fs-demo-repeat-selection {
  0%, 54.54% { opacity: 1; transform: scaleX(1); }
  54.55%, 100% { opacity: 0; transform: scaleX(1); }
}

@keyframes fs-demo-repeat-highlight {
  0%, 54.54% { opacity: 0; }
  54.55%, 100% { opacity: 1; }
}

@keyframes fs-demo-repeat-balloon {
  0%, 51.52% { opacity: 1; scale: 1; }
  54.55% { opacity: 1; scale: 0.86; }
  57.58%, 100% { opacity: 1; scale: 1; }
}

@keyframes fs-demo-repeat-bubble {
  0%, 54.54% { opacity: 1; scale: 1; }
  54.55%, 100% { opacity: 0; scale: 1; }
}

@keyframes fs-demo-repeat-cursor {
  0%, 36.36% { left: var(--demo-cursor-rest-x); top: var(--demo-cursor-rest-y); scale: 1; opacity: 0; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  40.91% { opacity: 1; }
  51.52% { left: var(--demo-cursor-click-x); top: var(--demo-cursor-click-y); scale: 1; }
  54.55% { left: var(--demo-cursor-click-x); top: var(--demo-cursor-click-y); scale: 0.82; opacity: 1; }
  57.58% { left: var(--demo-cursor-click-x); top: var(--demo-cursor-click-y); scale: 1; opacity: 1; animation-timing-function: ease-in; }
  66.67%, 100% { left: var(--demo-cursor-leave-x); top: var(--demo-cursor-leave-y); scale: 1; opacity: 0; }
}

/* 解説カードと本文に共通。クリックの時刻でパッと出す */
@keyframes fs-demo-repeat-card {
  0%, 54.54% { opacity: 0; }
  54.55%, 100% { opacity: 1; }
}

@keyframes fs-demo-repeat-save-before {
  0%, 54.54% { opacity: 1; }
  54.55%, 100% { opacity: 0; }
}

@keyframes fs-demo-repeat-save-ring {
  0%, 54.55% { box-shadow: 0 0 0 0 rgba(242, 201, 76, 0.9); }
  69.7%, 100% { box-shadow: 0 0 0 7px rgba(242, 201, 76, 0); }
}

@keyframes fs-demo-repeat-step-2 {
  0%, 36.36% { background: var(--color-accent-soft); }
  36.37%, 100% { background: transparent; }
}
@keyframes fs-demo-repeat-step-3 {
  0%, 36.36% { background: transparent; }
  36.37%, 54.54% { background: var(--color-accent-soft); }
  54.55%, 100% { background: transparent; }
}
@keyframes fs-demo-repeat-step-4 {
  0%, 54.54% { background: transparent; }
  54.55%, 100% { background: var(--color-accent-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .demo[data-animate] *,
  .demo[data-animate] *::before,
  .demo[data-animate] *::after { animation: none !important; }
  .demo__progress { display: none; }
}

/* ---------- 機能紹介 ---------- */

.bento {
  display: grid;
  gap: var(--space-m);
}
@media (min-width: 768px) {
  .bento {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
  }
  .bento__item--lead { grid-row: span 2; }
}

.bento__item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
}

.bento__visual {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(160deg, #fdf6dd, var(--color-cream) 70%);
  font-size: 0.9375rem;
}
.bento__item--lead .bento__visual { flex: 1; min-height: 18rem; }

.bento__text { padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2rem); }
.bento__title { font-size: var(--fs-h3); font-weight: 800; line-height: 1.5; }
.bento__text p:not(.pill) { margin-top: 0.4rem; color: var(--color-muted); }

.mock-text {
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-soft);
  line-height: 2;
}

.fs-card--mini {
  width: min(100%, 20rem);
  margin-left: auto;
  font-size: 0.875rem;
}
.fs-card--mini .fs-card__header { justify-content: space-between; }
.fs-card--mini .fs-card__body { padding-bottom: 14px; }

.chat-bubble {
  justify-self: start;
  max-width: 85%;
  padding: 0.5rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid #ece5d4;
  border-radius: 12px 12px 12px 4px;
  font-size: var(--fs-small);
}
.chat-bubble--me {
  justify-self: end;
  background: #fdf6d8;
  border-color: #efdf9e;
  border-radius: 12px 12px 4px 12px;
}
.chat-input {
  padding: 0.45rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid #d9d2c0;
  border-radius: 6px;
  color: #a39b8d;
  font-size: var(--fs-tiny);
}

.note-view {
  padding: 0.4rem 0.75rem;
  background: #fdf6d8;
  border-left: 3px solid #e0c454;
  border-radius: 0 4px 4px 0;
  font-size: var(--fs-small);
}

.facts {
  display: grid;
  gap: var(--space-s) var(--space-l);
  margin-top: var(--space-xl);
  padding-top: var(--space-l);
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: var(--fs-small);
  line-height: 1.8;
}
@media (min-width: 768px) {
  .facts { grid-template-columns: 1fr 1fr 1.6fr; }
}
.facts__item strong { display: block; color: var(--color-text); font-size: var(--fs-body); }
.facts__item--data {
  padding-left: var(--space-m);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text);
}

/* ---------- はじめ方 ---------- */

.section--start {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

.steps {
  display: grid;
  gap: var(--space-l);
  counter-reset: none;
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--space-m); }
}
.steps__item {
  position: relative;
  padding-top: 0.25rem;
  text-align: center;
}
.steps__item p { margin-top: 0.4rem; color: var(--color-muted); font-size: var(--fs-small); }
@media (min-width: 768px) {
  /* 番号同士をつなぐ線。最後の段階の後には引かない */
  .steps__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 2rem;
    left: calc(50% + 2.75rem);
    right: calc(-50% + 2.75rem);
    border-top: 2px dashed #e6d9ad;
  }
}
.steps__num {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-m);
  border-radius: 50%;
  background: var(--color-accent);
  font-size: 1.375rem;
  font-weight: 800;
  box-shadow: 0 0 0 8px var(--color-accent-soft);
}
.steps__title { font-size: var(--fs-h3); font-weight: 800; line-height: 1.5; }
.steps__note {
  width: fit-content;
  max-width: 100%;
  margin: var(--space-xl) auto 0;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-m);
  background: var(--color-cream);
  color: #4a4640;
  font-size: var(--fs-small);
  text-align: center;
}

/* ---------- 開発の想い ---------- */

.story { max-width: var(--container-narrow); }
.story > p:not(.eyebrow) { margin-top: var(--space-m); font-size: var(--fs-lead); line-height: 2; }
.story > .section-title + p,
.story > p.story__mail { margin-top: var(--space-l); }
.story__mail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.story__address { color: var(--color-muted); font-size: var(--fs-small); }

.story-flow {
  margin-block: var(--space-xl);
  padding: var(--space-xs) clamp(1rem, 3vw, var(--space-l));
  border-radius: var(--radius-m);
  background: var(--color-cream);
}
.story-flow__row {
  display: grid;
  gap: var(--space-xs);
  padding-block: var(--space-m);
}
.story-flow__row + .story-flow__row { border-top: 1px solid var(--color-line); }
@media (min-width: 768px) {
  .story-flow__row { grid-template-columns: 9rem 1fr; gap: var(--space-m); align-items: baseline; }
}
.story-flow__label {
  color: var(--color-muted);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.6;
}
.story-flow__row--fusen .story-flow__label { color: var(--color-accent-ink); }
.story-flow__steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) 0.25rem;
}
/* 矢印を前の項目の末尾ではなく次の項目の先頭に置き、折り返しても行頭の「→」で続きだと分かるようにする */
.story-flow__steps > li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
}
.story-flow__arrow { flex: none; color: var(--color-muted); font-size: var(--fs-small); line-height: 1; }
.story-flow__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--fs-small);
  line-height: 1.6;
}
.story-flow__step--accent { border-color: #e9d690; background: var(--color-accent-soft); }
.story-flow__balloon { flex: none; width: 0.62em; height: 0.93em; }

/* ---------- FAQ ---------- */

.section--faq {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

.faq {
  display: grid;
  gap: var(--space-l);
}
@media (min-width: 960px) {
  .faq { grid-template-columns: 0.8fr 1.6fr; align-items: start; }
  .faq .section-head { position: sticky; top: calc(var(--header-height) + 2rem); }
}

.faq__list { border-top: 1px solid var(--color-line); }
.faq__item { border-bottom: 1px solid var(--color-line); }
.faq__item summary {
  position: relative;
  display: block;
  padding: 1.25rem 3rem 1.25rem 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::before,
.faq__item summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.5rem;
  width: 14px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.2s ease;
}
.faq__item summary::after { transform: rotate(90deg); }
.faq__item[open] summary::after { transform: rotate(0deg); }
.faq__item summary:hover { color: var(--color-accent-ink); }
.faq__answer { padding: 0 3rem 1.5rem 0; color: #4a4640; }
.faq__answer > * + * { margin-top: 0.75em; }
.faq__answer ul { padding-left: 1.25em; list-style: disc; }
.faq__answer li + li { margin-top: 0.375em; }
.faq__answer li::marker { color: var(--color-accent-ink); }
@media (max-width: 479px) {
  .faq__answer { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .faq__item summary::after { transition: none; }
}

/* ---------- 最後の案内 ---------- */

.section--closing {
  background:
    radial-gradient(40rem 20rem at 50% 0%, rgba(255, 255, 255, 0.7), transparent 70%),
    linear-gradient(180deg, #fbeeb9, #f8e59a);
}
.closing { max-width: var(--container-narrow); text-align: center; }
.closing__balloon {
  width: 3.5rem;
  height: auto;
  aspect-ratio: 618 / 936;
  margin: 0 auto var(--space-m);
  transform: rotate(6deg);
}
.closing .section-lead { color: #5a5242; }
.closing .cta-row { margin-top: var(--space-l); }
.closing .button--primary { background: var(--color-text); color: #fff; box-shadow: none; }
.closing .button--primary:hover { background: #4a4640; }
.closing .status { background: rgba(255, 255, 255, 0.7); border-color: rgba(122, 92, 0, 0.25); }
