@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Shippori+Mincho:wght@400;500;600;800&display=swap');

:root {
  --navy-deep: #0d1620;
  --navy: #182739;
  --navy-light: #33495c;
  --cream: #f3ede0;
  --cream-dim: #d9d0ba;
  --sage: #7c8d70;
  --brick: #a8412e;
  --gold: #c9a86a;
  --ink: #171a1f;
  --serif-en: 'Cormorant Garamond', serif;
  --serif-jp: 'Shippori Mincho', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--navy-deep);
  color: var(--cream);
  font-family: var(--serif-jp);
  line-height: 1.9;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- reveal animation (page-turn) ---------- */
section { perspective: 1400px; }
.reveal {
  opacity: 0;
  transform: translateY(36px) rotateX(8deg);
  transform-origin: top center;
  transition: opacity 1.1s ease, transform 1.2s cubic-bezier(.16,.84,.44,1);
  will-change: transform, opacity;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

/* ---------- decorative sparkle ---------- */
.sparkles {
  position: relative;
  height: 60px;
  margin: 0 auto;
  max-width: 1080px;
}
.sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--gold);
  font-size: var(--s);
  opacity: 0;
  animation: twinkle 3.2s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 0.9; transform: scale(1); }
}

.divider {
  width: 1px;
  height: 56px;
  margin: 0 auto;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-parallax {
  position: absolute;
  inset: -6% 0 -6% 0;
  will-change: transform;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/img/hero.jpg');
  background-size: cover;
  background-position: center 30%;
  animation: kenburns 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenburns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-1%, -1.5%); }
}
.hero-beam {
  position: absolute;
  inset: -20% -60% -20% -60%;
  background: linear-gradient(100deg, transparent 42%, rgba(243,237,224,0.16) 49%, rgba(255,248,232,0.3) 50%, rgba(243,237,224,0.16) 51%, transparent 58%);
  animation: beam-sweep 7s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}
@keyframes beam-sweep {
  0% { transform: translateX(-38%); }
  50% { transform: translateX(38%); }
  100% { transform: translateX(-38%); }
}
.hero-mist { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mist-orb {
  position: absolute;
  bottom: -10%;
  left: var(--mx);
  width: var(--mw);
  height: var(--mw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,232,240,0.22) 0%, rgba(224,232,240,0) 70%);
  filter: blur(2px);
  animation: mist-drift var(--md) ease-in-out infinite;
  animation-delay: var(--mdelay);
}
@keyframes mist-drift {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 0.8; }
  50% { transform: translate(var(--mdx), -18vh); opacity: 0.55; }
  85% { opacity: 0.2; }
  100% { transform: translate(calc(var(--mdx) * 1.6), -34vh); opacity: 0; }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10,16,24,0.55) 0%, rgba(10,16,24,0.35) 35%, rgba(10,16,24,0.75) 78%, rgba(10,16,24,0.96) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-icon,
.hero-eyebrow,
.hero-title,
.hero-sub,
.hero-tagline,
.hero-badges {
  animation: hero-in 1.3s cubic-bezier(.16,.84,.44,1) both;
}
.hero-eyebrow { animation-delay: 0.15s; }
.hero-title { animation-delay: 0.3s; }
.hero-sub { animation-delay: 0.5s; }
.hero-tagline { animation-delay: 0.7s; }
.hero-badges { animation-delay: 0.95s; }

.hero-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 22px;
  color: var(--cream);
  opacity: 0.92;
  animation: hero-in 1.3s cubic-bezier(.16,.84,.44,1) both, icon-glow 4s ease-in-out 1.3s infinite;
}
@keyframes icon-glow {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(201,168,106,0)); }
  50% { filter: drop-shadow(0 0 12px rgba(201,168,106,0.85)); }
}
.hero-eyebrow {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.35em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--serif-en);
  font-weight: 500;
  font-size: clamp(46px, 9vw, 92px);
  letter-spacing: 0.12em;
  line-height: 1.12;
  color: #fbf7ee;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.hero-sub {
  margin-top: 18px;
  font-family: var(--serif-en);
  font-size: 14px;
  letter-spacing: 0.5em;
  color: var(--cream-dim);
  text-transform: uppercase;
}
.hero-tagline {
  margin-top: 44px;
  font-size: clamp(18px, 3vw, 24px);
  color: var(--cream);
  letter-spacing: 0.08em;
}
.hero-tagline span { display: block; }
.hero-badges {
  margin-top: 38px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.badge {
  border: 1px solid rgba(243,237,224,0.45);
  padding: 8px 18px;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--cream);
  border-radius: 2px;
  white-space: nowrap;
}
.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 54px;
  background: linear-gradient(to bottom, transparent, var(--cream-dim));
}
.scroll-cue::after {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip {
  0% { top: 0; opacity: 0; }
  20% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- section shared ---------- */
section { position: relative; padding: 110px 0; }
.section-label {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--serif-jp);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 38px);
  text-align: center;
  color: var(--cream);
  margin-bottom: 64px;
  text-wrap: balance;
}

