/* ============================================
   盛事策劃 Grand Events — Dramatic Portfolio
   Dark theme, gold accent, editorial typography
   ============================================ */

:root {
  /* Dark theme (default) */
  --bg: #08080b;
  --bg-surface: #111116;
  --bg-elevated: #18181f;
  --fg: #f0ebe0;
  --fg-muted: #9a9488;
  --fg-dim: #635f58;
  --accent: #c9a84c;
  --accent-glow: rgba(201, 168, 76, 0.15);
  --accent-soft: rgba(201, 168, 76, 0.08);
  --accent-hover: #dbb954;
  --accent-dark: #a88a3a;
  --border: #25242a;
  --border-light: #333138;
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
  --radius: 6px;
  --radius-lg: 12px;
  --font-display: 'Playfair Display', 'Noto Serif TC', serif;
  --font-body: 'Noto Sans TC', 'Inter', sans-serif;

  /* Spacing scale */
  --space-xs: 6px;
  --space-sm: 12px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 128px;
}

/* Light theme */
[data-theme="light"] {
  --bg: #faf8f4;
  --bg-surface: #ffffff;
  --bg-elevated: #f0ede6;
  --fg: #1a1815;
  --fg-muted: #6b6560;
  --fg-dim: #a09890;
  --accent: #b8942e;
  --accent-glow: rgba(184, 148, 46, 0.1);
  --accent-soft: rgba(184, 148, 46, 0.06);
  --accent-hover: #a08028;
  --accent-dark: #8a6e22;
  --border: #e0dcd4;
  --border-light: #e8e4dc;
  --shadow: 0 4px 32px rgba(0,0,0,0.08);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

/* Subtle grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md); }
.container-narrow { max-width: 900px; }

section { padding: var(--space-xl) 0; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.display-1 {
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.display-2 {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(28px, 4vw, 48px);
  margin-bottom: var(--space-md);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin-top: var(--space-sm);
}

.text-gold { color: var(--accent); }
.text-muted { color: var(--fg-muted); }

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  background: rgba(8, 8, 11, 0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 1030;
}

[data-theme="light"] .navbar {
  background: rgba(250, 248, 244, 0.92) !important;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent) !important;
  letter-spacing: 0.05em;
}

.navbar-brand .brand-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #000;
  border-radius: 4px;
  text-align: center;
  line-height: 32px;
  font-size: 0.9rem;
  margin-right: 8px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted) !important;
  padding: 0.5rem 1rem !important;
  transition: color 0.3s ease;
  letter-spacing: 0.02em;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent) !important;
}

.nav-link.active { font-weight: 600; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: var(--space-sm);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  padding: 12px 32px;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #0a0a0a;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #0a0a0a;
  transform: translateY(-2px);
}

.btn:active { transform: scale(0.97) !important; }

.btn-lg { padding: 16px 40px; font-size: 1.05rem; }

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 50%, var(--accent-glow), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 168, 76, 0.06), transparent 50%),
    var(--bg);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.03));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
  animation: fadeUp 0.8s ease forwards;
}

.hero h1 {
  animation: fadeUp 0.8s 0.1s ease forwards;
  opacity: 0;
}

.hero .lead {
  font-size: 1.1rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-lg);
  max-width: 500px;
  animation: fadeUp 0.8s 0.2s ease forwards;
  opacity: 0;
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  animation: fadeUp 0.8s 0.3s ease forwards;
  opacity: 0;
}

.hero-visual {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-lg) 0;
}

.stat-item {
  text-align: center;
  padding: var(--space-sm);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: var(--space-xs);
  letter-spacing: 0.05em;
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card .icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.service-card h3 {
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
}

.service-card p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.service-price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 700;
}

.service-price small {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 400;
}

/* ============================================
   PORTFOLIO GRID
   ============================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.portfolio-item:hover img {
  transform: scale(1.08);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h4 {
  color: var(--fg);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.portfolio-overlay span {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.page-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--fg-muted);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.3s ease;
}

.page-btn:hover, .page-btn.active {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 12px;
  left: 24px;
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.15;
  line-height: 1;
}

.testimonial-text {
  font-size: 1rem;
  color: var(--fg-muted);
  font-style: italic;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.testimonial-author {
  font-weight: 600;
  color: var(--fg);
}

.testimonial-role {
  font-size: 0.85rem;
  color: var(--fg-dim);
}

/* ============================================
   ABOUT PAGE
   ============================================ */
.about-hero-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.about-hero-img img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.timeline-item {
  padding-left: 32px;
  border-left: 2px solid var(--border);
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact-info-item {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

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

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.form-control {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
  color: var(--fg);
  outline: none;
}

.form-control::placeholder {
  color: var(--fg-dim);
}

.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--fg-muted);
}

.map-placeholder {
  width: 100%;
  height: 350px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-dim);
  font-size: 0.9rem;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  background:
    radial-gradient(ellipse at center, var(--accent-glow), transparent 60%),
    var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.footer h6 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
  margin-bottom: var(--space-md);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  color: var(--fg-dim);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--fg-dim);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Gold accent line animation */
.accent-line {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: var(--space-md) 0;
  position: relative;
  overflow: hidden;
}

.accent-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2.5s infinite;
}

.accent-line.center { margin-left: auto; margin-right: auto; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
  .hero { min-height: 70vh; }
  .hero-visual { opacity: 0.12; width: 100%; }
  .hero-content { max-width: 100%; text-align: center; }
  .hero .lead { max-width: 100%; }
  .hero-buttons { justify-content: center; }
  section { padding: var(--space-xl) 0; }
  .portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 767px) {
  :root { --space-xl: 56px; --space-lg: 32px; }
  section { padding: var(--space-lg) 0; }
  .stat-number { font-size: 1.8rem; }
  .service-card { padding: var(--space-md); }
  .about-hero-img img { height: 250px; }
  .map-placeholder { height: 250px; }
}

@media (max-width: 390px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 2rem; }
  .btn-lg { padding: 12px 28px; font-size: 0.95rem; }
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   FOCUS STATES
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   MODAL / LIGHTBOX
   ============================================ */
.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }

.btn-close {
  filter: invert(0.7);
}

[data-theme="light"] .btn-close {
  filter: invert(0.2);
}
