/* reset */
html {
  scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}
p {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
}
ol {
  margin: 0;
  padding: 0;
}
li {
  list-style: none;
}
a {
  text-decoration: none;
}
img {
  max-width: 100%;
}

/* style */
:root {
  --primary-color: #fff;
  --background-color: #091f43;
  --accent-color: #4a90e2;
}

body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.6;
  color: var(--primary-color);
  background-color: var(--background-color);
  margin: 0;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

body.is-loaded {
  opacity: 1;
}

.message__inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 20px 20px 120px;
}
.message__text {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.message__text h2 {
  font-size: 40px;
  font-weight: normal;
}
.message__text p {
  margin-top: 30px;
  text-align: left;
  font-size: 18px;
  line-height: 1.6;
}

.sign {
  display: flex;
  text-align: right;
  justify-content: flex-end;
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.6;
}

.linkToSection {
  margin-top: 120px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 20px;
}
@media (max-width: 920px) {
  .linkToSection {
    grid-template-columns: repeat(1, 1fr);
  }
}

.linkToSection__item {
  display: flex;
  align-items: flex-end;
  color: var(--primary-color);
  font-size: 15px;
  line-height: 1.2;
  padding-bottom: 16px;
  border-bottom: 1px solid #fff;
  transition: color 0.3s ease;
  font-weight: bold;
}

.linkToSection__item:hover {
  color: rgba(255, 255, 255, 0.7);
}

.linkToSection__item span {
  font-size: 40px;
  margin-right: 10px;
  line-height: 1;
  font-weight: bold;
  transition: opacity 0.3s ease;
}

.linkToSection__item:hover span {
  opacity: 0.7;
}

.content__wrapper {
  max-width: 840px;
  margin: 0 auto;
  padding: 60px 20px 120px;
}
@media (max-width: 920px) {
  .content__wrapper {
    padding: 40px 20px 80px;
  }
}

.content__inner {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.content__inner--left {
  margin-right: auto;
}

.content__inner--right {
  margin-left: auto;
}

.numberHeading {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  font-size: 28px;
  line-height: 1.2;
}
.numberHeading span {
  font-size: 120px;
  line-height: 0.8;
}
.numberHeading--extendRight {
  margin-right: -240px;
}
@media (max-width: 920px) {
  .numberHeading {
    font-size: 20px;
    align-items: center;
  }
  .numberHeading span {
    font-size: 60px;
  }
}
.numberHeading__number {
  display: inline-block;
  font-weight: bold;
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

.numberHeading__number--01 {
  color: #A78B7C;
}

.numberHeading__number--02 {
  color: #EB0000;
}

.numberHeading__number--03 {
  color: #FFE500;
}

.numberHeading__number--04 {
  color: #0AA7B5;
}

.numberHeading__number--05 {
  color: #FF6201;
}

.numberHeading__number--06 {
  color: #0097F4;
}

.numberHeading__number--07 {
  color: #176CC8;
}

.content__image {
  display: block;
  width: 100%;
  height: auto;
  background: #576378;
  aspect-ratio: 1200/720;
}
.content__text {
  font-size: 18px;
  line-height: 1.6;
}

.content__text p {
  margin-top: 30px;
}

.content__text p:first-child {
  margin-top: 0;
}

.content__text p:last-child {
  margin-bottom: 0;
}

.content__link {
  display: inline-flex;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  width: fit-content;
  font-size: 18px;
  line-height: 1.2;
  font-weight: bold;
  margin-left: auto;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.content__link:hover {
  color: rgba(255, 255, 255, 0.7);
}

.content__link::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin-left: 20px;
  background-image: url("../images/icon-external-link.svg");
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity 0.3s ease;
}

.content__link:hover::after {
  opacity: 0.7;
}

.content {
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
}

@media (max-width: 920px) {
  .content {
    background-size: 1440px auto;
  }
}

#section1 {
  background-image: url("../images/section-bg-1.webp");
}

#section2 {
  background-image: url("../images/section-bg-2.webp");
}

#section3 {
  background-image: url("../images/section-bg-3.webp");
}

#section4 {
  background-image: url("../images/section-bg-4.webp");
}

#section5 {
  background-image: url("../images/section-bg-5.webp");
}

#section6 {
  background-image: url("../images/section-bg-6.webp");
}

#section7 {
  background-image: url("../images/section-bg-7.webp");
}

/* hero */

.hero {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.hero__visual {
  position: relative;
  width: 100%;
  height: 924px;
  overflow: hidden;
  z-index: 1;
}

@media (max-width: 920px) {
  .hero__visual {
    height: calc(100vh - 140px);
  }
}

.starfield-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

main {
  position: relative;
  z-index: 1;
}

.hero__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(9, 31, 67, 0.6);
}

.hero__background canvas {
  display: none;
}

.hero__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 1;
}

.hero__books {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 2;
  background-color: transparent;
}

.hero__books-row {
  display: flex;
  gap: 0;
}

.hero__book-tile {
  width: 139px;
  height: 180px;
  perspective: 1000px;
  opacity: 0;
  animation: bookFadeIn 0.3s ease-out forwards,
    flipOutRotate 0.4s ease-in forwards;
  pointer-events: none;
  animation-fill-mode: forwards;
  margin: 4px 0 0 4px;
}

@media (max-width: 920px) {
  .hero__book-tile {
    width: 100px;
    height: 130px;
  }
}

.hero__book-tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

.hero__book-tile.is-animated {
  pointer-events: auto;
  opacity: 0;
  animation: none;
  transition: opacity 0.3s ease-out;
}

