:root {
  --red-deep: #7a0f1e;
  --red: #b3182f;
  --red-bright: #e63950;
  --red-soft: #ff7a8a;
  --blue-deep: #0b1f4d;
  --blue: #16337a;
  --blue-bright: #3a63c9;
  --blue-soft: #7fa6ff;
  --bg-dark: #0a0812;
  --parchment: #fdf6ee;
  --parchment-dim: #efe2d2;
  --gold: #d9b26a;
  --font-serif-en: 'Cormorant Garamond', serif;
  --font-serif-zh: 'Noto Serif TC', serif;

  /* 介面用的衍生變數（僅 index 使用） */
  --hairline: rgba(217, 178, 106, 0.18);
  --hairline-strong: rgba(217, 178, 106, 0.4);
  --glass: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014));
  --ink-dim: rgba(253, 246, 238, 0.62);
  --shadow-soft: 0 22px 54px rgba(0, 0, 0, 0.34);
  --shadow-lift: 0 30px 70px rgba(0, 0, 0, 0.46);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--bg-dark);
  color: var(--parchment);
  font-family: var(--font-serif-zh), var(--font-serif-en), serif;
  font-weight: 400;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(217, 178, 106, 0.3);
  color: #fff;
}

.infinity {
  display: inline-block;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(217, 178, 106, 0.5));
}

/* ---------- Starfield background ---------- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(179, 24, 47, 0.25), transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(58, 99, 201, 0.25), transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(179, 24, 47, 0.15), transparent 60%),
    linear-gradient(160deg, #0a0812 0%, #120a1c 40%, #0a1330 100%);
}

/* 極淡的顆粒質感，讓大面積漸層不要太「數位」 */
#grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Floating hearts ---------- */
#hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -10%;
  font-size: 1.2rem;
  opacity: 0;
  animation: floatUp linear infinite;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

@keyframes floatUp {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 40px)) rotate(25deg); opacity: 0; }
}

/* ---------- Scroll progress ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 101;
  background: linear-gradient(90deg, var(--red-bright), var(--gold) 55%, var(--blue-bright));
  box-shadow: 0 0 12px rgba(217, 178, 106, 0.55);
  transition: width 0.12s linear;
}

/* ---------- Navbar ---------- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 2.5rem;
  background: rgba(10, 8, 18, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 178, 106, 0.15);
  transition: background 0.3s ease, padding 0.3s ease;
}

#navbar.is-scrolled {
  background: rgba(10, 8, 18, 0.82);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.nav-symbol {
  font-family: var(--font-serif-en);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--blue-soft), var(--gold), var(--red-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.2rem;
}

.nav-links a {
  color: var(--parchment-dim);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--red-soft), var(--blue-soft));
  transition: width 0.35s var(--ease);
}

.nav-links a:hover,
.nav-links a.active { color: #fff; }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ---------- Hero ---------- */
header#hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 2rem 4rem;
}

.hero-inner {
  max-width: 780px;
  animation: heroFadeIn 1.6s var(--ease) both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-family: var(--font-serif-en);
  font-style: italic;
  letter-spacing: 0.32em;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 1.4rem;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero-title {
  font-family: var(--font-serif-en);
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  background: linear-gradient(100deg, var(--blue-bright) 0%, var(--gold) 45%, var(--red-bright) 70%, var(--blue-bright) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(217, 178, 106, 0.25);
  line-height: 1.1;
  animation: shimmer 16s linear infinite;
}

@keyframes shimmer {
  to { background-position: 220% center; }
}

/* 裝飾用細線 + 中央符號 */
.hero-rule,
.section-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.6rem auto 1.9rem;
  max-width: 320px;
  color: var(--gold);
  font-size: 0.95rem;
  opacity: 0.75;
}

.hero-rule::before, .hero-rule::after,
.section-rule::before, .section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-strong));
}
.hero-rule::after,
.section-rule::after {
  background: linear-gradient(90deg, var(--hairline-strong), transparent);
}

.hero-sub {
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  line-height: 2.2;
  font-weight: 300;
  color: var(--parchment-dim);
  letter-spacing: 0.03em;
}

.hero-whisper {
  position: relative;
  height: 2.6rem;
  margin: 1.6rem 0 2.6rem;
}

.whisper-line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease);
}
.whisper-line.is-on {
  opacity: 0.9;
  transform: translateY(0);
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--parchment-dim);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}
.scroll-cue:hover { color: #fff; }

.chevron {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(6px, 6px); }
}

/* ---------- Section shared ---------- */
main { position: relative; z-index: 2; }

