@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&family=Zen+Old+Mincho:wght@400;700;900&display=swap');

/* ===== CSS Variables ===== */
:root {
  --wisteria-light: #c9a8e0;
  --wisteria-mid: #9b6abf;
  --wisteria-deep: #6a3d9a;
  --navy-dark: #0d0a1a;
  --navy-mid: #1a1530;
  --navy-surface: #241d3d;
  --navy-border: #3a3160;
  --gold: #c8a84b;
  --gold-light: #e8c96a;
  --crimson: #8b2040;
  --crimson-light: #c44068;
  --petal-pink: #e8a0b0;
  --text-main: #ede8f5;
  --text-sub: #b8a8d0;
  --text-muted: #7a6a9a;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--navy-dark);
  color: var(--text-main);
  font-family: 'Noto Serif JP', serif;
  line-height: 1.9;
  overflow-x: hidden;
  cursor: default;
}

/* ===== Background Atmosphere ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(106, 61, 154, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(139, 32, 64, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 40%, rgba(155, 106, 191, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Noise grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ===== Falling Petal Particles ===== */
.petals-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -20px;
  border-radius: 50% 0 50% 0;
  opacity: 0;
  animation: fall linear infinite;
}

.petal:nth-child(odd) {
  background: rgba(201, 168, 224, 0.35);
}

.petal:nth-child(even) {
  background: rgba(232, 160, 176, 0.25);
}

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(110vh) rotate(720deg) translateX(80px);
    opacity: 0;
  }
}

/* ===== Wisteria Vines (Decorative) ===== */
.wisteria-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 250px;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.wisteria-top::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  filter: blur(5px);
  /* CSSのbox-shadowを使って、多数の花房（丸み）の集合体を表現 */
  box-shadow:
    /* 左側の大きな房 */
    6vw 20px 0 18px rgba(155, 106, 191, 0.4),
    9vw 40px 0 14px rgba(201, 168, 224, 0.45),
    4vw 60px 0 10px rgba(106, 61, 154, 0.35),
    7vw 85px 0 6px rgba(155, 106, 191, 0.4),
    10vw 110px 0 2px rgba(201, 168, 224, 0.3),
    6vw 135px 0 -2px rgba(155, 106, 191, 0.25),
    8vw 160px 0 -6px rgba(201, 168, 224, 0.2),

    /* 右側の房 */
    88vw 15px 0 20px rgba(106, 61, 154, 0.3),
    84vw 45px 0 14px rgba(155, 106, 191, 0.4),
    90vw 70px 0 10px rgba(201, 168, 224, 0.35),
    86vw 95px 0 6px rgba(155, 106, 191, 0.3),
    88vw 125px 0 0 rgba(106, 61, 154, 0.2),
    85vw 150px 0 -4px rgba(201, 168, 224, 0.15),

    /* 中央寄りの小さな房 */
    30vw 10px 0 12px rgba(155, 106, 191, 0.2),
    32vw 35px 0 8px rgba(201, 168, 224, 0.25),
    29vw 55px 0 4px rgba(106, 61, 154, 0.15),
    31vw 75px 0 -2px rgba(155, 106, 191, 0.1),

    68vw 5px 0 14px rgba(201, 168, 224, 0.2),
    65vw 30px 0 10px rgba(155, 106, 191, 0.25),
    70vw 55px 0 6px rgba(106, 61, 154, 0.15),
    67vw 80px 0 2px rgba(201, 168, 224, 0.1);
}

/* ===== Decorative Vine Lines ===== */
.vine-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 60px auto;
  width: 80%;
  max-width: 400px;
  position: relative;
}

.vine-divider span {
  display: block;
  flex: 1;
  height: 1px;
}

.vine-divider span:first-child {
  background: linear-gradient(90deg, transparent, rgba(155, 106, 191, 0.7));
}

.vine-divider span:last-child {
  background: linear-gradient(270deg, transparent, rgba(155, 106, 191, 0.7));
}

.vine-divider::after {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--wisteria-light);
  font-size: 0.6rem;
  text-shadow: 0 0 6px var(--wisteria-mid);
  padding: 0 10px;
}

/* ===== Main Layout ===== */
main {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 24px 80px;
}

/* ===== Hero Section ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
  padding: 60px 0 40px;
  animation: fadeUp 1.2s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-cover {
  position: relative;
  perspective: 1000px;
}

.hero-cover img {
  display: block;
  width: 100%;
  border-radius: 2px 6px 6px 2px;
  box-shadow:
    -2px 0 5px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(106, 61, 154, 0.2);
  transition: all 0.5s ease;
  transform-origin: left center;
}

/* 書籍の背表紙・ページの厚みを表現するハイライト */
.hero-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 2px 6px 6px 2px;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(0, 0, 0, 0.3) 3%,
      transparent 8%,
      transparent 98%,
      rgba(255, 255, 255, 0.1) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  transition: all 0.5s ease;
  transform-origin: left center;
}

.hero-cover:hover img {
  transform: rotateY(-8deg) scale(1.02);
  box-shadow:
    -4px 4px 12px rgba(0, 0, 0, 0.6),
    12px 20px 40px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(106, 61, 154, 0.4);
}

.hero-cover:hover::after {
  transform: rotateY(-8deg) scale(1.02);
}

