
html{
  scroll-behavior: smooth;
}

body {
  background-color: rgb(243, 243, 243);
  font-family: "Hina Mincho", serif;
  font-weight: 400;
  font-style: normal;
  color: rgb(32, 32, 32);
  margin: -2%;
  overflow-x: hidden;
} 

.hero {
  width: 100%;
  height:560px;
  overflow: hidden;

}

.hero-area {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 80% 30%;
}

.rogo {
  max-width: 50%;
  margin-left: 10%;
  margin-top: -500%;
}

#trailCanvas{
  position:fixed;
  top:0;
  left:0;
  pointer-events:none;
  z-index:9999;
}


.bg2 {
  position: relative;
  height: 80px;
  background-color: #f1f1f1;
  transform: rotate(-3deg);
  box-shadow: 0px 20px 20px #bababa;
  z-index: 30;
}

.bg {
  position: relative;
  height: 80px;
  background-color: #f1f1f1;
  box-shadow: 0px 20px 20px #bababa;
  z-index: 20;
  transform: translateY(-50px);
  transition: transform 1s ease;
}

.bg.visible {
  transform: translateY(0);
  opacity: 1;
}


.hero{
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: rgb(243, 243, 243);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}







/* ロゴ */
.hero-logo{
  position: absolute;
  z-index: 30;              /* bg / mask-svg より上 */
  
  bottom: 2%;
  left: 6%;                 /* or right: 6% */

  width: 70%;
  height: auto;

  pointer-events: none;     /* クリック不要なら */
  opacity: 0;
  transform: translateY(10px);
  animation: logoFadeIn 1.2s ease-out 0.8s forwards;
}

@keyframes logoFadeIn{
  to{
    opacity: 1;
    transform: translateY(0);
  }
}


/* 表示サイズ（レスポンシブ） 
.hero .mask-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}
*/
/* 楕円は r じゃなく rx/ry をアニメーションする */
/*
@keyframes expandEllipse {
  0%   { rx: 0;   ry: 0; }
  100% { rx: 1200; ry: 800; } /* ここは滲みの広がり量 */


/* 重要：nth-child は「maskの中の子要素順」依存になりやすいので
   迷ったらHTML側で style="animation-delay:..." を付けるのが安定 */
  /*
.ink-ellipse:nth-child(1) { animation: expandEllipse 4s forwards 0s; }
.ink-ellipse:nth-child(2) { animation: expandEllipse 4s forwards 0.2s; }
.ink-ellipse:nth-child(3) { animation: expandEllipse 4s forwards 0.4s; }
.ink-ellipse:nth-child(4) { animation: expandEllipse 4s forwards 0.6s; }
*/
.image-modal{
  position: fixed;   /* ←これが全画面の鍵 */
  inset: 0;
  z-index: 9998;     /* nav(2000)やbgより確実に上 */
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  z-index: 1500; /* ← 2000より下にする */
}

.image-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}

