:root {
  --night-deep: #3e5084;
  --night-soft: #6b83ab;
  --night-mid: #465f94;
  --night-bottom: #3e5084;
  --night-shadow: #26335c;
  --gold: #d0ca7d;
  --gold-soft: rgba(208, 202, 125, 0.28);
  --paper: #f4efe6;
  --paper-muted: rgba(244, 239, 230, 0.72);
  --panel-shadow: rgba(20, 26, 49, 0.26);
  --cta-text: #3e5084;
  --page-background:
    radial-gradient(circle at 30% 18%, rgba(255, 238, 190, 0.12), transparent 24rem),
    linear-gradient(180deg, var(--night-soft) 0%, var(--night-mid) 45%, var(--night-bottom) 100%);
}

html[data-theme="deep"] {
  --night-deep: #394f82;
  --night-soft: #435a8c;
  --night-mid: #3a4f7e;
  --night-bottom: #32466f;
  --gold: #cfc58a;
  --cta-text: #2c416f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--night-bottom);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100%;
  margin: 0;
  color: var(--paper);
  font-family: "Noto Serif JP", serif;
  background: transparent;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background: var(--page-background);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: 64px 22px 84px;
  overflow: hidden;
  place-items: center;
  background: transparent;
}

.hero::after {
  display: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  text-align: center;
}

.hero__subtitle {
  margin: 0 0 24px;
  color: var(--paper-muted);
  font-size: clamp(0.82rem, 2.7vw, 1rem);
  font-weight: 400;
  line-height: 1.9;
}

h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(2.1rem, 9vw, 4.5rem);
  font-weight: 500;
  line-height: 1.48;
  text-wrap: balance;
  text-shadow: 0 12px 30px rgba(20, 26, 49, 0.18);
}

.hero__guide {
  margin: 28px auto 0;
  color: rgba(244, 239, 230, 0.66);
  font-size: clamp(0.82rem, 2.9vw, 0.98rem);
  font-weight: 400;
  line-height: 1.9;
}

.night-lights {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.light {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px 5px var(--gold-soft);
  opacity: 0.34;
}

.light-1 {
  top: 15%;
  left: 16%;
}

.light-2 {
  top: 25%;
  right: 18%;
  width: 3px;
  height: 3px;
  opacity: 0.26;
}

.light-3 {
  top: 58%;
  left: 10%;
  width: 2px;
  height: 2px;
  opacity: 0.22;
}

.light-4 {
  right: 12%;
  bottom: 22%;
  width: 5px;
  height: 5px;
  opacity: 0.24;
}

.light-5 {
  top: 72%;
  left: 50%;
  width: 2px;
  height: 2px;
  opacity: 0.2;
}

.light-6 {
  top: 40%;
  right: 36%;
  width: 3px;
  height: 3px;
  opacity: 0.18;
}

.scroll-cue {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 34px;
  left: 0;
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  place-items: center;
  opacity: 0.78;
  text-decoration: none;
  animation: cueDrift 2.6s ease-in-out infinite;
}

.scroll-cue span {
  width: 13px;
  height: 13px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: rotate(45deg);
}

.story {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 72px 10px 20px;
}

.comic-panel {
  position: relative;
  margin: 0 auto 64px;
}

.comic-panel:last-child {
  margin-bottom: 32px;
}

.comic-panel::before {
  display: none;
}

.comic-panel picture {
  display: block;
}

.comic-panel img {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(244, 239, 230, 0.13), rgba(208, 202, 125, 0.09)),
    rgba(244, 239, 230, 0.08);
  box-shadow: 0 26px 70px var(--panel-shadow);
}

.comic-panel.image-missing::before {
  display: grid;
  width: 100%;
  min-height: 420px;
  aspect-ratio: 941 / 1672;
  place-items: center;
  padding: 28px;
  border: 1px solid rgba(244, 239, 230, 0.12);
  border-radius: 4px;
  color: rgba(244, 239, 230, 0.62);
  font-size: 0.95rem;
  line-height: 1.8;
  text-align: center;
  content: attr(data-placeholder);
  background:
    radial-gradient(circle at 50% 38%, rgba(208, 202, 125, 0.13), transparent 15rem),
    linear-gradient(145deg, rgba(244, 239, 230, 0.11), rgba(244, 239, 230, 0.045));
  box-shadow: 0 26px 70px var(--panel-shadow);
}

.comic-panel.image-missing img {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.closing {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 22px 22px 54px;
  text-align: center;
}

.closing__line {
  width: 80px;
  height: 1px;
  margin: 0 auto 36px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.closing p {
  margin: 0 auto 8px;
  color: var(--paper);
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  font-weight: 400;
  line-height: 1.75;
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 278px);
  min-height: 56px;
  margin: 38px auto 14px;
  padding: 16px 32px;
  border-radius: 8px;
  color: var(--cta-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  background: var(--gold);
  box-shadow: 0 16px 44px rgba(20, 26, 49, 0.2);
  overflow: hidden;
  transition:
    background-color 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.24s ease;
}

.cta::after {
  pointer-events: none;
}

.cta--edge::after {
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 245, 0);
  border-radius: 6px;
  content: "";
  box-shadow: inset 0 0 0 rgba(255, 255, 245, 0);
  animation: edgeGlow 4.8s ease-in-out infinite;
}

.cta:hover,
.cta:focus-visible {
  background: #d8cf86;
  box-shadow: 0 18px 48px rgba(20, 26, 49, 0.24);
  transform: translateY(-1px);
}

.cta:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.closing .cta-note {
  color: var(--paper-muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.closing .closing__small {
  max-width: 520px;
  margin-top: 24px;
  color: rgba(244, 239, 230, 0.78);
  font-size: clamp(0.92rem, 3.6vw, 1.08rem);
  line-height: 1.8;
}

.footer {
  padding: 14px 20px 28px;
  color: rgba(244, 239, 230, 0.58);
  text-align: center;
  background: transparent;
}

.footer small {
  font-size: 0.74rem;
  line-height: 1.7;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0 0 0 0);
}

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

  50% {
    transform: translateY(8px);
  }
}

@keyframes edgeGlow {
  0%,
  100% {
    border-color: rgba(255, 255, 245, 0);
    box-shadow: inset 0 0 0 rgba(255, 255, 245, 0);
    opacity: 0.2;
  }

  50% {
    border-color: rgba(255, 255, 245, 0.55);
    box-shadow: inset 0 0 18px rgba(255, 255, 245, 0.18);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .hero {
    padding-inline: 48px;
  }

  .story {
    max-width: 636px;
    padding-top: 116px;
  }

  .comic-panel {
    margin-bottom: 96px;
  }

  .comic-panel:last-child {
    margin-bottom: 56px;
  }

  .closing {
    padding-bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .cta--edge::after {
    animation: none;
  }
}
