/*
 * Eternal Gardens design tokens (brand system 2026, design 142).
 *
 * One semantic layer for both themes. Components use these names only:
 * never a hex value, never a page-specific gold. Dark ("Night garden") is the
 * default; light ("Morning garden") applies when <html data-theme="light">.
 * During the rollout only pages marked <body class="theme-ready"> switch to
 * light (see design 142, "Light theme rollout"); every other page keeps the
 * dark tokens so nothing renders half-converted.
 *
 * Linked by public/includes/header.php before the CSS bundle (plan 280), so
 * every page can read these names; public/assets/css/brand.css is the first
 * consumer. Older sheets still use variables.css, whose gold, text and font
 * values now match these tokens.
 */

:root {
  color-scheme: dark;

  /* ---- Brand constants (identical in both themes) ---- */
  --eg-brand-gold: #f2c14e;        /* Garden gold: buttons, highlights, logo */
  --eg-brand-gold-light: #f9dd8e;
  --eg-brand-gold-deep: #c98f26;
  --eg-brand-bronze: #8a5d12;      /* gold for text on light surfaces */
  --eg-brand-ink: #101827;         /* text on gold: EG navy */
  --eg-brand-night: #080b12;       /* existing --eg-night */
  --eg-brand-navy: #101827;        /* existing --eg-navy */
  --eg-brand-glass: #172235;       /* existing --eg-glass */
  --eg-brand-violet: #9b6bdb;      /* clematis */
  --eg-brand-teal: #2a9c91;        /* glass teal */
  --eg-brand-rose: #d64f7e;        /* lily rose */
  --eg-brand-leaf: #4e9a45;        /* leaf green */
  --eg-brand-sky: #2b8fc4;         /* forget-me-not blue */

  /* ---- Surfaces: Night garden (EG navy) ---- */
  --eg-bg: #080b12;                /* page: --eg-night */
  --eg-bg-tint: radial-gradient(1200px 600px at 70% -10%, rgba(242, 193, 78, 0.07), transparent 60%);
  --eg-surface-1: #101827;         /* cards: --eg-navy */
  --eg-surface-2: #172235;         /* raised: menus, inputs: --eg-glass */
  --eg-surface-3: #1f2c44;         /* hover, selected */
  --eg-overlay: rgba(4, 6, 12, 0.72);
  --eg-border: rgba(249, 221, 142, 0.12);
  --eg-border-strong: rgba(249, 221, 142, 0.24);

  /* ---- Text ---- */
  --eg-text: #f7f3ea;              /* --eg-porcelain */
  --eg-text-2: #c4cad6;
  --eg-text-3: #8a93a6;
  --eg-text-on-accent: var(--eg-brand-ink);
  --eg-link: var(--eg-brand-gold);

  /* ---- Accent (actions) ---- */
  --eg-accent: var(--eg-brand-gold);
  --eg-accent-hover: var(--eg-brand-gold-light);
  --eg-accent-soft: rgba(242, 193, 78, 0.12);
  --eg-accent-text: var(--eg-brand-gold);      /* gold used as text/icon */
  --eg-focus: #f9dd8e;

  /* ---- Feedback ---- */
  --eg-success: #5cc48a;
  --eg-success-soft: rgba(92, 196, 138, 0.14);
  --eg-warning: #f0a83c;
  --eg-warning-soft: rgba(240, 168, 60, 0.14);
  --eg-danger: #ef6a6a;
  --eg-danger-soft: rgba(239, 106, 106, 0.14);
  --eg-info: #6cb4e8;
  --eg-info-soft: rgba(108, 180, 232, 0.14);

  /* ---- Creator & membership ---- */
  --eg-tier-1: #6cb4e8;            /* Supporter */
  --eg-tier-2: #b48cf0;            /* Member */
  --eg-tier-3: var(--eg-brand-gold); /* Patron */
  --eg-earnings: #5cc48a;

  /* ---- Type ---- */
  --eg-font-display: 'Fraunces', 'Noto Serif SC', Georgia, serif;
  --eg-font-ui: 'Inter', 'Noto Sans SC', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --eg-font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --eg-text-xs: 0.75rem;
  --eg-text-sm: 0.875rem;
  --eg-text-md: 1rem;
  --eg-text-lg: 1.125rem;
  --eg-text-xl: 1.375rem;
  --eg-h3: clamp(1.25rem, 1.6vw, 1.5rem);
  --eg-h2: clamp(1.75rem, 2.8vw, 2.5rem);
  --eg-h1: clamp(2.25rem, 4.4vw, 3.75rem);
  --eg-display: clamp(2.75rem, 6vw, 5rem);

  /* ---- Space, shape, depth, motion ---- */
  --eg-space-1: 4px;
  --eg-space-2: 8px;
  --eg-space-3: 12px;
  --eg-space-4: 16px;
  --eg-space-5: 24px;
  --eg-space-6: 32px;
  --eg-space-7: 48px;
  --eg-space-8: 64px;
  --eg-space-9: 96px;
  --eg-radius-sm: 8px;
  --eg-radius-md: 12px;
  --eg-radius-lg: 18px;
  --eg-radius-xl: 28px;
  --eg-radius-pill: 999px;
  --eg-shadow-1: 0 1px 2px rgba(2, 4, 10, 0.5);
  --eg-shadow-2: 0 10px 30px rgba(2, 4, 10, 0.45);
  --eg-shadow-3: 0 24px 70px rgba(2, 4, 10, 0.6);
  --eg-glow-accent: 0 0 0 1px rgba(242, 193, 78, 0.35), 0 8px 28px rgba(242, 193, 78, 0.18);
  --eg-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --eg-duration: 180ms;
  --eg-container: 1200px;
}

