:root {
  --bg: #131209;
  --surface: #1f1f1f;
  --line: #313131;
  --paper: #ece4d3;
  --paper-ink: #1c1a14;
  --paper-muted: #6b6455;
  --text: #ece4d3;
  --muted: #9b9384;
  --faint: rgba(236, 228, 211, 0.3);
  --maple: #c2453b;
  --gold: #c8963e;
  --curve: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Serif TC', serif;
  font-size: 1rem;
  line-height: 1.5rem;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
/* 紙張的顆粒感：雜訊圖，不是漸層 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.defs { position: absolute; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }

.skip {
  position: fixed; top: 16px; left: 16px; z-index: 200;
  padding: 8px 12px; background: var(--paper); color: var(--paper-ink); border-radius: 8px;
  transform: translateY(-200%); transition: transform 300ms var(--curve);
}
.skip:focus { transform: none; }

/* ---------- 導覽 ---------- */
.nav {
  position: fixed; top: 16px; left: 50%; z-index: 50;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 24px;
  padding: 8px 12px 8px 16px;
  background: rgba(19, 18, 9, 0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(236, 228, 211, 0.12);
  border-radius: 9999px;
}
.nav-mark { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 0.875rem; line-height: 1.25rem; letter-spacing: 0.08em; }
.nav-mark svg { width: 16px; height: 16px; fill: var(--maple); }
.nav-links { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  display: block; padding: 4px 12px; border-radius: 9999px;
  font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; text-decoration: none; color: var(--muted);
  transition: color 300ms var(--curve), background-color 300ms var(--curve);
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current='true'] { color: var(--paper-ink); background: var(--paper); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav { left: 16px; right: 16px; transform: none; justify-content: space-between; }
  .nav-toggle {
    display: grid; place-items: center; gap: 4px; width: 40px; height: 40px;
    background: none; border: 0; border-radius: 9999px; cursor: pointer; position: relative; z-index: 2;
  }
  .nav-toggle span {
    position: absolute; width: 16px; height: 2px; background: var(--text); border-radius: 2px;
    transition: transform 500ms var(--curve);
  }
  .nav-toggle span:first-child { transform: translateY(-4px); }
  .nav-toggle span:last-child { transform: translateY(4px); }
  .nav-toggle[aria-expanded='true'] span:first-child { transform: rotate(45deg); }
  .nav-toggle[aria-expanded='true'] span:last-child { transform: rotate(-45deg); }
  .nav-links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; align-items: center; gap: 16px;
    background: rgba(19, 18, 9, 0.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    opacity: 0; pointer-events: none; transition: opacity 500ms var(--curve);
  }
  /* backdrop-filter 會讓裡面 position: fixed 的面板只蓋住導覽列，打開時拿掉，面板才能蓋滿整個畫面 */
  .nav.open { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; border-color: transparent; }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-links li { opacity: 0; transform: translateY(24px); transition: opacity 500ms var(--curve), transform 500ms var(--curve); }
  .nav.open .nav-links li { opacity: 1; transform: none; }
  .nav.open .nav-links li:nth-child(2) { transition-delay: 60ms; }
  .nav.open .nav-links li:nth-child(3) { transition-delay: 120ms; }
  .nav.open .nav-links li:nth-child(4) { transition-delay: 180ms; }
  .nav-links a { font-size: 1.5rem; line-height: 2rem; padding: 8px 24px; }
}

/* ---------- 入口 ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 64px;
  padding: 128px 24px 80px;
}
.eyebrow, .hall-no, .ticket-kicker, .guide-label { font-size: 0.75rem; line-height: 1rem; letter-spacing: 0.24em; color: var(--gold); }
.hero-title {
  margin-top: 24px; max-width: 680px;
  font-size: 3.75rem; line-height: 1.15; letter-spacing: 0.02em;
  background: linear-gradient(90deg, #ffffff, #9b9b9b); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 24px; max-width: 680px; font-size: 1.125rem; line-height: 2rem; color: var(--muted); }
.btn {
  display: inline-block; margin-top: 40px; padding: 8px 12px;
  font-size: 1rem; line-height: 1.5rem; font-weight: 600; text-decoration: none;
  color: var(--paper-ink); background: var(--paper); border-radius: 8px;
  transition: transform 300ms var(--curve), background-color 300ms var(--curve);
}
.btn:hover { background: #fff; transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.hero-live { margin-top: 24px; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted); min-height: 20px; }
.hero-live strong { color: var(--text); font-weight: 600; }

.ticket {
  margin: 0; display: grid; grid-template-columns: 1fr 96px;
  color: var(--paper-ink); background: var(--paper); border-radius: 12px;
  transform: rotate(-4deg); box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  animation: ticket-in 1200ms var(--curve) both 200ms;
}
@keyframes ticket-in { from { opacity: 0; transform: rotate(-12deg) translateY(48px); } }
.ticket-main { padding: 32px; }
.ticket-kicker { color: var(--maple); }
.ticket-date { margin-top: 16px; font-size: 2.25rem; line-height: 2.5rem; font-weight: 700; letter-spacing: 0.04em; }
.ticket-stats { margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ticket-stats dt { font-size: 0.75rem; line-height: 1rem; color: var(--paper-muted); }
.ticket-stats dd { margin: 4px 0 0; font-size: 1.5rem; line-height: 2rem; font-weight: 700; }
.ticket-tear {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 32px 12px; font-size: 0.75rem; line-height: 1rem; color: var(--paper-muted);
  writing-mode: vertical-rl;
}
/* 撕線：一排圓點，加上上下兩個缺口 */
.ticket-tear::before {
  content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 2px;
  background-image: radial-gradient(circle, var(--paper-muted) 1px, transparent 1.5px);
  background-size: 2px 8px; opacity: 0.6;
}
.ticket-stamp { width: 40px; height: 40px; fill: var(--maple); transform: rotate(18deg); writing-mode: horizontal-tb; }

.falling-leaf {
  position: absolute; top: -48px; left: 62%; width: 24px; height: 24px; fill: var(--maple); opacity: 0.8;
  animation: fall 14s var(--curve) infinite;
}
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  10% { opacity: 0.8; }
  50% { transform: translate(-80px, 50vh) rotate(160deg); }
  90% { opacity: 0.6; }
  100% { transform: translate(40px, 105vh) rotate(320deg); opacity: 0; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; min-height: auto; padding-top: 112px; }
  .hero-title { font-size: 2.25rem; line-height: 1.25; }
  .ticket { max-width: 420px; transform: rotate(-2deg); }
  .ticket-main { padding: 24px; }
  .ticket-tear { padding: 24px 8px; }
  .grid-stubs { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 館訓 ---------- */
.reveal-words { max-width: var(--max); margin: 0 auto; padding: 128px 24px; }
.tagline { max-width: 680px; font-size: 3rem; line-height: 1.3; font-weight: 600; letter-spacing: 0.02em; }
.tagline .ch { color: var(--faint); transition: color 500ms var(--curve); }
.tagline .ch.on { color: var(--text); }
@media (max-width: 720px) { .tagline { font-size: 1.875rem; line-height: 1.4; } .reveal-words { padding: 80px 24px; } }

/* ---------- 篩選 ---------- */
.guide { max-width: var(--max); margin: 0 auto; padding: 0 24px 32px; }
.guide-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.regions { display: flex; flex-wrap: wrap; gap: 4px; }
.regions button, .more {
  padding: 4px 12px; font: inherit; font-size: 0.875rem; line-height: 1.25rem; font-weight: 600;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 9999px; cursor: pointer;
  transition: color 300ms var(--curve), background-color 300ms var(--curve), transform 300ms var(--curve);
}
.regions button:hover, .more:hover { color: var(--text); }
.regions button:active, .more:active { transform: scale(0.98); }
.regions button[aria-pressed='true'] { color: var(--paper-ink); background: var(--paper); border-color: var(--paper); }
.search { flex: 1 1 240px; }
.search input {
  width: 100%; padding: 8px 12px; font: inherit; font-size: 1rem; line-height: 1.5rem;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.search input::placeholder { color: var(--muted); }

/* ---------- 展廳 ---------- */
.hall { max-width: var(--max); margin: 0 auto; padding: 96px 24px 32px; }
.hall-head { max-width: 680px; margin-bottom: 48px; }
.hall-head h2 { margin-top: 12px; font-size: 3rem; line-height: 1; letter-spacing: 0.06em; }
.hall-story { margin-top: 24px; font-size: 1.125rem; line-height: 2rem; color: var(--muted); }
.hall-count { margin-top: 16px; font-size: 0.875rem; line-height: 1.25rem; color: var(--gold); }
.more { display: block; margin: 40px auto 0; padding: 8px 24px; font-size: 1rem; line-height: 1.5rem; }
.empty {
  grid-column: 1 / -1; padding: 48px 24px; text-align: center; color: var(--muted);
  border: 1px solid var(--line); border-radius: 16px;
}
.grid { display: grid; gap: 32px; }
.grid-stubs { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-labels { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* 票根 */
.stub-link {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  color: var(--paper-ink); background: var(--paper); border-radius: 12px; overflow: hidden;
  transition: transform 500ms var(--curve), box-shadow 500ms var(--curve);
}
.stub-link:hover { transform: translateY(-4px) rotate(-0.5deg); box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45); }
.stub-link:active { transform: scale(0.98); }
.stub-art { position: relative; aspect-ratio: 85 / 37; background: #272727; overflow: hidden; }
.stub-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) sepia(0.12); transition: transform 500ms var(--curve); }
.stub-link:hover .stub-art img { transform: scale(1.04); }
.stub-poster {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  font-size: 1.5rem; line-height: 2rem; font-weight: 700; text-align: center; color: var(--paper);
  background: var(--maple);
}
.stub-art.has-img .stub-poster { display: none; }
.stub-body { flex: 1; padding: 24px 24px 16px; }
.stub-date { font-size: 0.875rem; line-height: 1.25rem; font-weight: 700; letter-spacing: 0.08em; color: var(--maple); }
.stub-title { margin-top: 8px; font-size: 1.25rem; line-height: 1.75rem; }
.stub-venue { margin-top: 8px; font-size: 0.875rem; line-height: 1.25rem; color: var(--paper-muted); }
.stub-tear {
  position: relative; display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding: 12px 24px 16px;
  font-size: 0.75rem; line-height: 1rem; letter-spacing: 0.12em; color: var(--paper-muted);
}
.stub-tear::before {
  content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 2px;
  background-image: radial-gradient(circle, var(--paper-muted) 1px, transparent 1.5px);
  background-size: 8px 2px; opacity: 0.6;
}
.stub-when { color: var(--paper-ink); font-weight: 700; }

/* 剪報 */
.clips { columns: 3 300px; column-gap: 48px; }
.clip { break-inside: avoid; margin-bottom: 32px; }
.clip-link {
  display: block; padding: 24px; text-decoration: none;
  color: var(--paper-ink); background: #d9d0bd; border-radius: 4px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 500ms var(--curve), box-shadow 500ms var(--curve);
}
.clip-link:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45); }
.clip-link:active { transform: scale(0.98); }
.clip-date { font-size: 0.75rem; line-height: 1rem; letter-spacing: 0.16em; color: var(--maple); font-weight: 700; }
.clip-title { margin-top: 8px; font-size: 1.125rem; line-height: 1.75rem; }
.clip-meta { margin-top: 12px; font-size: 0.75rem; line-height: 1rem; color: var(--paper-muted); }

/* 展籤 */
.label-link {
  display: flex; flex-direction: column; height: 100%; padding: 24px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  transition: transform 500ms var(--curve), border-color 300ms var(--curve);
}
.label-link:hover { transform: translateY(-4px); border-color: var(--gold); }
.label-link:active { transform: scale(0.98); }
.label-img { width: calc(100% + 48px); max-width: none; margin: -24px -24px 24px; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(0.85); }
.label-no { font-size: 0.75rem; line-height: 1rem; letter-spacing: 0.16em; color: var(--gold); }
.label-title { margin-top: 12px; font-size: 1.125rem; line-height: 1.75rem; }
.label-venue { margin-top: 12px; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted); }
.label-dates { margin-top: 4px; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted); }
.label-desc { margin-top: 16px; font-size: 0.875rem; line-height: 1.5rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.label-end { margin-top: auto; padding-top: 16px; font-size: 0.75rem; line-height: 1rem; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.label-end.soon { color: var(--maple); }

/* 載入中 */
.skeleton { border-radius: 12px; background: var(--surface); animation: pulse 1600ms var(--curve) infinite alternate; }
.grid-stubs .skeleton { height: 340px; }
.grid-labels .skeleton { height: 240px; }
.clips .skeleton { height: 140px; margin-bottom: 32px; }
.skeleton-line { display: inline-block; width: 320px; max-width: 100%; height: 12px; border-radius: 4px; background: var(--surface); animation: pulse 1600ms var(--curve) infinite alternate; }
@keyframes pulse { to { opacity: 0.4; } }

/* ---------- 尾聲 ---------- */
.epilogue { max-width: 680px; margin: 0 auto; padding: 128px 24px 96px; text-align: center; }
.epilogue-leaf { width: 32px; height: 32px; margin: 0 auto 32px; fill: var(--maple); transform: rotate(24deg); }
.epilogue h2 { font-size: 2.25rem; line-height: 2.5rem; letter-spacing: 0.06em; }
.epilogue p { margin-top: 24px; font-size: 1.125rem; line-height: 2rem; color: var(--muted); }
.footer {
  max-width: var(--max); margin: 0 auto; padding: 32px 24px 48px;
  display: grid; gap: 8px; text-align: center; font-size: 0.75rem; line-height: 1rem; color: var(--muted);
}
.footer a { text-underline-offset: 4px; transition: color 300ms var(--curve); }
.footer a:hover { color: var(--text); }

/* ---------- 進場 ---------- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--curve), transform 700ms var(--curve); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transform: none; transition: opacity 300ms linear; }
  .falling-leaf { display: none; }
  .ticket { animation: none; }
  *, *::before, *::after { transition-duration: 200ms !important; }
}