/* ---------- story ---------- */
.story {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}
.story::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 28% 18%, rgba(168,65,46,0.09), transparent 55%),
    radial-gradient(circle at 78% 82%, rgba(124,141,112,0.07), transparent 50%);
  animation: ambient-drift 19s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes ambient-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -2%) scale(1.08); }
}
.story .container { position: relative; }
.story-body {
  max-width: 640px;
  margin: 0 auto;
  font-size: 17px;
  color: var(--cream-dim);
}
.story-body p { margin-bottom: 1.6em; }
.story-body p:last-child { margin-bottom: 0; }
.story-quote {
  margin: 2.2em 0;
  padding: 0.4em 0 0.4em 1.4em;
  border-left: 2px solid var(--brick);
  font-family: var(--serif-jp);
  font-weight: 500;
  font-size: 19px;
  color: var(--cream);
  animation: quote-flicker 3s ease-in-out infinite;
}
@keyframes quote-flicker {
  0%, 100% { border-left-color: var(--brick); }
  50% { border-left-color: #d16a4c; }
}

/* ---------- characters ---------- */
.characters { background: var(--navy-deep); }
.char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 720px) {
  .char-grid { grid-template-columns: 1fr; }
}
.char-card {
  position: relative;
  background: linear-gradient(160deg, #223449 0%, #141f2c 100%);
  border: 1px solid rgba(201,168,106,0.18);
  border-radius: 4px;
  overflow: hidden;
  padding: 34px 30px 30px;
  text-align: center;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.char-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px rgba(0,0,0,0.35);
}
.char-portrait-wrap {
  width: 168px;
  height: 168px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #3a4f63 0%, #101a26 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(201,168,106,0.35);
  animation: beacon-pulse 3.6s ease-in-out infinite;
}
.char-card:nth-child(2) .char-portrait-wrap { animation-delay: 0.4s; }
.char-card:nth-child(3) .char-portrait-wrap { animation-delay: 0.8s; }
.char-card:nth-child(4) .char-portrait-wrap { animation-delay: 1.2s; }
@keyframes beacon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,106,0.32); }
  50% { box-shadow: 0 0 0 9px rgba(201,168,106,0); }
}
.char-card:hover .char-portrait-wrap {
  animation-play-state: paused;
  box-shadow: 0 0 0 5px rgba(201,168,106,0.2), 0 0 26px 4px rgba(201,168,106,0.4);
}
.char-portrait-wrap img { transition: transform 0.6s ease; }
.char-card:hover .char-portrait-wrap img { transform: scale(1.06); }
.char-portrait-wrap img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  object-position: center 60%;
}
.char-name-jp {
  font-size: 24px;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
@media (max-width: 380px) {
  .char-name-jp { font-size: 21px; }
}
.char-name-en {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-top: 4px;
  margin-bottom: 16px;
}
.char-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.char-meta span {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  border: 1px solid rgba(243,237,224,0.25);
  padding: 4px 11px;
  border-radius: 20px;
}
.char-desc {
  font-size: 15px;
  color: var(--cream-dim);
  line-height: 1.85;
  min-height: 4.9em;
}

/* ---------- how to play ---------- */
.howto { background: var(--navy); }
.howto-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 70px;
}
.flow {
  max-width: 720px;
  margin: 0 auto;
  counter-reset: step;
}
.flow-item {
  display: flex;
  gap: 24px;
  padding-bottom: 34px;
  position: relative;
  opacity: 0;
  transform: translateX(-22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.flow-item.in { opacity: 1; transform: translateX(0); }
.flow-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 46px;
  bottom: 0;
  width: 1px;
  background: rgba(201,168,106,0.3);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.9s ease 0.25s;
}
.flow-item.in:not(:last-child)::before { transform: scaleY(1); }
.flow-num {
  counter-increment: step;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif-en);
  font-size: 17px;
  transition: box-shadow 0.5s ease 0.15s, background 0.5s ease 0.15s;
}
.flow-num::before { content: counter(step); }
.flow-item.in .flow-num {
  box-shadow: 0 0 16px 2px rgba(201,168,106,0.55);
  background: rgba(201,168,106,0.12);
}
.flow-body { padding-top: 8px; }
.flow-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
}
.flow-desc {
  font-size: 14px;
  color: var(--cream-dim);
}

/* ---------- cta / links ---------- */
.cta { background: var(--navy-deep); }
.cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 820px) {
  .cta-grid { grid-template-columns: 1fr; }
}
.cta-card {
  display: block;
  position: relative;
  text-decoration: none;
  border: 1px solid rgba(201,168,106,0.3);
  padding: 32px 24px;
  text-align: center;
  color: var(--cream);
  transition: background 0.35s ease, transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  border-radius: 3px;
  overflow: hidden;
}
.cta-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(243,237,224,0.16), transparent);
  transform: skewX(-18deg);
  transition: left 0.75s ease;
}
.cta-card:hover::after { left: 130%; }
.cta-card:hover {
  background: rgba(201,168,106,0.08);
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.3);
}
.cta-tag {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cta-name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.cta-desc { font-size: 13px; color: var(--cream-dim); }

/* ---------- footer ---------- */
footer {
  padding: 60px 0 46px;
  text-align: center;
  background: var(--navy-deep);
  border-top: 1px solid rgba(201,168,106,0.15);
}
.footer-mark {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.25em;
  color: var(--cream-dim);
}
.footer-note {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(217,208,186,0.5);
  letter-spacing: 0.05em;
}

/* ---------- BGM toggle ---------- */
.bgm-player-wrap { display: none; }
.bgm-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(13,22,32,0.88);
  border: 1px solid rgba(201,168,106,0.55);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.bgm-toggle svg { width: 21px; height: 21px; }
.bgm-toggle:hover { transform: translateY(-2px); border-color: var(--gold); }
.bgm-toggle.loading { opacity: 0.55; cursor: wait; }
.bgm-toggle.playing {
  border-color: var(--gold);
  background: rgba(35,53,71,0.92);
  animation: bgm-pulse 2.4s ease-in-out infinite;
}
@keyframes bgm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,106,0.45); }
  50% { box-shadow: 0 0 0 11px rgba(201,168,106,0); }
}
@media (max-width: 600px) {
  .bgm-toggle { right: 16px; bottom: 16px; width: 46px; height: 46px; }
  .bgm-toggle svg { width: 18px; height: 18px; }
}