section {
  padding: 7rem 6vw 8rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* 區塊之間的細分隔線 */
section + section { position: relative; }
section + section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 60%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline), transparent);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 4.5rem;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif-en);
  font-style: italic;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue-soft);
  font-size: 0.85rem;
}

.kicker-num {
  font-style: normal;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--gold);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 0.9rem;
  background: linear-gradient(90deg, var(--red-soft), var(--parchment) 50%, var(--blue-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head .section-rule { margin: 1.2rem auto 1.4rem; max-width: 220px; }

.section-desc {
  color: var(--parchment-dim);
  font-size: 1.02rem;
  line-height: 2;
  font-weight: 300;
}

/* 區塊底部的延伸連結 */
.section-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 3.4rem auto 0;
  width: fit-content;
  padding: 0.6rem 0.2rem;
  text-decoration: none;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.section-more:hover {
  color: #fff;
  border-color: var(--hairline-strong);
}
.more-arrow { transition: transform 0.35s var(--ease); }
.section-more:hover .more-arrow { transform: translateX(5px); }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--red-bright) 8%,
    var(--gold) 50%,
    var(--blue-bright) 92%,
    transparent 100%);
  opacity: 0.45;
}

.timeline-item {
  position: relative;
  width: calc(50% - 3.2rem);
  margin-bottom: 3.2rem;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.timeline-item:nth-child(even) { margin-left: auto; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item.in-view { opacity: 1; transform: translateY(0); }

.timeline-dot {
  position: absolute;
  top: 1.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), var(--red-bright));
  box-shadow: 0 0 0 4px rgba(10, 8, 18, 0.9), 0 0 16px rgba(217, 178, 106, 0.7);
}
.timeline-item:nth-child(odd) .timeline-dot { right: calc(-3.2rem - 7px); }
.timeline-item:nth-child(even) .timeline-dot { left: calc(-3.2rem - 7px); }

.timeline-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 1.6rem 1.8rem 1.5rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: border-color 0.4s ease, transform 0.4s var(--ease), box-shadow 0.4s ease;
}
.timeline-card:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.timeline-date {
  display: inline-block;
  font-weight: 600;
  color: var(--blue-soft);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.timeline-card h4 {
  font-size: 1.3rem;
  margin: 0.5rem 0 0.6rem;
  color: #fff;
  letter-spacing: 0.03em;
}

.timeline-card p {
  color: var(--parchment-dim);
  font-size: 0.95rem;
  line-height: 1.95;
  font-weight: 300;
}

/* 時間軸卡片裡的歌詞引用 */
.tl-quote {
  margin-top: 1.2rem;
  padding: 0.85rem 0 0.85rem 1rem;
  border-left: 2px solid var(--blue-bright);
  background: linear-gradient(90deg, rgba(58, 99, 201, 0.09), transparent 70%);
  border-radius: 0 4px 4px 0;
}
.tl-quote[data-author="M"] {
  border-left-color: var(--red-bright);
  background: linear-gradient(90deg, rgba(230, 57, 80, 0.09), transparent 70%);
}

.tl-quote p {
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--parchment);
  letter-spacing: 0.04em;
  font-weight: 400;
}

.tl-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--blue-soft);
  opacity: 0.9;
}
.tl-quote cite::before { content: '♪　'; }
.tl-quote[data-author="M"] cite { color: var(--red-soft); }

/* ---------- Songs ---------- */
/* 同 .link-grid：曲目數不是整排時，落單的那張置中而不是靠左 */
.song-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.8rem;
}

.song-card {
  --accent: var(--blue-bright);
  --accent-soft: var(--blue-soft);
  --accent-rgb: 58, 99, 201;
  position: relative;
  display: flex;
  /* basis 偏大，讓寬螢幕排成 2×2 而不是 3 張加一張落單 */
  flex: 1 1 360px;
  max-width: 420px;
  flex-direction: column;
  padding: 1.9rem 1.7rem 1.7rem;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease), transform 0.5s var(--ease),
              border-color 0.4s ease, box-shadow 0.4s ease;
}
.song-card[data-author="M"] {
  --accent: var(--red-bright);
  --accent-soft: var(--red-soft);
  --accent-rgb: 230, 57, 80;
}
.song-card.in-view { opacity: 1; transform: translateY(0); }
.song-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}
.song-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.song-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: var(--shadow-lift);
}
.song-card:hover::after { opacity: 1; }

.song-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.3rem;
}

.song-heading { flex: 1; min-width: 0; }

