/**
 * Đồng Thuận — Shared design tokens (Craft-Warm)
 *
 * LOCKED for /admin and any non-storefront surfaces.
 * Public Mid-Autumn 2026 handoff palette lives ONLY under
 * `.storefront-2026` in styles/storefront-2026.css — do not redefine
 * the public cream/brown/lacquer/gold theme here.
 *
 * Canonical admin palette: TASK-928 Craft-Warm foundation.
 */

:root {
  /* —— Raw palette (Craft-Warm) —— */
  --palette-ivory: #f3eee6;
  --palette-cream: #ebe6dc;
  --palette-cream-deep: #e4d8c6;
  --palette-sand: #d9cdb8;
  --palette-cocoa: #3d3229;
  --palette-ink: #1c1410;
  --palette-gold: #c9953c;
  --palette-gold-deep: #8f6524;
  --palette-terracotta: #9a4e36;
  --palette-jade: #245a44;
  --palette-paper-raised: #f7f3ec;

  /* —— Semantic color —— */
  --color-bg: var(--palette-cream);
  --color-bg-soft: var(--palette-ivory);
  --color-surface: color-mix(in srgb, var(--palette-cream) 55%, white);
  --color-surface-raised: var(--palette-paper-raised);
  --color-text: var(--palette-ink);
  --color-text-muted: var(--palette-cocoa);
  --color-text-soft: color-mix(in srgb, var(--palette-cocoa) 72%, transparent);
  --color-border: color-mix(in srgb, var(--palette-ink) 12%, transparent);
  --color-border-strong: color-mix(in srgb, var(--palette-ink) 22%, transparent);
  --color-brand: var(--palette-gold);
  --color-brand-hover: color-mix(in srgb, var(--palette-gold) 88%, white);
  --color-brand-ink: var(--palette-ink);
  --color-accent: var(--palette-gold-deep);
  --color-accent-hover: color-mix(in srgb, var(--palette-gold-deep) 88%, black);
  --color-accent-soft: color-mix(in srgb, var(--palette-gold) 18%, transparent);
  --color-festive: var(--palette-terracotta);
  --color-success: var(--palette-jade);
  --color-warning: #8a6a1f;
  --color-danger: #8b3a2f;
  --color-overlay: rgba(28, 20, 16, 0.45);
  --color-focus: var(--palette-gold);
  --color-on-inverse: var(--palette-cream);
  --color-media-fallback: var(--palette-sand);

  /* Legacy aliases */
  --ink: var(--color-text);
  --ink-soft: var(--color-text-muted);
  --paper: var(--color-bg);
  --gold: var(--color-brand);
  --gold-deep: var(--color-accent);
  --jade: var(--color-success);
  --veil: linear-gradient(
    105deg,
    rgba(28, 20, 16, 0.82) 0%,
    rgba(28, 20, 16, 0.55) 42%,
    rgba(28, 20, 16, 0.18) 72%,
    rgba(28, 20, 16, 0.08) 100%
  );

  /* —— Typography —— */
  --font-display: "Literata", "Times New Roman", serif;
  --font-body: "Be Vietnam Pro", system-ui, sans-serif;

  --text-display-size: clamp(2.25rem, 6vw, 3.75rem);
  --text-display-lh: 1.05;
  --text-display-weight: 700;
  --text-display-tracking: -0.02em;

  --text-h1-size: clamp(1.5rem, 3.4vw, 2.15rem);
  --text-h1-lh: 1.25;
  --text-h1-weight: 500;
  --text-h1-tracking: 0;

  --text-h2-size: clamp(1.75rem, 3vw, 2.25rem);
  --text-h2-lh: 1.2;
  --text-h2-weight: 600;

  --text-h3-size: 1.125rem;
  --text-h3-lh: 1.25;
  --text-h3-weight: 600;

  --text-body-lg-size: 1.05rem;
  --text-body-lg-lh: 1.6;
  --text-body-size: 1rem;
  --text-body-lh: 1.55;
  --text-body-sm-size: 0.9rem;
  --text-body-sm-lh: 1.5;
  --text-caption-size: 0.8125rem;
  --text-caption-lh: 1.4;
  --text-price-size: 1rem;
  --text-price-weight: 600;
  --text-label-size: 0.8rem;
  --text-label-weight: 600;
  --text-label-tracking: 0.06em;

  /* —— Spacing —— */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --space-section: clamp(3.5rem, 10vw, 6.5rem);
  --space-section-compact: clamp(2.5rem, 6vw, 4rem);
  --space-container-inline: clamp(1.25rem, 4vw, 3rem);
  --space-card-padding: 0.95rem 0.95rem 1.1rem;
  --space-control-gap: 0.5rem;
  --space-grid-gap: 1rem;
  --space-grid-gap-md: 1.25rem;

  /* —— Radius —— */
  --radius-xs: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-pill: 999px;

  /* —— Shadow —— */
  --shadow-card: 0 1px 2px rgba(28, 20, 16, 0.06);
  --shadow-hover: 0 6px 18px rgba(28, 20, 16, 0.1);
  --shadow-floating: 0 12px 32px rgba(28, 20, 16, 0.14);
  --shadow-drawer: 0 -12px 40px rgba(28, 20, 16, 0.18);

  /* —— Layout —— */
  --width-content: 36rem;
  --width-readable: 40rem;
  --width-wide: 72rem;
  --gutter-mobile: 1.25rem;
  --gutter-desktop: 3rem;
  --header-h: 4.5rem;
  --announce-h: 2rem;

  --z-base: 0;
  --z-sticky: 10;
  --z-header: 20;
  --z-overlay: 30;
  --z-drawer: 40;
  --z-toast: 50;

  /* —— Motion —— */
  --duration-fast: 150ms;
  --duration-normal: 280ms;
  --duration-slow: 450ms;
  --duration-sheet: 220ms;
  /* Living Book tokens (public storefront; see styles/living-book-motion.css) */
  --motion-micro: 180ms;
  --motion-feedback: 220ms;
  --motion-component: 260ms;
  --motion-sheet: 360ms;
  --motion-section: 420ms;
  --motion-page: 360ms;
  --motion-hero: 650ms;
  --ease-book: cubic-bezier(0.22, 0.61, 0.36, 1);
  --touch-min: 2.75rem;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: var(--ease-standard);
  --motion-translate: 1.25rem;

  /* —— Control —— */
  --control-height-sm: 2.25rem;
  --control-height-md: 2.5rem;
  --control-height-lg: 2.85rem;
  --focus-ring: 2px solid var(--color-focus);
  --focus-offset: 3px;
}
