/* =========================
   Hero / FV Section (PC)
========================= */

#hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  overflow: visible;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 191px;
  background: var(--color-white);

  @media (max-width: 768px) {
    height: 100vh;
    min-height: 0;
    padding-top: 201px;
  }
}

.hero-layout {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;

  @media (max-width: 768px) {
    gap: 16px;
  }
}

.hero-title-scale {
  position: relative;
  width: 661px;
  max-width: calc(100% - 32px);
  min-width: 0;
  text-align: left;
  container-type: inline-size;
  container-name: hero;

  @media (max-width: 768px) {
    max-width: min(600px, calc(100% - 40px));
  }
}

.hero-title-guide {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
  object-position: left top;
  display: none;
  opacity: 0.4;
  pointer-events: none;
}

.hero-title {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-en);
  font-size: calc(100cqi * 121 / 661);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-black);
  text-align: left;
  white-space: nowrap;

  @media (max-width: 768px) {
    font-size: calc(100cqi * 60 / 335);
  }
}

.hero-title-line {
  display: block;
  line-height: 1;
  word-spacing: -0.08em;
}

.hero-title-letter {
  display: inline-block;
  letter-spacing: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(35px) scale(0.75);
}

.hero-title-letter.animate {
  animation: titlePop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes titlePop {
  0% {
    opacity: 0;
    transform: translateY(35px) scale(0.75);
  }

  60% {
    opacity: 1;
    transform: translateY(-8px) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-subcopy {
  font-family: var(--font-jp);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--color-black);
  margin: 0;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;

  @media (max-width: 768px) {
    width: auto;
    max-width: 100%;
    font-size: 16px;
    font-weight: 700;
  }
}

.hero-button {
  position: relative;
  z-index: 25;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: max-content;
  max-width: 100%;
  margin-top: 0;
  padding: 12px 28px;
  background: var(--color-white);
  color: var(--color-black);
  font-weight: 700;
  font-family: var(--font-jp);
  font-size: 13px;
  line-height: 1;
  border: 1px solid var(--color-text);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  transform: translateZ(0);
  transition:
    color 0.35s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;

  @media (max-width: 768px) {
    padding: 16px 20px;
    font-family: var(--font-contact);
    font-weight: 500;
    font-size: 13px;
  }
}

.hero-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--color-pink);
  z-index: -1;
  transition: width 0.5s ease;
}

.hero-button:hover::before {
  width: 100%;
}

.hero-button:hover {
  color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.planet-loop {
  position: absolute;
  top: 50%;
  left: 42%;
  z-index: 2;
  pointer-events: none;
  animation: planetOrbit 90s linear infinite;

  /* SPは専用の .hero-planet-sp / .hero-sparkle-sp に差し替えるため、
     PCの惑星はSPでは非表示にする */
  @media (max-width: 768px) {
    display: none;
  }
}

.planet-loop .planet {
  display: block;
  height: auto;
}

.planet-loop-1 {
  animation-delay: 0s;
}
.planet-loop-2 {
  animation-delay: -13s;
}
.planet-loop-3 {
  animation-delay: -26s;
}
.planet-loop-4 {
  animation-delay: -39s;
}
.planet-loop-5 {
  animation-delay: -52s;
}
.planet-loop-6 {
  animation-delay: -65s;
}
.planet-loop-7 {
  animation-delay: -78s;
}

.planet-loop-1 .planet {
  width: 320px;
}
.planet-loop-2 .planet {
  width: 190px;
}
.planet-loop-3 .planet {
  width: 300px;
}
.planet-loop-4 .planet {
  width: 210px;
}
.planet-loop-5 .planet {
  width: 340px;
}
.planet-loop-6 .planet {
  width: 180px;
}
.planet-loop-7 .planet {
  width: 260px;
}

@keyframes planetOrbit {
  0% {
    transform: rotate(0deg) translateX(42vw) rotate(0deg);
  }

  100% {
    transform: rotate(360deg) translateX(42vw) rotate(-360deg);
  }
}

/* =========================
   Hero 背景装飾（SP専用）
   惑星(.hero-planet-sp)は基準点を必ず通る楕円軌道でゆっくり周回し、
   キラキラ(.hero-sparkle-sp)は惑星ではないため回転させない。
   PCでは非表示（.planet-loop側がPC用）。
========================= */

.hero-planet-sp,
.hero-sparkle-sp {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  pointer-events: none;

  @media (max-width: 768px) {
    display: block;
  }
}

.hero-planet-sp {
  animation: planetOrbitEllipse 35s linear infinite;
}

.hero-sparkle-sp {
  animation: starTwinkle 2.4s ease-in-out infinite;
}

.hero-planet-sp-img,
.hero-sparkle-sp-img {
  display: block;
  height: auto;
}

/* --rx/--ry は惑星ごとに変えた楕円の半径（0%地点で基準点をちょうど通過する） */
.hero-planet-sp-1 {
  animation-delay: 0s;

  @media (max-width: 768px) {
    top: calc(100vw * 33 / 375);
    left: calc(100vw * -29 / 375);
    --rx: 28px;
    --ry: 16px;
  }
}
.hero-sparkle-sp-1 {
  @media (max-width: 768px) {
    top: calc(100vw * 68 / 375);
    left: calc(100vw * 195 / 375);
  }
}
.hero-planet-sp-2 {
  animation-delay: -6s;

  @media (max-width: 768px) {
    top: calc(100vw * 96 / 375);
    left: calc(100vw * 287 / 375);
    --rx: 24px;
    --ry: 14px;
  }
}
.hero-planet-sp-3 {
  animation-delay: -12s;

  @media (max-width: 768px) {
    top: calc(100vw * 227 / 375);
    left: calc(100vw * 319 / 375);
    width: 104px;
    height: 104px;
    --rx: 16px;
    --ry: 20px;
  }
}
.hero-planet-sp-4 {
  animation-delay: -18s;

  @media (max-width: 768px) {
    top: calc(100vw * 296 / 375);
    left: calc(100vw * -41 / 375);
    --rx: 32px;
    --ry: 18px;
  }
}
.hero-planet-sp-5 {
  animation-delay: -23s;

  @media (max-width: 768px) {
    top: calc(100vw * 490 / 375);
    left: calc(100vw * -60 / 375);
    --rx: 20px;
    --ry: 26px;
  }
}
.hero-planet-sp-6 {
  animation-delay: -29s;

  @media (max-width: 768px) {
    top: calc(100vw * 472 / 375);
    left: calc(100vw * 256 / 375);
    width: 162px;
    height: 162px;
    --rx: 26px;
    --ry: 15px;
  }
}

.hero-planet-sp-1 .hero-planet-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 128 / 375);
  }
}
.hero-sparkle-sp-1 .hero-sparkle-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 70 / 375);
  }
}
.hero-planet-sp-2 .hero-planet-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 72 / 375);
  }
}
.hero-planet-sp-3 .hero-planet-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 104 / 375);
  }
}
.hero-planet-sp-4 .hero-planet-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 126 / 375);
  }
}
.hero-planet-sp-5 .hero-planet-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 244 / 375);
  }
}
.hero-planet-sp-6 .hero-planet-sp-img {
  @media (max-width: 768px) {
    width: calc(100vw * 162 / 375);
  }
}