.image-modal-bg{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.image-modal img{
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  transition: transform 350ms cubic-bezier(.2,.9,.2,1), opacity 250ms ease;
}

.image-modal.is-open img{
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.image-modal img{
  max-width: 50vw;
  padding-right: 30%;
}

.sticky-btn{
  position: relative;
  width: 100px;
  height: 44px;

  background: rgb(243,243,243);
  color: #333333;

  border: none;
  border-radius: 2px;
  cursor: pointer;

  font-family: "Hina Mincho", serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    0 4px 6px rgba(0,0,0,0.15),
    0 1px 0 rgba(255,255,255,0.6) inset;

  transform: rotate(-2deg);
  transition:
    transform 200ms cubic-bezier(.2,.9,.2,1),
    box-shadow 200ms ease;
}

.sticky-btn::after{
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;

  width: 12px;
  height: 12px;

  background: rgba(0,0,0,0.08);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.sticky-btn:hover{
  transform: rotate(0deg) translateY(-2px);
  box-shadow:
    0 6px 10px rgba(0,0,0,0.18),
    0 1px 0 rgba(255,255,255,0.6) inset;
}

.sticky-btn:active{
  transform: rotate(1deg) translateY(1px);
  box-shadow:
    0 3px 4px rgba(0,0,0,0.12);
}


/* download用だけ小さく / 大きく */
.sticky-download{
  width: 200px;     /* ←ここ調整 */
  height: 44px;
  margin-left: 10%;
}

.sticky-btn,
.sticky-btn:link,
.sticky-btn:visited,
.sticky-btn:hover,
.sticky-btn:active{
  text-decoration: none;
}



.update,
.about,
.soundtos,
.charatos,
.sound,
.inquiry {
  margin-top: 80px;
  position: relative;
  margin-left: 10%;
  margin-right: 40%;

  z-index: 10;                 /* ←負のz-indexは使わない！ */
  transform: translateY(-100px);
  transition: transform 1.5s ease, z-index 0s 1.5s; /* z-indexは遅れて変化 */
}


.update.visible,
.about.visible,
.soundtos.visible,
.charatos.visible,
.sound.visible,
.inquiry.visible {
  transform: translateY(0);
  /*z-index: 40;*/
  transition: transform 1.5s ease, z-index 0s 0s;
}

.tatie{
    width: 90%;
}


#sideNav{
  position: fixed;
  top: 0;
  left: auto !important;
  right: 0 !important;
  height: 100vh;
  width: 30%;                 /* 細めの縦長バー。好みで調整OK */
  background: #1f1f1f;
  z-index: 2000;               /* bg/bg2 より前に */
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 10px;
  box-sizing: border-box;
  
 clip-path: polygon(
    8% 0%,
    100% 2%,
    95% 100%,
    0% 96%
  );

    --reveal-rot: -90deg;
    --reveal-x: 100%;
    --wobble-rot: 0deg;
    --wobble-x: 0px;

    transform-origin: top right;
    transform:
    rotate(calc(var(--reveal-rot) + var(--wobble-rot)))
    translateX(calc(var(--reveal-x) + var(--wobble-x)));

  pointer-events: none;

   transition: transform 900ms cubic-bezier(.2,.9,.2,1);

}


.sideNav-inner{
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 10px;
  box-sizing: border-box;
}


/* update 以降で表示 */
#sideNav.is-shown{
  --reveal-rot: 0deg;
  --reveal-x: 0%;
  pointer-events: auto;

  /* 揺れは別アニメで変数だけ動かす */
  animation: navWobbleVars 1800ms linear 1;
  animation-delay: 900ms; /* ← 出現が終わってから余韻 */
}

@keyframes navReveal{
  0%   { transform: rotate(-90deg) translateX(100%); }
  100% { transform: rotate(0deg) translateX(0); }
}

#sideNav a{
  display: inline-block;
  position: relative;
  color: rgb(243,243,243);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding-bottom: 6px;
  margin: 5%;
}

#sideNav a::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;          /* 太くして確認 */
  background:rgb(243,243,243); 
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
}

#sideNav a:hover::after{
  transform: scaleX(1) skewX(-8deg);
}


/* ハンバーガー（PCは非表示） */
#hamburger{
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: #1f1f1f;
  border-radius: 6px;
  z-index: 10001; /* sideNavより上に */
  cursor: pointer;
}

/* 3本線 */
#hamburger span{
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: rgb(243,243,243);
  transition: transform 200ms ease, top 200ms ease, opacity 200ms ease;
}
#hamburger span:nth-child(1){ top: 13px; }
#hamburger span:nth-child(2){ top: 21px; }
#hamburger span:nth-child(3){ top: 29px; }

/* 開いたとき×に変形 */
#hamburger.is-open span:nth-child(1){ top: 21px; transform: rotate(45deg); }
#hamburger.is-open span:nth-child(2){ opacity: 0; }
#hamburger.is-open span:nth-child(3){ top: 21px; transform: rotate(-45deg); }

