@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Geist:wght@400;500;600;700&display=swap');
/* Creator-selectable fonts for inline product-page text editing (Details canvas). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600;700&family=Syne:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=Cormorant:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
/* Landing page only — "Mural" brand concept: Archivo (display) + Figtree (body)
   + Caveat (hand-drawn sticky-note / cursor-label accents). Scoped to the
   marketing page via inline classes, same as its color palette. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;700;800;900&family=Figtree:wght@400;500;600;700&family=Caveat:wght@600;700&display=swap');

/* ════════════════════════════════════════════════════════════════════════
   THEME TOKENS — Light + Dark  ("Creattivo · Color", Figma modes Light/Dark)
   ────────────────────────────────────────────────────────────────────────
   Two layers:
     1. RAW palette tokens (--bg-canvas, --text-primary, …) — the ONE source
        of truth, hex only, from the Figma token sheet. Light values live on
        :root; dark values on [data-theme="dark"] (and, as a no-JS fallback,
        under prefers-color-scheme for a viewer who hasn't forced light).
     2. SEMANTIC tokens (--background, --foreground, --card, --border, …) that
        the components + shadcn already consume. They are defined ONCE on :root
        as var() references to the raw layer, so they re-resolve automatically
        when the raw layer flips under [data-theme="dark"] — no dark-mode
        duplication needed for the semantic layer.
   Component code references tokens only — never a hex value.  The resolved
   theme is applied to <html data-theme="light|dark"> before first paint by the
   inline script in root.tsx (System resolves to one of the two).
   ════════════════════════════════════════════════════════════════════════ */

/* Light values apply on :root AND on any subtree explicitly marked
   data-theme="light" — that is how a creator page (storefront canvas, buyer
   preview, public page) renders in Light regardless of the app theme around it:
   mark its root data-theme="light" and every token below re-resolves to Light. */
