@charset "UTF-8";

/* ==================================================
   TOP PAGE
   世界の終わる、翌朝に。
   ================================================== */

/*
  bodyにはclassを指定せず、
  :has()でトップページだけにスタイルを適用します。
*/
body:has(.afterworld-index) {
  margin: 0;
  min-height: 100svh;
  color: #f5f0e9;
  background: #626b75;
  overflow-x: hidden;
}

/* ページ全体 */
.afterworld-index {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  box-sizing: border-box;
  padding:
    max(42px, env(safe-area-inset-top))
    24px
    max(38px, env(safe-area-inset-bottom));
  font-family:
    "Yu Mincho",
    "Hiragino Mincho ProN",
    "Hiragino Mincho Pro",
    "Noto Serif JP",
    serif;
}

/* 空と朝焼け */
.afterworld-index::before {
  content: "";
  position: fixed;
  z-index: -4;
  inset: 0;
  pointer-events: none;

  background:
    /* 朝日 */
    radial-gradient(
      circle at 72% 30%,
      rgba(255, 243, 207, 0.98) 0,
      rgba(255, 228, 174, 0.72) 5%,
      rgba(236, 192, 153, 0.25) 14%,
      transparent 30%
    ),

    /* 遠くに残る夜 */
    radial-gradient(
      ellipse at 15% 8%,
      rgba(29, 42, 57, 0.65) 0,
      transparent 52%
    ),

    /* 空全体 */
    linear-gradient(
      to bottom,
      #536477 0%,
      #84909b 25%,
      #c1aba0 53%,
      #d1af91 68%,
      #777276 86%,
      #363b42 100%
    );
}

/* 霞・光・焼けた大気 */
.afterworld-index::after {
  content: "";
  position: fixed;
  z-index: -3;
  inset: 0;
  pointer-events: none;

  background:
    linear-gradient(
      118deg,
      transparent 0 48%,
      rgba(255, 238, 206, 0.10) 51%,
      transparent 67%
    ),
    linear-gradient(
      to bottom,
      rgba(13, 23, 34, 0.16),
      transparent 35%,
      rgba(255, 211, 174, 0.10) 65%,
      rgba(18, 22, 28, 0.58)
    );

  mix-blend-mode: soft-light;
}

/* 薄いノイズ */
.afterworld-noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;

  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 3px
    );
}

/* 遠景の霞 */
.afterworld-haze {
  position: fixed;
  z-index: -1;
  right: -15%;
  bottom: 18%;
  left: -15%;
  height: 24%;
  pointer-events: none;
  opacity: 0.7;
  filter: blur(18px);

  background:
    linear-gradient(
      to bottom,
      transparent,
      rgba(206, 188, 176, 0.34),
      rgba(80, 78, 82, 0.16),
      transparent
    );
}

/* メイン部分 */
.afterworld-main {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  box-sizing: border-box;
  margin-top: -8svh;
}

/* 上部の小さな表記 */
.afterworld-date {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 25px;
  color: rgba(245, 240, 233, 0.67);
  font-family:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  line-height: 1.8;
  opacity: 0;
  animation: afterworld-fade 1.3s ease 0.25s forwards;
}

.afterworld-date::before {
  content: "";
  flex: 0 0 34px;
  height: 1px;
  background: rgba(255, 244, 225, 0.5);
}

/* タイトル */
.afterworld-title {
  margin: 0;
  color: #fffaf1;
  font-size: clamp(2.15rem, 10vw, 3.45rem);
  font-weight: 400;
  letter-spacing: 0.075em;
  line-height: 1.48;
  text-shadow:
    0 2px 2px rgba(27, 31, 37, 0.28),
    0 10px 30px rgba(37, 39, 44, 0.24);
}

.afterworld-title span {
  display: block;
  opacity: 0;
  transform: translateY(13px);
}

.afterworld-title span:first-child {
  animation: afterworld-title-in 1.4s ease 0.55s forwards;
}

.afterworld-title span:last-child {
  margin-left: 1.35em;
  animation: afterworld-title-in 1.4s ease 0.85s forwards;
}

/* 英字サブタイトル */
.afterworld-english {
  margin: 22px 0 0;
  color: rgba(255, 245, 230, 0.48);
  font-family:
    "Times New Roman",
    "Yu Mincho",
    serif;
  font-size: 0.59rem;
  letter-spacing: 0.37em;
  line-height: 1.8;
  opacity: 0;
  animation: afterworld-fade 1.4s ease 1.25s forwards;
}

