:root {
  --paper: #EFE6D6;  /* 和紙：地 */
  --sheet: #F8F4EC;  /* 白っぽい紙 */
  --navy: #24306B;   /* 紺のインク：ボタン・見出し */
  --shu: #D2452F;    /* 朱：花まる・必須 */
  --ink: #3A332C;    /* 焦げ茶：本文 */
  --line: #D9CDB8;   /* 罫線 */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}
h1, h2, h3 { word-break: auto-phrase; text-wrap: balance; line-break: strict; }

.lp { max-width: 640px; margin: 0 auto; background: var(--paper); box-shadow: 0 0 40px rgba(58,51,44,.10); }
.part { position: relative; margin: 0; line-height: 0; overflow: hidden; }
.part img { display: block; width: 100%; height: auto; }

/* 画像の中のボタンに重ねる透明なリンク */
.hit { position: absolute; display: block; border-radius: 8px; color: transparent; font-size: 1px; overflow: hidden; }
.hit:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--navy); }
.hit::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.35), rgba(255,255,255,0));
  animation: btn-shine 5s ease-in-out 2s infinite;
}
@keyframes btn-shine { 0% { left: -40%; } 30%, 100% { left: 120%; } }

/* ---------- FV：ペン字が左から書かれていく ---------- */
/* 和紙の地（FV画像から切り出したタイル）をかぶせ、左からはがす。JSが無いときは出さない */
.pen-cover { position: absolute; display: none; pointer-events: none;
  background: url("images/paper-tile.webp") repeat; background-size: 8.68% auto; }
html.js .pen-cover { display: block; animation: pen-write 1.1s cubic-bezier(.45,.05,.55,.95) var(--d) both; }
@keyframes pen-write { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }

/* ---------- 料金表の右列（HTMLで重ねる） ---------- */
.lp { container-type: inline-size; }
.price-fill { position: absolute; inset: 0; margin: 0; pointer-events: none; }
.price-fill div { position: absolute; left: 46.4%; width: 48%; height: 7.9%; display: flex; align-items: center; }
.price-fill p { margin: 0; font-size: 4.6cqw; line-height: 1.3; color: var(--ink); font-feature-settings: "palt"; }

/* ---------- 悩み：先生の朱線 ---------- */
.shu-line { position: absolute; height: .45%; border-radius: 99px; background: var(--shu); opacity: .85;
  transform-origin: left center; transform: scaleX(0); pointer-events: none; }
#pain.on .shu-line { animation: shu-draw .7s ease-out calc(var(--i) * .55s + .3s) both; }
html:not(.js) .shu-line { transform: none; }
@keyframes shu-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- 体験の流れ：1→2→3 の順に囲む（2周で止まる） ---------- */
.step-glow { position: absolute; border: 3px solid var(--navy); border-radius: 12px; opacity: 0; pointer-events: none; }
#cta.on .step-glow { animation: step-on 4.2s ease-out calc(var(--i) * .8s + .3s) 2; }
@keyframes step-on { 0% { opacity: 0; } 6% { opacity: 1; } 22% { opacity: 1; } 32%, 100% { opacity: 0; } }

/* ---------- 申込欄の花まる：くるっと描かれる ---------- */
.apply { position: relative; }
.apply-head { position: relative; }
/* 花まるは見出し1行目（短い行）の右に浮かせ、見出しの幅を狭めない */
.hanamaru { position: absolute; right: -4px; top: -14px; width: clamp(64px, 17vw, 92px); height: auto; }
.hanamaru path { fill: none; stroke: var(--shu); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
html.js .hanamaru path { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.js #apply.on .hm-outer { animation: hm-draw 1.1s ease-in-out .2s forwards; }
html.js #apply.on .hm-spiral { animation: hm-draw .9s ease-in-out 1.2s forwards; }
@keyframes hm-draw { to { stroke-dashoffset: 0; } }

/* 2枚目以降はふわっと表示 */
.part.reveal img { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.part.reveal.on img { opacity: 1; transform: none; }

/* 申込フォーム */
.apply { padding: 56px 6% 64px; background: var(--paper); }
.apply-label { margin: 0 0 8px; color: var(--navy); font-size: 15px; letter-spacing: .06em; }
.apply-label::before { content: ""; display: inline-block; width: 28px; height: 2px; margin-right: 10px; vertical-align: middle; background: var(--navy); }
.apply h2 { margin: 0 0 16px; font-weight: 400; font-size: clamp(23px, 6vw, 30px); line-height: 1.5; color: var(--ink); }
.apply-lead { margin: 0 0 28px; font-size: 16px; line-height: 1.8; text-wrap: pretty; }
#apply-form { display: grid; gap: 18px; padding: 24px 5%; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; }
#apply-form > label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 0; font-size: 16px; }
#apply-form > label > input, #apply-form > label > textarea { grid-column: 1 / -1; }
.req, .opt { justify-self: start; margin-left: 8px; padding: 0 8px; font-size: 12px; line-height: 20px; display: inline-block; }
.req { background: var(--shu); color: #fff; }
.opt { background: var(--paper); color: var(--ink); }
#apply-form input, #apply-form textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid #CBBFA9; border-radius: 4px; background: #fff;
}
#apply-form textarea { line-height: 1.7; resize: vertical; }
#apply-form :focus-visible { outline: 3px solid rgba(36,48,107,.3); border-color: var(--navy); }
.form-msg { margin: 0; padding: 12px 14px; font-size: 15px; line-height: 1.7; background: #FFF6E5; border-left: 4px solid #C98A1B; }
.form-msg.error { background: #FDECEA; border-left-color: var(--shu); }
#apply-form button {
  min-height: 56px; margin-top: 4px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--navy); color: #fff; font: inherit; font-size: 17px; letter-spacing: .06em;
}
#apply-form button:hover { filter: brightness(1.12); }

.foot { padding: 32px 6% 120px; background: var(--navy); color: #fff; font-size: 14px; line-height: 1.8; }
.foot p { margin: 0 0 8px; }
.foot-name { font-size: 16px; letter-spacing: .08em; }
.demo { opacity: .7; font-size: 13px; }

/* 画面下に追従するボタン */
.sticky {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%) translateY(140%);
  width: min(92vw, 560px); min-height: 52px; padding: 12px 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--navy); color: #fff; text-decoration: none; font-size: 16px; letter-spacing: .06em;
  border-radius: 6px; box-shadow: 0 6px 20px rgba(36,48,107,.25);
  transition: transform .35s ease; z-index: 10;
}
.sticky.show { transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hit::after { animation: none; display: none; }
  html.js .pen-cover { display: none; animation: none; }
  .shu-line, #pain.on .shu-line { animation: none; transform: none; }
  .step-glow { animation: none !important; }
  html.js .hanamaru path, html.js #apply.on .hanamaru path { animation: none; stroke-dashoffset: 0; }
  .part.reveal img { opacity: 1; transform: none; transition: none; }
  .sticky { transition: none; }
}
