/* =========================================================
 * Base & Fonts
 * =======================================================*/
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  perspective: 1500px;
  font-family: "Warming", sans-serif;
}
html {
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden;
}

@font-face {
  font-family: "Noteworthy";
  src: url("./fonts/Noteworthy.ttc") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* Warming Regular（400） */
@font-face {
  font-family: "Warming";
  src: url("./fonts/warming-font-family-2023-11-27-05-11-16-utc/Warming WOFF/Warming-Regular.woff2")
      format("woff2"),
    url("./fonts/warming-font-family-2023-11-27-05-11-16-utc/Warming WOFF/Warming-Regular.woff")
      format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Warming Bold（700） */
@font-face {
  font-family: "Warming";
  src: url("./fonts/warming-font-family-2023-11-27-05-11-16-utc/Warming WOFF/Warming-Bold.woff2")
      format("woff2"),
    url("./fonts/warming-font-family-2023-11-27-05-11-16-utc/Warming WOFF/Warming-Bold.woff")
      format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Warming ExtraBold（800） */
@font-face {
  font-family: "Warming";
  src: url("./fonts/warming-font-family-2023-11-27-05-11-16-utc/Warming WOFF/Warming-ExtraBold.woff2")
      format("woff2"),
    url("./fonts/warming-font-family-2023-11-27-05-11-16-utc/Warming WOFF/Warming-ExtraBold.woff")
      format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

.noteworthy {
  font-family: "Noteworthy", sans-serif;
}
.sans-serif {
  font-family: Poppins, system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
}
* {
  box-sizing: border-box;
}

:root {
  --magnet-radius: 180px;
  --magnet-strength: 28;
  --spring: 0.12;
  --damping: 0.85;
  --max-offset: 32px;
  --rotate-factor: 0.15;
}

/* =========================================================
 * Layout
 * =======================================================*/
body {
  background: #fff;
  color: #000;
}
.container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}
section {
  height: 100vh;
  scroll-snap-align: start;
  transform-style: preserve-3d;
}

/* =========================================================
 * Hero
 * =======================================================*/
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  flex-direction: column;
  background: #fff;
  z-index: 1;
}
.hero-bg {
  position: absolute;
  top: 80%;
  left: 80%;
  width: 70%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: -1;
}
.hero-text {
  position: relative;
  z-index: 1;
  color: #000;
  font-family: "Warming";
  line-height: 1;
  font-weight: 800;
  font-size: clamp(8rem, 7vw, 6rem);
  text-transform: uppercase;
  text-align: left;
  max-width: 102%;
  user-select: none;
  margin-top: 40px;
  padding: 0;
}
.hero-text .line {
  position: relative;
  overflow: visible;
  white-space: nowrap;
}
.hero-text .char {
  display: inline-block;
  position: relative;
  top: 0;
  left: 0;
  will-change: top, left, transform;
  transition: transform 0s;
  pointer-events: none;
}
/* Typo positions（既存配置を継承） */
.wiping {
  margin-left: 50px;
}
.ltd {
  text-transform: none;
  font-size: 14px;
  top: -6em;
  right: 2rem;
}
.ke {
  margin-left: 14%;
}
.tokyo {
  font-size: 12px;
  top: -7em;
  right: 3rem;
}
.ltd,
.tokyo {
  font-size: 12px;
  line-height: 1;
  text-transform: none;
  position: relative;
}
.creation {
  margin-left: 11%;
  margin-right: 124px;
}
.num_21 {
  margin-left: 10%;
  font-weight: bold;
}
.DESTRUCTION {
  margin-left: 30px;
}
.and {
  margin-left: 20%;
}
.fusion {
  margin-left: 80px;
}
.num-31 {
  margin-left: 10%;
}
.num-52 {
  margin-left: 12%;
}
.revolving {
  margin-left: 30px;
}
.an {
  margin-left: 550px;
}
.axis {
  margin-left: 30px;
}
.num-24 {
  margin-left: 14%;
}

/* Motion-reduce */
@media (prefers-reduced-motion: reduce) {
  :root {
    --magnet-strength: 10;
    --damping: 0.9;
    --max-offset: 12px;
  }
}

/* =========================================================
 * Stones
 * =======================================================*/
.section-video-stones {
  position: relative;
  width: 100%;
  height: 102vh;
  overflow: hidden;
  background: #ffffff;
  isolation: isolate;
  z-index: 2;
}
.section-video-stones .video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
  transform-origin: top center; /* 上を基準に縮む */
}
.section-video-stones .stone-wrap {
  position: absolute;
  will-change: transform;
  pointer-events: none;
}
/* これをファイルの最後の方に置く（または既存の後半ブロックを書き換え） */
.section-video-stones .stone {
  position: absolute;
  width: 22vw;
  height: auto;
  filter: drop-shadow(0 10px 40px rgba(249, 249, 249, 0.35));
  will-change: transform, opacity;
  opacity: 1; /* ← ここが重要（0を上書き） */
  transform: translateY(-1vh);
}

@media (prefers-reduced-motion: reduce) {
  .section-video-stones .stone,
  .section-video-stones .stone-wrap {
    transition: none !important;
  }
}

/* =========================================================
 * Sticky Curtain（クロスフェード）
 * =======================================================*/
.curtain > section {
  position: sticky;
  top: 0;
  min-height: 100vh;
  scroll-snap-align: none;
  z-index: 0;
}

.hero {
  z-index: 2;
  background: #fff;
}

/* ふわっと切替（Hero→Stones） */
.curtain .hero,
.curtain .section-video-stones {
  transition: opacity 1s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.curtain.is-auto-animating .hero {
  opacity: 1;
  transform: translateY(-2vh) scale(0.99);
}
.curtain.is-auto-animating .section-video-stones {
  opacity: 1;
  transform: translateY(0);
}
.curtain .section-video-stones {
  opacity: 1;
  transform: translateY(1vh);
}
.container.is-auto-scrolling {
  scroll-snap-type: none !important;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .curtain .hero,
  .curtain .section-video-stones {
    transition-duration: 0.3s;
  }
}

/* =========================================================
 * OctaveFX（接頭辞用）
 * =======================================================*/
.octavefx-hint {
  position: absolute;
  left: 50%;
  bottom: 3vmin;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
[data-octavefx="hero"] {
  position: relative;
  overflow: hidden;
}
.octavefx-blob {
  position: absolute;
  left: 10%;
  top: 10%;
  width: min(55vmax, 90vw);
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: radial-gradient(
      circle at 35% 35%,
      rgba(120, 170, 255, 0.9) 0%,
      rgba(40, 80, 170, 0.9) 45%,
      transparent 60%
    ),
    radial-gradient(
      circle at 65% 60%,
      rgba(160, 230, 255, 0.8) 0%,
      rgba(25, 150, 200, 0.8) 45%,
      transparent 60%
    );
  filter: blur(30px) saturate(140%) brightness(120%);
  mix-blend-mode: screen;
  opacity: 0.5;
  pointer-events: none;
}

/* 以降、plans/specialities などは既存のままでOK */

/* === Hero Scroll FX 用の最適化 === */
.hero-text {
  will-change: transform, filter, opacity;
  transform-origin: 50% 60%; /* デフォは中央寄り */
}

/* 「suck」モード用：重心を下に置く */
.hero-text.is-suck-origin {
  transform-origin: 50% 120%;
}

@media (prefers-reduced-motion: reduce) {
  .hero-text {
    transform: none !important;
    filter: none !important;
  }
}

.container {
  overscroll-behavior: contain;
}

/* はみ出しを切られないように */
.container,
.curtain,
.section-video-stones {
  overflow: visible !important;
}

/* stacking：セクション自体には z-index を付けない（＝前面にしない） */
.section-video-stones {
  position: relative;
} /* z-index は付けない */
.hero {
  position: relative;
  z-index: 1;
}

/* 石だけ前面へ（動画よりも・ヒーローよりも上） */
.section-video-stones .stone {
  position: absolute;
  z-index: 5; /* ← 石だけを最前面に */
  will-change: transform;
  pointer-events: auto; /* 触れたい場合。触れたくなければ none */
}

/* 動画は下でOK（元のパララックス/ストレッチはそのまま動く） */
.section-video-stones .video-bg {
  position: absolute;
  z-index: 0; /* 石より下、ヒーローより下でもOK */
}