/* ---- Morning garden (light) ---- */
:root[data-theme="light"] {
  color-scheme: light;
  --eg-bg: #f7f3ea;                /* --eg-porcelain */
  --eg-bg-tint: radial-gradient(1200px 600px at 70% -10%, rgba(242, 193, 78, 0.12), transparent 60%);
  --eg-surface-1: #fffdf8;         /* --eg-white */
  --eg-surface-2: #eee8dc;
  --eg-surface-3: #eae2d2;         /* --eg-parchment */
  --eg-overlay: rgba(16, 24, 39, 0.45);
  --eg-border: #e2dacb;
  --eg-border-strong: #cfc4b0;

  --eg-text: #17202b;              /* --eg-ink (navy) */
  --eg-text-2: #515c6b;            /* --eg-slate */
  --eg-text-3: #687180;
  --eg-link: var(--eg-brand-bronze);

  --eg-accent: var(--eg-brand-gold);
  --eg-accent-hover: #e8b23a;
  --eg-accent-soft: rgba(201, 143, 38, 0.12);
  --eg-accent-text: var(--eg-brand-bronze);
  --eg-focus: #8a5d12;

  --eg-success: #24854f;
  --eg-success-soft: #e3f3e9;
  --eg-warning: #a8650a;
  --eg-warning-soft: #fbefd9;
  --eg-danger: #c03b3b;
  --eg-danger-soft: #fbe5e5;
  --eg-info: #1f6fa8;
  --eg-info-soft: #e2eff8;

  --eg-tier-1: #1f6fa8;
  --eg-tier-2: #7445c9;
  --eg-tier-3: #a8700f;
  --eg-earnings: #24854f;

  --eg-shadow-1: 0 1px 2px rgba(16, 24, 39, 0.08);
  --eg-shadow-2: 0 10px 30px rgba(16, 24, 39, 0.1);
  --eg-shadow-3: 0 24px 70px rgba(16, 24, 39, 0.16);
  --eg-glow-accent: 0 0 0 1px rgba(201, 143, 38, 0.4), 0 8px 24px rgba(201, 143, 38, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  :root { --eg-duration: 0ms; }
}

/*
 * Legacy aliases (wired during the upgrade, removed page by page):
 *   --eg-gold, --gold-primary, --rs-gold, --sc-gold, --bv-gold, --meet-gold,
 *   --wr-gold                  -> var(--eg-accent) / var(--eg-accent-text)
 *   --eg-gold-light            -> var(--eg-brand-gold-light)
 *   --eg-gold-deep             -> var(--eg-brand-gold-deep)
 *   --eg-white, --color-text   -> var(--eg-text)
 *   --color-text-muted         -> var(--eg-text-2)
 *   --eg-night                 -> var(--eg-bg)
 *   --eg-navy                  -> var(--eg-surface-1)
 *   --eg-glass, --glass-bg     -> var(--eg-surface-2)
 * Mapping of the top hard-coded colours: docs/design/142-creator-earnings-brand-system/color-audit.md
 */
