/* お気に入りの童話集 — キャンドルライト・テキスト中心 */

body.tl-body--candle {
  background-color: #1a1218;
  background-image:
    radial-gradient(ellipse 55% 40% at 50% 18%, rgba(120, 72, 48, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 12% 88%, rgba(60, 28, 48, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 88% 75%, rgba(0, 0, 0, 0.25) 0%, transparent 45%),
    repeating-linear-gradient(
      92deg,
      transparent,
      transparent 28px,
      rgba(0, 0, 0, 0.03) 28px,
      rgba(0, 0, 0, 0.03) 29px
    ),
    linear-gradient(175deg, #3d2430 0%, #2a1822 35%, #1a1218 100%);
  color: var(--tl-paper);
}

body.tl-body--candle::before {
  background-image:
    radial-gradient(circle at 50% 12%, rgba(196, 140, 80, 0.12) 0%, transparent 28%),
    radial-gradient(circle at 18% 62%, rgba(80, 40, 60, 0.1) 0%, transparent 22%);
}

body.tl-body--candle::after {
  opacity: 0.1;
}

.tl-story {
  overflow-x: hidden;
}

.tl-candle-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
  background: rgba(26, 18, 24, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(196, 140, 80, 0.14);
}

.tl-candle-header__back {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(244, 234, 216, 0.72);
  text-decoration: none;
  transition: color 0.2s;
}

.tl-candle-header__back:hover {
  color: var(--tl-paper);
}

.tl-candle-header__series {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: rgba(196, 140, 80, 0.55);
  font-style: italic;
}

.tl-scroll-panel {
  position: relative;
  height: var(--panel-height, 130vh);
}

.tl-scroll-panel--cover {
  height: 108vh;
}

.tl-scroll-panel__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3.25rem, 5.5vh, 4rem) clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 1.5vh, 1.25rem);
  transition: opacity 0.3s ease;
  will-change: opacity;
}

.tl-scroll-panel__sticky::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 18%;
  width: clamp(6rem, 18vw, 11rem);
  height: clamp(6rem, 18vw, 11rem);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(196, 140, 80, 0.16) 0%,
    rgba(120, 72, 48, 0.06) 45%,
    transparent 70%
  );
  pointer-events: none;
  opacity: inherit;
}

.tl-scroll-panel--cover .tl-scroll-panel__sticky {
  align-items: center;
}

.tl-scroll-panel--text-only .tl-scroll-panel__stage {
  max-width: min(96vw, 40rem);
}

.scene .tl-scroll-panel__visual.fade-in {
  --reveal-delay: 0ms;
}

.scene .tl-scroll-panel__copy.fade-in {
  --reveal-delay: 180ms;
}

.tl-candle-cover__title-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 30rem);
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
  background:
    linear-gradient(160deg, rgba(255, 248, 230, 0.35) 0%, transparent 55%),
    var(--tl-paper);
  color: var(--tl-ink);
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 20px 40px rgba(0, 0, 0, 0.35);
}

.tl-scroll-panel__stage {
  position: relative;
  z-index: 1;
  width: min(96vw, 76rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.tl-scroll-panel__visual {
  flex-shrink: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(196, 140, 80, 0.16);
  border-radius: 3px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.tl-scroll-panel__figure {
  margin: 0;
  filter: sepia(0.1) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.22));
}

.tl-scroll-panel__figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(42vh, 20rem);
  object-fit: contain;
  border-radius: 2px;
}

.tl-scroll-panel__copy {
  position: relative;
  flex: 1;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
  background:
    linear-gradient(180deg, rgba(255, 248, 230, 0.45) 0%, transparent 30%),
    var(--tl-paper);
  color: var(--tl-ink);
  border-radius: 3px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

.tl-candle-cover__glyph {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  margin: 0 0 0.75rem;
  line-height: 1;
}

.tl-candle-cover__series {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--tl-accent);
  margin: 0 0 1rem;
}

.tl-candle-cover__title {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0.1em;
  margin: 0 0 0.65rem;
}

.tl-candle-cover__en {
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--tl-ink-muted);
  margin: 0 0 0.5rem;
}

.tl-candle-cover__tagline {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--tl-ink-muted);
  margin: 0 0 1.1rem;
}

.tl-candle-cover__meta {
  font-size: 0.76rem;
  line-height: 1.9;
  color: var(--tl-ink-muted);
  margin: 0 0 1.5rem;
}

.tl-candle-cover__hint {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--tl-ink-muted);
  margin: 0;
  opacity: 0.65;
}

.scene .fade-in {
  --reveal-delay: 0ms;
  --reveal-duration: 1.75s;
  --reveal-opacity-duration: 1.75s;
  --reveal-distance: 1.75rem;
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance), 0);
  transition:
    opacity var(--reveal-opacity-duration) cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay);
  will-change: opacity, transform;
}

.tl-scene-reveal.is-visible .fade-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tl-story__outro .fade-in {
  --reveal-duration: 1.6s;
  --reveal-opacity-duration: 1.6s;
  --reveal-distance: 1.25rem;
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance), 0);
  transition:
    opacity var(--reveal-opacity-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-scene-reveal.is-visible .tl-story__outro-inner.fade-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.tl-scroll-panel__glyph {
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  margin: 0 0 0.35rem;
  line-height: 1;
}

.tl-scroll-panel__num {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--tl-accent);
  margin: 0 0 0.35rem;
  text-align: center;
}

.tl-scroll-panel__chapter {
  font-size: clamp(1.05rem, 2.5vw, 1.22rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: center;
  margin: 0 0 0.85rem;
}

.tl-scroll-panel__copy p {
  font-size: clamp(0.9rem, 1.6vw, 1.02rem);
  line-height: 1.9;
  letter-spacing: 0.04em;
  margin: 0 0 0.55rem;
}

.tl-scroll-panel__end {
  text-align: center;
  color: var(--tl-accent);
  margin-top: 0.75rem !important;
}

.tl-story__outro {
  position: relative;
  z-index: 100;
  min-height: 32vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 2.5rem;
  background-color: #1a1218;
}

.tl-story__outro-inner {
  text-align: center;
  max-width: 32rem;
}

.tl-story__credit {
  font-size: 0.74rem;
  color: rgba(244, 234, 216, 0.68);
  line-height: 2;
  margin: 0 0 1.5rem;
  text-align: left;
}

.tl-story__back {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--tl-paper);
  text-decoration: none;
  border: 1px solid rgba(244, 234, 216, 0.3);
  border-radius: 2px;
  transition: background 0.25s, border-color 0.25s;
}

.tl-story__back:hover {
  background: rgba(244, 234, 216, 0.08);
  border-color: rgba(244, 234, 216, 0.55);
}

@media (min-width: 900px) {
  .tl-scroll-panel__stage {
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(0.85rem, 1.5vw, 1.35rem);
  }

  .tl-scroll-panel__visual {
    flex: 0 0 min(48%, 28rem);
  }

  .tl-scroll-panel__copy {
    flex: 1;
    min-width: 0;
  }

  .tl-scroll-panel__figure img {
    max-height: min(68vh, 24rem);
  }
}

@media (max-width: 640px) {
  .tl-scroll-panel__figure img {
    max-height: min(34vh, 14rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-scroll-panel {
    height: auto;
    min-height: auto;
  }

  .tl-scroll-panel__sticky {
    position: relative;
    height: auto;
    min-height: auto;
    padding-top: 5rem;
    padding-bottom: 3rem;
    opacity: 1 !important;
  }

  .tl-scroll-panel__sticky,
  .fade-in,
  .tl-candle-cover__title-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
