/* ─────────────────────────────────────────────────────────────
   詠生時光 O-Life Registry — Design Tokens
   Quiet Luxury × Warm Digital × Memorial Gallery
───────────────────────────────────────────────────────────── */

:root {
  /* Brand palette */
  --ivory:      #F7F1E8;
  --ivory-2:    #FBF7F0;
  --sand:       #E9DCC8;
  --sand-2:     #F0E6D4;
  --ink:        #1F2528;
  --ink-2:      #2C3236;
  --ink-soft:   #5A6469;
  --evergreen:  #1F4D43;
  --evergreen-2:#2A6358;
  --gold:       #B79A63;
  --gold-soft:  #D4BC8A;
  --mist:       #DDE8EA;
  --mist-2:     #EEF4F5;
  --obsidian:   #111417;
  --obsidian-2: #1A1F23;

  /* Semantic */
  --bg:         var(--ivory);
  --bg-card:    #FFFFFF;
  --bg-warm:    var(--sand);
  --text:       var(--ink);
  --text-soft:  var(--ink-soft);
  --accent:     var(--evergreen);
  --line:       rgba(31,37,40,0.10);
  --line-soft:  rgba(31,37,40,0.06);

  /* Type stacks */
  --font-serif: "Noto Serif TC", "Cormorant Garamond", "Songti TC", serif;
  --font-sans:  "Noto Sans TC", "Inter", -apple-system, system-ui, sans-serif;
  --font-en-serif: "Cormorant Garamond", "Libre Baskerville", serif;
  --font-mono:  "JetBrains Mono", ui-monospace, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows (whisper-soft) */
  --sh-sm: 0 1px 2px rgba(31,37,40,0.04), 0 0 0 1px rgba(31,37,40,0.04);
  --sh-md: 0 4px 24px rgba(31,37,40,0.06), 0 0 0 1px rgba(31,37,40,0.04);
  --sh-lg: 0 24px 64px -16px rgba(31,37,40,0.16), 0 0 0 1px rgba(31,37,40,0.05);
  --sh-card: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 32px -12px rgba(31,37,40,0.10);
}

/* Theme: museum-light (more chalk, lighter contrast) */
[data-theme="museum"] {
  --bg: #FAF6EE;
  --bg-card: #FFFFFF;
  --bg-warm: #F3ECDF;
  --accent: #2A6358;
  --gold: #C2A878;
}

/* Theme: black-card (premium obsidian) */
[data-theme="onyx"] {
  --bg: #111417;
  --bg-card: #1A1F23;
  --bg-warm: #20262B;
  --text: #F0EADF;
  --text-soft: #9CA3A8;
  --accent: #B79A63;
  --line: rgba(255,255,255,0.10);
  --line-soft: rgba(255,255,255,0.06);
  --sh-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px -12px rgba(0,0,0,0.6);
  --sh-md: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
  --sh-lg: 0 24px 64px -16px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: #EFEAE0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.en-serif { font-family: var(--font-en-serif); font-style: italic; }
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
}
.eyebrow-gold { color: var(--gold); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--ivory);
}
.btn-primary:hover { box-shadow: 0 10px 24px -10px var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(31,37,40,0.04); }
.btn-onyx {
  background: var(--obsidian);
  color: var(--gold-soft);
  border: 1px solid rgba(183,154,99,0.4);
}
.btn-sm { padding: 9px 14px; font-size: 12.5px; }
.btn-lg { padding: 17px 28px; font-size: 15px; }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--sh-card);
}

/* Soft divider */
.hairline {
  height: 1px; background: var(--line); border: 0;
}

/* Tag chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--mist-2);
  color: var(--evergreen);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.chip-gold { background: rgba(183,154,99,0.12); color: var(--gold); }
.chip-onyx { background: rgba(17,20,23,0.92); color: var(--gold-soft); }

/* Particles / abstract bg */
@keyframes drift {
  0% { transform: translate(0,0); }
  50% { transform: translate(6px,-8px); }
  100% { transform: translate(0,0); }
}
.particle {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.5;
  animation: drift 9s ease-in-out infinite;
}

/* Memorial page glow */
@keyframes softpulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.05); }
}

/* Numbers (dashboard) */
.metric {
  font-family: var(--font-en-serif);
  font-style: normal;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Scrollbar tidy inside artboards */
.scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Image-slot defaults */
image-slot {
  background: var(--sand-2);
}

/* Warm sepia tone for memorial photos — unifies real photos to the brand palette */
image-slot img,
.warm-photo,
.warm-photo img {
  filter: sepia(0.22) hue-rotate(-8deg) saturate(0.88) contrast(0.96);
}
.warm-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