.song-name {
  font-size: 1.22rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.song-tagline {
  margin-top: 0.28rem;
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
}

/* 小唱片 */
.song-disc {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--accent) 0 14%, rgba(10, 8, 18, 0.95) 15% 22%, transparent 23%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 4px),
    radial-gradient(circle, #241a2c, #0c0912 72%);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7);
}
.song-card:hover .song-disc { animation: spin 4.5s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.song-lyric {
  flex: 1;
  padding: 1.05rem 0 1.05rem 1.15rem;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), transparent 75%);
  border-radius: 0 4px 4px 0;
  margin-bottom: 1.5rem;
}

.song-lyric p {
  font-size: 0.96rem;
  line-height: 2.05;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--parchment-dim);
}

.song-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  align-self: flex-start;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.08);
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.song-play:hover {
  color: #fff;
  background: rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 8px 26px rgba(var(--accent-rgb), 0.3);
}

.song-play-icon {
  width: 0;
  height: 0;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* ---------- Book card (story teaser) ---------- */
.book-card {
  position: relative;
  max-width: 660px;
  margin: 0 auto;
  padding: 3.4rem 3.2rem;
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(217, 178, 106, 0.22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.book-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.book-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(135deg, var(--red-bright), transparent 35%, transparent 65%, var(--blue-bright));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.book-cover {
  text-align: center;
  margin-bottom: 2.4rem;
}

.book-eyebrow {
  font-family: var(--font-serif-en);
  font-style: italic;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--blue-soft);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.book-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.book-subtitle {
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--red-soft);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.book-divider {
  margin-top: 1.6rem;
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.7;
}

.book-excerpt {
  margin: 0 0 1.6rem;
  padding: 1.8rem 2rem;
  border-left: 2px solid var(--red-bright);
  border-right: 2px solid var(--blue-bright);
  background: rgba(0, 0, 0, 0.15);
  font-style: italic;
}

.book-excerpt p {
  color: var(--parchment-dim);
  line-height: 2;
  font-size: 1.02rem;
  font-weight: 300;
  margin-bottom: 0.6rem;
}
.book-excerpt p:last-child { margin-bottom: 0; }

/* 小說與歌詞互相呼應的一行 */
.book-echo {
  text-align: center;
  color: var(--gold);
  font-size: 0.92rem;
  line-height: 1.9;
  letter-spacing: 0.05em;
  opacity: 0.88;
  margin-bottom: 1.9rem;
}
.book-echo span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  color: var(--red-soft);
  opacity: 0.85;
}

.book-meta {
  display: flex;
  justify-content: center;
  gap: 2.4rem;
  margin-bottom: 2.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}
.book-meta strong {
  font-family: var(--font-serif-en);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  margin-right: 0.3rem;
}

.book-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 0 auto;
  width: fit-content;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  font-size: 1.02rem;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, var(--red-bright), var(--blue-bright));
  box-shadow: 0 10px 30px rgba(230, 57, 80, 0.25);
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.book-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(58, 99, 201, 0.35);
}

.book-cta-arrow { transition: transform 0.35s var(--ease); }
.book-cta:hover .book-cta-arrow { transform: translateX(4px); }

/* ---------- Poetry gallery ---------- */
.poetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.poetry-card {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(217, 178, 106, 0.22);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.5s var(--ease),
              box-shadow 0.4s ease, border-color 0.4s ease;
}

.poetry-card.in-view { opacity: 1; transform: translateY(0); }

.poetry-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lift);
}

.poetry-img-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.poetry-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease), filter 0.6s ease;
}

.poetry-card:hover .poetry-img-wrap img {
  transform: scale(1.06);
  filter: brightness(0.72);
}

.poetry-zoom {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 0.45rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: rgba(10, 8, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
  pointer-events: none;
}
.poetry-card:hover .poetry-zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.poetry-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
}

.poetry-caption h4 {
  font-size: 1.1rem;
  color: var(--parchment);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.poetry-author {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  font-family: var(--font-serif-en);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.poetry-author-a {
  background: radial-gradient(circle, var(--blue-bright), var(--blue-deep));
  box-shadow: 0 0 14px rgba(58, 99, 201, 0.45);
}

.poetry-author-m {
  background: radial-gradient(circle, var(--red-bright), var(--red-deep));
  box-shadow: 0 0 14px rgba(230, 57, 80, 0.45);
}

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 10, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 4rem 1.5rem;
}

#lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

#lightbox-figure {
  max-width: min(90vw, 640px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.94);
  transition: transform 0.35s var(--ease);
}

#lightbox.open #lightbox-figure { transform: scale(1); }

