/* 初回訪問時のローディング（桜島写真 → 八角形 → レンズフレア → 明転） */

.site-intro {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  /* スクロールバー用の余白まで覆い、横の緑帯を出さない */
  width: 100vw;
  height: 100%;
  z-index: 1000;
  overflow: hidden;
  background: var(--green-deep, #1b2e24);
  isolation: isolate;
  opacity: 1;
}

html.is-intro .site-intro,
html.is-intro-leaving .site-intro {
  display: block;
}

html.is-intro,
html.is-intro body,
html.is-intro-leaving,
html.is-intro-leaving body {
  overflow: hidden;
  /* 幅は保ったまま、導入中だけバーを隠す */
  scrollbar-gutter: stable;
}

html.is-intro,
html.is-intro-leaving {
  scrollbar-width: none;
}

html.is-intro::-webkit-scrollbar,
html.is-intro-leaving::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.site-intro-photo,
.site-intro-flare {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.site-intro-photo {
  z-index: 0;
}

/* 黒背景のレンズフレアを Screen 合成して透過させる */
.site-intro-flare {
  z-index: 1;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

html.is-intro-flare .site-intro-flare {
  opacity: 1;
}

.site-intro-octagon {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(7.5rem, 28vw);
  height: min(7.5rem, 28vw);
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}

.site-intro-octagon-path {
  fill: none;
  stroke: var(--green-mid, #355246);
  stroke-width: 2px;
  stroke-linejoin: miter;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.site-intro-octagon-fill {
  fill: var(--green-mid, #355246);
}

html.is-intro-flare .site-intro-octagon {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.site-intro-white {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

html.is-intro-whiteout .site-intro-white {
  opacity: 1;
  transition: opacity 0.15s linear;
}

html.is-intro-leaving .site-intro {
  opacity: 0;
  pointer-events: none;
  /* 白の明転から、じわっとサイトが見えてくる */
  transition: opacity 0.5s cubic-bezier(0.37, 0, 0.2, 1);
}

html.is-intro-leaving .site-intro-white {
  opacity: 1;
}

/* 初回ロード中は言語切替・ハンバーガーを出さず、アニメーションだけ見せる */
html.is-intro body.is-home #site-header {
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html.is-intro-flare .site-intro-octagon,
  html.is-intro-whiteout .site-intro-white,
  html.is-intro-leaving .site-intro {
    transition: none;
  }
}
