:root {
  --color-base: #efdebc; /* Base */
  --color-accent: #e60012; /* Accent */
  --color-turquoise: #1b5d75; /* ターコイズ */
  --color-retro-green: #4a773c; /* レトログリーン */
  --color-cream: #ffb400; /* クリーム */
  --color-kaki: #aa572a; /* 柿色 */
  --color-black: #333333; /* ダークグレー */

  --maxw: 1128px; /* PC最大幅 */
  --gutter: 16px; /* ベース余白 */
  --radius: 16px;
}

/* ------------------------------

　　ベース

------------------------------ */
* {
  box-sizing: border-box;
}
html{
  scroll-behavior: smooth;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--color-black, #333333);
  background-color: rgba(239, 222, 188, 0.85);
  font: 16px/1.75 "Noto Serif JP", serif;
  text-rendering: optimizeLegibility;
  font-kerning:auto;
  font-feature-settings: "palt", "kern";
  text-align:justify;
  hyphens:auto;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../img/noise-512.webp");
  background-repeat: repeat;
  background-size: 512px 512px;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
  text-decoration: underline;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Zen Antique", serif;
}

ul{
  list-style:none;
}

.fontZen{
  font-family: "Zen Antique", serif;
}

/* ページトップに戻るボタン */
#to-page-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 40px;
	height: 40px;
	background-color: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease, visibility 0.5s ease;
	z-index: 100;
}
/* 表示状態 */
#to-page-top.active {
	opacity: 1;
	visibility: visible;
}
/* CSSで作る「fa-chevron-up」風の矢印（V字型） */
#to-page-top::before,
#to-page-top::after {
	content: "";
	position: absolute;
	width: 14px;  /* 線の長さ */
	height: 2px;  /* 線の太さ */
	background-color: #000;
	left: 50%;
	bottom: 50%;
	transform-origin: bottom center;
}
/* 左側の線：45°回転 */
#to-page-top::before {
	transform:translate(-10px) rotate(-45deg);
}
/* 右側の線：-45°回転 */
#to-page-top::after {
	transform:translate(-2px)  rotate(45deg);
}


/* ------------------------------

　　ヘッダー

------------------------------ */
#header {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: transparent;
}

#header img {
  display: block;
  width: clamp(40px, 6vw, 60px);
  height: auto;
}

/* ロゴのフェード */
#header img {
  transition: opacity 300ms ease;
  will-change: opacity;
  opacity: 1;
}
#header img.is-hidden {
  opacity: 0;
}

/* 動きが苦手な方への配慮 */
@media (prefers-reduced-motion: reduce) {
  #header img { transition: none; }
}


