/* ============================================================
   opening.css
   ------------------------------------------------------------
   サイトを開いた瞬間に表示される「オープニングアニメーション」
   (湯気が立ちのぼり、ロゴがフワッと浮かび上がる演出)のスタイルです。

   もともと別プロジェクト(ezokamui-opening)として作られていたものを、
   このサイト(index.html)用に画像パスだけ変更して取り込んでいます。
   ============================================================ */

/* ==================================================
   ①オープニング画面 全体（#opening）
   ------------------------------------------------
   position: fixed を使って、画面いっぱいに固定表示させます。
================================================== */
#opening {
  position: fixed;   /* 画面に固定する */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* 万が一、背景画像が読み込めなかったときの「保険」の色 */
  background-color: #f4f2ee;

  /* 中の要素（湯気・ロゴ）を画面の中央に配置するための設定 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* 湯気がはみ出して画面外に消えていく動きをするので、
     はみ出た部分は見えないように隠しておく */
  overflow: hidden;

  /* 他の要素より必ず手前（一番上）に表示させる */
  z-index: 9999;

  /* opacity（透明度）が変化するときに、1秒かけてゆっくり変化させる */
  transition: opacity 1s ease;
}

/* #opening の「背景専用レイヤー」(和紙の背景にぼかしをかける) */
#opening::before {
  content: "";
  position: absolute;

  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;

  background-image: url("images/opening-washi-bg.jpg");
  background-size: cover;
  background-position: center;

  filter: blur(6px);

  z-index: 0;
}

/* JavaScript側で、時間が経ったらこの is-hidden クラスを
   #opening に追加する。すると、上で設定したtransitionの効果で
   1秒かけてフワッと透明になっていく。 */
#opening.is-hidden {
  opacity: 0;
  pointer-events: none;
}


/* ==================================================
   ②湯気（ゆげ）まわりのスタイル
================================================== */
.steam-container {
  position: absolute;
  bottom: 24%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1;
}

.steam {
  width: 130px;
  height: auto;

  filter: brightness(1.2)
          drop-shadow(0 4px 10px rgba(90, 70, 50, 0.45))
          drop-shadow(0 0 14px rgba(90, 70, 50, 0.25));

  opacity: 0;

  animation: opening-steam-rise 4.5s ease-in-out infinite;
}

.steam:nth-child(1) {
  width: 75px;
}
.steam:nth-child(2) {
  width: 175px;
}
.steam:nth-child(3) {
  width: 70px;
}

.steam:nth-child(2) {
  animation-delay: 1.5s;
}
.steam:nth-child(3) {
  animation-delay: 3s;
}

@keyframes opening-steam-rise {
  0% {
    transform: translateY(0) translateX(0) scale(0.9);
    opacity: 0;
  }
  15% {
    opacity: 0.55;
  }
  50% {
    transform: translateY(-210px) translateX(10px) scale(1);
  }
  85% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(-440px) translateX(-8px) scale(1.05);
    opacity: 0;
  }
}


/* ==================================================
   ③ロゴエリア
================================================== */
.opening-logo-area {
  position: relative;
  z-index: 2;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.opening-logo-mark {
  width: 130px;
  height: auto;
  margin-bottom: 8px;

  opacity: 0;
  transform: translateY(14px);
  animation: opening-fade-up 1.8s ease forwards;
}

.opening-logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.opening-logo-sub {
  color: #8a7768;
  font-size: 22px;
  letter-spacing: 4px;
  margin-bottom: 0;
  line-height: 1;

  opacity: 0;
  transform: translateY(14px);
  animation: opening-fade-up 1.8s ease forwards;
  animation-delay: 2s;
}

.opening-logo-main {
  color: #3b2b23;

  font-size: clamp(34px, 9vw, 62px);
  letter-spacing: 6px;
  line-height: 1;

  white-space: nowrap;

  font-family: "Shippori Mincho", serif;
  font-weight: 700;

  opacity: 0;
  transform: translateY(14px);
  animation: opening-fade-up 1.8s ease forwards;
  animation-delay: 2.4s;
}

@keyframes opening-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==================================================
   ④スマホなど、画面が狭いときだけ効く特別なスタイル
================================================== */
@media (max-width: 480px) {

  .opening-logo-area {
    padding: 0 24px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .opening-logo-sub {
    font-size: 15px;
    letter-spacing: 2px;
  }

  .opening-logo-main {
    font-size: clamp(26px, 8vw, 62px);
    letter-spacing: 3px;
  }

  .steam-container {
    width: 160px;
  }

  .steam:nth-child(1) {
    width: 55px;
  }
  .steam:nth-child(2) {
    width: 130px;
  }
  .steam:nth-child(3) {
    width: 50px;
  }
}