:root,
[data-theme="light"] {
  /* ── RAW palette · Light ──────────────────────────────────────────────── */
  /* backgrounds */
  --bg-canvas: #FAFAFB;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-overlay: #FFFFFF;
  --bg-menu: #FFFFFF;
  --bg-subtle: #F3F4F6;
  --bg-sunken: #F4F5F7;
  --bg-field: #FFFFFF;
  --bg-selected: #FFFFFF;
  --bg-muted: #F9FAFB;
  --bg-scrim: rgba(17, 24, 39, 0.40);          /* modal scrim — no blur, so carry the dim itself */
  --bg-inverse: #1F2937;
  --bg-tooltip: #1F2937;
  --bg-tooltip-key: #374151;
  /* interaction */
  --state-hover: rgba(17, 24, 39, 0.03);        /* #111827 @3% — ONE translucent layer */
  --state-active: rgba(17, 24, 39, 0.06);       /* pressed / active — 2× hover */
  /* borders */
  --border-subtle-t: #EEF0F3;
  --border-default: #E5E7EB;
  --border-strong-t: #D1D5DB;
  --border-field: #E5E7EB;
  --border-control: #8C929D;
  --border-overlay: rgba(255, 255, 255, 0);     /* #FFFFFF @0% */
  --border-inverse: #374151;
  /* text */
  --text-primary: #111827;
  --text-body: #374151;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-placeholder: #9CA3AF;
  --text-on-inverse: #FFFFFF;
  --text-link-on-inverse: #93C5FD;
  --text-tooltip: #FFFFFF;
  --text-tooltip-muted: #D1D5DB;
  /* icon */
  --icon-strong: #111827;
  --icon-body: #374151;
  --icon-secondary: #4B5563;
  --icon-default: #6B7280;
  --icon-faint: #8B919C;
  /* action */
  --action-primary: #1F2937;
  --action-on-primary: #FFFFFF;
  --action-primary-hover: #313B4A;
  --action-primary-divider: rgba(255, 255, 255, 0.22);  /* #FFFFFF @22% */
  --action-secondary: #FFFFFF;
  /* status */
  --status-success: #22A559;
  --status-success-bg: #E6F6EC;
  --status-success-on-inverse: #4ADE80;
  --status-warning: #C08223;                    /* darker amber — 3:1 dot */
  --status-warning-bg: #FEF5E2;
  --status-danger: #DC2626;
  --status-danger-bg: #FDECEC;
  --status-neutral: #9CA3AF;
  /* focus */
  --focus-border: rgba(31, 41, 55, 0.35);       /* #1F2937 @35% */
  --focus-ring: rgba(31, 41, 55, 0.08);         /* #1F2937 @8% */
  /* shadow (colours; composed into --shadow-* below) */
  --shadow-soft: rgba(0, 0, 0, 0.08);
  --shadow-overlay: rgba(15, 23, 42, 0.22);     /* #0F172A @22% */
  /* controls & graphics */
  --control-knob: #FFFFFF;
  --illo-surface: #FFFFFF;
  --illo-inner: #F9FAFB;
  --illo-tile: #F3F4F6;
  --illo-line: #E5E7EB;
  --illo-divider: #EEF0F3;

  /* ── SEMANTIC layer (existing token names → raw layer) ────────────────── */
  /* shadcn base */
  --background: var(--bg-canvas);               /* the PAGE (rail/bars/cards use surface) */
  --foreground: var(--text-primary);
  --card: var(--bg-card);
  --card-foreground: var(--text-primary);
  --popover: var(--bg-menu);                    /* dropdowns / select / popover / tooltip content */
  --popover-foreground: var(--text-primary);
  --primary: var(--action-primary);
  --primary-foreground: var(--action-on-primary);
  --secondary: var(--action-secondary);
  --secondary-foreground: var(--text-primary);
  --muted: var(--bg-muted);
  --muted-foreground: var(--text-tertiary);
  --accent: var(--state-hover);                 /* shadcn hover tint = the translucent layer */
  --accent-foreground: var(--text-primary);
  --destructive: var(--status-danger);
  --destructive-foreground: #FFFFFF;
  --border: var(--border-default);
  --input: var(--border-field);
  --ring: var(--action-primary);
  --success: var(--status-success);
  --warning: var(--status-warning);
  --chart-1: var(--action-primary);
  --chart-2: var(--status-warning);
  --chart-3: var(--status-success);
  --chart-4: #C0562A;
  --chart-5: #3E5BB0;
  --sidebar: var(--bg-surface);
  --sidebar-foreground: var(--text-primary);
  --sidebar-primary: var(--action-primary);
  --sidebar-primary-foreground: var(--action-on-primary);
  --sidebar-accent: var(--state-hover);
  --sidebar-accent-foreground: var(--text-primary);
  --sidebar-border: var(--border-default);
  --sidebar-ring: var(--action-primary);

  /* warm brand accent (creator storefront chrome) — NOT part of the UI theme,
     kept fixed so the logo dot / brand energy reads the same in both modes. */
  --brand-amber: oklch(0.84 0.15 84);
  --brand-amber-foreground: oklch(0.26 0.035 264);

  /* surface hierarchy */
  --background-secondary: var(--bg-sunken);
  --surface-hover: var(--state-hover);          /* translucent — layers over any surface */
  --surface-active: var(--state-active);
  --surface-elevated: var(--bg-overlay);

  /* border hierarchy */
  --border-subtle: var(--border-subtle-t);
  --border-muted: var(--border-subtle-t);
  --border-strong: var(--border-strong-t);

  /* text hierarchy */
  --foreground-secondary: var(--text-secondary);

  /* primary depth */
  --primary-hover: var(--action-primary-hover);
  --primary-muted: color-mix(in srgb, var(--primary) 14%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 7%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 5%,  var(--background));

  /* form-control focus (input / select / textarea): 1px border + faint 3px glow */
  --input-focus-border: var(--focus-border);
  --input-focus-ring: var(--focus-ring);

  /* error (form validation) */
  --error: var(--status-danger);
  --error-foreground: #FFFFFF;

  /* ── radius ───────────────────────────────────────────────────────────── */
  --radius: 0.625rem;
  --radius-none: 0rem;
  --radius-sm: 0.375rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────────────── */
  --font-display: 'Fraunces', Georgia, ui-serif, serif;
  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 600;
  --line-height-display: 1.08;
  --tracking-display: -0.01em;
  --font-weight-body: 400;
  --line-height-body: 1.55;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows (colour from the shadow/* tokens so they deepen in dark) ──── */
  --shadow-sm: 0 1px 2px var(--shadow-soft);
  --shadow-md: 0 6px 20px var(--shadow-soft);
  --shadow-lg: 0 18px 44px var(--shadow-overlay);

  /* ── motion ───────────────────────────────────────────────────────────── */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;

  /* ── form controls: the ONE single-line control height ────────────────── */
  --input-height: 40px;
}

/* ── RAW palette · Dark ───────────────────────────────────────────────────
   Only the raw layer is redefined; the semantic layer on :root re-resolves. */
:root[data-theme="dark"] {
  --bg-canvas: #0D0F13;
  --bg-surface: #121419;
  --bg-card: #16191E;
  --bg-overlay: #1A1D23;
  --bg-menu: #262A31;
  --bg-subtle: #1D2026;
  --bg-sunken: #0F1116;
  --bg-field: #0F1116;
  --bg-selected: #2A2E36;
  --bg-muted: #13161A;
  --bg-scrim: rgba(0, 0, 0, 0.55);              /* modal scrim — no blur, darkens the dark page */
  --bg-inverse: #30343C;
  --bg-tooltip: #F3F4F6;
  --bg-tooltip-key: #E5E7EB;
  --state-hover: rgba(255, 255, 255, 0.05);     /* #FFFFFF @5% */
  --state-active: rgba(255, 255, 255, 0.09);
  --border-subtle-t: #1F2228;
  --border-default: #2A2E36;
  --border-strong-t: #3A404A;
  --border-field: #2A2E36;
  --border-control: #6E737C;
  --border-overlay: #2A2E36;
  --border-inverse: #454B55;
  --text-primary: #EDEFF2;
  --text-body: #D0D4DB;
  --text-secondary: #AEB4BF;
  --text-tertiary: #8A919D;
  --text-placeholder: #646B77;
  --text-on-inverse: #EDEFF2;
  --text-link-on-inverse: #93C5FD;
  --text-tooltip: #1F2937;
  --text-tooltip-muted: #4B5563;
  --icon-strong: #EDEFF2;
  --icon-body: #D0D4DB;
  --icon-secondary: #AEB4BF;
  --icon-default: #8A919D;
  --icon-faint: #636A76;
  --action-primary: #EDEFF2;
  --action-on-primary: #111318;
  --action-primary-hover: #FFFFFF;
  --action-primary-divider: rgba(17, 19, 24, 0.18);   /* #111318 @18% */
  --action-secondary: #1D2026;
  --status-success: #3FCF84;
  --status-success-bg: #12301F;
  --status-success-on-inverse: #4ADE80;
  --status-warning: #F0A94B;
  --status-warning-bg: #33260F;
  --status-danger: #F26D6D;
  --status-danger-bg: #3A1618;
  --status-neutral: #646B77;
  --focus-border: rgba(237, 239, 242, 0.40);    /* #EDEFF2 @40% */
  --focus-ring: rgba(237, 239, 242, 0.12);      /* #EDEFF2 @12% */
  --shadow-soft: rgba(0, 0, 0, 0.50);
  --shadow-overlay: rgba(0, 0, 0, 0.60);
  --control-knob: #EDEFF2;
  --illo-surface: #1E2228;
  --illo-inner: #1A1D23;
  --illo-tile: #2C3038;
  --illo-line: #3D424C;
  --illo-divider: #30343C;

  /* dark-only brand-accent foreground tweak */
  --brand-amber-foreground: oklch(0.24 0.03 264);
}

/* No-JS fallback: a viewer who hasn't forced Light, whose OS is dark, before the
   inline script runs. Mirrors the [data-theme="dark"] raw layer above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg-canvas: #0D0F13;
    --bg-surface: #121419;
    --bg-card: #16191E;
    --bg-overlay: #1A1D23;
    --bg-menu: #262A31;
    --bg-subtle: #1D2026;
    --bg-sunken: #0F1116;
    --bg-field: #0F1116;
    --bg-selected: #2A2E36;
    --bg-muted: #13161A;
    --bg-scrim: rgba(0, 0, 0, 0.55);
    --bg-inverse: #30343C;
    --bg-tooltip: #F3F4F6;
    --bg-tooltip-key: #E5E7EB;
    --state-hover: rgba(255, 255, 255, 0.05);
    --state-active: rgba(255, 255, 255, 0.09);
    --border-subtle-t: #1F2228;
    --border-default: #2A2E36;
    --border-strong-t: #3A404A;
    --border-field: #2A2E36;
    --border-control: #6E737C;
    --border-overlay: #2A2E36;
    --border-inverse: #454B55;
    --text-primary: #EDEFF2;
    --text-body: #D0D4DB;
    --text-secondary: #AEB4BF;
    --text-tertiary: #8A919D;
    --text-placeholder: #646B77;
    --text-on-inverse: #EDEFF2;
    --text-link-on-inverse: #93C5FD;
    --text-tooltip: #1F2937;
    --text-tooltip-muted: #4B5563;
    --icon-strong: #EDEFF2;
    --icon-body: #D0D4DB;
    --icon-secondary: #AEB4BF;
    --icon-default: #8A919D;
    --icon-faint: #636A76;
    --action-primary: #EDEFF2;
    --action-on-primary: #111318;
    --action-primary-hover: #FFFFFF;
    --action-primary-divider: rgba(17, 19, 24, 0.18);
    --action-secondary: #1D2026;
    --status-success: #3FCF84;
    --status-success-bg: #12301F;
    --status-success-on-inverse: #4ADE80;
    --status-warning: #F0A94B;
    --status-warning-bg: #33260F;
    --status-danger: #F26D6D;
    --status-danger-bg: #3A1618;
    --status-neutral: #646B77;
    --focus-border: rgba(237, 239, 242, 0.40);
    --focus-ring: rgba(237, 239, 242, 0.12);
    --shadow-soft: rgba(0, 0, 0, 0.50);
    --shadow-overlay: rgba(0, 0, 0, 0.60);
    --control-knob: #EDEFF2;
    --illo-surface: #1E2228;
    --illo-inner: #1A1D23;
    --illo-tile: #2C3038;
    --illo-line: #3D424C;
    --illo-divider: #30343C;
    --brand-amber-foreground: oklch(0.24 0.03 264);
  }
}
