/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
  --color-bg-dark: #0a0a0f;
  --color-bg-section: #f8f5f0;
  --color-bg-alt: #1a1a2e;
  --color-gold: #c9a96e;
  --color-gold-light: #dfc397;
  --color-text: #2c2c2c;
  --color-text-light: #5a5a5a;
  --color-text-on-dark: #e8e0d4;
  --color-white: #ffffff;
  --color-border: #d4c5a9;

  --font-sans-tc: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-serif-tc: 'Noto Serif TC', 'Georgia', serif;
  --font-serif-en: 'Cormorant Garamond', 'Georgia', serif;

  --container-max: 1100px;
  --section-padding: 120px 0;
}

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

html {
  scroll-behavior: auto;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

body {
  font-family: var(--font-sans-tc);
  color: var(--color-text);
  background: var(--color-bg-dark);
  overflow-x: hidden;
  line-height: 1.75;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Loader
   ============================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner { text-align: center; }

.loader-brand {
  font-family: var(--font-serif-en);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 0.3em;
  margin-bottom: 40px;
}

.loader-bar-track {
  width: 240px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  overflow: hidden;
  margin: 0 auto 16px;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-gold);
  transition: width 0.1s linear;
}

.loader-text {
  font-family: var(--font-serif-en);
  font-size: 0.85rem;
  color: var(--color-text-light);
  letter-spacing: 0.15em;
}

/* ============================================
   Immersive Section (Canvas)
   ============================================ */
.immersive-section {
  position: relative;
  height: 1400vh;
  background: var(--color-bg-dark);
}

#sequenceCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.immersive-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.brand-title {
  text-align: center;
  color: var(--color-white);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}

.brand-title .brand-sub {
  display: block;
  font-family: var(--font-serif-en);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: 12px;
}

.brand-title h1 {
  font-family: var(--font-serif-en);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: 0.25em;
  margin-bottom: 8px;
}

.brand-title .brand-tagline {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.6em;
  color: var(--color-gold-light);
}

/* ============================================
   Chapter Overlay System — Text Chapters
   ============================================ */
.chapter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
}

.chapter-content {
  max-width: 560px;
  color: var(--color-white);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6), 0 0 80px rgba(0, 0, 0, 0.3);
}

.chapter-overlay--left {
  justify-content: flex-start;
  padding-left: 8vw;
}

.chapter-overlay--right {
  justify-content: flex-end;
  padding-right: 8vw;
}

.chapter-overlay--right .chapter-content {
  text-align: right;
}

.chapter-overlay--center {
  justify-content: center;
}

.chapter-overlay--center .chapter-content {
  text-align: center;
}

.chapter-badge {
  display: inline-block;
  font-family: var(--font-serif-en);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201, 169, 110, 0.4);
}

.chapter-title {
  font-family: var(--font-serif-en), var(--font-serif-tc);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.chapter-title .title-accent {
  color: var(--color-gold);
  margin: 0 8px;
  font-weight: 300;
}

.chapter-body {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.9);
}

.chapter-body em {
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--color-gold-light);
  font-size: 1.1em;
}

/* ============================================
   Chapter Overlay — Glass Panel (data-heavy)
   ============================================ */
.chapter-panel {
  background: rgba(10, 10, 15, 0.92);
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 16px;
  padding: 40px 44px;
  max-width: 880px;
  width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  color: var(--color-text-on-dark);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow:
    0 0 30px rgba(201, 169, 110, 0.06),
    inset 0 1px 0 rgba(201, 169, 110, 0.1);
}

@supports (backdrop-filter: blur(20px)) {
  .chapter-panel {
    background: rgba(10, 10, 15, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(201, 169, 110, 0.3);
    box-shadow:
      0 0 40px rgba(201, 169, 110, 0.08),
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(201, 169, 110, 0.15);
  }
}

.chapter-panel .chapter-badge {
  text-shadow: none;
}

.chapter-panel-title {
  font-family: var(--font-serif-tc);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.chapter-panel-lead {
  text-align: center;
  font-size: 0.95rem;
  color: rgba(232, 224, 212, 0.85);
  margin: -12px 0 24px;
  line-height: 1.7;
}

.chapter-panel-notes {
  margin-top: 20px;
  font-size: 0.9rem;
  color: rgba(232, 224, 212, 0.7);
  line-height: 1.7;
}

/* --- Panel table (tiers) --- */
.chapter-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chapter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.chapter-table th {
  background: rgba(201, 169, 110, 0.15);
  color: var(--color-gold-light);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-gold);
  white-space: nowrap;
}

.chapter-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  line-height: 1.6;
}

.ct-label {
  font-weight: 600;
  color: var(--color-gold-light);
  white-space: nowrap;
}

.ct-price {
  font-family: var(--font-serif-en);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
}

.ct-points {
  font-family: var(--font-serif-en);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-gold);
  text-align: center;
}

/* --- Panel items (benefits / premium) --- */
.chapter-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chapter-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chapter-item:last-child {
  border-bottom: none;
}

.chapter-item-pts {
  flex-shrink: 0;
  min-width: 64px;
  font-family: var(--font-serif-en);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-gold);
  letter-spacing: 0.03em;
  padding-top: 2px;
}

.chapter-item-icon {
  flex-shrink: 0;
  min-width: 32px;
  font-size: 1rem;
  color: var(--color-gold);
  padding-top: 2px;
  text-align: center;
}

.chapter-item h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 4px;
}