.hero__book-tile.is-animated .hero__book-tile-inner {
  transform: rotateY(180deg);
}

.hero__book-tile.is-animated.is-auto-rotating {
  opacity: 0.5;
}

.hero__book-tile.is-animated.is-auto-rotating .hero__book-tile-inner {
  animation: none;
}

/* アニメーションを3ステップに分割 */
.hero__book-tile.is-animated.is-auto-rotating.is-showing
  .hero__book-tile-inner {
  animation: showBook 0.5s ease-out forwards;
}

.hero__book-tile.is-animated.is-auto-rotating.is-hiding .hero__book-tile-inner {
  animation: hideBook 0.5s ease-in forwards;
}

@keyframes showBook {
  from {
    transform: rotateY(180deg);
  }
  to {
    transform: rotateY(0);
  }
}

@keyframes hideBook {
  from {
    transform: rotateY(0);
  }
  to {
    transform: rotateY(180deg);
  }
}

.hero__book-tile.is-animated:hover {
  opacity: 1;
}

.hero__book-tile.is-animated:hover .hero__book-tile-inner {
  animation: none;
  transform: rotateY(0);
}

.hero__book-tile-front,
.hero__book-tile-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: opacity 0.3s ease-out;
}

.hero__book-tile-back {
  transform: rotateY(180deg);
  background: transparent;
}

/* ロゴ用のフェードインアニメーション */
@keyframes logoFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 本用のフェードインアニメーション */
@keyframes bookFadeIn {
  from {
    opacity: 0;
    transform: translate(-20px, -20px);
  }
  to {
    opacity: 0.5;
    transform: translate(0, 0);
  }
}

@keyframes flipOutRotate {
  from {
    transform: rotateY(0);
    opacity: 0.5;
  }
  to {
    transform: rotateY(160deg) translate(20px, 20px);
    opacity: 0;
  }
}

/* 追加: 自動回転のアニメーション */
@keyframes autoRotate {
  from {
    transform: rotateY(180deg);
  }
  to {
    transform: rotateY(0);
  }
}

.hero__heading {
  position: relative;
  z-index: 2;
  height: 140px;
  margin-bottom: -54px;
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 80px;
  line-height: 1;
  gap: 20px;
  margin-top: -54px;
}
@media (max-width: 920px) {
  .hero__title {
    font-size: 28px;
  }
}

.hero__title-main {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 1;
  gap: 8px;
  font-weight: normal;
}

.hero__title-number {
  display: inline-block;
  margin: 0;
}

.hero__title img {
  display: block;
  width: 142px;
  height: 104px;
}
@media (max-width: 920px) {
  .hero__title img {
    width: 100px;
    height: 70px;
  }
}

.hero__title-sub {
  display: block;
  font-size: 18px;
  font-weight: normal;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.6;
}

.hero__book-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 920px) {
  .hero__book-image {
    width: 100px;
    height: 130px;
  }
}

/* Footer */
.footer {
  color: #fff;
}

.footer__top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 27px;
  background: rgba(255, 255, 255, 0.1);
  padding: 40px 0;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 920px) {
  .footer__top {
    flex-direction: column;
    gap: 20px;
    padding: 40px 20px;
  }
}

.footer__text {
  font-size: 18px;
}
@media (max-width: 920px) {
  .footer__text {
    font-size: 16px;
  }
}

.footer__button {
  display: inline-block;
  background-color: #000;
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s;
}

.footer__button:hover {
  background-color: #fff;
  color: #000;
}

.footer__middle {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  box-sizing: border-box;
}

@media (max-width: 920px) {
  .footer__middle {
    font-size: 13px;
    gap: 20px;
    margin-top: 30px;
  }

  .footer__link:not(:last-child)::after {
    display: none;
  }
}

.footer__link {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.3s;
}

.footer__link:not(:last-child)::after {
  content: "|";
  color: #fff;
  margin: 0 20px;
}

.footer__link:hover {
  opacity: 0.8;
}

.footer__separator {
  color: #fff;
  margin: 0 0.5rem;
  opacity: 0.5;
}

.footer__bottom {
  margin-top: 20px;
  padding-bottom: 50px;
}

.footer__copyright {
  text-align: center;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* PC版とSP版の表示切り替え */
.hero__books-pc {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-image: linear-gradient(
      rgba(0, 0, 0, 0.3) 0,
      rgba(0, 0, 0, 0.3) 4px,
      transparent 4px
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.3) 0,
      rgba(0, 0, 0, 0.3) 4px,
      transparent 4px
    );
  background-size: 100% calc(180px + 4px), calc(139px + 4px) 100%;
  background-position: 0 0;
  background-repeat: repeat;
  padding: 0 4px 4px 0;
}

.hero__books-sp {
  display: none;
  flex-direction: column;
  gap: 0;
  background-image: linear-gradient(
      rgba(0, 0, 0, 0.3) 0,
      rgba(0, 0, 0, 0.3) 4px,
      transparent 4px
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.3) 0,
      rgba(0, 0, 0, 0.3) 4px,
      transparent 4px
    );
  background-size: 100% calc(130px + 4px), calc(100px + 4px) 100%;
  background-position: 0 0;
  background-repeat: repeat;
  padding: 0 4px 4px 0;
}

@media (max-width: 920px) {
  .hero__books {
    height: 100%;
    width: 100%;
    justify-content: center;
    align-items: center;
  }

  .hero__books-pc {
    display: none;
  }

  .hero__books-sp {
    display: flex;
  }
}