.hero-cover::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 2px 6px 6px 2px;
  background: linear-gradient(135deg, var(--gold) 0%, transparent 40%, transparent 60%, var(--wisteria-mid) 100%);
  padding: 1px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0.6;
  pointer-events: none;
  transition: all 0.5s ease;
  transform-origin: left center;
  z-index: 2;
}

.hero-cover:hover::before {
  transform: rotateY(-8deg) scale(1.02);
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  border: 1px solid rgba(200, 168, 75, 0.4);
  padding: 4px 14px;
  border-radius: 2px;
  width: fit-content;
  background: rgba(200, 168, 75, 0.05);
}

.hero-title {
  font-family: 'Zen Old Mincho', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.4;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--wisteria-light) 60%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-author {
  font-size: 0.85rem;
  color: var(--text-sub);
  letter-spacing: 0.1em;
}

.hero-author span {
  color: var(--gold);
}

.hero-tagline {
  font-size: 0.9rem;
  color: var(--text-sub);
  font-style: italic;
  border-left: 2px solid var(--wisteria-deep);
  padding-left: 14px;
  line-height: 1.8;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.72rem;
  color: var(--wisteria-light);
  border: 1px solid rgba(201, 168, 224, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(106, 61, 154, 0.1);
  letter-spacing: 0.05em;
}

/* ===== Read Button ===== */
.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--wisteria-deep), var(--crimson));
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  border-radius: 3px;
  border: 1px solid rgba(201, 168, 224, 0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  width: fit-content;
}

.btn-read::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-read:hover::before {
  left: 100%;
}

.btn-read:hover {
  box-shadow: 0 4px 24px rgba(139, 32, 64, 0.5);
  transform: translateY(-2px);
  border-color: rgba(201, 168, 224, 0.5);
}

/* ===== Story Section ===== */
.section {
  margin: 60px 0;
  animation: fadeUp 1s ease both;
  animation-delay: 0.2s;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--wisteria-mid);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--navy-border), transparent);
}

.section-title {
  font-family: 'Zen Old Mincho', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ===== Story Cards ===== */
.synopsis {
  background: linear-gradient(135deg, rgba(36, 29, 61, 0.8), rgba(26, 21, 48, 0.9));
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.synopsis::before {
  content: '❝';
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 6rem;
  color: rgba(201, 168, 224, 0.08);
  font-family: Georgia, serif;
  line-height: 1;
  transform: rotate(-10deg);
  pointer-events: none;
}

.synopsis p {
  font-size: 0.92rem;
  color: var(--text-sub);
  line-height: 2;
}

.synopsis p+p {
  margin-top: 1em;
}

.synopsis>div.vine-divider {
  margin: 30px 0;
}

.synopsis>div.vine-divider::after {
  content: ' ';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 6px var(--wisteria-mid);
  padding: 0 10px;
}

/* ===== Characters ===== */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.char-card {
  background: linear-gradient(160deg, rgba(36, 29, 61, 0.9), rgba(20, 16, 38, 0.95));
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.char-card:hover {
  transform: translateY(-4px);
  border-color: var(--wisteria-deep);
}

.char-card.navy .char-accent {
  background: linear-gradient(180deg, #3a6bbd, #1a3a80);
}

.char-card.red .char-accent {
  background: linear-gradient(180deg, #c44068, var(--crimson));
}

.char-card.dark .char-accent {
  background: linear-gradient(180deg, #4a3a5a, #2a1a3a);
}

.char-accent {
  width: 3px;
  height: 40px;
  border-radius: 2px;
  margin-bottom: 14px;
}

.char-name {
  font-family: 'Zen Old Mincho', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.char-name-ruby {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.char-desc {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.8;
}

/* ===== Info Table ===== */
.info-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--navy-border);
  border: 1px solid var(--navy-border);
  border-radius: 6px;
  overflow: hidden;
}

.info-row {
  background: rgba(36, 29, 61, 0.8);
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.info-row dt {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  white-space: nowrap;
  flex-shrink: 0;
}

.info-row dd {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* ===== Warning/Notice ===== */
.notice {
  margin: 40px 0;
  padding: 20px 24px;
  background: rgba(139, 32, 64, 0.08);
  border: 1px solid rgba(139, 32, 64, 0.25);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.9;
}

.notice strong {
  color: var(--crimson-light);
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

/* ===== Footer ===== */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 24px 40px;
  border-top: 1px solid var(--navy-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.footer-credits {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.creator-main {
  font-size: 1.1rem;
  color: var(--text-main);
}

.creator-main span {
  display: block;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.creator-main a {
  color: var(--wisteria-light);
  text-decoration: none;
  font-family: 'Zen Old Mincho', serif;
  font-weight: 700;
  transition: color 0.3s;
}

.creator-main a:hover {
  color: var(--gold-light);
}

.creator-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.creator-sub span {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  margin-right: 8px;
}

.creator-sub a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.3s;
}

.creator-sub a:hover {
  color: var(--wisteria-light);
}

.copyright {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* ===== Back to Top Button ===== */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--wisteria-deep), var(--navy-mid));
  border: 1px solid rgba(201, 168, 224, 0.3);
  border-radius: 50%;
  color: var(--wisteria-light);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  box-shadow: 0 4px 20px rgba(106, 61, 154, 0.5);
  border-color: var(--wisteria-mid);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 0 20px;
  }

  .hero-cover {
    max-width: 260px;
    margin: 0 auto;
  }

  .characters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .info-table {
    grid-template-columns: 1fr;
  }

  #back-to-top {
    bottom: 20px;
    right: 20px;
  }
}