/* 本文 */
.afterworld-text {
  position: relative;
  width: 78%;
  margin: 35px 0 0 auto;
  padding: 0 0 0 18px;
  color: rgba(250, 244, 236, 0.75);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  line-height: 2.25;
  opacity: 0;
  animation: afterworld-fade 1.5s ease 1.55s forwards;
}

.afterworld-text::before {
  content: "";
  position: absolute;
  top: 0.55em;
  bottom: 0.55em;
  left: 0;
  width: 1px;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 239, 211, 0.66),
      transparent
    );
}

/* 入口リンク */
.afterworld-enter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: fit-content;
  margin: 37px 0 0 auto;
  padding: 10px 0;
  color: rgba(255, 248, 238, 0.82);
  font-family:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;
  font-size: 0.67rem;
  letter-spacing: 0.25em;
  text-decoration: none;
  opacity: 0;
  animation: afterworld-fade 1.4s ease 1.9s forwards;
  transition:
    color 0.4s ease,
    letter-spacing 0.4s ease;
}

.afterworld-enter::after {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  background: currentColor;
  transform-origin: left center;
  transition: transform 0.4s ease;
}

.afterworld-enter:hover,
.afterworld-enter:active {
  color: #fffaf0;
  letter-spacing: 0.32em;
}

.afterworld-enter:hover::after,
.afterworld-enter:active::after {
  transform: scaleX(1.35);
}

/* 漂う灰 */
.afterworld-ash {
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.afterworld-ash span {
  position: absolute;
  top: -10%;
  display: block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(237, 230, 221, 0.58);
  box-shadow: 0 0 4px rgba(255, 242, 224, 0.25);
  animation:
    afterworld-ash-fall linear infinite,
    afterworld-ash-sway ease-in-out infinite alternate;
}

.afterworld-ash span:nth-child(1) {
  left: 8%;
  animation-duration: 14s, 4s;
  animation-delay: -4s, -1s;
}

.afterworld-ash span:nth-child(2) {
  left: 19%;
  width: 3px;
  height: 1px;
  animation-duration: 18s, 5s;
  animation-delay: -11s, -2s;
}

.afterworld-ash span:nth-child(3) {
  left: 31%;
  animation-duration: 12s, 3.7s;
  animation-delay: -6s, -1.5s;
}

.afterworld-ash span:nth-child(4) {
  left: 44%;
  width: 1px;
  height: 3px;
  animation-duration: 20s, 4.5s;
  animation-delay: -15s, -3s;
}

.afterworld-ash span:nth-child(5) {
  left: 57%;
  animation-duration: 16s, 5.5s;
  animation-delay: -2s, -1s;
}

.afterworld-ash span:nth-child(6) {
  left: 68%;
  width: 3px;
  height: 2px;
  animation-duration: 21s, 4s;
  animation-delay: -13s, -2.5s;
}

.afterworld-ash span:nth-child(7) {
  left: 79%;
  animation-duration: 13s, 4.8s;
  animation-delay: -8s, -2s;
}

.afterworld-ash span:nth-child(8) {
  left: 91%;
  width: 2px;
  height: 3px;
  animation-duration: 19s, 5.2s;
  animation-delay: -16s, -3.5s;
}

/* 画面下部 */
.afterworld-footer {
  position: absolute;
  right: 24px;
  bottom: max(17px, env(safe-area-inset-bottom));
  left: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(238, 233, 227, 0.29);
  font-family:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;
  font-size: 0.48rem;
  letter-spacing: 0.24em;
  opacity: 0;
  animation: afterworld-fade 1.2s ease 2.25s forwards;
}

.afterworld-footer::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
}

/* アニメーション */
@keyframes afterworld-title-in {
  from {
    opacity: 0;
    transform: translateY(13px);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes afterworld-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes afterworld-ash-fall {
  from {
    top: -8%;
  }

  to {
    top: 108%;
  }
}

@keyframes afterworld-ash-sway {
  from {
    margin-left: -8px;
    transform: rotate(0deg);
  }

  to {
    margin-left: 14px;
    transform: rotate(180deg);
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .afterworld-date,
  .afterworld-title span,
  .afterworld-english,
  .afterworld-text,
  .afterworld-enter,
  .afterworld-footer {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }

  .afterworld-ash span {
    animation: none;
  }
}