.chapter-item p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(232, 224, 212, 0.78);
}

/* ============================================
   Content Wrapper & Shared Sections
   ============================================ */
#content-wrapper {
  position: relative;
  z-index: 10;
}

.content-section {
  position: relative;
  z-index: 10;
  background: var(--color-bg-section);
  padding: var(--section-padding);
}

.section-title {
  font-family: var(--font-serif-tc);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: 0.08em;
  color: var(--color-text);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   CTA Split Section
   ============================================ */
.cta-split-section {
  background: var(--color-bg-section);
  padding: 0;
}

.cta-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80vh;
}

.cta-split-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 60px;
}

.cta-split-label {
  font-family: var(--font-serif-en);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cta-split-title {
  font-family: var(--font-serif-en);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.cta-split-desc {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--color-text-light);
  margin-bottom: 48px;
  max-width: 440px;
}

.cta-split-stats {
  display: flex;
  gap: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.cta-stat { display: flex; flex-direction: column; }

.cta-stat-value {
  font-family: var(--font-serif-en);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.cta-stat-label {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.cta-split-right {
  position: relative;
  overflow: hidden;
}

.cta-split-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}

.cta-split-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   ULTRA RARE — UR 館資訊
   ============================================ */
.ur-section {
  background: var(--color-bg-alt);
  color: var(--color-text-on-dark);
  padding: 100px 0;
}

.ur-header {
  text-align: center;
  margin-bottom: 56px;
}

.ur-brand {
  font-family: var(--font-serif-en);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-white);
  margin-bottom: 8px;
}

.ur-sub {
  font-size: 1rem;
  color: var(--color-gold-light);
  letter-spacing: 0.15em;
}

.ur-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.ur-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 8px;
  transition: border-color 0.3s ease;
}

.ur-item:hover { border-color: var(--color-gold); }

.ur-item-icon {
  flex-shrink: 0;
  color: var(--color-gold);
  margin-top: 2px;
}

.ur-item-content h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold-light);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ur-item-content p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-on-dark);
}

.ur-item-content a {
  color: var(--color-text-on-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.ur-item-content a:hover { color: var(--color-gold); }

/* ============================================
   LINE CTA — Dark theme
   ============================================ */
.line-cta-section {
  background: var(--color-bg-alt);
  padding: 80px 0;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(201, 169, 110, 0.2);
}

.line-cta-content { text-align: center; }

.line-cta-icon { margin-bottom: 24px; }

.line-cta-icon svg { fill: #06C755; }

.line-cta-title {
  font-family: var(--font-serif-tc);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.line-cta-desc {
  font-size: 1.05rem;
  color: var(--color-gold-light);
  margin-bottom: 36px;
}

.line-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: transparent;
  color: #06C755;
  font-family: var(--font-serif-tc);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: 50px;
  border: 1.5px solid #06C755;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.line-cta-button svg {
  fill: #06C755;
  transition: fill 0.3s ease;
}

.line-cta-button:hover {
  background: #06C755;
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 199, 85, 0.25);
}

.line-cta-button:hover svg { fill: var(--color-white); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(232, 224, 212, 0.55);
  text-align: center;
  padding: 40px 0;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  font-size: 0.85rem;
  position: relative;
  z-index: 10;
}

.site-footer .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px 0;
  }

  .brand-title h1 { letter-spacing: 0.12em; }

  .chapter-overlay--left,
  .chapter-overlay--right {
    justify-content: center;
    padding-left: 24px;
    padding-right: 24px;
  }

  .chapter-overlay--right .chapter-content { text-align: center; }

  .chapter-content { max-width: 100%; }

  .chapter-title { font-size: clamp(1.6rem, 6vw, 2.5rem); }

  .chapter-panel {
    padding: 28px 20px;
    max-width: 95vw;
    width: 95vw;
    max-height: 92vh;
  }

  .chapter-panel-title { font-size: 1.3rem; margin-bottom: 20px; }

  .chapter-table { font-size: 0.875rem; }
  .chapter-table th,
  .chapter-table td { padding: 10px 10px; }
  .ct-price { font-size: 0.95rem; }
  .ct-points { font-size: 1rem; }

  .chapter-item-pts { min-width: 52px; font-size: 0.75rem; }
  .chapter-item h4 { font-size: 0.9rem; }
  .chapter-item p { font-size: 0.875rem; }

  .cta-split { grid-template-columns: 1fr; }
  .cta-split-left { padding: 60px 24px; }
  .cta-split-right { height: 50vh; }
  .cta-split-stats { gap: 24px; }

  .ur-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand-title .brand-sub { font-size: 0.8rem; letter-spacing: 0.25em; }
  .brand-title .brand-tagline { font-size: 0.9rem; letter-spacing: 0.35em; }
  .loader-brand { font-size: 1.4rem; letter-spacing: 0.2em; }

  .chapter-panel { padding: 24px 16px; }
  .chapter-item { gap: 10px; padding: 10px 0; }
}

/* ============================================
   Accessibility: Focus styles
   ============================================ */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 4px;
}

/* ============================================
   Accessibility: prefers-reduced-motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .chapter-overlay,
  .chapter-content,
  .chapter-panel,
  .chapter-badge,
  .chapter-title,
  .chapter-body {
    transform: none !important;
    transition: opacity 0.4s ease !important;
  }

  .reveal {
    transform: none;
    transition: opacity 0.4s ease;
  }

  .chapter-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 10, 15, 0.95);
  }
}