/* --- スマホ用 --- */
@media (max-width: 768px){

  /* ハンバーガーを出す */
  #hamburger{ display: block; }

  /* PC用の縦バーは「引き出し」化 */
  #sideNav{
    width: min(78vw, 320px); /* スマホ幅 */
    height: 100vh;

    /* ここ重要：回転演出はスマホではやめて横スライドに */
    transform: translateX(110%);
    transition: transform 260ms cubic-bezier(.2,.9,.2,1);

    transform-origin: top right;
    top: 0;
    right: 0;
  }

  /* 開いた状態 */
  #sideNav.is-open{
    transform: translateX(0);
    pointer-events: auto;
  }

  /* update以降で表示…という仕様があるなら、スマホは常時使える方が便利なので
     is-shown に依存してる場合は一旦ここで無効化してOK */
  #sideNav.is-shown{
    animation: none;
  }

  /* メニュー内リンクの見やすさ（任意） */
  #sideNav a{
    font-size: 14px;
  }
}

@media (max-width: 768px){

  #hamburger{ display: block; }

  /* 全画面メニュー */
  #sideNav{
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;

    /* 見た目 */
    background: #1f1f1f;

    /* 最前面 */
    z-index: 2400;

    /* 開閉 */
    transform: translateX(100%);
    transition: transform 260ms cubic-bezier(.2,.9,.2,1);

    /* クリップ歪みを使ってるなら、全画面では外した方が安定 */
    clip-path: none;

    /* スマホでは縦書きOFFの方が見やすいならここで上書き可 */
    /* writing-mode: horizontal-tb; */
  }

  #sideNav.is-open{
    transform: translateX(0);
    pointer-events: auto;
  }

  /* 中身のレイアウト調整（任意） */
  #sideNav .sideNav-inner{
    height: 100%;
    padding: 80px 22px 22px; /* 上はハンバーガー分空ける */
    gap: 18px;
  }

  #sideNav a{
    font-size: 18px;
    letter-spacing: 0.08em;
  }
}


.accordion {
  max-width: 500px;
  margin-bottom: 7px;
  border-bottom: 2px solid #000000;
}

.accordion summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 1em 2em;
  color: #333333;
  font-weight: 600;
  cursor: pointer;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  transform: translateY(-25%) rotate(45deg);
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-bottom: 3px solid #333333b3;
  border-right: 3px solid #333333b3;
  content: '';
  transition: transform .3s;
}

.accordion[open] summary::after {
  transform: rotate(225deg);
}

.accordion p {
  transform: translateY(-10px);
  opacity: 0;
  margin: 0;
  padding: .3em 2em 1.5em;
  color: #333333;
  transition: transform .5s, opacity .5s;
}

.accordion[open] p {
  transform: none;
  opacity: 1;
}

.about h3 {
  margin-top: -3%;
}

footer {
  text-align: center;
  color: #8d8d8d;
  margin-top: 20%;
  margin-bottom: 5%;
}



.x-icon-link{
  display: inline-block;
}

.x-icon{
  margin-top: 30px;
  margin-left: 20%;
  width: 34px;      /* 好みで調整 */
  height: auto;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.x-icon-link:hover .x-icon{
  opacity: 1;
}


/* ロゴリンク */
.sideNav-logo{
  margin-bottom: 20px;
  padding: 10px;
}

/* ロゴ画像 */
.sideNav-logo img{
  width: 100%;
  max-width: 180px;   /* 好みで */
  height: auto;
  display: block;
}

/* ロゴには下線アニメを出さない */
.sideNav-logo::after{
  display: none;
}


/* サイドメニューが画面より長い時にスクロールできるようにする */
#sideNav{
  position: fixed;      /* すでに付いてたら不要 */
  inset: 0;             /* 画面いっぱい */
  overflow: hidden;     /* 外側は隠す */
  z-index: 9000;        /* 必要なら調整 */
}

#sideNav .sideNav-inner{
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iPhoneでヌルヌル */
  padding-bottom: 24px;              /* 下の項目が押しやすい */
}



.exhibit-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.exhibit-modal.is-hidden{
  display: none;
}

.exhibit-modal-inner{
  background: rgb(243,243,243);
  padding: 24px 28px;
  max-width: 320px;
  text-align: center;
  line-height: 1.6;
}

.exhibit-modal-close{
  margin-top: 16px;
  padding: 6px 18px;
  border: none;
  background: #161616;
  color: #fff;
  cursor: pointer;
}

.mask-svg{
  opacity: 0;
}

.mask-svg.is-loaded{
  opacity: 1;
}
