/* hero-math: パラメトリック点群ヒーロー(デザインの正: mockup/index.html) */

hero-math {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgb(var(--color-background));
}

/* sticky ヘッダー分を差し引き、ヒーロー全体(SCROLLヒント含む)が初期表示に収まるようにする */
.hero-math--full { height: calc(100svh - var(--header-height, 6.4rem)); min-height: 56rem; }
.hero-math--large { height: 80svh; min-height: 48rem; }
.hero-math--medium { height: 60svh; min-height: 40rem; }
.hero-math--small { height: 36svh; min-height: 24rem; }

/* 小(バンド)ではコンテンツを密に */
.hero-math--small .hero-math__eq { margin-bottom: 1.2rem; }
.hero-math--small .hero-math__eq-formula { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
.hero-math--small .hero-math__heading { font-size: clamp(2rem, 3.5vw, 2.8rem); }
.hero-math--small .hero-math__content { padding: 2rem 1.5rem; }

.hero-math__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.8s ease;
}

.hero-math__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* 初期化成功時: canvas をフェードイン、フォールバックをフェードアウト */
.hero-math--ready .hero-math__canvas { opacity: 1; }
.hero-math--ready .hero-math__fallback { opacity: 0; }

.hero-math__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4.5rem 1.5rem 3rem;
  pointer-events: none;
  /* スクリム(::before, z-index: -1)がcanvasの背後に落ちないようにする */
  isolation: isolate;
}

/* 数式のリアルタイム表示 */
.hero-math__eq {
  transition: opacity 0.4s;
  margin-bottom: clamp(2.5rem, 9vh, 6rem);
}

/* 点群が濃い場所でも読めるよう、テキスト背後にソフトなスクリムを敷く */
.hero-math__eq,
.hero-math__copy {
  position: relative;
}

.hero-math__eq::before,
.hero-math__copy::before {
  content: '';
  position: absolute;
  inset: -1.6rem -3.5rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse closest-side,
    rgba(var(--color-background), 0.92) 0%,
    rgba(var(--color-background), 0.6) 60%,
    rgba(var(--color-background), 0) 100%
  );
}

.hero-math__copy::before {
  inset: -3rem -5.5rem;
}

.hero-math__eq-formula {
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  color: rgba(var(--color-foreground), 0.65);
  letter-spacing: 0.05em;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.hero-math__heading {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.4rem, 6.4vw, 4.4rem);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: rgb(var(--color-foreground));
}

.hero-math__subheading {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: rgba(var(--color-foreground), 0.6);
  text-transform: uppercase;
  margin-top: 0.8rem;
}

.hero-math__buttons {
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-math__cta {
  pointer-events: auto;
  display: inline-block;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-decoration: none;
  color: rgb(var(--color-foreground));
  border: 0.1rem solid rgb(var(--color-foreground));
  padding: 1.3rem 4.2rem;
  transition: background 0.35s, color 0.35s;
}

.hero-math__cta:hover {
  background: rgb(var(--color-foreground));
  color: rgb(var(--color-background));
}

.hero-math__cta--secondary {
  border-color: rgba(var(--color-foreground), 0.35);
}

.hero-math__scroll-hint {
  position: absolute;
  right: 2.4rem;
  bottom: 2rem;
  font-size: 0.95rem;
  letter-spacing: 0.4em;
  color: rgba(var(--color-foreground), 0.35);
  writing-mode: vertical-rl;
}

@media screen and (max-width: 749px) {
  .hero-math__scroll-hint { display: none; }
  .hero-math--full { min-height: 48rem; }
}