#lightbox-img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(217, 178, 106, 0.3);
}

#lightbox-figure figcaption {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--parchment);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

#lightbox-close,
.lightbox-nav {
  position: fixed;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(217, 178, 106, 0.3);
  color: var(--parchment);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s var(--ease);
}
#lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(217, 178, 106, 0.25);
  transform: scale(1.08);
}

#lightbox-close {
  top: 1.6rem;
  right: 1.6rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.08); }

#lightbox-prev { left: 1.6rem; }
#lightbox-next { right: 1.6rem; }

@media (max-width: 640px) {
  #lightbox-close { top: 1rem; right: 1rem; width: 2.6rem; height: 2.6rem; }
  #lightbox-prev { left: 0.6rem; width: 2.6rem; height: 2.6rem; }
  #lightbox-next { right: 0.6rem; width: 2.6rem; height: 2.6rem; }
}

/* ---------- Links grid ---------- */
/* 用 flex 而非 grid：卡片數量不是整排時，落單的那張會置中而不是靠左 */
.link-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem;
}

.link-card {
  position: relative;
  display: block;
  flex: 1 1 220px;
  max-width: 300px;
  padding: 2.2rem 1.6rem;
  text-align: center;
  text-decoration: none;
  color: var(--parchment);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(179, 24, 47, 0.10), rgba(58, 99, 201, 0.10));
  border: 1px solid rgba(217, 178, 106, 0.18);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.4s var(--ease),
              box-shadow 0.4s ease, border-color 0.4s ease;
}
.link-card.in-view { opacity: 1; transform: translateY(0); }

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(230, 57, 80, 0.18), rgba(58, 99, 201, 0.18));
  opacity: 0;
  transition: opacity 0.4s ease;
}

a.link-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
a.link-card:hover::before { opacity: 1; }

.link-icon {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  font-size: 1.6rem;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.28));
  border: 1px solid var(--hairline);
  position: relative;
  z-index: 1;
  transition: transform 0.4s var(--ease), border-color 0.4s ease;
}
a.link-card:hover .link-icon {
  transform: translateY(-2px) scale(1.06);
  border-color: var(--hairline-strong);
}

.link-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.link-card p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--parchment-dim);
  position: relative;
  z-index: 1;
}

.link-card.is-soon {
  opacity: 0;
  cursor: default;
}
.link-card.is-soon.in-view { opacity: 0.5; }

.link-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4.5rem 2rem 3.5rem;
  border-top: 1px solid rgba(217, 178, 106, 0.15);
}

.footer-symbol {
  font-family: var(--font-serif-en);
  font-size: 1.7rem;
  letter-spacing: 0.15em;
  background: linear-gradient(90deg, var(--blue-soft), var(--gold), var(--red-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}

.footer-quote {
  color: var(--parchment-dim);
  font-size: 0.98rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.footer-meta {
  margin-top: 1.4rem;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .timeline { padding-left: 2.4rem; }
  .timeline::before { left: 6px; transform: none; }
  .timeline-item {
    width: 100%;
    margin-left: 0;
  }
  /* 圓點回推一個 padding 的距離，圓心正好落在 6px 處的軸線上 */
  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: -2.4rem;
    right: auto;
  }
}

@media (max-width: 720px) {
  #navbar { padding: 0.9rem 1.1rem; }
  .nav-symbol { font-size: 1.1rem; }
  .nav-links { gap: 1.15rem; }
  .nav-links a { font-size: 0.8rem; letter-spacing: 0.06em; }
  section { padding: 5rem 5vw 6rem; }
  .section-head { margin-bottom: 3.4rem; }
  .hero-sub { line-height: 2.05; }
  .book-card { padding: 2.4rem 1.6rem; }
  .book-excerpt { padding: 1.4rem 1.2rem; }
  .book-meta { gap: 1.3rem; font-size: 0.75rem; }
  .timeline-card { padding: 1.3rem 1.2rem; }
  .song-card { padding: 1.6rem 1.3rem; }
  .chapter { max-width: 100%; padding: 2rem 1.6rem; align-self: center !important; text-align: left !important; }
  .chapter-num { right: 1rem !important; left: auto !important; }
}

@media (max-width: 420px) {
  .nav-links { gap: 0.85rem; }
  .nav-links a { font-size: 0.74rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #hearts-container { display: none; }
  .timeline-item,
  .song-card,
  .poetry-card,
  .book-card,
  .link-card { opacity: 1 !important; transform: none !important; }
  .link-card.is-soon { opacity: 0.5 !important; }
}
