/* ============================================================
   B&C MANDARIN — Design System Tokens
   Colors, Typography, Spacing, Radii, Shadows, Animation
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ── FONTS ─────────────────────────────────────────────── */
:root {
  --font-display:  'Noto Serif SC', 'Noto Serif', serif;
  --font-heading:  'Lora', Georgia, serif;
  --font-body:     'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono:     'Space Mono', 'Courier New', monospace;
}

/* ── COLOR PRIMITIVES ───────────────────────────────────── */
:root {
  /* Primary */
  --color-red:        #C8372D;   /* Chinese Red — brand primary */
  --color-red-dark:   #A02820;   /* Pressed / hover state */
  --color-red-light:  #F0D0CE;   /* Tinted surface */

  --color-gold:       #D4A843;   /* Auspicious Gold */
  --color-gold-dark:  #A87E28;
  --color-gold-light: #F5E6BE;

  /* Neutral warm */
  --color-cream:      #FDF6EE;   /* Primary background */
  --color-blush:      #F5DDD0;   /* Card / surface */
  --color-peach:      #EEC9B2;   /* Divider / border */
  --color-smoke:      #8C7B6E;   /* Muted / secondary text */
  --color-ink:        #2C1A0E;   /* Primary text */
  --color-white:      #FFFFFF;

  /* Accent */
  --color-terra:      #C4714A;   /* Terracotta */
  --color-terra-light:#F2DDD3;
  --color-jade:       #5B8C6E;   /* Jade Green */
  --color-jade-light: #D4EBE0;
}

/* ── SEMANTIC COLOR VARS ────────────────────────────────── */
:root {
  --bg-page:          var(--color-cream);
  --bg-surface:       var(--color-white);
  --bg-card:          var(--color-white);
  --bg-card-tinted:   var(--color-blush);
  --bg-dark:          var(--color-ink);

  --fg-primary:       var(--color-ink);
  --fg-secondary:     var(--color-smoke);
  --fg-on-dark:       var(--color-cream);
  --fg-accent:        var(--color-red);
  --fg-gold:          var(--color-gold-dark);

  --border-default:   rgba(44, 26, 14, 0.10);
  --border-strong:    rgba(44, 26, 14, 0.20);
  --border-accent:    var(--color-gold);

  --action-primary:         var(--color-red);
  --action-primary-hover:   var(--color-red-dark);
  --action-primary-text:    var(--color-white);
  --action-secondary:       var(--color-gold);
  --action-secondary-text:  var(--color-ink);
}

/* ── TYPE SCALE ─────────────────────────────────────────── */
:root {
  /* Sizes */
  --text-display-size:   64px;
  --text-h1-size:        48px;
  --text-h2-size:        36px;
  --text-h3-size:        24px;
  --text-h4-size:        20px;
  --text-body-size:      16px;
  --text-small-size:     13px;
  --text-pinyin-size:    14px;
  --text-caption-size:   12px;

  /* Line heights */
  --lh-display:  1.1;
  --lh-heading:  1.25;
  --lh-body:     1.65;
  --lh-tight:    1.15;

  /* Weights */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    900;

  /* Letter spacing */
  --ls-display:  -0.02em;
  --ls-heading:  -0.01em;
  --ls-body:     0em;
  --ls-caps:     0.08em;
  --ls-pinyin:   0.04em;
}

/* ── SEMANTIC TYPE CLASSES ──────────────────────────────── */
.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  font-weight: var(--fw-bold);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--fg-primary);
}

.text-h1 {
  font-family: var(--font-heading);
  font-size: var(--text-h1-size);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--fg-primary);
}

.text-h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h2-size);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--fg-primary);
}

.text-h3 {
  font-family: var(--font-body);
  font-size: var(--text-h3-size);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  color: var(--fg-primary);
}

.text-h4 {
  font-family: var(--font-body);
  font-size: var(--text-h4-size);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
  color: var(--fg-primary);
}

.text-body {
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--fg-primary);
}

.text-small {
  font-family: var(--font-body);
  font-size: var(--text-small-size);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--fg-secondary);
}

.text-caption {
  font-family: var(--font-body);
  font-size: var(--text-caption-size);
  font-weight: var(--fw-medium);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--fg-secondary);
}

.text-pinyin {
  font-family: var(--font-mono);
  font-size: var(--text-pinyin-size);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-pinyin);
  color: var(--color-terra);
}

.text-chinese {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--fg-primary);
}

/* ── SPACING ────────────────────────────────────────────── */
:root {
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10: 128px;
}

/* ── BORDER RADIUS ──────────────────────────────────────── */
:root {
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   12px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-pill: 9999px;
}

/* ── SHADOWS / ELEVATION ────────────────────────────────── */
:root {
  --shadow-1: 0 2px 8px rgba(44, 26, 14, 0.08);      /* card */
  --shadow-2: 0 8px 24px rgba(44, 26, 14, 0.14);     /* dropdown / tooltip */
  --shadow-3: 0 20px 48px rgba(44, 26, 14, 0.20);    /* modal / overlay */
  --shadow-gold: 0 4px 20px rgba(212, 168, 67, 0.35); /* gold glow CTA */
  --shadow-red:  0 4px 20px rgba(200, 55, 45, 0.30);  /* red glow */
}

/* ── ANIMATION ──────────────────────────────────────────── */
:root {
  --ease-out-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
  --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:         cubic-bezier(0.4, 0, 1, 1);
  --ease-out:        cubic-bezier(0, 0, 0.2, 1);

  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
}

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

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

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

.anim-fade-up   { animation: fadeUp       var(--duration-base) var(--ease-out-spring) both; }
.anim-fade-in   { animation: fadeIn       var(--duration-base) var(--ease-standard) both; }
.anim-slide-in  { animation: slideInBottom var(--duration-slow) var(--ease-out-spring) both; }

/* ── CARD BASE ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
  transition: box-shadow var(--duration-base) var(--ease-standard),
              transform   var(--duration-base) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

/* ── BUTTON BASE ────────────────────────────────────────── */
.btn {
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
              box-shadow  var(--duration-fast) var(--ease-standard),
              transform   var(--duration-fast) var(--ease-standard);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.btn-primary {
  background: var(--action-primary);
  color: var(--action-primary-text);
}
.btn-primary:hover {
  background: var(--action-primary-hover);
  box-shadow: var(--shadow-red);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--color-gold);
  color: var(--color-ink);
}
.btn-secondary:hover {
  background: var(--color-gold-dark);
  box-shadow: var(--shadow-gold);
}
.btn-secondary:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  color: var(--fg-primary);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--color-blush);
}
.btn-ghost:active { transform: scale(0.97); }

.btn-sm {
  font-size: var(--text-small-size);
  padding: 8px 16px;
}

.btn-lg {
  font-size: 18px;
  padding: 16px 36px;
}
