:root {
  --sakura-blush: #ffe4ec;
  --sakura-pink: #ffc5d3;
  --sakura-deep: #ff6b9d;
  --sakura-rose: #ff8fab;
  --cream: #fff8f0;
  --parchment: #fbf3e9;
  --gold: #c9a227;
  --gold-soft: #e6c870;
  --ink: #3a241e;
  --ink-soft: #6b3a2b;
  --ink-whisper: #9c6a5c;
  --shadow: 0 10px 30px rgba(124, 59, 76, 0.08), 0 2px 6px rgba(124, 59, 76, 0.06);
  --shadow-lift: 0 18px 45px rgba(124, 59, 76, 0.14), 0 4px 12px rgba(124, 59, 76, 0.1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 20% 0%, #fff5f9 0%, var(--cream) 45%, #fdece1 100%);
  color: var(--ink);
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

#petal-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ————— music toggle ————— */

#music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 20;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: grid;
  place-items: center;
}
#music-toggle:hover { transform: scale(1.08); box-shadow: var(--shadow-lift); }
#music-toggle .music-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}
#music-toggle.playing .music-ring {
  border-color: rgba(255, 107, 157, 0.6);
  animation: ring-pulse 2s ease-in-out infinite;
}
#music-toggle .music-note {
  font-size: 24px;
  color: var(--sakura-deep);
  line-height: 1;
  transition: transform 0.2s ease;
}
#music-toggle.playing .music-note { animation: note-bounce 1.6s ease-in-out infinite; }
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 0.4; }
}
@keyframes note-bounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-3px) rotate(6deg); }
}

/* ————— hero ————— */

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 4rem 1.5rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 197, 211, 0.55), transparent 40%),
    radial-gradient(circle at 15% 90%, rgba(255, 228, 236, 0.5), transparent 40%);
  z-index: 0;
}

.sakura-branch {
  position: absolute;
  width: 420px;
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}
.sakura-branch--tl { top: -20px; left: -40px; transform: rotate(-6deg); }
.sakura-branch svg { width: 100%; height: auto; }

.hero__inner {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 3rem 1rem;
  animation: fade-up 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__pre {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  color: var(--ink-whisper);
  margin: 0 0 0.8rem;
  letter-spacing: 0.5px;
}

.hero__title {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.hero__thomas {
  background: linear-gradient(120deg, var(--sakura-deep) 0%, #d74877 35%, #b43d6a 65%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(215, 72, 119, 0.25));
}
.hero__dancer {
  font-size: 0.65em;
  display: inline-block;
  animation: dance 2.8s ease-in-out infinite;
  transform-origin: 50% 80%;
}
@keyframes dance {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  25% { transform: rotate(6deg) translateY(-4px); }
  50% { transform: rotate(-4deg) translateY(0); }
  75% { transform: rotate(8deg) translateY(-2px); }
}

.hero__sub {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  margin: 0.4rem 0 1.5rem;
  letter-spacing: 0.01em;
}
.hero__sub .dot {
  display: inline-block;
  opacity: 0;
  animation: dot-twinkle 2.4s infinite;
}
.hero__sub .dot:nth-child(1) { animation-delay: 0.0s; }
.hero__sub .dot:nth-child(2) { animation-delay: 0.3s; }
.hero__sub .dot:nth-child(3) { animation-delay: 0.6s; }
@keyframes dot-twinkle {
  0%, 30% { opacity: 0; }
  60% { opacity: 1; text-shadow: 0 0 10px rgba(255, 107, 157, 0.8); }
  100% { opacity: 0.3; text-shadow: none; }
}

.hero__for {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.8rem 2rem;
  border-top: 1px solid rgba(201, 162, 39, 0.35);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--ink-soft);
}
.hero__for > span:first-child { font-style: italic; }
.hero__selenia {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2rem, 4vw, 2.8rem);
  background: linear-gradient(100deg, var(--gold) 0%, #b88726 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.hero__jp {
  margin: 1.5rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-whisper);
  font-size: 1.05rem;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.hero__scroll span {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--ink-whisper), transparent);
  animation: scroll-line 2.4s ease-in-out infinite;
}
@keyframes scroll-line {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50% { transform: scaleY(1.2); opacity: 1; }
}