/* ------------------------------

　　フッター

------------------------------ */
footer {
  background: var(--color-turquoise, #1b5d75);
  background-image: url(../img/noise-512.webp);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-position: top left;
  color: var(--color-base, #efdebc);
  position: relative;
  margin-top: 60px;
}
footer::before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 75px; 
  top: -50px; 
  background-image: url('../img/footer_top.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

footer .container {
  max-width: var(--maxw, 1128px);
  width: 90%;
  margin: 0 auto;
  padding: 32px 0 16px;
}

footer .container p a{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-decoration:none;
}
footer .container li a{
  text-decoration:none;
}
footer .container p img{
  width:auto;
  height:24px;
  display:inline-block;
  background-color:#fff;
  border-radius:50%;
}
footer .container p span{
  display:inline-block;
  height:30px;
  padding-left:4px;
}

footer .container section{
  font-size:12px;
  font-weight:400;
  margin-top:16px;
}
footer .container section h4{
  font-family:"Noto Serif JP", serif;
}
footer .container section ul{
  list-style: disc;
  margin: 0;
  padding-left: 1em;
}

footer .container section ul li{
  display: list-item;
  padding-inline-start: 4px;
}

footer .container section ul li::marker {
  color: currentColor;
  font-size: 1em;
  transform: scale(1.4);
}

footer .container .copyRight{
  text-align:center;
  margin:16px 0 0 0;
}

/* ------------------------------

　　ヒーロー

------------------------------ */
.hero{
  position: relative;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: clip;
}

.hero-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.heroText {
  position: absolute;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: clamp(16px, 2vw, 24px);
  line-height:1.5;
  color: var(--color-black, #333333);
  padding: 1rem 1.25rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  text-shadow:
    0 0 16px  rgba(239, 222, 188, 1),
    0 0 20px rgba(239, 222, 188, 0.9),
    0 0 32px rgba(239, 222, 188, 0.8),
    0 0 48px rgba(239, 222, 188, 0.7),
    0 0 64px rgba(239, 222, 188, 0.6);
}

.heroText h2 {
  font-feature-settings: "pkna"; /* プロポーショナルかな：カギカッコの詰め */
}
.brkt-open,
.brkt-close { display: inline-block; }
.brkt-open  { margin-inline-start: -0.4em; }
.brkt-close { margin-inline-end:   -0.4em; }
.brkt-open, .brkt-close { letter-spacing: -0.02em; }

/* --- Heroの下の装飾 --- */
.hero-bottom-wave {
  position: relative;
  width: 100%;
  height: 20px;
  margin-top: -1px;
  z-index: 10;
  background-image: url('../img/header_bottom.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center bottom;
  pointer-events: none;
}


/* ------------------------------

　　メイン

------------------------------ */

main {
  max-width: var(--maxw, 1128px);
  width: 90%;
  margin: 80px auto 0 auto;
  padding-bottom:480px;
  position: relative;
  --yatai-h: clamp(360px, 45vw, 720px);
  padding-bottom: var(--yatai-h);
  font-weight:500;
}
main::after{
  content:"";
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width:100vw;
  height:var(--yatai-h);
  background: url(../img/bgyatai.png) no-repeat center bottom / cover;
  opacity:.25;
  pointer-events:none;
}

main h3 {
  color: var(--color-kaki, #aa572a);
  /* border-top: 1px solid var(--color-kaki, #aa572a);
  border-bottom: 1px solid var(--color-kaki, #aa572a); */
  padding: 1.2em clamp(24px, 2.4vw, 32px);
  margin: 80px 0 0;
  font-size:clamp(16px, 1.7vw, 24px);
  position: relative;
}
main h3::before,
main h3::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 15px;
  background-image: url('../img/line-hand.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
main h3::before {
  top: 0;
}
main h3::after {
  bottom: 0;
  transform: scale(-1, -1);
}

main h4{
  padding-left:clamp(24px, 2.4vw, 32px);
}

main .lead{
  font-size:clamp(16px, 1.7vw, 24px);
}

main p{
  font-size:clamp(14px, 1.5vw, 18px);
  line-height:2;
  margin: 0;
  padding:0 clamp(24px, 2.4vw, 32px);
}
main ul{
  font-size:clamp(14px, 1.5vw, 18px);
  line-height:2;
  margin: 0;
  padding: 0 clamp(40px, 4.3vw, 54px);
}
main ul li{
  position: relative;
}
ul li:before {
  font-family: "Font Awesome 5 Free";
  content: "\f0da";
  font-weight: 900;
  position: absolute;
  left : -1em;
  top: 0.1em;
  color: #aa572a;;
}

main article ul li span{
  display:inline-block;
  padding:0 8px 0 0;
  line-height:24px;
  font-weight:800;
}

main #poem-kaizan pre{
  font-size:clamp(12px, 1.5vw, 18px);
  font-family: "Zen Antique", serif;
  padding-left:clamp(24px, 2.4vw, 32px);
}

main figure.figureS{
  max-width:240px;
}
main figure.figureS img{
  margin-left:1em;
}
@media(min-width:768px){
  main figure.figureS img{
    margin-left:0;
  }
}
main figure.figureM{
  max-width:480px;
}

@media(min-width:768px){
  main h3 {
    margin: 120px 0 32px;
  }
  main #poem-kaizan pre{
    padding-left:0;
  }
  main article .contentsWrapGrid{
    display:grid;
    grid-template-columns:1fr 1fr;
    column-gap:24px;
    justify-items: center;
    align-items: start;
    grid-auto-rows: auto;
  }
  main article .contentsWrapGrid > p {
    grid-column: 1;
  }
  main article .contentsWrapGrid > figure:last-child {
    grid-column: 2;
    grid-row: 1 / span 999;
    align-self: start;
  }
  main .imgBox .imgBoxContents{
    display:grid;
    grid-template-columns:1fr 1fr;
    column-gap:24px;
    place-items: center;
  }

  main article .figureWrap{
    display:grid;
    grid-template-columns:1fr 1fr;
    column-gap:24px;
    justify-items: center;
    align-items: start;
    grid-auto-rows: auto;
  }

}

main figcaption{
  text-align:center;
  font-size:clamp(12px, 1.2vw, 14px);
  padding:0 1.5em;
}

main .imgBox{
  margin-top:80px;
}
main .imgBox figure{
  margin-top:24px;
}

.yataiPage figure{
  margin:48px 0;
}

#refs-heading{
  margin-top:32px;
}

.kaizanIndex{
  display:flex;
  justify-content:space-around;
  align-items:center;
}

/* 画像の周囲をグランジ加工 */
.photo-container img {
  display: block;
  width: 100%;
  height: auto;
  /* --- 9スライス設定 --- */
  /* 画像のパス */
  -webkit-mask-box-image-source: url('../img/grunge-mask.png');
  /* 画像の端から「何ピクセル分」を四隅（変形させないエリア）として扱うか指定 */
  /* 例えば1000pxの画像のフチ20px分がザラザラなら「20」 */
  -webkit-mask-box-image-slice: 0 fill;
  /* 辺の引き伸ばし方 */
  /* stretch: 引き伸ばす / repeat: 繰り返す（ザラザラならstretchが自然です） */
  -webkit-mask-box-image-repeat: stretch;
  /* --- Firefox等用標準プロパティも記述 --- */
  mask-border-source: url('../img/grunge-mask.png');
  mask-border-slice: 0 fill;
  mask-border-repeat: stretch;
}


/* ------------------------------

　　フォーム

------------------------------ */

button[data-modal-open="contact"],
button[data-modal-open="privacy"] {
  background: none;
  border: none;
  color: var(--color-base, #efdebc);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

/* オーバーレイ */
.mf-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.mf-overlay[aria-hidden="false"]{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ダイアログ本体 */
.mf-dialog{
  position: relative;
  margin: 6vh auto;
  width: clamp(320px, 92vw, 720px);
  max-height: min(88vh, 900px);
  overflow: auto;

  background: #fff;
  color: #111;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
  padding: 28px 28px 24px;

  /* 文字組み（両端揃えの解除・読みやすさ） */
  text-align: left;
  line-height: 1.6;
  letter-spacing: normal;
}

/* ヘッダー */
.mf-header h2{
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.mf-desc{
  margin: 0 0 12px;
  color: #555;
  font-size: 13px;
}

/* 閉じるボタン */
.mf-close{
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #333;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.mf-close:hover{ background: rgba(0,0,0,.06); }

/* 入力ブロック */
.mf-field{ margin: 16px 0; }
.mf-field label{
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

/* 入力要素 */
.mf-field input,
.mf-field textarea{
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #111;

  background: #fff;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
  outline: none;
}
.mf-field textarea{
  resize: vertical;
  min-height: 140px;
}

/* フォーカス可視化（企業サイト向け控えめリング） */
.mf-field input:focus,
.mf-field textarea:focus{
  border-color: var(--color-turquoise, #1b5d75);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-turquoise, #1b5d75) 20%, transparent);
}

/* 必須マーク */
.mf-required{
  color: var(--color-accent, #e60012);
  font-size: 12px;
  margin-left: .4em;
  font-weight: 600;
}

/* プライバシーチェック */
.mf-privacy{ margin: 20px 0; font-size: 13px; }
.mf-checkbox{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.mf-checkbox input{ width: 16px; height: 16px; }

/* エラーメッセージ */
.mf-errors{
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--color-accent, #e60012) 55%, #fff);
  background: color-mix(in srgb, var(--color-accent, #e60012) 6%, #fff);
  color: var(--color-accent, #e60012);
  border-radius: 8px;
  font-size: 13px;
}

/* 確認ビューの表示 */
.mf-review{
  display: grid;
  grid-template-columns: 10em 1fr;
  gap: 10px 16px;
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid #eee;
}
.mf-review dt{ color: #555; font-size: 13px; }
.mf-review dd{ margin: 0; word-break: break-word; }

/* ボタン */
.mf-actions{
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.mf-btn{
  appearance: none;
  border: 1px solid #cfcfcf;
  background: #f7f7f7;
  color: #222;
  padding: .65em 1.25em;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .02s ease;
}
.mf-btn:hover{ background: #efefef; }
.mf-btn:active{ transform: translateY(1px); }

.mf-btn--primary{
  background: var(--color-turquoise, #1b5d75);
  border-color: var(--color-turquoise, #1b5d75);
  color: #fff;
}
.mf-btn--primary:hover{
  background: color-mix(in srgb, var(--color-turquoise, #1b5d75) 90%, #fff);
  border-color: color-mix(in srgb, var(--color-turquoise, #1b5d75) 90%, #fff);
}

/* フォーカスリング（アクセシビリティ） */
.mf-btn:focus-visible,
.mf-close:focus-visible{
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-turquoise, #1b5d75) 25%, #0000);
}

/* アニメーションを減らす環境 */
@media (prefers-reduced-motion: reduce){
  .mf-overlay{ transition: none; }
}

/* 狭い画面向け微調整 */
@media (max-width: 480px){
  .mf-dialog{ padding: 22px 18px 18px; }
  .mf-header h2{ font-size: 18px; }
  .mf-review{ grid-template-columns: 8.5em 1fr; }
}

.recaptcha-notice {
  font-size: 12px;
  color: #666;
  margin-top: 12px;
  line-height: 1.4;
  text-align: left;
}
.recaptcha-notice a {
  color: inherit;
  text-decoration: underline;
}

.grecaptcha-badge { visibility: hidden; }



/* ------------------------------

　　プライバシー

------------------------------ */
.mf-overlay[data-modal="privacy"] .mf-dialog {
  max-width: 800px;         /* 読みやすい横幅 */
  font-size: 14px;          /* 小さめの文字 */
  line-height: 1.9;         /* 行間を広めに */
  text-align: justify;      /* 両端揃え */
}

.mf-overlay[data-modal="privacy"] h2,
.mf-overlay[data-modal="privacy"] h3 {
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  font-weight: bold;
}

.mf-overlay[data-modal="privacy"] p,
.mf-overlay[data-modal="privacy"] ul,
.mf-overlay[data-modal="privacy"] li {
  margin-bottom: 1em;
}

.mf-overlay[data-modal="privacy"] ul {
  padding-left: 1.5em;   /* 箇条書きは少し字下げ */
}

.mf-overlay[data-modal="privacy"] li {
  list-style: disc;
}

/* タブボタン */
.tabButton{
    position:fixed;
    top:30%;
    right:0;
    transform:translateY(-100%) rotate(-90deg);
    transform-origin:bottom right;
    background-color:#1b5d75;
    color:#fff;
    padding:8px;
    border-radius:4px 4px 0 0;
    cursor:pointer;
    font-size:clamp(14px, 1.5vw, 18px);
    text-decoration:none;
    opacity:0;
    transition:opacity 0.5s ease;
    z-index:10;
}

.tabButton.visible{
    opacity:1;
}
.tabButton.hidden{
    opacity:0;
}


/* ------------------------------

　　エフェクト

------------------------------ */
/* 桜吹雪レイヤー：最前面＆クリックを邪魔しない＋たまに風で全体が動く */
.sakura-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3; /* hero-img 0, heroText 2 の前面 */

  /* ゆっくりした「風」のアニメーション（レイヤー全体に適用） */
  animation: sakura-wind 28s ease-in-out infinite;
}

/* レイヤー全体の「風」アニメーション */
@keyframes sakura-wind {
  0%, 10%, 55%, 100% {
    transform: translateX(0);
  }

  /* 1回目の風（右へ） */
  15% {
    transform: translateX(10px);
  }
  18% {
    transform: translateX(40px);
  }
  22% {
    transform: translateX(15px);
  }

  /* 2回目の風（左へ） */
  35% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(-45px);
  }
  45% {
    transform: translateX(-20px);
  }

  /* 3回目（やや強めに右へ） */
  70% {
    transform: translateX(0);
  }
  78% {
    transform: translateX(35px);
  }
  85% {
    transform: translateX(10px);
  }
}

/* 花びらの基本形状（小さめ） */
.sakura-petal {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 16px;
  border-radius: 70% 15% 70% 15%; /* デフォルト形状 */
  opacity: 0;
  transform-origin: center;
  will-change: transform, opacity;
  animation-name: sakura-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* 色のバリエーション：白50% / 黒50% */
.sakura-overlay[data-sakura-color="light"] .sakura-petal {
  background: rgba(255, 255, 255, 0.3);
}

.sakura-overlay[data-sakura-color="dark"] .sakura-petal {
  background: rgba(0, 0, 0, 0.3);
}

/* 花びらタイプA：縦長 */
.sakura-petal.type-a {
  border-radius: 100% 0% 100% 0% / 91% 11% 89% 9%;
}

/* 花びらタイプB：丸め */
.sakura-petal.type-b {
  border-radius: 60% 35% 65% 40%;
}

/* 花びらタイプC：先がとがり気味 */
.sakura-petal.type-c {
  border-radius: 80% 10% 55% 45%;
}

/*
  落下＋左右ゆらぎ＋クルクル回転
  - --start-x       : X方向の基準位置
  - --drift         : 左右の揺れ幅
  - --rotate-offset : 各花びらごとの回転オフセット
  - --spin-mult     : 回転スピード倍率（不定期クルクル用）
  - --scale         : 大きさ（0.6〜1.2倍）
  - --flip          : 左右反転（1 or -1）
*/
@keyframes sakura-fall {
  0% {
    transform:
      translate3d(var(--start-x, 0px), -10vh, 0)
      rotateZ(calc(0deg * var(--spin-mult, 1) + var(--rotate-offset, 0deg)))
      scaleX(var(--flip, 1))
      scale(var(--scale, 1));
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  /* 少し右に流れつつゆっくり回転 */
  25% {
    transform:
      translate3d(
        calc(var(--start-x, 0px) + var(--drift, 25px)),
        25vh,
        0
      )
      rotateZ(calc(1080deg * var(--spin-mult, 1) + var(--rotate-offset, 0deg)))
      scaleX(var(--flip, 1))
      scale(var(--scale, 1));
  }

  /* 左に戻りながら、一気にクルクル（速い回転） */
  50% {
    transform:
      translate3d(
        calc(var(--start-x, 0px) - var(--drift, 25px)),
        50vh,
        0
      )
      rotateZ(calc(2160deg * var(--spin-mult, 1) + var(--rotate-offset, 0deg)))
      scaleX(var(--flip, 1))
      scale(var(--scale, 1));
  }

  /* 再び右へ、少しスローダウン */
  75% {
    transform:
      translate3d(
        calc(var(--start-x, 0px) + var(--drift, 25px)),
        80vh,
        0
      )
      rotateZ(calc(900deg * var(--spin-mult, 1) + var(--rotate-offset, 0deg)))
      scaleX(var(--flip, 1))
      scale(var(--scale, 1));
  }

  /* 最後に左へ抜けながら、回転を落ち着ける */
  100% {
    transform:
      translate3d(
        calc(var(--start-x, 0px) - var(--drift, 25px)),
        110vh,
        0
      )
      rotateZ(calc(1080deg * var(--spin-mult, 1) + var(--rotate-offset, 0deg)))
      scaleX(var(--flip, 1))
      scale(var(--scale, 1));
    opacity: 0;
  }
}
