/* ===== CSS Variables & Theme ===== */
:root {
  /* Colors - Oriental Minimalist Premium (Blueprint) */
  --bg-primary: #f8f3e3; /* Linen */
  --bg-secondary: #ffffff;
  --bg-card: #fefcf6;
  --bg-card-hover: #fdf9ef;
  --bg-overlay: rgba(248, 243, 227, 0.95);

  --color-ink-navy: #1a1a2e;
  --color-seal-red: #c0392b;
  --color-linen: #f8f3e3;
  --color-muted-gray: #8c8c8c;
  --color-mineral-gold: #d4a574;
  --ease-premium: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --gold-primary: var(--color-mineral-gold);
  --gold-light: #e6c598;
  --gold-dark: #b88a5b;
  --gold-glow: rgba(212, 165, 116, 0.3);

  --text-primary: var(--color-ink-navy);
  --text-secondary: var(--color-muted-gray);
  --text-muted: #a3a3a3;

  --border-color: rgba(26, 26, 46, 0.1); /* Subtle dark border */
  --border-gold: rgba(212, 165, 116, 0.3);

  --error: var(--color-seal-red);
  --success: #2ecc71;

  /* Five Elements Colors (Semantic overrides based on dark navy background) */
  --element-wood: #4a9e4a;
  --element-fire: var(--color-seal-red);
  --element-earth: var(--color-mineral-gold);
  --element-metal: #7f8c8d;
  --element-water: #3498db;

  /* Typography */
  --font-heading: 'Cinzel', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-chinese-calligraphy: 'Ma Shan Zheng', cursive;
  --font-chinese-serif: 'Noto Serif SC', serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition-fast: 0.1s var(--ease-premium);
  --transition-base: 0.3s var(--ease-premium);
  --transition-slow: 0.6s var(--ease-premium);

  /* Container */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Removed radial dark gradients for pure Linen vibe */

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold-light);
}

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

ul, ol {
  list-style: none;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: 0.05em;
}

h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.text-gold { color: var(--gold-primary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.chinese-calligraphy {
  font-family: var(--font-chinese-calligraphy);
}

.chinese-serif {
  font-family: var(--font-chinese-serif);
}

/* ===== Layout Utilities ===== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ===== Section Spacing ===== */
.section {
  padding: var(--space-3xl) 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--gold-primary);
  letter-spacing: 0.1em;
}

/* ===== Decorative Elements ===== */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  color: var(--gold-primary);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  margin: var(--space-lg) 0;
}

.ornament::before,
.ornament::after {
  content: '';
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: var(--space-2xl) 0;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--gold-glow); }
  50% { box-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(201, 168, 76, 0.1); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  .container { padding: 0 var(--space-md); }
}

@media (max-width: 768px) {
  html { font-size: 14px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .section { padding: var(--space-2xl) 0; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* ===== Selection ===== */
::selection {
  background: var(--gold-primary);
  color: var(--bg-primary);
}