@keyframes fade-up {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ————— chapters ————— */

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

.chapter {
  max-width: 780px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  position: relative;
}

.chapter__mark {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}
.chapter__mark::before,
.chapter__mark::after {
  content: "";
  display: block;
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold) 50%, transparent);
  margin: 0 auto 1rem;
}
.chapter__mark::after {
  margin: 1rem auto 0;
}
.chapter__roman {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  color: var(--gold);
  letter-spacing: 0.15em;
  opacity: 0.8;
}
.chapter__title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0.2rem 0 0.3rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.chapter__fr {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  color: var(--sakura-deep);
  margin: 0;
  letter-spacing: 0.5px;
}

.quote {
  position: relative;
  margin: 1.4rem 0;
  padding: 2rem 2.2rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 197, 211, 0.5);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
  opacity: 0;
  transform: translateY(18px);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.quote.in-view {
  opacity: 1;
  transform: translateY(0);
}
.quote:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--sakura-pink);
}
.quote::before {
  content: "“";
  position: absolute;
  top: -6px;
  left: 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 4rem;
  color: var(--sakura-pink);
  line-height: 1;
  opacity: 0.55;
  font-style: italic;
}
.quote::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 14px;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, rgba(255, 220, 120, 0.9), transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.quote:hover::after {
  opacity: 1;
  animation: spark 1.4s ease-in-out infinite;
}
@keyframes spark {
  0%, 100% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 1; }
}

.q-en {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: var(--ink);
  margin: 0 0 0.6rem;
  line-height: 1.45;
  letter-spacing: 0.005em;
}
.q-fr {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--sakura-deep);
  margin: 0;
  line-height: 1.5;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(255, 143, 171, 0.4);
}

.q-note {
  margin: 1rem 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-whisper);
  text-align: right;
}

.quote--tiny {
  padding: 1.2rem 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  background: rgba(255, 228, 236, 0.6);
}
.quote--tiny .q-en { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.4rem); }
.quote--tiny .q-fr { margin: 0; padding-top: 0; border-top: 0; font-size: clamp(0.95rem, 1.8vw, 1.15rem); }
.quote--tiny .q-note { width: 100%; text-align: center; margin-top: 0.4rem; }

.quote--long { padding: 2.6rem 2.4rem; }
.quote--long .q-en { font-size: clamp(1.15rem, 2.6vw, 1.55rem); }

.quote--featured {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 228, 236, 0.85) 100%);
  border: 1px solid var(--gold-soft);
  padding: 2.8rem 2.5rem;
  text-align: center;
  box-shadow: 0 14px 40px rgba(201, 162, 39, 0.14), 0 4px 12px rgba(255, 107, 157, 0.12);
}
.quote--featured::before { left: 50%; transform: translateX(-50%); }
.quote--featured .q-en {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 500;
}
.quote--featured .q-fr {
  text-align: center;
  border-top-color: var(--gold-soft);
  color: var(--sakura-deep);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}

.chapter--finale {
  padding-top: 7rem;
  padding-bottom: 6rem;
}
.chapter--finale::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  opacity: 0.5;
}

/* ————— footer ————— */

.footer {
  position: relative;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  z-index: 3;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 197, 211, 0.14) 50%, transparent 100%);
}
.footer__petals {
  font-size: 1.6rem;
  letter-spacing: 0.8rem;
  opacity: 0.85;
  margin-bottom: 1.5rem;
}
.footer__line {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  color: var(--ink-soft);
  font-weight: 400;
  margin: 0;
}
.footer__name {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--gold);
  letter-spacing: 0.5px;
}
.footer__small {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--ink-whisper);
  margin: 1rem 0 2rem;
  font-size: 1.05rem;
}
.footer__credit {
  font-family: "Noto Sans", sans-serif;
  font-size: 0.75rem;
  color: var(--ink-whisper);
  letter-spacing: 0.5px;
  opacity: 0.7;
  margin: 0;
}

/* ————— motion prefs ————— */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #petal-canvas { display: none; }
}

/* ————— mobile ————— */

@media (max-width: 520px) {
  .chapter { padding: 4rem 1rem 2.5rem; }
  .quote { padding: 1.6rem 1.5rem; border-radius: 14px; }
  .quote--long { padding: 1.8rem 1.6rem; }
  .quote--featured { padding: 2rem 1.6rem; }
  .sakura-branch { display: none; }
  #music-toggle { width: 46px; height: 46px; top: 14px; right: 14px; }
  #music-toggle .music-note { font-size: 20px; }
}