/* 基準点(0%/100%)を必ず通る楕円軌道。--rx/--ryは惑星ごとに個別指定
   （translateのみなので画像自体は回転せず、向きはそのまま） */
@keyframes planetOrbitEllipse {
  0%,
  100% {
    transform: translate(0, 0);
  }

  12.5% {
    transform: translate(calc(var(--rx, 20px) * -0.293), calc(var(--ry, 20px) * 0.707));
  }

  25% {
    transform: translate(calc(var(--rx, 20px) * -1), var(--ry, 20px));
  }

  37.5% {
    transform: translate(calc(var(--rx, 20px) * -1.707), calc(var(--ry, 20px) * 0.707));
  }

  50% {
    transform: translate(calc(var(--rx, 20px) * -2), 0);
  }

  62.5% {
    transform: translate(calc(var(--rx, 20px) * -1.707), calc(var(--ry, 20px) * -0.707));
  }

  75% {
    transform: translate(calc(var(--rx, 20px) * -1), calc(var(--ry, 20px) * -1));
  }

  87.5% {
    transform: translate(calc(var(--rx, 20px) * -0.293), calc(var(--ry, 20px) * -0.707));
  }
}

.hero-star {
  position: absolute;
  z-index: 3;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
  animation: starTwinkle 2.8s ease-in-out infinite;

  img {
    display: block;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    max-width: none;
    margin: -1px;
    border: 0;
  }
}

.star-1 {
  width: 42px;
  top: 24%;
  left: 20%;
}

.star-2 {
  width: 32px;
  top: 45%;
  left: 9%;
  animation-delay: 0.7s;
}

.star-3 {
  width: 36px;
  bottom: 25%;
  right: 28%;
  animation-delay: 1.3s;
}

.star-4 {
  width: 52px;
  top: 34%;
  right: 18%;
  animation-delay: 1.9s;
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.hero-satellite {
  position: absolute;
  top: calc(100% + 33px);
  left: calc(50% - 145px);
  z-index: 3;
  display: block;
  width: 243px;
  height: 243px;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
  animation: satelliteSpin 14s linear infinite;

  img {
    display: block;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    max-width: none;
    margin: -1px;
    border: 0;
    object-fit: contain;
  }

  @media (max-width: 768px) {
    top: calc(100% + 20px);
    left: calc(50% - 70px);
    width: 140px;
    height: 140px;
  }
}
.hero-layout .hero-satellite {
  display: block;
}
.hero-satellite {
  @media (max-width: 768px) {
    display: none;
}
}

@keyframes satelliteSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

.wakako-plane {
  position: absolute;
  z-index: 10;
  display: block;
  width: calc(100cqi * 240 / 661);
  aspect-ratio: 1;
  overflow: hidden;
  line-height: 0;
  left: calc(100cqi * 480 / 661);
  top: calc(100cqi * -60 / 661);
  pointer-events: none;
  animation: wakakoFloat 4s ease-in-out infinite;

  img {
    display: block;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    max-width: none;
    margin: -1px;
    border: 0;
  }

  @media (max-width: 768px) {
    width: calc(100vw * 96 / 375);
    left: calc(100vw * 226 / 375);
    top: calc(100vw * -20 / 375);
  }
}

@keyframes wakakoFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(calc(100cqi * -18 / 661));
  }
}

